jazz-browser-auth-clerk 0.7.33-new-auth.0

Sign up to get free protection for your applications and to get access to all the features.
package/.eslintrc.cjs ADDED
@@ -0,0 +1,24 @@
1
+ module.exports = {
2
+ extends: [
3
+ "eslint:recommended",
4
+ "plugin:@typescript-eslint/recommended",
5
+ "plugin:require-extensions/recommended",
6
+ "prettier"
7
+ ],
8
+ parser: "@typescript-eslint/parser",
9
+ plugins: ["@typescript-eslint", "require-extensions"],
10
+ parserOptions: {
11
+ project: "./tsconfig.json",
12
+ tsconfigRootDir: __dirname,
13
+ },
14
+ ignorePatterns: [".eslint.cjs"],
15
+ root: true,
16
+ rules: {
17
+ "no-unused-vars": "off",
18
+ "@typescript-eslint/no-unused-vars": [
19
+ "error",
20
+ { argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
21
+ ],
22
+ "@typescript-eslint/no-floating-promises": "error",
23
+ },
24
+ }
package/.prettierrc.js ADDED
@@ -0,0 +1,9 @@
1
+ /** @type {import("prettier").Config} */
2
+ const config = {
3
+ trailingComma: "all",
4
+ tabWidth: 4,
5
+ semi: true,
6
+ singleQuote: false,
7
+ };
8
+
9
+ export default config;
@@ -0,0 +1,8 @@
1
+
2
+ > jazz-browser-auth-clerk@0.7.33-new-auth.0 build /Users/anselm/jazz/jazz/packages/jazz-browser-auth-clerk
3
+ > npm run lint && rm -rf ./dist && tsc --sourceMap --outDir dist
4
+
5
+
6
+ > jazz-browser-auth-clerk@0.7.33-new-auth.0 lint
7
+ > eslint . --ext ts,tsx
8
+
package/CHANGELOG.md ADDED
@@ -0,0 +1,663 @@
1
+ # jazz-browser-media-images
2
+
3
+ ## 0.7.33-new-auth.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - jazz-browser@0.7.35-new-auth.0
9
+ - jazz-tools@0.7.35-new-auth.0
10
+
11
+ ## 0.7.32
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+ - jazz-tools@0.7.32
17
+ - jazz-browser@0.7.32
18
+
19
+ ## 0.7.31
20
+
21
+ ### Patch Changes
22
+
23
+ - jazz-browser@0.7.31
24
+ - jazz-tools@0.7.31
25
+
26
+ ## 0.7.30
27
+
28
+ ### Patch Changes
29
+
30
+ - jazz-browser@0.7.30
31
+
32
+ ## 0.7.29
33
+
34
+ ### Patch Changes
35
+
36
+ - jazz-browser@0.7.29
37
+ - jazz-tools@0.7.29
38
+
39
+ ## 0.7.28
40
+
41
+ ### Patch Changes
42
+
43
+ - jazz-browser@0.7.28
44
+ - jazz-tools@0.7.28
45
+
46
+ ## 0.7.27
47
+
48
+ ### Patch Changes
49
+
50
+ - jazz-browser@0.7.27
51
+
52
+ ## 0.7.26
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies
57
+ - jazz-browser@0.7.26
58
+ - jazz-tools@0.7.26
59
+
60
+ ## 0.7.25
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies
65
+ - jazz-tools@0.7.25
66
+ - jazz-browser@0.7.25
67
+
68
+ ## 0.7.24
69
+
70
+ ### Patch Changes
71
+
72
+ - Updated dependencies
73
+ - jazz-tools@0.7.24
74
+ - jazz-browser@0.7.24
75
+
76
+ ## 0.7.23
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies
81
+ - jazz-tools@0.7.23
82
+ - jazz-browser@0.7.23
83
+
84
+ ## 0.7.22
85
+
86
+ ### Patch Changes
87
+
88
+ - jazz-browser@0.7.22
89
+
90
+ ## 0.7.21
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies
95
+ - jazz-tools@0.7.21
96
+ - jazz-browser@0.7.21
97
+
98
+ ## 0.7.20
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies
103
+ - jazz-tools@0.7.20
104
+ - jazz-browser@0.7.20
105
+
106
+ ## 0.7.19
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies
111
+ - jazz-tools@0.7.19
112
+ - jazz-browser@0.7.19
113
+
114
+ ## 0.7.18
115
+
116
+ ### Patch Changes
117
+
118
+ - jazz-browser@0.7.18
119
+ - jazz-tools@0.7.18
120
+
121
+ ## 0.7.17
122
+
123
+ ### Patch Changes
124
+
125
+ - jazz-browser@0.7.17
126
+ - jazz-tools@0.7.17
127
+
128
+ ## 0.7.16
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies
133
+ - jazz-tools@0.7.16
134
+ - jazz-browser@0.7.16
135
+
136
+ ## 0.7.14
137
+
138
+ ### Patch Changes
139
+
140
+ - Updated dependencies
141
+ - jazz-tools@0.7.14
142
+ - jazz-browser@0.7.14
143
+
144
+ ## 0.7.13
145
+
146
+ ### Patch Changes
147
+
148
+ - Updated dependencies
149
+ - jazz-tools@0.7.13
150
+ - jazz-browser@0.7.13
151
+
152
+ ## 0.7.12
153
+
154
+ ### Patch Changes
155
+
156
+ - Updated dependencies
157
+ - jazz-tools@0.7.12
158
+ - jazz-browser@0.7.12
159
+
160
+ ## 0.7.11
161
+
162
+ ### Patch Changes
163
+
164
+ - jazz-browser@0.7.11
165
+ - jazz-tools@0.7.11
166
+
167
+ ## 0.7.10
168
+
169
+ ### Patch Changes
170
+
171
+ - jazz-browser@0.7.10
172
+ - jazz-tools@0.7.10
173
+
174
+ ## 0.7.9
175
+
176
+ ### Patch Changes
177
+
178
+ - jazz-browser@0.7.9
179
+ - jazz-tools@0.7.9
180
+
181
+ ## 0.7.8
182
+
183
+ ### Patch Changes
184
+
185
+ - Updated dependencies
186
+ - jazz-tools@0.7.8
187
+ - jazz-browser@0.7.8
188
+
189
+ ## 0.7.6
190
+
191
+ ### Patch Changes
192
+
193
+ - Updated dependencies
194
+ - jazz-tools@0.7.6
195
+ - jazz-browser@0.7.6
196
+
197
+ ## 0.7.5
198
+
199
+ ### Patch Changes
200
+
201
+ - Updated dependencies
202
+ - jazz-browser@0.7.5
203
+
204
+ ## 0.7.3
205
+
206
+ ### Patch Changes
207
+
208
+ - Updated dependencies
209
+ - jazz-tools@0.7.3
210
+ - jazz-browser@0.7.3
211
+
212
+ ## 0.7.1
213
+
214
+ ### Patch Changes
215
+
216
+ - Updated dependencies
217
+ - jazz-tools@0.7.1
218
+ - jazz-browser@0.7.1
219
+
220
+ ## 0.7.0
221
+
222
+ ### Minor Changes
223
+
224
+ - e299c3e: New simplified API
225
+
226
+ ### Patch Changes
227
+
228
+ - 59c18c3: CoMap fix
229
+ - c4151fc: Support stricter TS lint rules
230
+ - 952982e: Consistent proxy based API
231
+ - d2e03ff: Fix variance of ID.\_\_type
232
+ - 354bdcd: Even friendlier for subclassing CoMap
233
+ - 69ac514: Use effect schema much less
234
+ - f0f6f1b: Clean up API more & re-add jazz-nodejs
235
+ - 1a44f87: Refactoring
236
+ - 627d895: Get rid of Co namespace
237
+ - 85d2b62: More subclass-friendly types in CoMap
238
+ - Updated dependencies [8636319]
239
+ - Updated dependencies [1a35307]
240
+ - Updated dependencies [8636319]
241
+ - Updated dependencies [1a35307]
242
+ - Updated dependencies [96c494f]
243
+ - Updated dependencies [59c18c3]
244
+ - Updated dependencies [19f52b7]
245
+ - Updated dependencies [8636319]
246
+ - Updated dependencies [d8fe2b1]
247
+ - Updated dependencies [19004b4]
248
+ - Updated dependencies [a78f168]
249
+ - Updated dependencies [52675c9]
250
+ - Updated dependencies [129e2c1]
251
+ - Updated dependencies [1cfa279]
252
+ - Updated dependencies [704af7d]
253
+ - Updated dependencies [460478f]
254
+ - Updated dependencies [6b0418f]
255
+ - Updated dependencies [e299c3e]
256
+ - Updated dependencies [ed5643a]
257
+ - Updated dependencies [bde684f]
258
+ - Updated dependencies [c4151fc]
259
+ - Updated dependencies [63374cc]
260
+ - Updated dependencies [01ac646]
261
+ - Updated dependencies [a5e68a4]
262
+ - Updated dependencies [daee49c]
263
+ - Updated dependencies [952982e]
264
+ - Updated dependencies [1a35307]
265
+ - Updated dependencies [5fa277c]
266
+ - Updated dependencies [60d5ca2]
267
+ - Updated dependencies [21771c4]
268
+ - Updated dependencies [77c2b56]
269
+ - Updated dependencies [63374cc]
270
+ - Updated dependencies [d2e03ff]
271
+ - Updated dependencies [354bdcd]
272
+ - Updated dependencies [60d5ca2]
273
+ - Updated dependencies [69ac514]
274
+ - Updated dependencies [f8a5c46]
275
+ - Updated dependencies [f0f6f1b]
276
+ - Updated dependencies [e5eed5b]
277
+ - Updated dependencies [1a44f87]
278
+ - Updated dependencies [627d895]
279
+ - Updated dependencies [1200aae]
280
+ - Updated dependencies [63374cc]
281
+ - Updated dependencies [ece35b3]
282
+ - Updated dependencies [38d4410]
283
+ - Updated dependencies [85d2b62]
284
+ - Updated dependencies [fd86c11]
285
+ - Updated dependencies [52675c9]
286
+ - jazz-tools@0.7.0
287
+ - jazz-browser@0.7.0
288
+
289
+ ## 0.7.0-alpha.40
290
+
291
+ ### Patch Changes
292
+
293
+ - Updated dependencies
294
+ - jazz-tools@0.7.0-alpha.42
295
+ - jazz-browser@0.7.0-alpha.42
296
+
297
+ ## 0.7.0-alpha.39
298
+
299
+ ### Patch Changes
300
+
301
+ - jazz-tools@0.7.0-alpha.41
302
+ - jazz-browser@0.7.0-alpha.41
303
+
304
+ ## 0.7.0-alpha.38
305
+
306
+ ### Patch Changes
307
+
308
+ - jazz-browser@0.7.0-alpha.39
309
+ - jazz-tools@0.7.0-alpha.39
310
+
311
+ ## 0.7.0-alpha.37
312
+
313
+ ### Patch Changes
314
+
315
+ - Updated dependencies
316
+ - Updated dependencies
317
+ - Updated dependencies
318
+ - jazz-tools@0.7.0-alpha.38
319
+ - jazz-browser@0.7.0-alpha.38
320
+
321
+ ## 0.7.0-alpha.36
322
+
323
+ ### Patch Changes
324
+
325
+ - Updated dependencies
326
+ - jazz-browser@0.7.0-alpha.37
327
+ - jazz-tools@0.7.0-alpha.37
328
+
329
+ ## 0.7.0-alpha.35
330
+
331
+ ### Patch Changes
332
+
333
+ - Updated dependencies [1a35307]
334
+ - Updated dependencies [1a35307]
335
+ - Updated dependencies [6b0418f]
336
+ - Updated dependencies [1a35307]
337
+ - jazz-browser@0.7.0-alpha.36
338
+ - jazz-tools@0.7.0-alpha.36
339
+
340
+ ## 0.7.0-alpha.34
341
+
342
+ ### Patch Changes
343
+
344
+ - Updated dependencies
345
+ - jazz-tools@0.7.0-alpha.35
346
+ - jazz-browser@0.7.0-alpha.35
347
+
348
+ ## 0.7.0-alpha.33
349
+
350
+ ### Patch Changes
351
+
352
+ - Updated dependencies
353
+ - jazz-tools@0.7.0-alpha.34
354
+ - jazz-browser@0.7.0-alpha.34
355
+
356
+ ## 0.7.0-alpha.32
357
+
358
+ ### Patch Changes
359
+
360
+ - Updated dependencies
361
+ - Updated dependencies
362
+ - jazz-tools@0.7.0-alpha.32
363
+ - jazz-browser@0.7.0-alpha.32
364
+
365
+ ## 0.7.0-alpha.31
366
+
367
+ ### Patch Changes
368
+
369
+ - Updated dependencies
370
+ - jazz-tools@0.7.0-alpha.31
371
+ - jazz-browser@0.7.0-alpha.31
372
+
373
+ ## 0.7.0-alpha.30
374
+
375
+ ### Patch Changes
376
+
377
+ - Updated dependencies
378
+ - jazz-tools@0.7.0-alpha.30
379
+ - jazz-browser@0.7.0-alpha.30
380
+
381
+ ## 0.7.0-alpha.29
382
+
383
+ ### Patch Changes
384
+
385
+ - Updated dependencies
386
+ - jazz-tools@0.7.0-alpha.29
387
+ - jazz-browser@0.7.0-alpha.29
388
+
389
+ ## 0.7.0-alpha.28
390
+
391
+ ### Patch Changes
392
+
393
+ - Updated dependencies
394
+ - jazz-tools@0.7.0-alpha.28
395
+ - jazz-browser@0.7.0-alpha.28
396
+
397
+ ## 0.7.0-alpha.27
398
+
399
+ ### Patch Changes
400
+
401
+ - Updated dependencies
402
+ - Updated dependencies
403
+ - jazz-tools@0.7.0-alpha.27
404
+ - jazz-browser@0.7.0-alpha.27
405
+
406
+ ## 0.7.0-alpha.26
407
+
408
+ ### Patch Changes
409
+
410
+ - Updated dependencies
411
+ - jazz-tools@0.7.0-alpha.26
412
+ - jazz-browser@0.7.0-alpha.26
413
+
414
+ ## 0.7.0-alpha.25
415
+
416
+ ### Patch Changes
417
+
418
+ - Updated dependencies
419
+ - jazz-tools@0.7.0-alpha.25
420
+ - jazz-browser@0.7.0-alpha.25
421
+
422
+ ## 0.7.0-alpha.24
423
+
424
+ ### Patch Changes
425
+
426
+ - Updated dependencies
427
+ - Updated dependencies
428
+ - Updated dependencies
429
+ - jazz-tools@0.7.0-alpha.24
430
+ - jazz-browser@0.7.0-alpha.24
431
+
432
+ ## 0.7.0-alpha.23
433
+
434
+ ### Patch Changes
435
+
436
+ - Updated dependencies
437
+ - jazz-tools@0.7.0-alpha.23
438
+ - jazz-browser@0.7.0-alpha.23
439
+
440
+ ## 0.7.0-alpha.22
441
+
442
+ ### Patch Changes
443
+
444
+ - Updated dependencies
445
+ - jazz-tools@0.7.0-alpha.22
446
+ - jazz-browser@0.7.0-alpha.22
447
+
448
+ ## 0.7.0-alpha.21
449
+
450
+ ### Patch Changes
451
+
452
+ - Updated dependencies
453
+ - jazz-tools@0.7.0-alpha.21
454
+ - jazz-browser@0.7.0-alpha.21
455
+
456
+ ## 0.7.0-alpha.20
457
+
458
+ ### Patch Changes
459
+
460
+ - Updated dependencies
461
+ - jazz-tools@0.7.0-alpha.20
462
+ - jazz-browser@0.7.0-alpha.20
463
+
464
+ ## 0.7.0-alpha.19
465
+
466
+ ### Patch Changes
467
+
468
+ - Updated dependencies
469
+ - jazz-tools@0.7.0-alpha.19
470
+ - jazz-browser@0.7.0-alpha.19
471
+
472
+ ## 0.7.0-alpha.18
473
+
474
+ ### Patch Changes
475
+
476
+ - Updated dependencies
477
+ - jazz-browser@0.7.0-alpha.18
478
+
479
+ ## 0.7.0-alpha.17
480
+
481
+ ### Patch Changes
482
+
483
+ - Updated dependencies
484
+ - jazz-tools@0.7.0-alpha.17
485
+ - jazz-browser@0.7.0-alpha.17
486
+
487
+ ## 0.7.0-alpha.16
488
+
489
+ ### Patch Changes
490
+
491
+ - Updated dependencies
492
+ - jazz-tools@0.7.0-alpha.16
493
+ - jazz-browser@0.7.0-alpha.16
494
+
495
+ ## 0.7.0-alpha.15
496
+
497
+ ### Patch Changes
498
+
499
+ - Updated dependencies
500
+ - jazz-tools@0.7.0-alpha.15
501
+ - jazz-browser@0.7.0-alpha.15
502
+
503
+ ## 0.7.0-alpha.14
504
+
505
+ ### Patch Changes
506
+
507
+ - Updated dependencies
508
+ - jazz-tools@0.7.0-alpha.14
509
+ - jazz-browser@0.7.0-alpha.14
510
+
511
+ ## 0.7.0-alpha.13
512
+
513
+ ### Patch Changes
514
+
515
+ - Updated dependencies
516
+ - jazz-tools@0.7.0-alpha.13
517
+ - jazz-browser@0.7.0-alpha.13
518
+
519
+ ## 0.7.0-alpha.12
520
+
521
+ ### Patch Changes
522
+
523
+ - Fix variance of ID.\_\_type
524
+ - Updated dependencies
525
+ - jazz-browser@0.7.0-alpha.12
526
+ - jazz-tools@0.7.0-alpha.12
527
+
528
+ ## 0.7.0-alpha.11
529
+
530
+ ### Patch Changes
531
+
532
+ - Support stricter TS lint rules
533
+ - Updated dependencies
534
+ - jazz-browser@0.7.0-alpha.11
535
+ - jazz-tools@0.7.0-alpha.11
536
+
537
+ ## 0.7.0-alpha.10
538
+
539
+ ### Patch Changes
540
+
541
+ - Clean up API more & re-add jazz-nodejs
542
+ - Updated dependencies
543
+ - jazz-browser@0.7.0-alpha.10
544
+ - jazz-tools@0.7.0-alpha.10
545
+
546
+ ## 0.7.0-alpha.9
547
+
548
+ ### Patch Changes
549
+
550
+ - Even friendlier for subclassing CoMap
551
+ - Updated dependencies
552
+ - jazz-browser@0.7.0-alpha.9
553
+ - jazz-tools@0.7.0-alpha.9
554
+
555
+ ## 0.7.0-alpha.8
556
+
557
+ ### Patch Changes
558
+
559
+ - More subclass-friendly types in CoMap
560
+ - Updated dependencies
561
+ - jazz-browser@0.7.0-alpha.8
562
+ - jazz-tools@0.7.0-alpha.8
563
+
564
+ ## 0.7.0-alpha.7
565
+
566
+ ### Patch Changes
567
+
568
+ - Consistent proxy based API
569
+ - Updated dependencies
570
+ - jazz-browser@0.7.0-alpha.7
571
+ - jazz-tools@0.7.0-alpha.7
572
+
573
+ ## 0.7.0-alpha.6
574
+
575
+ ### Patch Changes
576
+
577
+ - CoMap fix
578
+ - Updated dependencies
579
+ - jazz-browser@0.7.0-alpha.6
580
+ - jazz-tools@0.7.0-alpha.6
581
+
582
+ ## 0.7.0-alpha.5
583
+
584
+ ### Patch Changes
585
+
586
+ - Refactoring
587
+ - Updated dependencies
588
+ - jazz-browser@0.7.0-alpha.5
589
+ - jazz-tools@0.7.0-alpha.5
590
+
591
+ ## 0.7.0-alpha.4
592
+
593
+ ### Patch Changes
594
+
595
+ - Updated dependencies
596
+ - jazz-tools@0.7.0-alpha.4
597
+ - jazz-browser@0.7.0-alpha.4
598
+
599
+ ## 0.7.0-alpha.3
600
+
601
+ ### Patch Changes
602
+
603
+ - Updated dependencies
604
+ - jazz-tools@0.7.0-alpha.3
605
+ - jazz-browser@0.7.0-alpha.3
606
+
607
+ ## 0.7.0-alpha.2
608
+
609
+ ### Patch Changes
610
+
611
+ - Get rid of Co namespace
612
+ - Updated dependencies
613
+ - jazz-browser@0.7.0-alpha.2
614
+ - jazz-tools@0.7.0-alpha.2
615
+
616
+ ## 0.7.0-alpha.1
617
+
618
+ ### Patch Changes
619
+
620
+ - Use effect schema much less
621
+ - Updated dependencies
622
+ - jazz-browser@0.7.0-alpha.1
623
+ - jazz-tools@0.7.0-alpha.1
624
+
625
+ ## 0.7.0-alpha.0
626
+
627
+ ### Minor Changes
628
+
629
+ - New simplified API
630
+
631
+ ### Patch Changes
632
+
633
+ - Updated dependencies
634
+ - jazz-browser@0.7.0-alpha.0
635
+ - jazz-tools@0.7.0-alpha.0
636
+
637
+ ## 0.6.0
638
+
639
+ ### Minor Changes
640
+
641
+ - Parametrize BrowserImage for maxWidth
642
+
643
+ ## 0.5.1
644
+
645
+ ### Patch Changes
646
+
647
+ - Updated dependencies
648
+ - jazz-autosub@0.6.0
649
+ - jazz-browser@0.6.0
650
+ - cojson@0.6.0
651
+
652
+ ## 0.5.0
653
+
654
+ ### Minor Changes
655
+
656
+ - Adding a lot of performance improvements to cojson, add a stresstest for the twit example and make that run smoother in a lot of ways.
657
+
658
+ ### Patch Changes
659
+
660
+ - Updated dependencies
661
+ - jazz-autosub@0.5.0
662
+ - jazz-browser@0.5.0
663
+ - cojson@0.5.0
package/LICENSE.txt ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2024, Garden Computing, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # `jazz-browser-media-images`
2
+
3
+ This is an optional add-on for `jazz-browser` or `jazz-react` that provides support for creating `ImageDefinition`-compatible image sets from images provided as `File` or `Blob` objects.
4
+
5
+ In particular, it implements multi-resolution resizing based on `pica`.
package/dist/index.js ADDED
@@ -0,0 +1,53 @@
1
+ export class BrowserClerkAuth {
2
+ constructor(driver, clerkClient) {
3
+ this.driver = driver;
4
+ this.clerkClient = clerkClient;
5
+ }
6
+ async start() {
7
+ if (this.clerkClient.user) {
8
+ const storedCredentials = this.clerkClient.user.unsafeMetadata;
9
+ if (storedCredentials.jazzAccountID) {
10
+ if (!storedCredentials.jazzAccountSecret) {
11
+ throw new Error("No secret for existing user");
12
+ }
13
+ return {
14
+ type: "existing",
15
+ credentials: {
16
+ accountID: storedCredentials.jazzAccountID,
17
+ secret: storedCredentials.jazzAccountSecret,
18
+ },
19
+ onSuccess: () => { },
20
+ onError: (error) => {
21
+ this.driver.onError(error);
22
+ },
23
+ };
24
+ }
25
+ else {
26
+ return {
27
+ type: "new",
28
+ creationProps: {
29
+ name: this.clerkClient.user.fullName ||
30
+ this.clerkClient.user.username ||
31
+ this.clerkClient.user.id,
32
+ },
33
+ saveCredentials: async (credentials) => {
34
+ await this.clerkClient.user?.update({
35
+ unsafeMetadata: {
36
+ jazzAccountID: credentials.accountID,
37
+ jazzAccountSecret: credentials.secret,
38
+ },
39
+ });
40
+ },
41
+ onSuccess: () => { },
42
+ onError: (error) => {
43
+ this.driver.onError(error);
44
+ },
45
+ };
46
+ }
47
+ }
48
+ else {
49
+ throw new Error("Not signed in");
50
+ }
51
+ }
52
+ }
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,gBAAgB;IACzB,YACW,MAA+B,EACrB,WAAwB;QADlC,WAAM,GAAN,MAAM,CAAyB;QACrB,gBAAW,GAAX,WAAW,CAAa;IAC1C,CAAC;IAEJ,KAAK,CAAC,KAAK;QACP,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YACxB,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC;YAC/D,IAAI,iBAAiB,CAAC,aAAa,EAAE,CAAC;gBAClC,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,CAAC;oBACvC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;gBACnD,CAAC;gBACD,OAAO;oBACH,IAAI,EAAE,UAAU;oBAChB,WAAW,EAAE;wBACT,SAAS,EACL,iBAAiB,CAAC,aAA4B;wBAClD,MAAM,EAAE,iBAAiB,CAAC,iBAAgC;qBAC7D;oBACD,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;oBACnB,OAAO,EAAE,CAAC,KAAqB,EAAE,EAAE;wBAC/B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAC/B,CAAC;iBACJ,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,IAAI,EAAE,KAAK;oBACX,aAAa,EAAE;wBACX,IAAI,EACA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ;4BAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ;4BAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;qBAC/B;oBACD,eAAe,EAAE,KAAK,EAAE,WAGvB,EAAE,EAAE;wBACD,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;4BAChC,cAAc,EAAE;gCACZ,aAAa,EAAE,WAAW,CAAC,SAAS;gCACpC,iBAAiB,EAAE,WAAW,CAAC,MAAM;6BACxC;yBACJ,CAAC,CAAC;oBACP,CAAC;oBACD,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;oBACnB,OAAO,EAAE,CAAC,KAAqB,EAAE,EAAE;wBAC/B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAC/B,CAAC;iBACJ,CAAC;YACN,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;CACJ"}
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "jazz-browser-auth-clerk",
3
+ "version": "0.7.33-new-auth.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "src/index.ts",
7
+ "license": "MIT",
8
+ "dependencies": {},
9
+ "peerDependencies": {
10
+ "@clerk/types": "^3.65.3",
11
+ "cojson": "0.7.34",
12
+ "jazz-tools": "0.7.35-new-auth.0",
13
+ "jazz-browser": "0.7.35-new-auth.0"
14
+ },
15
+ "devDependencies": {
16
+ "typescript": "^5.1.6"
17
+ },
18
+ "lint-staged": {
19
+ "*.{ts,tsx}": "eslint --fix",
20
+ "*.{js,jsx,mdx,json}": "prettier --write"
21
+ },
22
+ "scripts": {
23
+ "lint": "eslint . --ext ts,tsx",
24
+ "format": "prettier --write './src/**/*.{ts,tsx}'",
25
+ "build": "npm run lint && rm -rf ./dist && tsc --sourceMap --outDir dist"
26
+ }
27
+ }
package/src/index.ts ADDED
@@ -0,0 +1,67 @@
1
+ import { Account, AuthMethod, AuthResult, ID } from "jazz-tools";
2
+ import type { LoadedClerk } from '@clerk/types';
3
+ import { AgentSecret } from "cojson";
4
+
5
+ export class BrowserClerkAuth implements AuthMethod {
6
+ constructor(
7
+ public driver: BrowserClerkAuth.Driver,
8
+ private readonly clerkClient: LoadedClerk,
9
+ ) {}
10
+
11
+ async start(): Promise<AuthResult> {
12
+ if (this.clerkClient.user) {
13
+ const storedCredentials = this.clerkClient.user.unsafeMetadata;
14
+ if (storedCredentials.jazzAccountID) {
15
+ if (!storedCredentials.jazzAccountSecret) {
16
+ throw new Error("No secret for existing user");
17
+ }
18
+ return {
19
+ type: "existing",
20
+ credentials: {
21
+ accountID:
22
+ storedCredentials.jazzAccountID as ID<Account>,
23
+ secret: storedCredentials.jazzAccountSecret as AgentSecret,
24
+ },
25
+ onSuccess: () => {},
26
+ onError: (error: string | Error) => {
27
+ this.driver.onError(error);
28
+ },
29
+ };
30
+ } else {
31
+ return {
32
+ type: "new",
33
+ creationProps: {
34
+ name:
35
+ this.clerkClient.user.fullName ||
36
+ this.clerkClient.user.username ||
37
+ this.clerkClient.user.id,
38
+ },
39
+ saveCredentials: async (credentials: {
40
+ accountID: ID<Account>;
41
+ secret: AgentSecret;
42
+ }) => {
43
+ await this.clerkClient.user?.update({
44
+ unsafeMetadata: {
45
+ jazzAccountID: credentials.accountID,
46
+ jazzAccountSecret: credentials.secret,
47
+ },
48
+ });
49
+ },
50
+ onSuccess: () => {},
51
+ onError: (error: string | Error) => {
52
+ this.driver.onError(error);
53
+ },
54
+ };
55
+ }
56
+ } else {
57
+ throw new Error("Not signed in");
58
+ }
59
+ }
60
+ }
61
+
62
+ // eslint-disable-next-line @typescript-eslint/no-namespace
63
+ export namespace BrowserClerkAuth {
64
+ export interface Driver {
65
+ onError: (error: string | Error) => void;
66
+ }
67
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["ESNext", "DOM"],
4
+ "module": "esnext",
5
+ "target": "ES2020",
6
+ "moduleResolution": "bundler",
7
+ "moduleDetection": "force",
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "jsx": "react",
11
+ "forceConsistentCasingInFileNames": true,
12
+ "noUncheckedIndexedAccess": true,
13
+ "esModuleInterop": true,
14
+ },
15
+ "include": ["./src/**/*"],
16
+ }