@sfxcode/nuxt-mongocamp-server 1.5.2 → 1.7.0

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 (119) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/api/.openapi-generator/FILES +18 -2
  4. package/dist/runtime/api/apis/AdminApi.d.ts +1 -1
  5. package/dist/runtime/api/apis/ApplicationApi.d.ts +1 -1
  6. package/dist/runtime/api/apis/AuthApi.d.ts +21 -4
  7. package/dist/runtime/api/apis/AuthApi.js +50 -2
  8. package/dist/runtime/api/apis/BucketApi.d.ts +1 -1
  9. package/dist/runtime/api/apis/CollectionApi.d.ts +26 -8
  10. package/dist/runtime/api/apis/CollectionApi.js +53 -2
  11. package/dist/runtime/api/apis/DatabaseApi.d.ts +1 -1
  12. package/dist/runtime/api/apis/DocumentApi.d.ts +60 -13
  13. package/dist/runtime/api/apis/DocumentApi.js +136 -0
  14. package/dist/runtime/api/apis/FileApi.d.ts +1 -1
  15. package/dist/runtime/api/apis/IndexApi.d.ts +19 -2
  16. package/dist/runtime/api/apis/IndexApi.js +52 -0
  17. package/dist/runtime/api/apis/JobsApi.d.ts +1 -1
  18. package/dist/runtime/api/apis/{InformationApi.d.ts → SystemApi.d.ts} +17 -3
  19. package/dist/runtime/api/apis/SystemApi.js +82 -0
  20. package/dist/runtime/api/apis/index.d.ts +1 -1
  21. package/dist/runtime/api/apis/index.js +1 -1
  22. package/dist/runtime/api/docs/AdminApi.md +2 -2
  23. package/dist/runtime/api/docs/AuthApi.md +79 -1
  24. package/dist/runtime/api/docs/ClusterInformation.md +36 -0
  25. package/dist/runtime/api/docs/ClusterMemberInformation.md +42 -0
  26. package/dist/runtime/api/docs/CollectionApi.md +86 -5
  27. package/dist/runtime/api/docs/CollectionPermission.md +40 -0
  28. package/dist/runtime/api/docs/CollectionStatus.md +1 -1
  29. package/dist/runtime/api/docs/CollectionSummary.md +50 -0
  30. package/dist/runtime/api/docs/CountResponse.md +34 -0
  31. package/dist/runtime/api/docs/DatabaseInfo.md +1 -1
  32. package/dist/runtime/api/docs/DocumentApi.md +208 -24
  33. package/dist/runtime/api/docs/FileApi.md +2 -2
  34. package/dist/runtime/api/docs/FileInformation.md +1 -1
  35. package/dist/runtime/api/docs/IndexApi.md +80 -2
  36. package/dist/runtime/api/docs/IndexUsage.md +40 -0
  37. package/dist/runtime/api/docs/InsertError.md +38 -0
  38. package/dist/runtime/api/docs/InsertResponse.md +4 -0
  39. package/dist/runtime/api/docs/JsonSchemaDefinition.md +1 -1
  40. package/dist/runtime/api/docs/JsonValueAny.md +1 -1
  41. package/dist/runtime/api/docs/MongoCampConfiguration.md +1 -1
  42. package/dist/runtime/api/docs/MongoFindRequest.md +3 -3
  43. package/dist/runtime/api/docs/MongoIndex.md +3 -3
  44. package/dist/runtime/api/docs/PipelineStage.md +1 -1
  45. package/dist/runtime/api/docs/SearchRequest.md +38 -0
  46. package/dist/runtime/api/docs/SettingsResponse.md +1 -1
  47. package/dist/runtime/api/docs/SystemApi.md +139 -0
  48. package/dist/runtime/api/docs/UpdateFileInformationRequest.md +1 -1
  49. package/dist/runtime/api/docs/UpdateRequest.md +2 -2
  50. package/dist/runtime/api/models/BucketInformation.d.ts +1 -1
  51. package/dist/runtime/api/models/ClusterInformation.d.ts +39 -0
  52. package/dist/runtime/api/models/ClusterInformation.js +32 -0
  53. package/dist/runtime/api/models/ClusterMemberInformation.d.ts +56 -0
  54. package/dist/runtime/api/models/ClusterMemberInformation.js +38 -0
  55. package/dist/runtime/api/models/CollectionPermission.d.ts +50 -0
  56. package/dist/runtime/api/models/CollectionPermission.js +35 -0
  57. package/dist/runtime/api/models/CollectionStatus.d.ts +3 -3
  58. package/dist/runtime/api/models/CollectionSummary.d.ts +80 -0
  59. package/dist/runtime/api/models/CollectionSummary.js +50 -0
  60. package/dist/runtime/api/models/CountResponse.d.ts +32 -0
  61. package/dist/runtime/api/models/CountResponse.js +26 -0
  62. package/dist/runtime/api/models/DatabaseInfo.d.ts +3 -3
  63. package/dist/runtime/api/models/DeleteResponse.d.ts +1 -1
  64. package/dist/runtime/api/models/ErrorDescription.d.ts +1 -1
  65. package/dist/runtime/api/models/FileInformation.d.ts +3 -3
  66. package/dist/runtime/api/models/Grant.d.ts +1 -1
  67. package/dist/runtime/api/models/IndexCreateRequest.d.ts +1 -1
  68. package/dist/runtime/api/models/IndexCreateResponse.d.ts +1 -1
  69. package/dist/runtime/api/models/IndexDropResponse.d.ts +1 -1
  70. package/dist/runtime/api/models/IndexOptionsRequest.d.ts +1 -1
  71. package/dist/runtime/api/models/IndexUsage.d.ts +52 -0
  72. package/dist/runtime/api/models/IndexUsage.js +35 -0
  73. package/dist/runtime/api/models/InsertError.d.ts +44 -0
  74. package/dist/runtime/api/models/InsertError.js +32 -0
  75. package/dist/runtime/api/models/InsertResponse.d.ts +14 -1
  76. package/dist/runtime/api/models/InsertResponse.js +10 -2
  77. package/dist/runtime/api/models/JobConfig.d.ts +1 -1
  78. package/dist/runtime/api/models/JobInformation.d.ts +2 -2
  79. package/dist/runtime/api/models/JobInformation.js +1 -2
  80. package/dist/runtime/api/models/JsonSchema.d.ts +1 -1
  81. package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +3 -3
  82. package/dist/runtime/api/models/JsonValueAny.d.ts +3 -3
  83. package/dist/runtime/api/models/JsonValueBoolean.d.ts +1 -1
  84. package/dist/runtime/api/models/JsonValueString.d.ts +1 -1
  85. package/dist/runtime/api/models/Login.d.ts +1 -1
  86. package/dist/runtime/api/models/LoginResult.d.ts +1 -1
  87. package/dist/runtime/api/models/MongoAggregateRequest.d.ts +1 -1
  88. package/dist/runtime/api/models/MongoCampConfiguration.d.ts +3 -3
  89. package/dist/runtime/api/models/MongoFindRequest.d.ts +7 -7
  90. package/dist/runtime/api/models/MongoIndex.d.ts +7 -7
  91. package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +1 -1
  92. package/dist/runtime/api/models/PipelineStage.d.ts +3 -3
  93. package/dist/runtime/api/models/Role.d.ts +1 -1
  94. package/dist/runtime/api/models/SchemaAnalysis.d.ts +1 -1
  95. package/dist/runtime/api/models/SchemaAnalysisField.d.ts +1 -1
  96. package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +1 -1
  97. package/dist/runtime/api/models/SearchRequest.d.ts +44 -0
  98. package/dist/runtime/api/models/SearchRequest.js +29 -0
  99. package/dist/runtime/api/models/SettingsResponse.d.ts +3 -3
  100. package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +3 -3
  101. package/dist/runtime/api/models/UpdateRequest.d.ts +5 -5
  102. package/dist/runtime/api/models/UpdateResponse.d.ts +1 -1
  103. package/dist/runtime/api/models/UpdateRoleRequest.d.ts +1 -1
  104. package/dist/runtime/api/models/UserInformation.d.ts +1 -1
  105. package/dist/runtime/api/models/UserProfile.d.ts +1 -1
  106. package/dist/runtime/api/models/Version.d.ts +1 -1
  107. package/dist/runtime/api/models/index.d.ts +8 -0
  108. package/dist/runtime/api/models/index.js +8 -0
  109. package/dist/runtime/api/runtime.d.ts +1 -1
  110. package/dist/runtime/composables/mongocampApi.d.ts +1 -1
  111. package/dist/runtime/composables/mongocampApiCollection.d.ts +2 -2
  112. package/dist/runtime/composables/mongocampSearch.d.ts +3 -3
  113. package/dist/runtime/composables/mongocampStorage.d.ts +1 -1
  114. package/dist/runtime/server/composables/mongocampApi.d.ts +1 -1
  115. package/dist/runtime/server/composables/mongocampServerApi.d.ts +1 -1
  116. package/dist/runtime/utils/createMongocampApis.d.ts +2 -2
  117. package/dist/runtime/utils/createMongocampApis.js +2 -2
  118. package/package.json +14 -14
  119. package/dist/runtime/api/apis/InformationApi.js +0 -37
