@blazeo.com/appointment-client 1.0.2 → 1.0.4

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.
Files changed (32) hide show
  1. package/blazeo.com-appointment-client-1.0.4.tgz +0 -0
  2. package/dist/calendar/fetchCalendarWithOpeningHours.d.ts +21 -0
  3. package/dist/calendar/fetchCalendarWithOpeningHours.js +75 -0
  4. package/dist/config/initializeAppointmentClient.d.ts +5 -2
  5. package/dist/config/initializeAppointmentClient.d.ts.map +1 -1
  6. package/dist/config/initializeAppointmentClient.js +11 -6
  7. package/dist/config/initializeAppointmentClient.js.map +1 -1
  8. package/dist/events/appointmentEventFacade.js +0 -1
  9. package/dist/events/appointmentEventFacade.js.map +1 -1
  10. package/dist/events/mapAppointmentToEventSnapshot.d.ts.map +1 -1
  11. package/dist/events/mapAppointmentToEventSnapshot.js +2 -0
  12. package/dist/events/mapAppointmentToEventSnapshot.js.map +1 -1
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.js +1 -0
  15. package/dist/types/appointment.d.ts +1 -0
  16. package/dist/types/appointment.d.ts.map +1 -1
  17. package/package.json +23 -39
  18. package/sample/index.html +13 -0
  19. package/sample/package-lock.json +1658 -0
  20. package/sample/package.json +19 -0
  21. package/sample/src/App2.jsx +148 -0
  22. package/sample/src/AvailabilityTab.jsx +83 -0
  23. package/sample/src/BlazeoConnectionSettings.jsx +118 -0
  24. package/sample/src/CalendarTab.jsx +37 -0
  25. package/sample/src/CreateCalendarTab.jsx +147 -0
  26. package/sample/src/EventTab.jsx +244 -0
  27. package/sample/src/FetchCalendarTab.jsx +566 -0
  28. package/sample/src/ParticipantTab.jsx +102 -0
  29. package/sample/src/main.jsx +19 -0
  30. package/sample/src/style.css +681 -0
  31. package/sample/src/vite-env.d.ts +12 -0
  32. package/sample/vite.config.js +47 -0
