@domino-sdk/relay 0.24.0 → 0.25.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domino-sdk/relay",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -37,8 +37,10 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "zod": "4.3.6",
41
- "esbuild": "0.25.12"
40
+ "@dicebear/core": "9.4.3",
41
+ "@dicebear/shapes": "9.4.3",
42
+ "esbuild": "0.25.12",
43
+ "zod": "4.3.6"
42
44
  },
43
45
  "peerDependencies": {
44
46
  "react": ">=19"
@@ -1,37 +0,0 @@
1
- import {
2
- identifier
3
- } from "./chunk-UYS522ER.js";
4
-
5
- // src/auth.ts
6
- import { z } from "zod";
7
- var authScopeSchema = z.object({
8
- organization: identifier,
9
- project: identifier,
10
- environment: z.enum(["test", "live"])
11
- }).strict();
12
- var principalSchema = z.discriminatedUnion("kind", [
13
- z.object({ kind: z.literal("member"), member: identifier }).strict(),
14
- z.object({ kind: z.literal("staff"), subject: identifier }).strict(),
15
- z.object({ kind: z.literal("operator"), subject: identifier }).strict()
16
- ]);
17
- var sessionSchema = authScopeSchema.extend({
18
- id: identifier,
19
- principal: principalSchema,
20
- expiresAt: z.number()
21
- });
22
- var exchangeSchema = authScopeSchema.extend({
23
- identity: z.object({ issuer: identifier, subject: z.string().min(1).max(200) }).strict(),
24
- role: z.enum(["member", "staff", "operator"])
25
- }).strict();
26
- var exchangeResultSchema = z.object({
27
- token: z.string(),
28
- session: sessionSchema
29
- });
30
-
31
- export {
32
- authScopeSchema,
33
- principalSchema,
34
- sessionSchema,
35
- exchangeSchema,
36
- exchangeResultSchema
37
- };
@@ -1,61 +0,0 @@
1
- import {
2
- createRelayClient
3
- } from "./chunk-RTBIXGMH.js";
4
-
5
- // src/browser.ts
6
- function createBrowserRelayClient(options) {
7
- return createRelayClient({
8
- ...options,
9
- submissionStore: options.submissionStore ?? browserSubmissionStore()
10
- });
11
- }
12
- function browserSubmissionStore() {
13
- let database;
14
- function open() {
15
- if (!globalThis.indexedDB || !globalThis.navigator?.locks) {
16
- throw new Error(
17
- "This browser cannot safely save submissions. Use a browser with IndexedDB and Web Locks enabled."
18
- );
19
- }
20
- return database ??= new Promise((resolve, reject) => {
21
- const request = indexedDB.open("domino-relay-submissions", 1);
22
- request.onupgradeneeded = () => request.result.createObjectStore("submissions");
23
- request.onerror = () => reject(new Error("Could not open submission storage"));
24
- request.onsuccess = () => resolve(request.result);
25
- request.onblocked = () => reject(new Error("Close other Relay tabs and try again"));
26
- });
27
- }
28
- async function transact(key, value) {
29
- const db = await open();
30
- return new Promise((resolve, reject) => {
31
- const transaction = db.transaction(
32
- "submissions",
33
- value === void 0 ? "readonly" : "readwrite",
34
- { durability: "strict" }
35
- );
36
- const store = transaction.objectStore("submissions");
37
- const request = value === void 0 ? store.get(key) : store.put(value, key);
38
- transaction.oncomplete = () => resolve(request.result);
39
- transaction.onerror = transaction.onabort = () => reject(
40
- new Error(
41
- "Could not save submission progress. Resume the saved submission when browser storage is available."
42
- )
43
- );
44
- });
45
- }
46
- return {
47
- read: (key) => transact(key),
48
- write: async (key, value) => {
49
- await transact(key, value);
50
- },
51
- exclusive: async (key, task) => {
52
- await open();
53
- return navigator.locks.request(key, task);
54
- }
55
- };
56
- }
57
-
58
- export {
59
- createBrowserRelayClient,
60
- browserSubmissionStore
61
- };