@@ -1,8 +1,10 @@
1
1
  import * as runtime from "../runtime.js";
2
2
  import {
3
+ CountResponseFromJSON,
3
4
  DeleteResponseFromJSON,
4
5
  InsertResponseFromJSON,
5
6
  MongoFindRequestToJSON,
7
+ SearchRequestToJSON,
6
8
  UpdateRequestToJSON,
7
9
  UpdateResponseFromJSON
8
10
  } from "../models/index.js";
@@ -65,6 +67,60 @@ export class DocumentApi extends runtime.BaseAPI {
65
67
  const response = await this._deleteRaw(requestParameters, initOverrides);
66
68
  return await response.value();
67
69
  }
70
+ /**
71
+ * Creates request options for countDocuments without sending the request
72
+ */
73
+ async countDocumentsRequestOpts(requestParameters) {
74
+ if (requestParameters["collectionName"] == null) {
75
+ throw new runtime.RequiredError(
76
+ "collectionName",
77
+ 'Required parameter "collectionName" was null or undefined when calling countDocuments().'
78
+ );
79
+ }
80
+ const queryParameters = {};
81
+ if (requestParameters["filter"] != null) {
82
+ queryParameters["filter"] = requestParameters["filter"];
83
+ }
84
+ const headerParameters = {};
85
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
86
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
87
+ }
88
+ if (this.configuration && this.configuration.accessToken) {
89
+ const token = this.configuration.accessToken;
90
+ const tokenString = await token("httpAuth", []);
91
+ if (tokenString) {
92
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
93
+ }
94
+ }
95
+ if (this.configuration && this.configuration.apiKey) {
96
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
97
+ }
98
+ let urlPath = `/mongodb/collections/{collectionName}/documents/count`;
99
+ urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
100
+ return {
101
+ path: urlPath,
102
+ method: "GET",
103
+ headers: headerParameters,
104
+ query: queryParameters
105
+ };
106
+ }
107
+ /**
108
+ * Count the Documents of the given Collection that match the filter without loading them
109
+ * Count Documents in Collection
110
+ */
111
+ async countDocumentsRaw(requestParameters, initOverrides) {
112
+ const requestOptions = await this.countDocumentsRequestOpts(requestParameters);
113
+ const response = await this.request(requestOptions, initOverrides);
114
+ return new runtime.JSONApiResponse(response, (jsonValue) => CountResponseFromJSON(jsonValue));
115
+ }
116
+ /**
117
+ * Count the Documents of the given Collection that match the filter without loading them
118
+ * Count Documents in Collection
119
+ */
120
+ async countDocuments(requestParameters, initOverrides) {
121
+ const response = await this.countDocumentsRaw(requestParameters, initOverrides);
122
+ return await response.value();
123
+ }
68
124
  /**
69
125
  * Creates request options for deleteMany without sending the request
70
126
  */
