@snokam/mcp-api 0.5.1

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.
@@ -0,0 +1,631 @@
1
+ {
2
+ "openapi": "3.0.1",
3
+ "info": {
4
+ "title": "Webshop Function",
5
+ "description": "Backend for webshop to e.g handle orders",
6
+ "version": "v1.0.0"
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "https://webshop.api.snokam.no"
11
+ }
12
+ ],
13
+ "paths": {
14
+ "/v1.1/GetWebshopProducts": {
15
+ "get": {
16
+ "tags": [
17
+ "Webshop"
18
+ ],
19
+ "summary": "Gets webshop products",
20
+ "description": "Retrieves a list of webshop products.",
21
+ "operationId": "GetWebshopProducts",
22
+ "responses": {
23
+ "200": {
24
+ "description": "List of webshop products retrieved successfully",
25
+ "content": {
26
+ "application/json": {
27
+ "schema": {
28
+ "type": "array",
29
+ "items": {
30
+ "$ref": "#/components/schemas/equipment"
31
+ }
32
+ }
33
+ }
34
+ },
35
+ "x-ms-summary": "Success"
36
+ }
37
+ },
38
+ "security": [
39
+ {
40
+ "Implicit": [
41
+ "api://5814647d-d6dc-413e-b091-b70231e5530e/user_impersonation"
42
+ ]
43
+ }
44
+ ]
45
+ }
46
+ },
47
+ "/v1.1/GetMyOrders": {
48
+ "get": {
49
+ "tags": [
50
+ "Orders"
51
+ ],
52
+ "summary": "Gets user's orders",
53
+ "description": "Retrieves the orders of the authenticated user.",
54
+ "operationId": "GetMyOrders",
55
+ "responses": {
56
+ "200": {
57
+ "description": "User's orders retrieved successfully",
58
+ "content": {
59
+ "application/json": {
60
+ "schema": {
61
+ "type": "array",
62
+ "items": {
63
+ "$ref": "#/components/schemas/innerOrder"
64
+ }
65
+ }
66
+ }
67
+ },
68
+ "x-ms-summary": "Success"
69
+ },
70
+ "401": {
71
+ "description": "User is not authenticated",
72
+ "x-ms-summary": "Unauthorized"
73
+ }
74
+ },
75
+ "security": [
76
+ {
77
+ "Implicit": [
78
+ "api://5814647d-d6dc-413e-b091-b70231e5530e/user_impersonation"
79
+ ]
80
+ }
81
+ ]
82
+ }
83
+ },
84
+ "/v1.1/PlaceMyOrder": {
85
+ "post": {
86
+ "tags": [
87
+ "Orders"
88
+ ],
89
+ "summary": "Places an order",
90
+ "description": "Places a new order for the authenticated user.",
91
+ "operationId": "PlaceMyOrder",
92
+ "requestBody": {
93
+ "description": "Order details",
94
+ "content": {
95
+ "application/json": {
96
+ "schema": {
97
+ "$ref": "#/components/schemas/order"
98
+ }
99
+ }
100
+ },
101
+ "required": true
102
+ },
103
+ "responses": {
104
+ "200": {
105
+ "description": "Order placed successfully",
106
+ "content": {
107
+ "application/json": {
108
+ "schema": {
109
+ "$ref": "#/components/schemas/order"
110
+ }
111
+ }
112
+ },
113
+ "x-ms-summary": "Success"
114
+ },
115
+ "401": {
116
+ "description": "User is not authenticated",
117
+ "x-ms-summary": "Unauthorized"
118
+ }
119
+ },
120
+ "security": [
121
+ {
122
+ "Implicit": [
123
+ "api://5814647d-d6dc-413e-b091-b70231e5530e/user_impersonation"
124
+ ]
125
+ }
126
+ ]
127
+ }
128
+ },
129
+ "/v1.1/RemoveMyOrder": {
130
+ "post": {
131
+ "tags": [
132
+ "Orders"
133
+ ],
134
+ "summary": "Removes an order",
135
+ "description": "Removes an order for the authenticated user.",
136
+ "operationId": "RemoveMyOrder",
137
+ "requestBody": {
138
+ "description": "Order ID to remove",
139
+ "content": {
140
+ "application/json": {
141
+ "schema": {
142
+ "$ref": "#/components/schemas/removeOrder"
143
+ }
144
+ }
145
+ },
146
+ "required": true
147
+ },
148
+ "responses": {
149
+ "200": {
150
+ "description": "Order removed successfully",
151
+ "content": {
152
+ "application/json": {
153
+ "schema": {
154
+ "type": "boolean"
155
+ }
156
+ }
157
+ },
158
+ "x-ms-summary": "Success"
159
+ },
160
+ "401": {
161
+ "description": "User is not authenticated",
162
+ "x-ms-summary": "Unauthorized"
163
+ },
164
+ "500": {
165
+ "description": "Failed to remove order",
166
+ "x-ms-summary": "Internal Server Error"
167
+ }
168
+ },
169
+ "security": [
170
+ {
171
+ "Implicit": [
172
+ "api://5814647d-d6dc-413e-b091-b70231e5530e/user_impersonation"
173
+ ]
174
+ }
175
+ ]
176
+ }
177
+ },
178
+ "/v1.1/GetAllOrdersGroupedByEmployee": {
179
+ "get": {
180
+ "tags": [
181
+ "Orders"
182
+ ],
183
+ "summary": "Gets all orders grouped by employee",
184
+ "description": "Retrieves all orders grouped by employee.",
185
+ "operationId": "GetAllOrdersGroupedByEmployee",
186
+ "responses": {
187
+ "200": {
188
+ "description": "Orders grouped by employee retrieved successfully",
189
+ "content": {
190
+ "application/json": {
191
+ "schema": {
192
+ "type": "object",
193
+ "additionalProperties": {
194
+ "$ref": "#/components/schemas/list_adminOrder"
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "x-ms-summary": "Success"
200
+ }
201
+ },
202
+ "security": [
203
+ {
204
+ "Implicit": [
205
+ "api://5814647d-d6dc-413e-b091-b70231e5530e/user_impersonation"
206
+ ]
207
+ }
208
+ ]
209
+ }
210
+ },
211
+ "/v1.1/GetAllOrdersGroupedByEquipment": {
212
+ "get": {
213
+ "tags": [
214
+ "Orders"
215
+ ],
216
+ "summary": "Gets all orders grouped by equipment",
217
+ "description": "Retrieves all orders grouped by equipment.",
218
+ "operationId": "GetAllOrdersGroupedByEquipment",
219
+ "responses": {
220
+ "200": {
221
+ "description": "Orders grouped by equipment retrieved successfully",
222
+ "content": {
223
+ "application/json": {
224
+ "schema": {
225
+ "type": "object",
226
+ "additionalProperties": {
227
+ "$ref": "#/components/schemas/list_adminOrder"
228
+ }
229
+ }
230
+ }
231
+ },
232
+ "x-ms-summary": "Success"
233
+ }
234
+ },
235
+ "security": [
236
+ {
237
+ "Implicit": [
238
+ "api://5814647d-d6dc-413e-b091-b70231e5530e/user_impersonation"
239
+ ]
240
+ }
241
+ ]
242
+ }
243
+ },
244
+ "/v1.1/AssignOrdersToEmployees": {
245
+ "post": {
246
+ "tags": [
247
+ "Orders"
248
+ ],
249
+ "summary": "Assigns orders to employees",
250
+ "description": "Assigns orders to employees for the current year.",
251
+ "operationId": "AssignOrdersToEmployees",
252
+ "requestBody": {
253
+ "description": "List of order IDs to assign",
254
+ "content": {
255
+ "application/json": {
256
+ "schema": {
257
+ "type": "array",
258
+ "items": {
259
+ "type": "string"
260
+ }
261
+ }
262
+ }
263
+ },
264
+ "required": true
265
+ },
266
+ "responses": {
267
+ "200": {
268
+ "description": "Orders assigned to employees successfully",
269
+ "content": {
270
+ "application/json": {
271
+ "schema": {
272
+ "type": "string"
273
+ }
274
+ }
275
+ },
276
+ "x-ms-summary": "Success"
277
+ },
278
+ "401": {
279
+ "description": "User is not authenticated",
280
+ "x-ms-summary": "Unauthorized"
281
+ }
282
+ },
283
+ "security": [
284
+ {
285
+ "Implicit": [
286
+ "api://5814647d-d6dc-413e-b091-b70231e5530e/user_impersonation"
287
+ ]
288
+ }
289
+ ]
290
+ }
291
+ }
292
+ },
293
+ "components": {
294
+ "schemas": {
295
+ "adminOrder": {
296
+ "required": [
297
+ "orderId",
298
+ "equipmentId",
299
+ "employee"
300
+ ],
301
+ "type": "object",
302
+ "properties": {
303
+ "orderId": {
304
+ "minLength": 1,
305
+ "type": "string"
306
+ },
307
+ "equipmentId": {
308
+ "minLength": 1,
309
+ "type": "string"
310
+ },
311
+ "employee": {
312
+ "minLength": 1,
313
+ "type": "string"
314
+ },
315
+ "size": {
316
+ "type": "string"
317
+ },
318
+ "kind": {
319
+ "type": "string"
320
+ },
321
+ "other": {
322
+ "type": "string"
323
+ },
324
+ "image": {
325
+ "type": "string"
326
+ },
327
+ "quantity": {
328
+ "type": "integer",
329
+ "format": "int32",
330
+ "nullable": true
331
+ },
332
+ "price": {
333
+ "type": "number",
334
+ "format": "float",
335
+ "nullable": true
336
+ },
337
+ "offeredPrice": {
338
+ "type": "number",
339
+ "format": "float",
340
+ "nullable": true
341
+ },
342
+ "choosenVariant": {
343
+ "$ref": "#/components/schemas/availableVariants"
344
+ },
345
+ "date": {
346
+ "type": "string"
347
+ }
348
+ }
349
+ },
350
+ "availableVariants": {
351
+ "type": "object",
352
+ "properties": {
353
+ "size": {
354
+ "type": "string"
355
+ },
356
+ "inventory": {
357
+ "type": "number",
358
+ "format": "double",
359
+ "nullable": true
360
+ }
361
+ }
362
+ },
363
+ "description": {
364
+ "type": "object",
365
+ "properties": {
366
+ "descriptionChildren": {
367
+ "type": "array",
368
+ "items": {
369
+ "$ref": "#/components/schemas/descriptionChild"
370
+ }
371
+ },
372
+ "sanityType": {
373
+ "type": "string"
374
+ },
375
+ "sanityKey": {
376
+ "type": "string"
377
+ }
378
+ }
379
+ },
380
+ "descriptionChild": {
381
+ "type": "object",
382
+ "properties": {
383
+ "marks": {
384
+ "type": "array",
385
+ "items": {
386
+ "type": "string"
387
+ }
388
+ },
389
+ "text": {
390
+ "type": "string"
391
+ },
392
+ "sanityType": {
393
+ "type": "string"
394
+ },
395
+ "sanityKey": {
396
+ "type": "string"
397
+ }
398
+ }
399
+ },
400
+ "employee": {
401
+ "type": "object",
402
+ "properties": {
403
+ "name": {
404
+ "type": "string"
405
+ },
406
+ "email": {
407
+ "type": "string"
408
+ },
409
+ "startDate": {
410
+ "type": "string"
411
+ },
412
+ "ownership": {
413
+ "type": "number",
414
+ "format": "float",
415
+ "nullable": true
416
+ },
417
+ "boardMember": {
418
+ "type": "boolean",
419
+ "nullable": true
420
+ },
421
+ "imageUrl": {
422
+ "type": "string"
423
+ }
424
+ }
425
+ },
426
+ "equipment": {
427
+ "type": "object",
428
+ "properties": {
429
+ "sanityId": {
430
+ "type": "string"
431
+ },
432
+ "sanityType": {
433
+ "type": "string"
434
+ },
435
+ "title": {
436
+ "type": "string"
437
+ },
438
+ "date": {
439
+ "type": "string"
440
+ },
441
+ "available": {
442
+ "type": "boolean",
443
+ "nullable": true
444
+ },
445
+ "availableSize": {
446
+ "type": "array",
447
+ "items": {
448
+ "type": "string"
449
+ }
450
+ },
451
+ "availableSex": {
452
+ "type": "array",
453
+ "items": {
454
+ "type": "string"
455
+ }
456
+ },
457
+ "availableVariants": {
458
+ "type": "array",
459
+ "items": {
460
+ "$ref": "#/components/schemas/variant"
461
+ }
462
+ },
463
+ "price": {
464
+ "type": "number",
465
+ "format": "double",
466
+ "nullable": true
467
+ },
468
+ "offeredPrice": {
469
+ "type": "number",
470
+ "format": "double",
471
+ "nullable": true
472
+ },
473
+ "descriptions": {
474
+ "type": "array",
475
+ "items": {
476
+ "$ref": "#/components/schemas/description"
477
+ }
478
+ },
479
+ "images": {
480
+ "type": "array",
481
+ "items": {
482
+ "$ref": "#/components/schemas/image"
483
+ }
484
+ }
485
+ }
486
+ },
487
+ "image": {
488
+ "type": "object",
489
+ "properties": {
490
+ "sanityType": {
491
+ "type": "string"
492
+ },
493
+ "sanityKey": {
494
+ "type": "string"
495
+ },
496
+ "asset": {
497
+ "$ref": "#/components/schemas/imageAsset"
498
+ }
499
+ }
500
+ },
501
+ "imageAsset": {
502
+ "type": "object",
503
+ "properties": {
504
+ "sanityType": {
505
+ "type": "string"
506
+ },
507
+ "mimeType": {
508
+ "type": "string"
509
+ },
510
+ "originalFilename": {
511
+ "type": "string"
512
+ },
513
+ "url": {
514
+ "type": "string"
515
+ }
516
+ }
517
+ },
518
+ "innerOrder": {
519
+ "required": [
520
+ "equipmentId"
521
+ ],
522
+ "type": "object",
523
+ "properties": {
524
+ "sanityId": {
525
+ "type": "string"
526
+ },
527
+ "equipmentId": {
528
+ "minLength": 1,
529
+ "type": "string"
530
+ },
531
+ "size": {
532
+ "type": "string"
533
+ },
534
+ "kind": {
535
+ "type": "string"
536
+ },
537
+ "other": {
538
+ "type": "string"
539
+ },
540
+ "quantity": {
541
+ "type": "integer",
542
+ "format": "int32",
543
+ "nullable": true
544
+ },
545
+ "employee": {
546
+ "$ref": "#/components/schemas/employee"
547
+ }
548
+ }
549
+ },
550
+ "list_adminOrder": {
551
+ "type": "array",
552
+ "items": {
553
+ "$ref": "#/components/schemas/adminOrder"
554
+ }
555
+ },
556
+ "order": {
557
+ "required": [
558
+ "equipmentId",
559
+ "size",
560
+ "kind",
561
+ "other",
562
+ "quantity"
563
+ ],
564
+ "type": "object",
565
+ "properties": {
566
+ "equipmentId": {
567
+ "minLength": 1,
568
+ "type": "string",
569
+ "description": "Equipment uuid"
570
+ },
571
+ "size": {
572
+ "minLength": 1,
573
+ "type": "string"
574
+ },
575
+ "kind": {
576
+ "minLength": 1,
577
+ "type": "string"
578
+ },
579
+ "other": {
580
+ "minLength": 1,
581
+ "type": "string"
582
+ },
583
+ "quantity": {
584
+ "type": "integer",
585
+ "format": "int32",
586
+ "nullable": true
587
+ }
588
+ }
589
+ },
590
+ "removeOrder": {
591
+ "required": [
592
+ "orderId"
593
+ ],
594
+ "type": "object",
595
+ "properties": {
596
+ "orderId": {
597
+ "minLength": 1,
598
+ "type": "string"
599
+ }
600
+ }
601
+ },
602
+ "variant": {
603
+ "type": "object",
604
+ "properties": {
605
+ "size": {
606
+ "type": "string"
607
+ },
608
+ "inventory": {
609
+ "type": "number",
610
+ "format": "double"
611
+ }
612
+ }
613
+ }
614
+ },
615
+ "securitySchemes": {
616
+ "Implicit": {
617
+ "type": "oauth2",
618
+ "flows": {
619
+ "implicit": {
620
+ "authorizationUrl": "https://login.microsoftonline.com/81a4f38d-6712-4b65-868b-c3771f9ba91e/oauth2/v2.0/authorize",
621
+ "tokenUrl": "https://login.microsoftonline.com/81a4f38d-6712-4b65-868b-c3771f9ba91e/oauth2/v2.0/token",
622
+ "refreshUrl": "https://login.microsoftonline.com/81a4f38d-6712-4b65-868b-c3771f9ba91e/oauth2/v2.0/token",
623
+ "scopes": {
624
+ "api://5814647d-d6dc-413e-b091-b70231e5530e/user_impersonation": "Default function scope"
625
+ }
626
+ }
627
+ }
628
+ }
629
+ }
630
+ }
631
+ }