@breign/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.
@@ -67,6 +67,9 @@ class BrainApi extends runtime.BaseAPI {
67
67
  const queryParameters = {};
68
68
  const headerParameters = {};
69
69
  headerParameters['Content-Type'] = 'application/json';
70
+ if (this.configuration && this.configuration.apiKey) {
71
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
72
+ }
70
73
  const response = await this.request({
71
74
  path: `/brains/{brainId}/modules`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
72
75
  method: 'POST',
@@ -95,6 +98,9 @@ class BrainApi extends runtime.BaseAPI {
95
98
  const queryParameters = {};
96
99
  const headerParameters = {};
97
100
  headerParameters['Content-Type'] = 'application/json';
101
+ if (this.configuration && this.configuration.apiKey) {
102
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
103
+ }
98
104
  const response = await this.request({
99
105
  path: `/brains`,
100
106
  method: 'POST',
@@ -126,6 +132,9 @@ class BrainApi extends runtime.BaseAPI {
126
132
  const queryParameters = {};
127
133
  const headerParameters = {};
128
134
  headerParameters['Content-Type'] = 'application/json';
135
+ if (this.configuration && this.configuration.apiKey) {
136
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
137
+ }
129
138
  const response = await this.request({
130
139
  path: `/brains/{brainId}/flows`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
131
140
  method: 'POST',
@@ -153,6 +162,9 @@ class BrainApi extends runtime.BaseAPI {
153
162
  }
154
163
  const queryParameters = {};
155
164
  const headerParameters = {};
165
+ if (this.configuration && this.configuration.apiKey) {
166
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
167
+ }
156
168
  const response = await this.request({
157
169
  path: `/brains/{brainId}`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
158
170
  method: 'DELETE',
@@ -181,6 +193,9 @@ class BrainApi extends runtime.BaseAPI {
181
193
  }
182
194
  const queryParameters = {};
183
195
  const headerParameters = {};
196
+ if (this.configuration && this.configuration.apiKey) {
197
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
198
+ }
184
199
  const response = await this.request({
185
200
  path: `/brains/{brainId}/flows/{flowId}`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))).replace(`{${"flowId"}}`, encodeURIComponent(String(requestParameters['flowId']))),
186
201
  method: 'DELETE',
@@ -209,6 +224,9 @@ class BrainApi extends runtime.BaseAPI {
209
224
  }
210
225
  const queryParameters = {};
211
226
  const headerParameters = {};
227
+ if (this.configuration && this.configuration.apiKey) {
228
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
229
+ }
212
230
  const response = await this.request({
213
231
  path: `/brains/{brainId}/modules/{moduleName}`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))).replace(`{${"moduleName"}}`, encodeURIComponent(String(requestParameters['moduleName']))),
214
232
  method: 'DELETE',
@@ -233,6 +251,9 @@ class BrainApi extends runtime.BaseAPI {
233
251
  }
234
252
  const queryParameters = {};
235
253
  const headerParameters = {};
254
+ if (this.configuration && this.configuration.apiKey) {
255
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
256
+ }
236
257
  const response = await this.request({
237
258
  path: `/brains/{brainId}`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
238
259
  method: 'GET',
@@ -264,6 +285,9 @@ class BrainApi extends runtime.BaseAPI {
264
285
  queryParameters['endDate'] = requestParameters['endDate'].toISOString();
265
286
  }
266
287
  const headerParameters = {};
288
+ if (this.configuration && this.configuration.apiKey) {
289
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
290
+ }
267
291
  const response = await this.request({
268
292
  path: `/brains/{brainId}/metrics`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
269
293
  method: 'GET',
@@ -299,6 +323,9 @@ class BrainApi extends runtime.BaseAPI {
299
323
  queryParameters['endDate'] = requestParameters['endDate'].toISOString();
300
324
  }
301
325
  const headerParameters = {};
326
+ if (this.configuration && this.configuration.apiKey) {
327
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
328
+ }
302
329
  const response = await this.request({
303
330
  path: `/brains/{brainId}/metrics/events`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
304
331
  method: 'GET',
@@ -331,6 +358,9 @@ class BrainApi extends runtime.BaseAPI {
331
358
  queryParameters['endDate'] = requestParameters['endDate'].toISOString();
332
359
  }
333
360
  const headerParameters = {};
361
+ if (this.configuration && this.configuration.apiKey) {
362
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
363
+ }
334
364
  const response = await this.request({
335
365
  path: `/brains/{brainId}/metrics/overview`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
336
366
  method: 'GET',
@@ -354,6 +384,9 @@ class BrainApi extends runtime.BaseAPI {
354
384
  async getBrainsRaw(initOverrides) {
355
385
  const queryParameters = {};
356
386
  const headerParameters = {};
387
+ if (this.configuration && this.configuration.apiKey) {
388
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
389
+ }
357
390
  const response = await this.request({
358
391
  path: `/brains`,
359
392
  method: 'GET',
@@ -383,6 +416,9 @@ class BrainApi extends runtime.BaseAPI {
383
416
  }
384
417
  const queryParameters = {};
385
418
  const headerParameters = {};
419
+ if (this.configuration && this.configuration.apiKey) {
420
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
421
+ }
386
422
  const response = await this.request({
387
423
  path: `/brains/{brainId}/flows/{flowId}`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))).replace(`{${"flowId"}}`, encodeURIComponent(String(requestParameters['flowId']))),
388
424
  method: 'GET',
@@ -409,6 +445,9 @@ class BrainApi extends runtime.BaseAPI {
409
445
  }
410
446
  const queryParameters = {};
411
447
  const headerParameters = {};
448
+ if (this.configuration && this.configuration.apiKey) {
449
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
450
+ }
412
451
  const response = await this.request({
413
452
  path: `/brains/{brainId}/flows`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
414
453
  method: 'GET',
@@ -435,6 +474,9 @@ class BrainApi extends runtime.BaseAPI {
435
474
  }
436
475
  const queryParameters = {};
437
476
  const headerParameters = {};
477
+ if (this.configuration && this.configuration.apiKey) {
478
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
479
+ }
438
480
  const response = await this.request({
439
481
  path: `/brains/{brainId}/modules`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
440
482
  method: 'GET',
@@ -461,6 +503,9 @@ class BrainApi extends runtime.BaseAPI {
461
503
  }
462
504
  const queryParameters = {};
463
505
  const headerParameters = {};
506
+ if (this.configuration && this.configuration.apiKey) {
507
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
508
+ }
464
509
  const response = await this.request({
465
510
  path: `/brains/{brainId}/files`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
466
511
  method: 'DELETE',
@@ -486,6 +531,9 @@ class BrainApi extends runtime.BaseAPI {
486
531
  }
487
532
  const queryParameters = {};
488
533
  const headerParameters = {};
534
+ if (this.configuration && this.configuration.apiKey) {
535
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
536
+ }
489
537
  const response = await this.request({
490
538
  path: `/brains/{brainId}/subscription`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
491
539
  method: 'DELETE',
@@ -515,6 +563,9 @@ class BrainApi extends runtime.BaseAPI {
515
563
  const queryParameters = {};
516
564
  const headerParameters = {};
517
565
  headerParameters['Content-Type'] = 'application/json';
566
+ if (this.configuration && this.configuration.apiKey) {
567
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
568
+ }
518
569
  const response = await this.request({
519
570
  path: `/brains/{brainId}`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
520
571
  method: 'PATCH',
@@ -546,6 +597,9 @@ class BrainApi extends runtime.BaseAPI {
546
597
  const queryParameters = {};
547
598
  const headerParameters = {};
548
599
  headerParameters['Content-Type'] = 'application/json';
600
+ if (this.configuration && this.configuration.apiKey) {
601
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
602
+ }
549
603
  const response = await this.request({
550
604
  path: `/brains/{brainId}/subscription`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
551
605
  method: 'PUT',
@@ -580,6 +634,9 @@ class BrainApi extends runtime.BaseAPI {
580
634
  const queryParameters = {};
581
635
  const headerParameters = {};
582
636
  headerParameters['Content-Type'] = 'application/json';
637
+ if (this.configuration && this.configuration.apiKey) {
638
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
639
+ }
583
640
  const response = await this.request({
584
641
  path: `/brains/{brainId}/flows/{flowId}`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))).replace(`{${"flowId"}}`, encodeURIComponent(String(requestParameters['flowId']))),
585
642
  method: 'PUT',
@@ -611,6 +668,9 @@ class BrainApi extends runtime.BaseAPI {
611
668
  const queryParameters = {};
612
669
  const headerParameters = {};
613
670
  headerParameters['Content-Type'] = 'application/json';
671
+ if (this.configuration && this.configuration.apiKey) {
672
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
673
+ }
614
674
  const response = await this.request({
615
675
  path: `/brains/{brainId}/files`.replace(`{${"brainId"}}`, encodeURIComponent(String(requestParameters['brainId']))),
616
676
  method: 'POST',
package/dist/openapi.json CHANGED
@@ -9,6 +9,9 @@
9
9
  "description" : "Generated server url",
10
10
  "url" : "http://localhost:8080/brain-client"
11
11
  } ],
12
+ "security" : [ {
13
+ "ApiKeyAuth" : [ ]
14
+ } ],
12
15
  "tags" : [ {
13
16
  "description" : "Brain management endpoints",
14
17
  "name" : "brain"
@@ -33,9 +36,6 @@
33
36
  "description" : "Brains retrieved successfully"
34
37
  }
35
38
  },
36
- "security" : [ {
37
- "ApiKeyAuth" : [ ]
38
- } ],
39
39
  "summary" : "Get all brains",
40
40
  "tags" : [ "brain" ]
41
41
  },
@@ -73,9 +73,6 @@
73
73
  "description" : "Forbidden - User is not an admin"
74
74
  }
75
75
  },
76
- "security" : [ {
77
- "ApiKeyAuth" : [ ]
78
- } ],
79
76
  "summary" : "Create a new brain",
80
77
  "tags" : [ "brain" ]
81
78
  }
@@ -107,9 +104,6 @@
107
104
  "description" : "Brain not found"
108
105
  }
109
106
  },
110
- "security" : [ {
111
- "ApiKeyAuth" : [ ]
112
- } ],
113
107
  "summary" : "Delete a brain",
114
108
  "tags" : [ "brain" ]
115
109
  },
@@ -145,9 +139,6 @@
145
139
  "description" : "Forbidden - User cannot access this brain"
146
140
  }
147
141
  },
148
- "security" : [ {
149
- "ApiKeyAuth" : [ ]
150
- } ],
151
142
  "summary" : "Get a specific brain by ID",
152
143
  "tags" : [ "brain" ]
153
144
  },
@@ -200,9 +191,6 @@
200
191
  "description" : "Brain not found after update (server error)"
201
192
  }
202
193
  },
203
- "security" : [ {
204
- "ApiKeyAuth" : [ ]
205
- } ],
206
194
  "summary" : "Update a brain",
207
195
  "tags" : [ "brain" ]
208
196
  }
@@ -244,9 +232,6 @@
244
232
  "description" : "Internal server error"
245
233
  }
246
234
  },
247
- "security" : [ {
248
- "ApiKeyAuth" : [ ]
249
- } ],
250
235
  "summary" : "Get brain modules",
251
236
  "tags" : [ "brain" ]
252
237
  },
@@ -299,9 +284,6 @@
299
284
  "description" : "Internal server error"
300
285
  }
301
286
  },
302
- "security" : [ {
303
- "ApiKeyAuth" : [ ]
304
- } ],
305
287
  "summary" : "Add a module to a brain",
306
288
  "tags" : [ "brain" ]
307
289
  }
@@ -344,9 +326,6 @@
344
326
  "description" : "Internal server error"
345
327
  }
346
328
  },
347
- "security" : [ {
348
- "ApiKeyAuth" : [ ]
349
- } ],
350
329
  "summary" : "Remove a module from a brain",
351
330
  "tags" : [ "brain" ]
352
331
  }
@@ -407,9 +386,6 @@
407
386
  "description" : "Internal server error"
408
387
  }
409
388
  },
410
- "security" : [ {
411
- "ApiKeyAuth" : [ ]
412
- } ],
413
389
  "summary" : "Get brain metrics overview",
414
390
  "tags" : [ "brain" ]
415
391
  }
@@ -470,9 +446,6 @@
470
446
  "description" : "Internal server error"
471
447
  }
472
448
  },
473
- "security" : [ {
474
- "ApiKeyAuth" : [ ]
475
- } ],
476
449
  "summary" : "Get detailed brain metrics",
477
450
  "tags" : [ "brain" ]
478
451
  }
@@ -541,9 +514,6 @@
541
514
  "description" : "Internal server error"
542
515
  }
543
516
  },
544
- "security" : [ {
545
- "ApiKeyAuth" : [ ]
546
- } ],
547
517
  "summary" : "Get brain metrics events",
548
518
  "tags" : [ "brain" ]
549
519
  }
@@ -588,9 +558,6 @@
588
558
  "description" : "Internal server error"
589
559
  }
590
560
  },
591
- "security" : [ {
592
- "ApiKeyAuth" : [ ]
593
- } ],
594
561
  "summary" : "Get all flows for a brain",
595
562
  "tags" : [ "brain" ]
596
563
  },
@@ -643,9 +610,6 @@
643
610
  "description" : "Internal server error"
644
611
  }