@@ -82,6 +138,12 @@ export class DocumentApi extends runtime.BaseAPI {
82
138
  );
83
139
  }
84
140
  const queryParameters = {};
141
+ if (requestParameters["matchAll"] != null) {
142
+ queryParameters["matchAll"] = requestParameters["matchAll"];
143
+ }
144
+ if (requestParameters["filter"] != null) {
145
+ queryParameters["filter"] = requestParameters["filter"];
146
+ }
85
147
  const headerParameters = {};
86
148
  headerParameters["Content-Type"] = "application/json";
87
149
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
@@ -317,6 +379,9 @@ export class DocumentApi extends runtime.BaseAPI {
317
379
  );
318
380
  }
319
381
  const queryParameters = {};
382
+ if (requestParameters["ordered"] != null) {
383
+ queryParameters["ordered"] = requestParameters["ordered"];
384
+ }
320
385
  const headerParameters = {};
321
386
  headerParameters["Content-Type"] = "application/json";
322
387
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
@@ -425,6 +490,71 @@ export class DocumentApi extends runtime.BaseAPI {
425
490
  const response = await this.listDocumentsRaw(requestParameters, initOverrides);
426
491
  return await response.value();
427
492
  }
493
+ /**
494
+ * Creates request options for searchDocuments without sending the request
495
+ */
496
+ async searchDocumentsRequestOpts(requestParameters) {
497
+ if (requestParameters["collectionName"] == null) {
498
+ throw new runtime.RequiredError(
499
+ "collectionName",
500
+ 'Required parameter "collectionName" was null or undefined when calling searchDocuments().'
501
+ );
502
+ }
503
+ if (requestParameters["searchRequest"] == null) {
504
+ throw new runtime.RequiredError(
505
+ "searchRequest",
506
+ 'Required parameter "searchRequest" was null or undefined when calling searchDocuments().'
507
+ );
508
+ }
509
+ const queryParameters = {};
510
+ if (requestParameters["rowsPerPage"] != null) {
511
+ queryParameters["rowsPerPage"] = requestParameters["rowsPerPage"];
512
+ }
513
+ if (requestParameters["page"] != null) {
514
+ queryParameters["page"] = requestParameters["page"];
515
+ }
516
+ const headerParameters = {};
517
+ headerParameters["Content-Type"] = "application/json";
518
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
519
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
520
+ }
521
+ if (this.configuration && this.configuration.accessToken) {
522
+ const token = this.configuration.accessToken;
523
+ const tokenString = await token("httpAuth", []);
524
+ if (tokenString) {
525
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
526
+ }
527
+ }
528
+ if (this.configuration && this.configuration.apiKey) {
529
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
530
+ }
531
+ let urlPath = `/mongodb/collections/{collectionName}/documents/search`;
532
+ urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
533
+ return {
534
+ path: urlPath,
535
+ method: "POST",
536
+ headers: headerParameters,
537
+ query: queryParameters,
538
+ body: SearchRequestToJSON(requestParameters["searchRequest"])
539
+ };
540
+ }
541
+ /**
542
+ * The list of documents with the parameters in the request body: for filters that are too long for the URL (a URL of more than 2048 characters is refused by the server before the request is handled, without CORS headers). The filter is a Lucene query like in the list, the answer and the pagination headers are the same.
543
+ * Search Documents in Collection
544
+ */
545
+ async searchDocumentsRaw(requestParameters, initOverrides) {
546
+ const requestOptions = await this.searchDocumentsRequestOpts(requestParameters);
547
+ const response = await this.request(requestOptions, initOverrides);
548
+ return new runtime.JSONApiResponse(response);
549
+ }
550
+ /**
551
+ * The list of documents with the parameters in the request body: for filters that are too long for the URL (a URL of more than 2048 characters is refused by the server before the request is handled, without CORS headers). The filter is a Lucene query like in the list, the answer and the pagination headers are the same.
552
+ * Search Documents in Collection
553
+ */
554
+ async searchDocuments(requestParameters, initOverrides) {
555
+ const response = await this.searchDocumentsRaw(requestParameters, initOverrides);
556
+ return await response.value();
557
+ }
428
558
  /**
429
559
  * Creates request options for update without sending the request
430
560
  */
