@scalar/api-client 2.0.1 → 2.0.3

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/App.vue.js CHANGED
@@ -1,749 +1,38 @@
1
- import { defineComponent as r, onMounted as a, watchEffect as i, onBeforeMount as p, openBlock as c, createElementBlock as m, Fragment as l, createVNode as e, createElementVNode as o, unref as s } from "vue";
2
- import d from "./components/SideNav/SideNav.vue.js";
1
+ import { defineComponent as c, onMounted as t, watchEffect as l, onBeforeMount as n, openBlock as i, createElementBlock as p, Fragment as d, createVNode as e, createElementVNode as r, unref as a } from "vue";
2
+ import f from "./components/SideNav/SideNav.vue.js";
3
3
  import u from "./components/TopNav/TopNav.vue.js";
4
- import { useWorkspace as h } from "./store/workspace.js";
5
- import { ScalarToasts as y } from "@scalar/use-toasts";
6
- import { RouterView as f } from "vue-router";
4
+ import { useWorkspace as _ } from "./store/workspace.js";
5
+ import { ScalarToasts as x } from "@scalar/use-toasts";
6
+ import { RouterView as h } from "vue-router";
7
7
  import { useDarkModeState as g } from "./hooks/useDarkModeState.js";
8
- const b = { class: "flex min-h-0 flex-1" }, j = { class: "flex flex-1 flex-col min-w-0" }, B = /* @__PURE__ */ r({
8
+ const k = { class: "flex min-h-0 flex-1" }, y = { class: "flex flex-1 flex-col min-w-0" }, F = /* @__PURE__ */ c({
9
9
  __name: "App",
10
- setup(x) {
11
- a(() => {
12
- i(() => {
13
- document.body.classList.toggle("dark-mode", t.value), document.body.classList.toggle("light-mode", !t.value);
10
+ setup(v) {
11
+ t(() => {
12
+ l(() => {
13
+ document.body.classList.toggle("dark-mode", o.value), document.body.classList.toggle("light-mode", !o.value);
14
14
  });
15
15
  });
16
- const { isDark: t } = g(), { importSpecFile: n } = h();
17
- return p(() => {
18
- }), a(() => {
19
- n({
20
- openapi: "3.1.0",
21
- info: {
22
- title: "Scalar Galaxy",
23
- version: "1.0.0"
24
- },
25
- servers: [
26
- {
27
- url: "https://galaxy.scalar.com/{basePath}",
28
- variables: {
29
- basePath: {
30
- default: "v1"
31
- }
32
- }
33
- },
34
- {
35
- url: "https://galaxy.scalar.com"
36
- }
37
- ],
38
- security: [
39
- {
40
- bearerAuth: []
41
- },
42
- {
43
- basicAuth: []
44
- },
45
- {
46
- apiKeyQuery: []
47
- },
48
- {
49
- apiKeyHeader: []
50
- },
51
- {
52
- apiKeyCookie: []
53
- },
54
- {
55
- oauth2: []
56
- }
57
- ],
58
- tags: [
59
- {
60
- name: "Authentication",
61
- description: "Some endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself."
62
- },
63
- {
64
- name: "Planets",
65
- description: "Everything about planets"
66
- }
67
- ],
68
- paths: {
69
- "/planets": {
70
- get: {
71
- tags: ["Planets"],
72
- summary: "Get all planets",
73
- description: "It’s easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one.",
74
- operationId: "getAllData",
75
- security: [{}],
76
- parameters: [
77
- {
78
- $ref: "#/components/parameters/limit"
79
- },
80
- {
81
- $ref: "#/components/parameters/offset"
82
- }
83
- ],
84
- responses: {
85
- 200: {
86
- description: "OK",
87
- content: {
88
- "application/json": {
89
- schema: {
90
- allOf: [
91
- {
92
- type: "object",
93
- properties: {
94
- data: {
95
- type: "array",
96
- items: {
97
- $ref: "#/components/schemas/Planet"
98
- }
99
- }
100
- }
101
- },
102
- {
103
- $ref: "#/components/schemas/PaginatedResource"
104
- }
105
- ]
106
- }
107
- }
108
- }
109
- }
110
- }
111
- },
112
- post: {
113
- tags: ["Planets"],
114
- summary: "Create a planet",
115
- description: "Time to play god and create a new planet. What do you think? Ah, don’t think too much. What could go wrong anyway?",
116
- operationId: "createPlanet",
117
- requestBody: {
118
- description: "Planet",
119
- content: {
120
- "application/json": {
121
- schema: {
122
- $ref: "#/components/schemas/Planet"
123
- }
124
- }
125
- }
126
- },
127
- responses: {
128
- 201: {
129
- description: "Created",
130
- content: {
131
- "application/json": {
132
- schema: {
133
- $ref: "#/components/schemas/Planet"
134
- }
135
- }
136
- }
137
- },
138
- 400: {
139
- description: "Bad Request",
140
- content: {
141
- "application/json": {
142
- schema: {
143
- $ref: "#/components/responses/BadRequest"
144
- }
145
- }
146
- }
147
- },
148
- 403: {
149
- description: "Forbidden",
150
- content: {
151
- "application/json": {
152
- schema: {
153
- $ref: "#/components/responses/Forbidden"
154
- }
155
- }
156
- }
157
- }
158
- }
159
- }
160
- },
161
- "/planets/{planetId}": {
162
- get: {
163
- tags: ["Planets"],
164
- summary: "Get a planet",
165
- description: "You’ll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone.",
166
- operationId: "getPlanet",
167
- security: [{}],
168
- parameters: [
169
- {
170
- $ref: "#/components/parameters/planetId"
171
- }
172
- ],
173
- responses: {
174
- 200: {
175
- description: "Planet Found",
176
- content: {
177
- "application/json": {
178
- schema: {
179
- $ref: "#/components/schemas/Planet"
180
- }
181
- }
182
- }
183
- },
184
- 404: {
185
- description: "Planet Not Found",
186
- content: {
187
- "application/json": {
188
- schema: {
189
- $ref: "#/components/responses/NotFound"
190
- }
191
- }
192
- }
193
- }
194
- }
195
- },
196
- put: {
197
- tags: ["Planets"],
198
- summary: "Update a planet",
199
- description: "Sometimes you make mistakes, that’s fine. No worries, you can update all planets.",
200
- operationId: "updatePlanet",
201
- requestBody: {
202
- description: "New information about the planet",
203
- content: {
204
- "application/json": {
205
- schema: {
206
- $ref: "#/components/schemas/Planet"
207
- }
208
- }
209
- }
210
- },
211
- parameters: [
212
- {
213
- $ref: "#/components/parameters/planetId"
214
- }
215
- ],
216
- responses: {
217
- 200: {
218
- description: "OK",
219
- content: {
220
- "application/json": {
221
- schema: {
222
- $ref: "#/components/schemas/Planet"
223
- }
224
- }
225
- }
226
- },
227
- 400: {
228
- description: "Bad Request",
229
- content: {
230
- "application/json": {
231
- schema: {
232
- $ref: "#/components/responses/BadRequest"
233
- }
234
- }
235
- }
236
- },
237
- 403: {
238
- description: "Forbidden",
239
- content: {
240
- "application/json": {
241
- schema: {
242
- $ref: "#/components/responses/Forbidden"
243
- }
244
- }
245
- }
246
- },
247
- 404: {
248
- description: "Not Found",
249
- content: {
250
- "application/json": {
251
- schema: {
252
- $ref: "#/components/responses/NotFound"
253
- }
254
- }
255
- }
256
- }
257
- }
258
- },
259
- delete: {
260
- tags: ["Planets"],
261
- summary: "Delete a planet",
262
- operationId: "deletePlanet",
263
- description: "This endpoint was used to delete planets. Unfortunately, that caused a lot of trouble for planets with life. So, this endpoint is now deprecated and should not be used anymore.",
264
- deprecated: !0,
265
- parameters: [
266
- {
267
- $ref: "#/components/parameters/planetId"
268
- }
269
- ],
270
- responses: {
271
- 204: {
272
- description: "No Content"
273
- },
274
- 404: {
275
- description: "Not Found"
276
- }
277
- }
278
- }
279
- },
280
- "/planets/{planetId}/image": {
281
- post: {
282
- tags: ["Planets"],
283
- summary: "Upload an image to a planet",
284
- description: "Got a crazy good photo of a planet? Share it with the world!",
285
- operationId: "uploadImage",
286
- parameters: [
287
- {
288
- $ref: "#/components/parameters/planetId"
289
- }
290
- ],
291
- requestBody: {
292
- content: {
293
- "multipart/form-data": {
294
- schema: {
295
- type: "object",
296
- properties: {
297
- image: {
298
- type: "string",
299
- format: "binary"
300
- }
301
- }
302
- }
303
- }
304
- }
305
- },
306
- responses: {
307
- 200: {
308
- description: "Image uploaded",
309
- content: {
310
- "application/json": {
311
- schema: {
312
- type: "object",
313
- properties: {
314
- message: {
315
- type: "string",
316
- examples: ["Image uploaded successfully"]
317
- }
318
- }
319
- }
320
- }
321
- }
322
- },
323
- 400: {
324
- description: "Bad Upload Request",
325
- content: {
326
- "application/json": {
327
- schema: {
328
- $ref: "#/components/responses/BadRequest"
329
- }
330
- }
331
- }
332
- },
333
- 403: {
334
- description: "Upload Forbidden",
335
- content: {
336
- "application/json": {
337
- schema: {
338
- $ref: "#/components/responses/Forbidden"
339
- }
340
- }
341
- }
342
- },
343
- 404: {
344
- description: "Failed to Upload Image, Planet Not Found",
345
- content: {
346
- "application/json": {
347
- schema: {
348
- $ref: "#/components/responses/NotFound"
349
- }
350
- }
351
- }
352
- }
353
- }
354
- }
355
- },
356
- "/user/signup": {
357
- post: {
358
- tags: ["Authentication"],
359
- summary: "Create a user",
360
- description: "Time to create a user account, eh?",
361
- operationId: "createUser",
362
- security: [{}],
363
- requestBody: {
364
- content: {
365
- "application/json": {
366
- schema: {
367
- $ref: "#/components/schemas/NewUser"
368
- }
369
- }
370
- }
371
- },
372
- responses: {
373
- 201: {
374
- description: "Created",
375
- content: {
376
- "application/json": {
377
- schema: {
378
- $ref: "#/components/schemas/User"
379
- }
380
- }
381
- }
382
- },
383
- 400: {
384
- description: "Bad Request",
385
- content: {
386
- "application/json": {
387
- schema: {
388
- $ref: "#/components/responses/BadRequest"
389
- }
390
- }
391
- }
392
- }
393
- }
394
- }
395
- },
396
- "/auth/token": {
397
- post: {
398
- tags: ["Authentication"],
399
- summary: "Get a token",
400
- description: "Yeah, this is the boring security stuff. Just get your super secret token and move on.",
401
- operationId: "getToken",
402
- security: [{}],
403
- requestBody: {
404
- content: {
405
- "application/json": {
406
- schema: {
407
- $ref: "#/components/schemas/Credentials"
408
- }
409
- }
410
- }
411
- },
412
- responses: {
413
- 201: {
414
- description: "Token Created",
415
- content: {
416
- "application/json": {
417
- schema: {
418
- ref: "#/components/schemas/Token"
419
- }
420
- }
421
- }
422
- }
423
- }
424
- }
425
- },
426
- "/me": {
427
- get: {
428
- tags: ["Authentication"],
429
- summary: "Get authenticated user",
430
- description: "Find yourself they say. That’s what you can do here.",
431
- operationId: "getMe",
432
- responses: {
433
- 200: {
434
- description: "OK",
435
- content: {
436
- "application/json": {
437
- schema: {
438
- $ref: "#/components/schemas/User"
439
- }
440
- }
441
- }
442
- },
443
- 403: {
444
- description: "Forbidden",
445
- content: {
446
- "application/json": {
447
- schema: {
448
- $ref: "#/components/responses/Forbidden"
449
- }
450
- }
451
- }
452
- }
453
- }
454
- }
455
- }
456
- },
457
- webhooks: {
458
- newPlanet: {
459
- post: {
460
- tags: ["Planets"],
461
- requestBody: {
462
- description: "Information about a new planet",
463
- content: {
464
- "application/json": {
465
- schema: {
466
- $ref: "#/components/schemas/Planet"
467
- }
468
- }
469
- }
470
- },
471
- responses: {
472
- 200: {
473
- description: "Return a 200 status to indicate that the data was received successfully"
474
- }
475
- }
476
- }
477
- }
478
- },
479
- components: {
480
- securitySchemes: {
481
- bearerAuth: {
482
- type: "http",
483
- scheme: "bearer"
484
- },
485
- basicAuth: {
486
- type: "http",
487
- scheme: "basic"
488
- },
489
- apiKeyHeader: {
490
- type: "apiKey",
491
- in: "header",
492
- name: "X-API-Key"
493
- },
494
- apiKeyQuery: {
495
- type: "apiKey",
496
- in: "query",
497
- name: "api_key"
498
- },
499
- apiKeyCookie: {
500
- type: "apiKey",
501
- in: "cookie",
502
- name: "api_key"
503
- },
504
- oauth2: {
505
- type: "oauth2",
506
- flows: {
507
- implicit: {
508
- authorizationUrl: "https://galaxy.scalar.com/oauth/authorize",
509
- scopes: {
510
- "write:planets": "modify planets in your account",
511
- "read:planets": "read your planets"
512
- }
513
- }
514
- }
515
- }
516
- },
517
- parameters: {
518
- planetId: {
519
- name: "planetId",
520
- in: "path",
521
- required: !0,
522
- schema: {
523
- type: "integer",
524
- format: "int64",
525
- examples: [1]
526
- }
527
- },
528
- limit: {
529
- name: "limit",
530
- in: "query",
531
- description: "The number of items to return",
532
- required: !1,
533
- schema: {
534
- type: "integer",
535
- format: "int64",
536
- default: 10
537
- }
538
- },
539
- offset: {
540
- name: "offset",
541
- in: "query",
542
- description: "The number of items to skip before starting to collect the result set",
543
- required: !1,
544
- schema: {
545
- type: "integer",
546
- format: "int64",
547
- default: 0
548
- }
549
- }
550
- },
551
- responses: {
552
- BadRequest: {
553
- description: "Bad Request",
554
- content: {
555
- "application/json": {
556
- schema: {
557
- $ref: "#/components/schemas/Error"
558
- }
559
- }
560
- }
561
- },
562
- Forbidden: {
563
- description: "Forbidden",
564
- content: {
565
- "application/json": {
566
- schema: {
567
- $ref: "#/components/schemas/Error"
568
- }
569
- }
570
- }
571
- },
572
- NotFound: {
573
- description: "NotFound",
574
- content: {
575
- "application/json": {
576
- schema: {
577
- $ref: "#/components/schemas/Error"
578
- }
579
- }
580
- }
581
- }
582
- },
583
- schemas: {
584
- NewUser: {
585
- type: "object",
586
- required: ["name", "email", "password"],
587
- properties: {
588
- name: {
589
- type: "string",
590
- examples: ["Marc"]
591
- },
592
- email: {
593
- type: "string",
594
- format: "email",
595
- examples: ["marc@scalar.com"]
596
- },
597
- password: {
598
- type: "string",
599
- minLength: 8,
600
- examples: ["i-love-scalar"]
601
- }
602
- }
603
- },
604
- User: {
605
- type: "object",
606
- required: ["id", "name", "email"],
607
- properties: {
608
- id: {
609
- type: "integer",
610
- format: "int64",
611
- examples: [1]
612
- },
613
- name: {
614
- type: "string",
615
- examples: ["Marc"]
616
- },
617
- email: {
618
- type: "string",
619
- format: "email",
620
- examples: ["marc@scalar.com"]
621
- }
622
- }
623
- },
624
- Credentials: {
625
- type: "object",
626
- required: ["email", "password"],
627
- properties: {
628
- email: {
629
- type: "string",
630
- format: "email",
631
- examples: ["marc@scalar.com"]
632
- },
633
- password: {
634
- type: "string",
635
- examples: ["i-love-scalar"]
636
- }
637
- }
638
- },
639
- Token: {
640
- type: "object",
641
- properties: {
642
- token: {
643
- type: "string",
644
- examples: [
645
- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
646
- ]
647
- }
648
- }
649
- },
650
- Planet: {
651
- type: "object",
652
- required: ["id", "name"],
653
- properties: {
654
- id: {
655
- type: "integer",
656
- format: "int64",
657
- examples: [1],
658
- "x-variable": "planetId"
659
- },
660
- name: {
661
- type: "string",
662
- examples: ["Mars"]
663
- },
664
- description: {
665
- type: ["string", "null"],
666
- examples: ["The red planet"]
667
- },
668
- image: {
669
- type: "string",
670
- nullable: !0,
671
- examples: ["https://cdn.scalar.com/photos/mars.jpg"]
672
- },
673
- creator: {
674
- $ref: "#/components/schemas/User"
675
- }
676
- }
677
- },
678
- PaginatedResource: {
679
- type: "object",
680
- properties: {
681
- meta: {
682
- type: "object",
683
- properties: {
684
- limit: {
685
- type: "integer",
686
- format: "int64",
687
- examples: [10]
688
- },
689
- offset: {
690
- type: "integer",
691
- format: "int64",
692
- examples: [0]
693
- },
694
- total: {
695
- type: "integer",
696
- format: "int64",
697
- examples: [100]
698
- },
699
- next: {
700
- type: ["string", "null"],
701
- examples: ["/planets?limit=10&offset=10"]
702
- }
703
- }
704
- }
705
- }
706
- },
707
- Error: {
708
- type: "object",
709
- description: "RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)",
710
- properties: {
711
- type: {
712
- type: "string",
713
- examples: ["https://example.com/errors/generic-error"]
714
- },
715
- title: {
716
- type: "string",
717
- examples: ["Something went wrong here."]
718
- },
719
- status: {
720
- type: "integer",
721
- format: "int64",
722
- examples: [403]
723
- },
724
- detail: {
725
- type: "string",
726
- examples: [
727
- "Unfortunately, we can’t provide further information."
728
- ]
729
- }
730
- }
731
- }
732
- }
733
- }
734
- });
735
- }), (I, w) => (c(), m(l, null, [
16
+ const { isDark: o } = g(), { importSpecFromUrl: s, workspaceMutators: m } = _();
17
+ return m.edit("proxyUrl", "https://proxy.scalar.com"), n(() => {
18
+ }), t(() => {
19
+ s(
20
+ "https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml"
21
+ // 'https://developer.spotify.com/reference/web-api/open-api-schema.yaml',
22
+ // 'https://proxy.scalar.com',
23
+ );
24
+ }), (w, M) => (i(), p(d, null, [
736
25
  e(u),
737
- o("main", b, [
738
- e(d),
739
- o("div", j, [
740
- e(s(f))
26
+ r("main", k, [
27
+ e(f),
28
+ r("div", y, [
29
+ e(a(h))
741
30
  ])
742
31
  ]),
743
- e(s(y))
32
+ e(a(x))
744
33
  ], 64));
745
34
  }
746
35
  });
747
36
  export {
748
- B as default
37
+ F as default
749
38
  };