645
612
  },
646
- "security" : [ {
647
- "ApiKeyAuth" : [ ]
648
- } ],
649
613
  "summary" : "Create a new flow",
650
614
  "tags" : [ "brain" ]
651
615
  }
@@ -689,9 +653,6 @@
689
653
  "description" : "Internal server error"
690
654
  }
691
655
  },
692
- "security" : [ {
693
- "ApiKeyAuth" : [ ]
694
- } ],
695
656
  "summary" : "Delete a flow",
696
657
  "tags" : [ "brain" ]
697
658
  },
@@ -740,9 +701,6 @@
740
701
  "description" : "Internal server error"
741
702
  }
742
703
  },
743
- "security" : [ {
744
- "ApiKeyAuth" : [ ]
745
- } ],
746
704
  "summary" : "Get a specific flow",
747
705
  "tags" : [ "brain" ]
748
706
  },
@@ -804,9 +762,6 @@
804
762
  "description" : "Internal server error"
805
763
  }
806
764
  },
807
- "security" : [ {
808
- "ApiKeyAuth" : [ ]
809
- } ],
810
765
  "summary" : "Update a flow",
811
766
  "tags" : [ "brain" ]
812
767
  }
@@ -838,9 +793,6 @@
838
793
  "description" : "Brain not found"
