@tula-tech/contract 0.1.1 → 0.3.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/headers.d.ts CHANGED
@@ -39,7 +39,7 @@ declare const CLIENT_HEADER = "x-tula-client";
39
39
  * It is a request, not a choice: the session gets that profile only when the environment marks
40
40
  * it `clientSelectable`. Any other name (unknown, not offered, a built-in) is ignored and the
41
41
  * session gets the profile of its client kind, so a client can never give itself a
42
- * longer-lived session than the operator offered (ADR 0028).
42
+ * longer-lived session than the operator offered.
43
43
  *
44
44
  * @example
45
45
  * ```ts
@@ -96,7 +96,7 @@ declare const CAN_STILL_SIGN_IN_HEADER = "x-tula-can-still-sign-in";
96
96
  * Sent together with {@link CONFIG_HASH_HEADER}. The API records both with the settings and
97
97
  * returns them as `managedBy`, so a dashboard can say "these settings come from a config file"
98
98
  * and warn when they were changed around it. A replace without the header keeps the record,
99
- * which then shows as drifted. See ADR 0030.
99
+ * which then shows as drifted.
100
100
  *
101
101
  * @example
102
102
  * ```ts
@@ -127,7 +127,7 @@ declare const CONFIG_HASH_HEADER = "x-tula-config-hash";
127
127
  declare const CONFIG_UNMANAGED = "none";
128
128
  /**
129
129
  * Request header every call the dashboard makes with its session cookie must carry, with the
130
- * value {@link DASHBOARD_HEADER_VALUE} (ADR 0032).
130
+ * value {@link DASHBOARD_HEADER_VALUE}.
131
131
  *
132
132
  * A browser attaches a cookie whoever wrote the page. This header is what a form cannot send
133
133
  * and what a cross-origin `fetch` may send only after a preflight, which the API answers for
@@ -187,6 +187,20 @@ declare const DASHBOARD_SESSION_COOKIE = "tula_dashboard";
187
187
  */
188
188
  declare const EMAIL_LINK_TOKEN_PARAM = "tula_link";
189
189
  /**
190
+ * Name of the URL-fragment parameter carrying an organization invitation's token.
191
+ *
192
+ * The link in the invitation email is the app's own redirect URL followed by
193
+ * `#tula_invitation=<token>`. A fragment is never sent to a server, a proxy or in `Referer`,
194
+ * so the token reaches only the page's own script, which posts it to the invitation routes
195
+ * (`preview`, `accept`, `decline`) and removes it from the URL.
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * const token = new URLSearchParams(location.hash.slice(1)).get(ORGANIZATION_INVITATION_TOKEN_PARAM)
200
+ * ```
201
+ */
202
+ declare const ORGANIZATION_INVITATION_TOKEN_PARAM = "tula_invitation";
203
+ /**
190
204
  * Name of the URL-fragment parameter carrying the id of the sign-in an emailed link belongs to.
191
205
  *
192
206
  * @example
@@ -197,7 +211,7 @@ declare const EMAIL_LINK_TOKEN_PARAM = "tula_link";
197
211
  declare const EMAIL_LINK_ATTEMPT_PARAM = "tula_attempt";
198
212
  /**
199
213
  * Name of the URL-fragment parameter carrying the single-use ticket an OAuth sign-in returns to
200
- * the app's page with (ADR 0026).
214
+ * the app's page with.
201
215
  *
202
216
  * The API redirects to the app's URL followed by `#tula_ticket=<ticket>&tula_attempt=<attempt
203
217
  * id>`. The page's script removes the fragment from the address and posts the ticket, with the
@@ -220,4 +234,10 @@ declare const OAUTH_TICKET_PARAM = "tula_ticket";
220
234
  * ```
221
235
  */
222
236
  declare const OAUTH_ERROR_PARAM = "tula_error";
223
- export { CAN_STILL_SIGN_IN_HEADER, CLIENT_HEADER, CONFIG_HASH_HEADER, CONFIG_MANAGED_BY_HEADER, CONFIG_UNMANAGED, DASHBOARD_HEADER, DASHBOARD_HEADER_VALUE, DASHBOARD_SESSION_COOKIE, EMAIL_LINK_ATTEMPT_PARAM, EMAIL_LINK_TOKEN_PARAM, ENVIRONMENT_HEADER, FLOW_ATTEMPT_HEADER, OAUTH_ERROR_PARAM, OAUTH_TICKET_PARAM, PUBLISHABLE_KEY_HEADER, SESSION_PROFILE_HEADER };
237
+ /**
238
+ * The header that carries a setup link's token to `/v1/setup/*`. The portal reads
239
+ * the token from the page address's fragment, which a browser never sends, and puts it here:
240
+ * it is never in a path or a query, so no access log or `Referer` holds it.
241
+ */
242
+ declare const SETUP_LINK_HEADER = "x-tula-setup-token";
243
+ export { CAN_STILL_SIGN_IN_HEADER, CLIENT_HEADER, CONFIG_HASH_HEADER, CONFIG_MANAGED_BY_HEADER, CONFIG_UNMANAGED, DASHBOARD_HEADER, DASHBOARD_HEADER_VALUE, DASHBOARD_SESSION_COOKIE, EMAIL_LINK_ATTEMPT_PARAM, EMAIL_LINK_TOKEN_PARAM, ENVIRONMENT_HEADER, FLOW_ATTEMPT_HEADER, OAUTH_ERROR_PARAM, OAUTH_TICKET_PARAM, ORGANIZATION_INVITATION_TOKEN_PARAM, PUBLISHABLE_KEY_HEADER, SESSION_PROFILE_HEADER, SETUP_LINK_HEADER };
package/dist/headers.js CHANGED
@@ -12,10 +12,12 @@ import {
12
12
  ENVIRONMENT_HEADER2,
13
13
  DASHBOARD_SESSION_COOKIE2,
14
14
  EMAIL_LINK_TOKEN_PARAM2,
15
+ ORGANIZATION_INVITATION_TOKEN_PARAM2,
15
16
  EMAIL_LINK_ATTEMPT_PARAM2,
16
17
  OAUTH_TICKET_PARAM2,
17
- OAUTH_ERROR_PARAM2
18
- } from "./shared/chunk-q309e9bk.js";
18
+ OAUTH_ERROR_PARAM2,
19
+ SETUP_LINK_HEADER2
20
+ } from "./shared/chunk-4hytq4je.js";
19
21
  export {
20
22
  CAN_STILL_SIGN_IN_HEADER2 as CAN_STILL_SIGN_IN_HEADER,
21
23
  CLIENT_HEADER2 as CLIENT_HEADER,
@@ -31,6 +33,8 @@ export {
31
33
  FLOW_ATTEMPT_HEADER2 as FLOW_ATTEMPT_HEADER,
32
34
  OAUTH_ERROR_PARAM2 as OAUTH_ERROR_PARAM,
33
35
  OAUTH_TICKET_PARAM2 as OAUTH_TICKET_PARAM,
36
+ ORGANIZATION_INVITATION_TOKEN_PARAM2 as ORGANIZATION_INVITATION_TOKEN_PARAM,
34
37
  PUBLISHABLE_KEY_HEADER2 as PUBLISHABLE_KEY_HEADER,
35
- SESSION_PROFILE_HEADER2 as SESSION_PROFILE_HEADER
38
+ SESSION_PROFILE_HEADER2 as SESSION_PROFILE_HEADER,
39
+ SETUP_LINK_HEADER2 as SETUP_LINK_HEADER
36
40
  };