@seed-hypermedia/client 0.0.105 → 0.0.106

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.mjs CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  PARAM_EMAIL,
5
5
  PARAM_EMAIL_PREVALIDATION,
6
6
  PARAM_ERROR,
7
+ PARAM_INVITE,
7
8
  PARAM_PROOF,
8
9
  PARAM_REDIRECT_URI,
9
10
  PARAM_SESSION_KEY,
@@ -13,7 +14,7 @@ import {
13
14
  parseEmailPrevalidation,
14
15
  validateClientId,
15
16
  validateRedirectUri
16
- } from "./chunk-UBBSVXFC.mjs";
17
+ } from "./chunk-4UVOQIGJ.mjs";
17
18
  import {
18
19
  decode,
19
20
  encode
@@ -157,6 +158,7 @@ async function startAuth(config, options = {}) {
157
158
  if (config.requestEmailPrevalidation) url.searchParams.set(PARAM_EMAIL_PREVALIDATION, "1");
158
159
  if (config.email) url.searchParams.set(PARAM_EMAIL, config.email);
159
160
  if (config.siteName) url.searchParams.set(PARAM_SITE_NAME, config.siteName);
161
+ if (config.invite) url.searchParams.set(PARAM_INVITE, config.invite);
160
162
  const signedUrl = url.toString();
161
163
  const proof = encode(await signWithKey(session.keyPair.privateKey, new TextEncoder().encode(signedUrl)));
162
164
  const delimiter = signedUrl.includes("?") ? "&" : "?";
@@ -41,6 +41,7 @@ var PARAM_DATA = "data";
41
41
  var PARAM_ERROR = "error";
42
42
  var PARAM_EMAIL = "email";
43
43
  var PARAM_SITE_NAME = "site_name";
44
+ var PARAM_INVITE = "invite";
44
45
  var DELEGATION_PATH = "/delegate";
45
46
  var AUTH_STATE_BYTES = 16;
46
47
  var REQUEST_PROOF_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
@@ -294,6 +295,7 @@ export {
294
295
  PARAM_ERROR,
295
296
  PARAM_EMAIL,
296
297
  PARAM_SITE_NAME,
298
+ PARAM_INVITE,
297
299
  DELEGATION_PATH,
298
300
  principalEncode,
299
301
  principalDecode,
package/dist/hmauth.d.ts CHANGED
@@ -24,6 +24,12 @@ export interface HypermediaAuthConfig {
24
24
  siteName?: string;
25
25
  /** Ask Vault to share verified email proof after consent. Disabled by default. */
26
26
  requestEmailPrevalidation?: boolean;
27
+ /**
28
+ * An invitation code for an invite-only vault. The vault creates the
29
+ * account for `email` from it and then completes this same delegation, so
30
+ * an invited person lands on the site signed in without a second sign-in.
31
+ */
32
+ invite?: string;
27
33
  }
28
34
  /** Stored session key with metadata. */
29
35
  export interface StoredSession {
@@ -92,6 +98,8 @@ export declare const PARAM_ERROR = "error";
92
98
  export declare const PARAM_EMAIL = "email";
93
99
  /** Optional URL parameter with the requesting site's display name, for vault UI copy. Claimed by the client — display only. */
94
100
  export declare const PARAM_SITE_NAME = "site_name";
101
+ /** Invitation code for an invite-only vault; the vault registers the account before delegating. */
102
+ export declare const PARAM_INVITE = "invite";
95
103
  /** Vault route path for handling delegation requests. */
96
104
  export declare const DELEGATION_PATH = "/delegate";
97
105
  /** Encode a 32-byte Ed25519 public key as a base58btc multibase principal string. */
package/dist/hmauth.mjs CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  PARAM_EMAIL,
6
6
  PARAM_EMAIL_PREVALIDATION,
7
7
  PARAM_ERROR,
8
+ PARAM_INVITE,
8
9
  PARAM_PROOF,
9
10
  PARAM_REDIRECT_URI,
10
11
  PARAM_SESSION_KEY,
@@ -23,7 +24,7 @@ import {
23
24
  validateSessionKeyPrincipal,
24
25
  validateState,
25
26
  verifyDelegationRequestProof
26
- } from "./chunk-UBBSVXFC.mjs";
27
+ } from "./chunk-4UVOQIGJ.mjs";
27
28
  import "./chunk-2MD3FXKB.mjs";
28
29
  import "./chunk-NBCHK76Q.mjs";
29
30
  import "./chunk-DR3HJ6BV.mjs";
@@ -36,6 +37,7 @@ export {
36
37
  PARAM_EMAIL,
37
38
  PARAM_EMAIL_PREVALIDATION,
38
39
  PARAM_ERROR,
40
+ PARAM_INVITE,
39
41
  PARAM_PROOF,
40
42
  PARAM_REDIRECT_URI,
41
43
  PARAM_SESSION_KEY,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.105",
3
+ "version": "0.0.106",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",