839
794
  }
840
795
  },
841
- "security" : [ {
842
- "ApiKeyAuth" : [ ]
843
- } ],
844
796
  "summary" : "Remove brain subscription",
845
797
  "tags" : [ "brain" ]
846
798
  },
@@ -890,9 +842,6 @@
890
842
  "description" : "Brain not found"
891
843
  }
892
844
  },
893
- "security" : [ {
894
- "ApiKeyAuth" : [ ]
895
- } ],
896
845
  "summary" : "Update brain subscription",
897
846
  "tags" : [ "brain" ]
898
847
  }
@@ -927,9 +876,6 @@
927
876
  "description" : "Failed to delete brain image"
928
877
  }
929
878
  },
930
- "security" : [ {
931
- "ApiKeyAuth" : [ ]
932
- } ],
933
879
  "summary" : "Remove brain profile image",
934
880
  "tags" : [ "brain" ]
935
881
  },
@@ -976,9 +922,6 @@
976
922
  "description" : "Forbidden - User doesn't have access to this brain"
977
923
  }
978
924
  },
979
- "security" : [ {
980
- "ApiKeyAuth" : [ ]
981
- } ],
982
925
  "summary" : "Upload brain profile image",
983
926
  "tags" : [ "brain" ]
984
927
  }
@@ -1663,6 +1606,13 @@
1663
1606
  "required" : [ "contentType", "ext", "hash", "size" ],