@@ -574,6 +704,12 @@ export class DocumentApi extends runtime.BaseAPI {
574
704
  );
575
705
  }
576
706
  const queryParameters = {};
707
+ if (requestParameters["matchAll"] != null) {
708
+ queryParameters["matchAll"] = requestParameters["matchAll"];
709
+ }
710
+ if (requestParameters["filter"] != null) {
711
+ queryParameters["filter"] = requestParameters["filter"];
712
+ }
577
713
  const headerParameters = {};
578
714
  headerParameters["Content-Type"] = "application/json";
579
715
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.5.10
5
+ * The version of the OpenAPI document: 1.7.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.5.10
5
+ * The version of the OpenAPI document: 1.7.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime.js';
13
- import type { IndexCreateRequest, IndexCreateResponse, IndexDropResponse, IndexOptionsRequest, MongoIndex } from '../models/index.js';
13
+ import type { IndexCreateRequest, IndexCreateResponse, IndexDropResponse, IndexOptionsRequest, IndexUsage, MongoIndex } from '../models/index.js';
14
14
  export interface CreateExpiringIndexRequest {
15
15
  collectionName: string;
16
16
  fieldName: string;
@@ -47,6 +47,9 @@ export interface IndexRequest {
47
47
  collectionName: string;
48
48
  indexName: string;
49
49
  }
50
+ export interface IndexStatsRequest {
51
+ collectionName: string;
52
+ }
50
53
  export interface ListIndicesRequest {
51
54
  collectionName: string;
52
55
  }
@@ -152,6 +155,20 @@ export declare class IndexApi extends runtime.BaseAPI {
152
155
  * Index for Collection
153
156
  */
154
157
  index(requestParameters: IndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MongoIndex>;
158
+ /**
159
+ * Creates request options for indexStats without sending the request
160
+ */
161
+ indexStatsRequestOpts(requestParameters: IndexStatsRequest): Promise<runtime.RequestOpts>;
162
+ /**
163
+ * How often every Index of the given Collection was used since the counting started. Replaces the aggregation stage $indexStats, which is denied by default because its result contains the address of the database server.
164
+ * Index usage for Collection
165
+ */
166
+ indexStatsRaw(requestParameters: IndexStatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<IndexUsage>>>;
167
+ /**
168
+ * How often every Index of the given Collection was used since the counting started. Replaces the aggregation stage $indexStats, which is denied by default because its result contains the address of the database server.
169
+ * Index usage for Collection
170
+ */
171
+ indexStats(requestParameters: IndexStatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<IndexUsage>>;
155
172
  /**
156
173
  * Creates request options for listIndices without sending the request
157
174
  */
@@ -4,6 +4,7 @@ import {
4
4
  IndexCreateResponseFromJSON,
5
5
  IndexDropResponseFromJSON,
6
6
  IndexOptionsRequestToJSON,
7
+ IndexUsageFromJSON,
7
8
  MongoIndexFromJSON
8
9
  } from "../models/index.js";
9
10
  export class IndexApi extends runtime.BaseAPI {
@@ -440,6 +441,57 @@ export class IndexApi extends runtime.BaseAPI {
440
441
  const response = await this.indexRaw(requestParameters, initOverrides);
441
442
  return await response.value();
442
443
  }
444
+ /**
445
+ * Creates request options for indexStats without sending the request
446
+ */
447
+ async indexStatsRequestOpts(requestParameters) {
448
+ if (requestParameters["collectionName"] == null) {
449
+ throw new runtime.RequiredError(
450
+ "collectionName",
451
+ 'Required parameter "collectionName" was null or undefined when calling indexStats().'
452
+ );
453
+ }
454
+ const queryParameters = {};
455
+ const headerParameters = {};
456
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
457
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
458
+ }
459
+ if (this.configuration && this.configuration.accessToken) {
460
+ const token = this.configuration.accessToken;
461
+ const tokenString = await token("httpAuth", []);
462
+ if (tokenString) {
463
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
464
+ }
465
+ }
466
+ if (this.configuration && this.configuration.apiKey) {
467
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
468
+ }
469
+ let urlPath = `/mongodb/collections/{collectionName}/index/stats`;
470
+ urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
471
+ return {
472
+ path: urlPath,
473
+ method: "GET",
474
+ headers: headerParameters,
475
+ query: queryParameters
476
+ };
477
+ }
478
+ /**
479
+ * How often every Index of the given Collection was used since the counting started. Replaces the aggregation stage $indexStats, which is denied by default because its result contains the address of the database server.
480
+ * Index usage for Collection
481
+ */
482
+ async indexStatsRaw(requestParameters, initOverrides) {
483
+ const requestOptions = await this.indexStatsRequestOpts(requestParameters);
484
+ const response = await this.request(requestOptions, initOverrides);
485
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(IndexUsageFromJSON));
486
+ }
487
+ /**
488
+ * How often every Index of the given Collection was used since the counting started. Replaces the aggregation stage $indexStats, which is denied by default because its result contains the address of the database server.
489
+ * Index usage for Collection
490
+ */
491
+ async indexStats(requestParameters, initOverrides) {
492
+ const response = await this.indexStatsRaw(requestParameters, initOverrides);
493
+ return await response.value();
494
+ }
443
495
  /**
444
496
  * Creates request options for listIndices without sending the request
445
497
  */
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.5.10
5
+ * The version of the OpenAPI document: 1.7.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.5.10
5
+ * The version of the OpenAPI document: 1.7.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -10,11 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime.js';
13
- import type { Version } from '../models/index.js';
13
+ import type { ClusterInformation, Version } from '../models/index.js';
14
14
  /**
15
15
  *
16
16
  */
17
- export declare class InformationApi extends runtime.BaseAPI {
17
+ export declare class SystemApi extends runtime.BaseAPI {
18
18
  /**
19
19
  * Creates request options for version without sending the request
20
20
  */
@@ -29,4 +29,18 @@ export declare class InformationApi extends runtime.BaseAPI {
29
29
  * Version Information
30
30
  */
31
31
  version(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Version>;
32
+ /**
33
+ * Creates request options for viewCluster without sending the request
34
+ */
35
+ viewClusterRequestOpts(): Promise<runtime.RequestOpts>;
36
+ /**
37
+ * Returns the List of all registered Jobs with full information
38
+ * Registered Jobs
39
+ */
40
+ viewClusterRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClusterInformation>>;
41
+ /**
42
+ * Returns the List of all registered Jobs with full information
43
+ * Registered Jobs
44
+ */
45
+ viewCluster(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClusterInformation>;
32
46
  }
@@ -0,0 +1,82 @@
1
+ import * as runtime from "../runtime.js";
2
+ import {
3
+ ClusterInformationFromJSON,
4
+ VersionFromJSON
5
+ } from "../models/index.js";
6
+ export class SystemApi extends runtime.BaseAPI {
7
+ /**
8
+ * Creates request options for version without sending the request
9
+ */
10
+ async versionRequestOpts() {
11
+ const queryParameters = {};
12
+ const headerParameters = {};
13
+ let urlPath = `/version`;
14
+ return {
15
+ path: urlPath,
16
+ method: "GET",
17
+ headers: headerParameters,
18
+ query: queryParameters
19
+ };
20
+ }
21
+ /**
22
+ * Version Info of the MongoCamp API
23
+ * Version Information
24
+ */
25
+ async versionRaw(initOverrides) {
26
+ const requestOptions = await this.versionRequestOpts();
27
+ const response = await this.request(requestOptions, initOverrides);
28
+ return new runtime.JSONApiResponse(response, (jsonValue) => VersionFromJSON(jsonValue));
29
+ }
30
+ /**
31
+ * Version Info of the MongoCamp API
32
+ * Version Information
33
+ */
34
+ async version(initOverrides) {
35
+ const response = await this.versionRaw(initOverrides);
36
+ return await response.value();
37
+ }
38
+ /**
39
+ * Creates request options for viewCluster without sending the request
40
+ */
41
+ async viewClusterRequestOpts() {
42
+ const queryParameters = {};
43
+ const headerParameters = {};
44
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
45
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
46
+ }
47
+ if (this.configuration && this.configuration.accessToken) {
48
+ const token = this.configuration.accessToken;
49
+ const tokenString = await token("httpAuth", []);
50
+ if (tokenString) {
51
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
52
+ }
53
+ }
54
+ if (this.configuration && this.configuration.apiKey) {
55
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
56
+ }
57
+ let urlPath = `/system/cluster`;
58
+ return {
59
+ path: urlPath,
60
+ method: "GET",
61
+ headers: headerParameters,
62
+ query: queryParameters
63
+ };
64
+ }
65
+ /**
66
+ * Returns the List of all registered Jobs with full information
67
+ * Registered Jobs
68
+ */
69
+ async viewClusterRaw(initOverrides) {
70
+ const requestOptions = await this.viewClusterRequestOpts();
71
+ const response = await this.request(requestOptions, initOverrides);
72
+ return new runtime.JSONApiResponse(response, (jsonValue) => ClusterInformationFromJSON(jsonValue));
73
+ }
74
+ /**
75
+ * Returns the List of all registered Jobs with full information
76
+ * Registered Jobs
77
+ */
78
+ async viewCluster(initOverrides) {
79
+ const response = await this.viewClusterRaw(initOverrides);
80
+ return await response.value();
81
+ }
82
+ }
@@ -7,5 +7,5 @@ export * from './DatabaseApi.js';
7
7
  export * from './DocumentApi.js';
8
8
  export * from './FileApi.js';
9
9
  export * from './IndexApi.js';
10
- export * from './InformationApi.js';
11
10
  export * from './JobsApi.js';
11
+ export * from './SystemApi.js';
@@ -7,5 +7,5 @@ export * from "./DatabaseApi.js";
7
7
  export * from "./DocumentApi.js";
8
8
  export * from "./FileApi.js";
9
9
  export * from "./IndexApi.js";
10
- export * from "./InformationApi.js";
11
10
  export * from "./JobsApi.js";
11
+ export * from "./SystemApi.js";
@@ -638,7 +638,7 @@ example().catch(console.error);
638
638
  | Status code | Description | Response headers |
639
639
  |-------------|-------------|------------------|
640
640
  | **200** | | * x-pagination-count-rows - count all elements <br> * x-pagination-rows-per-page - Count elements per page <br> * x-pagination-current-page - Current page <br> * x-pagination-count-pages - Count pages <br> |
641
- | **400** | Invalid value for: query parameter filter, Invalid value for: query parameter rowsPerPage, Invalid value for: query parameter page | - |
641
+ | **400** | Invalid value for: query parameter rowsPerPage, Invalid value for: query parameter page | - |
642
642
  | **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
643
643
 
644
644
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -722,7 +722,7 @@ example().catch(console.error);
722
722
  | Status code | Description | Response headers |
723
723
  |-------------|-------------|------------------|
724
724
  | **200** | | * x-pagination-count-rows - count all elements <br> * x-pagination-rows-per-page - Count elements per page <br> * x-pagination-current-page - Current page <br> * x-pagination-count-pages - Count pages <br> |
725
- | **400** | Invalid value for: query parameter filter, Invalid value for: query parameter rowsPerPage, Invalid value for: query parameter page | - |
725
+ | **400** | Invalid value for: query parameter rowsPerPage, Invalid value for: query parameter page | - |
726
726
  | **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
727
727
 
728
728
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -11,6 +11,7 @@ All URIs are relative to *http://localhost*
11
11
  | [**logoutByDelete**](AuthApi.md#logoutbydelete) | **DELETE** /auth/logout | Logout User |
12
12
  | [**refreshToken**](AuthApi.md#refreshtoken) | **GET** /auth/token/refresh | Refresh User |
13
13
  | [**updatePassword**](AuthApi.md#updatepassword) | **PATCH** /auth/profile/password | Update Password |
14
+ | [**userPermissions**](AuthApi.md#userpermissions) | **GET** /auth/permissions | Collection permissions |
14
15
  | [**userProfile**](AuthApi.md#userprofile) | **GET** /auth/profile | User Profile |
15
16
 
16
17
 
@@ -366,7 +367,7 @@ This endpoint does not need any parameter.
366
367
 
367
368
  Refresh User
368
369
 
369
- Refresh Token and return Login Information
370
+ Refresh Token and return Login Information. A new token is issued on every call, the bearer token that was used for the call stays valid for a grace period (AUTH_REFRESH_GRACE_DURATION, default 60 seconds) and is invalid afterwards.
370
371
 
371
372
  ### Example
372
373
 
@@ -507,6 +508,83 @@ example().catch(console.error);
507
508
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
508
509
 
509
510
 
511
+ ## userPermissions
512
+
513
+ > Array&lt;CollectionPermission&gt; userPermissions(collection)
514
+
515
+ Collection permissions
516
+
517
+ Return the resolved rights (read, write, administrate) of the loggedin user for the collections of the default database
518
+
519
+ ### Example
520
+
521
+ ```ts
522
+ import {
523
+ Configuration,
524
+ AuthApi,
525
+ } from '';
526
+ import type { UserPermissionsRequest } from '';
527
+
528
+ async function example() {
529
+ console.log("🚀 Testing SDK...");
530
+ const config = new Configuration({
531
+ // To configure HTTP basic authorization: httpAuth1
532
+ username: "YOUR USERNAME",
533
+ password: "YOUR PASSWORD",
534
+ // Configure HTTP bearer authorization: httpAuth
535
+ accessToken: "YOUR BEARER TOKEN",
536
+ // To configure API key authorization: apiKeyAuth
537
+ apiKey: "YOUR API KEY",
538
+ });
539
+ const api = new AuthApi(config);
540
+
541
+ const body = {
542
+ // string | Resolve the rights for this collection only (also if the user has none) (optional)
543
+ collection: collection_example,
544
+ } satisfies UserPermissionsRequest;
545
+
546
+ try {
547
+ const data = await api.userPermissions(body);
548
+ console.log(data);
549
+ } catch (error) {
550
+ console.error(error);
551
+ }
552
+ }
553
+
554
+ // Run the test
555
+ example().catch(console.error);
556
+ ```
557
+
558
+ ### Parameters
559
+
560
+
561
+ | Name | Type | Description | Notes |
562
+ |------------- | ------------- | ------------- | -------------|
563
+ | **collection** | `string` | Resolve the rights for this collection only (also if the user has none) | [Optional] [Defaults to `undefined`] |
564
+
565
+ ### Return type
566
+
567
+ [**Array&lt;CollectionPermission&gt;**](CollectionPermission.md)
568
+
569
+ ### Authorization
570
+
571
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
572
+
573
+ ### HTTP request headers
574
+
575
+ - **Content-Type**: Not defined
576
+ - **Accept**: `application/json`
577
+
578
+
579
+ ### HTTP response details
580
+ | Status code | Description | Response headers |
581
+ |-------------|-------------|------------------|
582
+ | **200** | | - |
583
+ | **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
584
+
585
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
586
+
587
+
510
588
  ## userProfile
511
589
 
512
590
  > UserProfile userProfile()
@@ -0,0 +1,36 @@
1
+
2
+ # ClusterInformation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `members` | [Array&lt;ClusterMemberInformation&gt;](ClusterMemberInformation.md)
10
+ `coordinator` | [ClusterMemberInformation](ClusterMemberInformation.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { ClusterInformation } from ''
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "members": null,
20
+ "coordinator": null,
21
+ } satisfies ClusterInformation
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as ClusterInformation
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -0,0 +1,42 @@
1
+
2
+ # ClusterMemberInformation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `name` | string
10
+ `siteMaster` | boolean
11
+ `siteAddress` | boolean
12
+ `multicast` | boolean
13
+ `coordinator` | boolean
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { ClusterMemberInformation } from ''
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "name": null,
23
+ "siteMaster": null,
24
+ "siteAddress": null,
25
+ "multicast": null,
26
+ "coordinator": null,
27
+ } satisfies ClusterMemberInformation
28
+
29
+ console.log(example)
30
+
31
+ // Convert the instance to a JSON string
32
+ const exampleJSON: string = JSON.stringify(example)
33
+ console.log(exampleJSON)
34
+
35
+ // Parse the JSON string back to an object
36
+ const exampleParsed = JSON.parse(exampleJSON) as ClusterMemberInformation
37
+ console.log(exampleParsed)
38
+ ```
39
+
40
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
41
+
42
+