@@ -0,0 +1,681 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ body {
8
+ margin: 0;
9
+ min-height: 100vh;
10
+ font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
11
+ font-size: 16px;
12
+ line-height: 1.5;
13
+ color: #1a1a1a;
14
+ background: linear-gradient(160deg, #f0f4f8 0%, #e2e8f0 100%);
15
+ }
16
+
17
+ .page {
18
+ max-width: 52rem;
19
+ margin: 0 auto;
20
+ padding: 2rem 1.25rem 3rem;
21
+ }
22
+
23
+ .header {
24
+ margin-bottom: 1.75rem;
25
+ }
26
+
27
+ .header h1 {
28
+ margin: 0 0 0.35rem;
29
+ font-size: 1.75rem;
30
+ font-weight: 700;
31
+ letter-spacing: -0.02em;
32
+ }
33
+
34
+ .muted {
35
+ margin: 0;
36
+ color: #64748b;
37
+ font-size: 0.95rem;
38
+ }
39
+
40
+ .small {
41
+ font-size: 0.875rem;
42
+ }
43
+
44
+ .card {
45
+ background: #fff;
46
+ border-radius: 12px;
47
+ padding: 1.25rem 1.35rem;
48
+ margin-bottom: 1rem;
49
+ box-shadow: 0 1px 3px rgb(15 23 42 / 8%), 0 4px 14px rgb(15 23 42 / 6%);
50
+ }
51
+
52
+ .card h2 {
53
+ margin: 0 0 0.75rem;
54
+ font-size: 1rem;
55
+ font-weight: 600;
56
+ color: #334155;
57
+ }
58
+
59
+ .card p {
60
+ margin: 0.35rem 0;
61
+ }
62
+
63
+ .card code {
64
+ font-size: 0.85em;
65
+ padding: 0.1em 0.35em;
66
+ background: #f1f5f9;
67
+ border-radius: 4px;
68
+ }
69
+
70
+ .tabs {
71
+ display: flex;
72
+ flex-wrap: wrap;
73
+ gap: 0.35rem;
74
+ margin-bottom: 1rem;
75
+ padding: 0.25rem;
76
+ background: rgb(255 255 255 / 70%);
77
+ border-radius: 12px;
78
+ box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
79
+ }
80
+
81
+ .tabs__btn {
82
+ appearance: none;
83
+ border: 1px solid transparent;
84
+ background: transparent;
85
+ color: #475569;
86
+ font: inherit;
87
+ font-size: 0.9rem;
88
+ font-weight: 500;
89
+ padding: 0.45rem 0.85rem;
90
+ border-radius: 8px;
91
+ cursor: pointer;
92
+ }
93
+
94
+ .tabs__btn:hover {
95
+ color: #1e293b;
96
+ background: rgb(241 245 249 / 90%);
97
+ }
98
+
99
+ .tabs__btn--active {
100
+ color: #0f172a;
101
+ background: #fff;
102
+ border-color: #e2e8f0;
103
+ box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
104
+ }
105
+
106
+ .tab-panel {
107
+ min-height: 8rem;
108
+ }
109
+
110
+ .connection-card__row {
111
+ display: grid;
112
+ gap: 1rem;
113
+ }
114
+
115
+ @media (min-width: 640px) {
116
+ .connection-card__row {
117
+ grid-template-columns: 1fr 1fr;
118
+ align-items: end;
119
+ }
120
+ }
121
+
122
+ .test-steps {
123
+ margin: 0 0 1rem;
124
+ padding-left: 1.25rem;
125
+ color: #334155;
126
+ font-size: 0.9rem;
127
+ line-height: 1.55;
128
+ }
129
+
130
+ .test-steps li {
131
+ margin-bottom: 0.5rem;
132
+ }
133
+
134
+ .form__label {
135
+ display: flex;
136
+ flex-direction: column;
137
+ gap: 0.35rem;
138
+ margin-bottom: 1rem;
139
+ font-size: 0.9rem;
140
+ font-weight: 500;
141
+ color: #334155;
142
+ }
143
+
144
+ .form__textarea {
145
+ width: 100%;
146
+ padding: 0.65rem 0.75rem;
147
+ font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
148
+ font-size: 0.8rem;
149
+ line-height: 1.45;
150
+ border: 1px solid #e2e8f0;
151
+ border-radius: 8px;
152
+ resize: vertical;
153
+ min-height: 12rem;
154
+ background: #f8fafc;
155
+ }
156
+
157
+ .form__input {
158
+ width: 100%;
159
+ padding: 0.55rem 0.75rem;
160
+ font-size: 0.9rem;
161
+ border: 1px solid #e2e8f0;
162
+ border-radius: 8px;
163
+ background: #fff;
164
+ }
165
+
166
+ .form__input:focus,
167
+ .form__textarea:focus {
168
+ outline: 2px solid #3b82f6;
169
+ outline-offset: 1px;
170
+ border-color: #93c5fd;
171
+ }
172
+
173
+ .form-actions {
174
+ display: flex;
175
+ flex-wrap: wrap;
176
+ gap: 0.5rem;
177
+ margin-bottom: 1rem;
178
+ }
179
+
180
+ .form-actions--top {
181
+ margin-bottom: 0.75rem;
182
+ }
183
+
184
+ .btn {
185
+ display: inline-flex;
186
+ align-items: center;
187
+ justify-content: center;
188
+ padding: 0.5rem 1rem;
189
+ font: inherit;
190
+ font-size: 0.9rem;
191
+ font-weight: 600;
192
+ border-radius: 8px;
193
+ border: 1px solid transparent;
194
+ cursor: pointer;
195
+ }
196
+
197
+ .btn:disabled {
198
+ opacity: 0.65;
199
+ cursor: not-allowed;
200
+ }
201
+
202
+ .btn--primary {
203
+ background: #2563eb;
204
+ color: #fff;
205
+ margin-top: 0.25rem;
206
+ }
207
+
208
+ .btn--primary:hover:not(:disabled) {
209
+ background: #1d4ed8;
210
+ }
211
+
212
+ .btn--secondary {
213
+ background: #f1f5f9;
214
+ color: #334155;
215
+ border-color: #e2e8f0;
216
+ }
217
+
218
+ .btn--secondary:hover {
219
+ background: #e2e8f0;
220
+ }
221
+
222
+ .pre-block {
223
+ margin: 0;
224
+ padding: 0.75rem 1rem;
225
+ font-size: 0.78rem;
226
+ line-height: 1.5;
227
+ overflow: auto;
228
+ max-height: 22rem;
229
+ background: #0f172a;
230
+ color: #e2e8f0;
231
+ border-radius: 8px;
232
+ white-space: pre-wrap;
233
+ word-break: break-word;
234
+ }
235
+
236
+ .card--error {
237
+ border: 1px solid #fecaca;
238
+ background: #fef2f2;
239
+ }
240
+
241
+ .card--error h2 {
242
+ color: #b91c1c;
243
+ }
244
+
245
+ .card--success {
246
+ border: 1px solid #bbf7d0;
247
+ background: #f0fdf4;
248
+ }
249
+
250
+ .card--success h2 {
251
+ color: #166534;
252
+ }
253
+
254
+ .table {
255
+ width: 100%;
256
+ border-collapse: collapse;
257
+ font-size: 0.9rem;
258
+ margin-top: 0.5rem;
259
+ }
260
+
261
+ .table th,
262
+ .table td {
263
+ text-align: left;
264
+ padding: 0.5rem 0.65rem;
265
+ border-bottom: 1px solid #f1f5f9;
266
+ }
267
+
268
+ .table th {
269
+ font-size: 0.75rem;
270
+ text-transform: uppercase;
271
+ letter-spacing: 0.04em;
272
+ color: #64748b;
273
+ font-weight: 600;
274
+ }
275
+
276
+ .table__code {
277
+ font-size: 0.8em;
278
+ }
279
+
280
+ .table__row--selected {
281
+ background: rgb(219 234 254 / 55%);
282
+ }
283
+
284
+ .table__row--selected td {
285
+ border-bottom-color: #bfdbfe;
286
+ }
287
+
288
+ *,
289
+ *::before,
290
+ *::after {
291
+ box-sizing: border-box;
292
+ }
293
+
294
+ body {
295
+ margin: 0;
296
+ min-height: 100vh;
297
+ font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
298
+ font-size: 16px;
299
+ line-height: 1.5;
300
+ color: #1a1a1a;
301
+ background: linear-gradient(160deg, #f0f4f8 0%, #e2e8f0 100%);
302
+ }
303
+
304
+ .page {
305
+ max-width: 52rem;
306
+ margin: 0 auto;
307
+ padding: 2rem 1.25rem 3rem;
308
+ }
309
+
310
+ .header {
311
+ margin-bottom: 1.75rem;
312
+ }
313
+
314
+ .header h1 {
315
+ margin: 0 0 0.35rem;
316
+ font-size: 1.75rem;
317
+ font-weight: 700;
318
+ letter-spacing: -0.02em;
319
+ }
320
+
321
+ .muted {
322
+ margin: 0;
323
+ color: #64748b;
324
+ font-size: 0.95rem;
325
+ }
326
+
327
+ .small {
328
+ font-size: 0.875rem;
329
+ }
330
+
331
+ .card {
332
+ background: #fff;
333
+ border-radius: 12px;
334
+ padding: 1.25rem 1.35rem;
335
+ margin-bottom: 1rem;
336
+ box-shadow: 0 1px 3px rgb(15 23 42 / 8%), 0 4px 14px rgb(15 23 42 / 6%);
337
+ }
338
+
339
+ .card h2 {
340
+ margin: 0 0 0.75rem;
341
+ font-size: 1rem;
342
+ font-weight: 600;
343
+ color: #334155;
344
+ }
345
+
346
+ .card p {
347
+ margin: 0.35rem 0;
348
+ }
349
+
350
+ .card code {
351
+ font-size: 0.85em;
352
+ padding: 0.1em 0.35em;
353
+ background: #f1f5f9;
354
+ border-radius: 4px;
355
+ }
356
+
357
+ .slots {
358
+ margin: 0;
359
+ padding-left: 1.15rem;
360
+ }
361
+
362
+ .slots li {
363
+ margin-bottom: 0.35rem;
364
+ }
365
+
366
+ .time {
367
+ display: inline-block;
368
+ min-width: 6.5rem;
369
+ font-variant-numeric: tabular-nums;
370
+ color: #475569;
371
+ font-size: 0.9rem;
372
+ }
373
+
374
+ .tabs {
375
+ display: flex;
376
+ flex-wrap: wrap;
377
+ gap: 0.35rem;
378
+ margin-bottom: 1rem;
379
+ padding: 0.25rem;
380
+ background: rgb(255 255 255 / 70%);
381
+ border-radius: 12px;
382
+ box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
383
+ }
384
+
385
+ .tabs__btn {
386
+ appearance: none;
387
+ border: 1px solid transparent;
388
+ background: transparent;
389
+ color: #475569;
390
+ font: inherit;
391
+ font-size: 0.9rem;
392
+ font-weight: 500;
393
+ padding: 0.45rem 0.85rem;
394
+ border-radius: 8px;
395
+ cursor: pointer;
396
+ }
397
+
398
+ .tabs__btn:hover {
399
+ color: #1e293b;
400
+ background: rgb(241 245 249 / 90%);
401
+ }
402
+
403
+ .tabs__btn--active {
404
+ color: #0f172a;
405
+ background: #fff;
406
+ border-color: #e2e8f0;
407
+ box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
408
+ }
409
+
410
+ .tab-panel {
411
+ min-height: 8rem;
412
+ }
413
+
414
+ .test-steps {
415
+ margin: 0 0 1rem;
416
+ padding-left: 1.25rem;
417
+ color: #334155;
418
+ font-size: 0.9rem;
419
+ line-height: 1.55;
420
+ }
421
+
422
+ .test-steps li {
423
+ margin-bottom: 0.5rem;
424
+ }
425
+
426
+ .flow-hint {
427
+ padding: 0.65rem 0.75rem;
428
+ background: #f8fafc;
429
+ border-radius: 8px;
430
+ border: 1px solid #e2e8f0;
431
+ }
432
+
433
+ .connection-card__row {
434
+ display: grid;
435
+ gap: 1rem;
436
+ }
437
+
438
+ @media (min-width: 640px) {
439
+ .connection-card__row {
440
+ grid-template-columns: 1fr 1fr;
441
+ align-items: end;
442
+ }
443
+ }
444
+
445
+ .list-block {
446
+ list-style: none;
447
+ margin: 0;
448
+ padding: 0;
449
+ }
450
+
451
+ .list-block__item {
452
+ padding: 0.75rem 0;
453
+ border-bottom: 1px solid #f1f5f9;
454
+ }
455
+
456
+ .list-block__item:last-child {
457
+ border-bottom: none;
458
+ }
459
+
460
+ .list-block__title {
461
+ font-weight: 600;
462
+ color: #0f172a;
463
+ }
464
+
465
+ .list-block__meta {
466
+ font-size: 0.875rem;
467
+ color: #64748b;
468
+ margin-top: 0.2rem;
469
+ }
470
+
471
+ .list-block__muted {
472
+ font-size: 0.825rem;
473
+ color: #94a3b8;
474
+ margin-top: 0.35rem;
475
+ font-variant-numeric: tabular-nums;
476
+ }
477
+
478
+ .table {
479
+ width: 100%;
480
+ border-collapse: collapse;
481
+ font-size: 0.9rem;
482
+ margin-top: 0.5rem;
483
+ }
484
+
485
+ .table th,
486
+ .table td {
487
+ text-align: left;
488
+ padding: 0.5rem 0.65rem;
489
+ border-bottom: 1px solid #f1f5f9;
490
+ }
491
+
492
+ .table th {
493
+ font-size: 0.75rem;
494
+ text-transform: uppercase;
495
+ letter-spacing: 0.04em;
496
+ color: #64748b;
497
+ font-weight: 600;
498
+ }
499
+
500
+ .table__code {
501
+ font-size: 0.8em;
502
+ }
503
+
504
+ .table__row--selected {
505
+ background: rgb(219 234 254 / 55%);
506
+ }
507
+
508
+ .table__row--selected td {
509
+ border-bottom-color: #bfdbfe;
510
+ }
511
+
512
+ .list-inline {
513
+ list-style: none;
514
+ margin: 0.5rem 0 0;
515
+ padding: 0;
516
+ }
517
+
518
+ .list-inline__row {
519
+ display: flex;
520
+ flex-wrap: wrap;
521
+ gap: 0.5rem 1rem;
522
+ padding: 0.55rem 0;
523
+ border-bottom: 1px solid #f1f5f9;
524
+ align-items: baseline;
525
+ }
526
+
527
+ .list-inline__row:last-child {
528
+ border-bottom: none;
529
+ }
530
+
531
+ .list-inline__day {
532
+ min-width: 6.5rem;
533
+ font-weight: 600;
534
+ color: #334155;
535
+ }
536
+
537
+ .list-inline__value {
538
+ color: #475569;
539
+ font-variant-numeric: tabular-nums;
540
+ }
541
+
542
+ .form__label {
543
+ display: flex;
544
+ flex-direction: column;
545
+ gap: 0.35rem;
546
+ margin-bottom: 1rem;
547
+ font-size: 0.9rem;
548
+ font-weight: 500;
549
+ color: #334155;
550
+ }
551
+
552
+ .form__textarea {
553
+ width: 100%;
554
+ padding: 0.65rem 0.75rem;
555
+ font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
556
+ font-size: 0.8rem;
557
+ line-height: 1.45;
558
+ border: 1px solid #e2e8f0;
559
+ border-radius: 8px;
560
+ resize: vertical;
561
+ min-height: 12rem;
562
+ background: #f8fafc;
563
+ }
564
+
565
+ .form__input {
566
+ width: 100%;
567
+ padding: 0.55rem 0.75rem;
568
+ font-size: 0.9rem;
569
+ border: 1px solid #e2e8f0;
570
+ border-radius: 8px;
571
+ background: #fff;
572
+ }
573
+
574
+ .form__check {
575
+ display: flex;
576
+ align-items: flex-start;
577
+ gap: 0.5rem;
578
+ margin: 0 0 1rem;
579
+ font-size: 0.9rem;
580
+ color: #475569;
581
+ cursor: pointer;
582
+ }
583
+
584
+ .form__check input {
585
+ margin-top: 0.2rem;
586
+ flex-shrink: 0;
587
+ }
588
+
589
+ .form__input:focus {
590
+ outline: 2px solid #3b82f6;
591
+ outline-offset: 1px;
592
+ border-color: #93c5fd;
593
+ }
594
+
595
+ .form__textarea:focus {
596
+ outline: 2px solid #3b82f6;
597
+ outline-offset: 1px;
598
+ border-color: #93c5fd;
599
+ background: #fff;
600
+ }
601
+
602
+ .form-actions {
603
+ display: flex;
604
+ flex-wrap: wrap;
605
+ gap: 0.5rem;
606
+ margin-bottom: 1rem;
607
+ }
608
+
609
+ .form-actions--top {
610
+ margin-bottom: 0.75rem;
611
+ }
612
+
613
+ .btn {
614
+ display: inline-flex;
615
+ align-items: center;
616
+ justify-content: center;
617
+ padding: 0.5rem 1rem;
618
+ font: inherit;
619
+ font-size: 0.9rem;
620
+ font-weight: 600;
621
+ border-radius: 8px;
622
+ border: 1px solid transparent;
623
+ cursor: pointer;
624
+ }
625
+
626
+ .btn:disabled {
627
+ opacity: 0.65;
628
+ cursor: not-allowed;
629
+ }
630
+
631
+ .btn--primary {
632
+ background: #2563eb;
633
+ color: #fff;
634
+ margin-top: 0.25rem;
635
+ }
636
+
637
+ .btn--primary:hover:not(:disabled) {
638
+ background: #1d4ed8;
639
+ }
640
+
641
+ .btn--secondary {
642
+ background: #f1f5f9;
643
+ color: #334155;
644
+ border-color: #e2e8f0;
645
+ }
646
+
647
+ .btn--secondary:hover {
648
+ background: #e2e8f0;
649
+ }
650
+
651
+ .pre-block {
652
+ margin: 0;
653
+ padding: 0.75rem 1rem;
654
+ font-size: 0.78rem;
655
+ line-height: 1.5;
656
+ overflow: auto;
657
+ max-height: 22rem;
658
+ background: #0f172a;
659
+ color: #e2e8f0;
660
+ border-radius: 8px;
661
+ white-space: pre-wrap;
662
+ word-break: break-word;
663
+ }
664
+
665
+ .card--error {
666
+ border: 1px solid #fecaca;
667
+ background: #fef2f2;
668
+ }
669
+
670
+ .card--error h2 {
671
+ color: #b91c1c;
672
+ }
673
+
674
+ .card--success {
675
+ border: 1px solid #bbf7d0;
676
+ background: #f0fdf4;
677
+ }
678
+
679
+ .card--success h2 {
680
+ color: #166534;
681
+ }
@@ -0,0 +1,12 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ /// <reference types="vite/client" />
4
+
5
+ interface ImportMetaEnv {
6
+ readonly VITE_BLAZEO_BASE_URL?: string;
7
+ readonly VITE_BLAZEO_CONSUMER?: string;
8
+ }
9
+
10
+ interface ImportMeta {
11
+ readonly env: ImportMetaEnv;
12
+ }
@@ -0,0 +1,47 @@
1
+ import react from "@vitejs/plugin-react";
2
+ import { defineConfig, loadEnv } from "vite";
3
+ import path from "path";
4
+ import { fileURLToPath } from "url";
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+
8
+ export default defineConfig(({ mode }) => {
9
+ const env = loadEnv(mode, path.resolve(__dirname, "."), "");
10
+ const proxyTarget = (env.VITE_DEV_PROXY_TARGET ?? "").trim().replace(/\/+$/, "");
11
+
12
+ /** Avoid browser CORS during local dev: requests go to same origin, Vite forwards to API. */
13
+ const devProxy =
14
+ proxyTarget.length > 0
15
+ ? {
16
+ "/blazeo-api": {
17
+ target: proxyTarget,
18
+ changeOrigin: true,
19
+ secure: true,
20
+ rewrite: (reqPath) => reqPath.replace(/^\/blazeo-api/, "") || "/",
21
+ },
22
+ }
23
+ : undefined;
24
+
25
+ return {
26
+ plugins: [react()],
27
+ /** Ensure one instance so `configure()` and models share the same store. */
28
+ resolve: {
29
+ preserveSymlinks: true,
30
+ dedupe: ["@blazeo.com/calendar-client", "mobx", "mobx-state-tree"],
31
+ alias: {
32
+ "@blazeo.com/calendar-client": path.resolve(
33
+ __dirname,
34
+ "../node_modules/@blazeo.com/calendar-client/dist/index.mjs"
35
+ ),
36
+ },
37
+ },
38
+ optimizeDeps: {
39
+ exclude: ["appointment-client", "@blazeo.com/calendar-client", "mobx", "mobx-state-tree"],
40
+ },
41
+ server: {
42
+ port: 5173,
43
+ open: true,
44
+ ...(devProxy ? { proxy: devProxy } : {}),
45
+ },
46
+ };
47
+ });