1664
1607
  "type" : "object"
1665
1608
  }
1609
+ },
1610
+ "securitySchemes" : {
1611
+ "ApiKeyAuth" : {
1612
+ "in" : "header",
1613
+ "name" : "X-API-Key",
1614
+ "type" : "apiKey"
1615
+ }
1666
1616
  }
1667
1617
  }
1668
1618
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -15,7 +15,9 @@
15
15
  "generate:yaml": "openapi-generator-cli generate -i src/resources/openapi/openapi.yaml -g openapi-yaml -o target/generated-sources/yaml --additional-properties=outputFile=openapi_merged.yaml",
16
16
  "generate:json": "openapi-generator-cli generate -i src/resources/openapi/openapi.yaml -g openapi -o target/generated-sources/json --additional-properties=outputFileName=openapi_merged.json",
17
17
  "clean": "rm -rf target/ && rm -rf dist/",
18
- "generate": "npm run clean && npm run generate:yaml && npm run generate:json && openapi-generator-cli generate && npm run build"
18
+ "generate": "npm run clean && npm run generate:yaml && npm run generate:json && openapi-generator-cli generate && npm run build",
19
+ "format": "prettier --write .",
20
+ "format:check": "prettier --check ."
19
21
  },
20
22
  "author": "",
21
23
  "license": "ISC",
@@ -23,6 +25,7 @@
23
25
  "devDependencies": {
24
26
  "@openapitools/openapi-generator-cli": "^2.20.0",
25
27
  "js-yaml": "^4.1.0",
26
- "typescript": "^5.0.0"
28
+ "typescript": "^5.0.0",
29
+ "prettier": "^2.8.8"
27
30
  }
28
31
  }