@sfxcode/nuxt-mongocamp-server 1.1.2 → 1.2.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.
Files changed (67) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/api/apis/AdminApi.mjs +99 -63
  4. package/dist/runtime/api/apis/ApplicationApi.mjs +22 -13
  5. package/dist/runtime/api/apis/AuthApi.mjs +19 -13
  6. package/dist/runtime/api/apis/BucketApi.mjs +22 -13
  7. package/dist/runtime/api/apis/CollectionApi.mjs +97 -64
  8. package/dist/runtime/api/apis/DatabaseApi.mjs +23 -14
  9. package/dist/runtime/api/apis/DocumentApi.d.ts +5 -5
  10. package/dist/runtime/api/apis/DocumentApi.mjs +151 -91
  11. package/dist/runtime/api/apis/FileApi.mjs +119 -74
  12. package/dist/runtime/api/apis/IndexApi.mjs +117 -69
  13. package/dist/runtime/api/apis/JobsApi.mjs +51 -27
  14. package/dist/runtime/api/models/BucketInformation.mjs +16 -16
  15. package/dist/runtime/api/models/CollectionStatus.d.ts +2 -2
  16. package/dist/runtime/api/models/CollectionStatus.mjs +43 -34
  17. package/dist/runtime/api/models/DatabaseInfo.d.ts +1 -1
  18. package/dist/runtime/api/models/DatabaseInfo.mjs +19 -18
  19. package/dist/runtime/api/models/DeleteResponse.mjs +10 -12
  20. package/dist/runtime/api/models/ErrorDescription.mjs +13 -14
  21. package/dist/runtime/api/models/FileInformation.d.ts +1 -1
  22. package/dist/runtime/api/models/FileInformation.mjs +22 -20
  23. package/dist/runtime/api/models/Grant.mjs +19 -18
  24. package/dist/runtime/api/models/IndexCreateRequest.d.ts +1 -1
  25. package/dist/runtime/api/models/IndexCreateRequest.mjs +9 -13
  26. package/dist/runtime/api/models/IndexCreateResponse.mjs +7 -10
  27. package/dist/runtime/api/models/IndexDropResponse.mjs +7 -10
  28. package/dist/runtime/api/models/IndexOptionsRequest.mjs +20 -25
  29. package/dist/runtime/api/models/InsertResponse.mjs +9 -13
  30. package/dist/runtime/api/models/JobConfig.mjs +22 -20
  31. package/dist/runtime/api/models/JobInformation.mjs +28 -27
  32. package/dist/runtime/api/models/JsonSchema.d.ts +1 -1
  33. package/dist/runtime/api/models/JsonSchema.mjs +14 -20
  34. package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +1 -1
  35. package/dist/runtime/api/models/JsonSchemaDefinition.mjs +18 -19
  36. package/dist/runtime/api/models/JsonValueAny.mjs +7 -10
  37. package/dist/runtime/api/models/JsonValueBoolean.mjs +7 -10
  38. package/dist/runtime/api/models/JsonValueString.mjs +7 -10
  39. package/dist/runtime/api/models/Login.mjs +10 -12
  40. package/dist/runtime/api/models/LoginResult.mjs +13 -14
  41. package/dist/runtime/api/models/MongoAggregateRequest.mjs +9 -13
  42. package/dist/runtime/api/models/MongoCampConfiguration.mjs +19 -18
  43. package/dist/runtime/api/models/MongoFindRequest.d.ts +3 -3
  44. package/dist/runtime/api/models/MongoFindRequest.mjs +13 -14
  45. package/dist/runtime/api/models/MongoIndex.d.ts +3 -3
  46. package/dist/runtime/api/models/MongoIndex.mjs +39 -33
  47. package/dist/runtime/api/models/PasswordUpdateRequest.mjs +7 -10
  48. package/dist/runtime/api/models/PipelineStage.mjs +10 -12
  49. package/dist/runtime/api/models/Role.mjs +12 -15
  50. package/dist/runtime/api/models/SchemaAnalysis.mjs +15 -17
  51. package/dist/runtime/api/models/SchemaAnalysisField.mjs +20 -21
  52. package/dist/runtime/api/models/SchemaAnalysisFieldType.mjs +13 -14
  53. package/dist/runtime/api/models/SettingsResponse.d.ts +1 -1
  54. package/dist/runtime/api/models/SettingsResponse.mjs +13 -17
  55. package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +1 -1
  56. package/dist/runtime/api/models/UpdateFileInformationRequest.mjs +8 -13
  57. package/dist/runtime/api/models/UpdateRequest.d.ts +2 -2
  58. package/dist/runtime/api/models/UpdateRequest.mjs +10 -12
  59. package/dist/runtime/api/models/UpdateResponse.mjs +15 -17
  60. package/dist/runtime/api/models/UpdateRoleRequest.mjs +9 -13
  61. package/dist/runtime/api/models/UserInformation.mjs +14 -17
  62. package/dist/runtime/api/models/UserProfile.mjs +16 -19
  63. package/dist/runtime/api/models/Version.mjs +13 -14
  64. package/dist/runtime/api/runtime.d.ts +2 -3
  65. package/dist/runtime/api/runtime.mjs +0 -4
  66. package/dist/runtime/composables/mongocampAuth.mjs +2 -0
  67. package/package.json +29 -18
@@ -1,35 +1,32 @@
1
- import { exists } from "../runtime.mjs";
2
1
  export function instanceOfUserInformation(value) {
3
- let isInstance = true;
4
- isInstance = isInstance && "userId" in value;
5
- isInstance = isInstance && "password" in value;
6
- return isInstance;
2
+ if (!("userId" in value))
3
+ return false;
4
+ if (!("password" in value))
5
+ return false;
6
+ return true;
7
7
  }
8
8
  export function UserInformationFromJSON(json) {
9
9
  return UserInformationFromJSONTyped(json, false);
10
10
  }
11
11
  export function UserInformationFromJSONTyped(json, ignoreDiscriminator) {
12
- if (json === void 0 || json === null) {
12
+ if (json == null) {
13
13
  return json;
14
14
  }
15
15
  return {
16
16
  "userId": json["userId"],
17
17
  "password": json["password"],
18
- "apiKey": !exists(json, "apiKey") ? void 0 : json["apiKey"],
19
- "roles": !exists(json, "roles") ? void 0 : json["roles"]
18
+ "apiKey": json["apiKey"] == null ? void 0 : json["apiKey"],
19
+ "roles": json["roles"] == null ? void 0 : json["roles"]
20
20
  };
21
21
  }
22
22
  export function UserInformationToJSON(value) {
23
- if (value === void 0) {
24
- return void 0;
25
- }
26
- if (value === null) {
27
- return null;
23
+ if (value == null) {
24
+ return value;
28
25
  }
29
26
  return {
30
- "userId": value.userId,
31
- "password": value.password,
32
- "apiKey": value.apiKey,
33
- "roles": value.roles
27
+ "userId": value["userId"],
28
+ "password": value["password"],
29
+ "apiKey": value["apiKey"],
30
+ "roles": value["roles"]
34
31
  };
35
32
  }
@@ -1,41 +1,38 @@
1
- import { exists } from "../runtime.mjs";
2
1
  import {
3
2
  GrantFromJSON,
4
3
  GrantToJSON
5
4
  } from "./Grant.mjs";
6
5
  export function instanceOfUserProfile(value) {
7
- let isInstance = true;
8
- isInstance = isInstance && "user" in value;
9
- isInstance = isInstance && "isAdmin" in value;
10
- return isInstance;
6
+ if (!("user" in value))
7
+ return false;
8
+ if (!("isAdmin" in value))
9
+ return false;
10
+ return true;
11
11
  }
12
12
  export function UserProfileFromJSON(json) {
13
13
  return UserProfileFromJSONTyped(json, false);
14
14
  }
15
15
  export function UserProfileFromJSONTyped(json, ignoreDiscriminator) {
16
- if (json === void 0 || json === null) {
16
+ if (json == null) {
17
17
  return json;
18
18
  }
19
19
  return {
20
20
  "user": json["user"],
21
21
  "isAdmin": json["isAdmin"],
22
- "apiKey": !exists(json, "apiKey") ? void 0 : json["apiKey"],
23
- "roles": !exists(json, "roles") ? void 0 : json["roles"],
24
- "grants": !exists(json, "grants") ? void 0 : json["grants"].map(GrantFromJSON)
22
+ "apiKey": json["apiKey"] == null ? void 0 : json["apiKey"],
23
+ "roles": json["roles"] == null ? void 0 : json["roles"],
24
+ "grants": json["grants"] == null ? void 0 : json["grants"].map(GrantFromJSON)
25
25
  };
26
26
  }
27
27
  export function UserProfileToJSON(value) {
28
- if (value === void 0) {
29
- return void 0;
30
- }
31
- if (value === null) {
32
- return null;
28
+ if (value == null) {
29
+ return value;
33
30
  }
34
31
  return {
35
- "user": value.user,
36
- "isAdmin": value.isAdmin,
37
- "apiKey": value.apiKey,
38
- "roles": value.roles,
39
- "grants": value.grants === void 0 ? void 0 : value.grants.map(GrantToJSON)
32
+ "user": value["user"],
33
+ "isAdmin": value["isAdmin"],
34
+ "apiKey": value["apiKey"],
35
+ "roles": value["roles"],
36
+ "grants": value["grants"] == null ? void 0 : value["grants"].map(GrantToJSON)
40
37
  };
41
38
  }
@@ -1,15 +1,17 @@
1
1
  export function instanceOfVersion(value) {
2
- let isInstance = true;
3
- isInstance = isInstance && "name" in value;
4
- isInstance = isInstance && "version" in value;
5
- isInstance = isInstance && "builtAt" in value;
6
- return isInstance;
2
+ if (!("name" in value))
3
+ return false;
4
+ if (!("version" in value))
5
+ return false;
6
+ if (!("builtAt" in value))
7
+ return false;
8
+ return true;
7
9
  }
8
10
  export function VersionFromJSON(json) {
9
11
  return VersionFromJSONTyped(json, false);
10
12
  }
11
13
  export function VersionFromJSONTyped(json, ignoreDiscriminator) {
12
- if (json === void 0 || json === null) {
14
+ if (json == null) {
13
15
  return json;
14
16
  }
15
17
  return {
@@ -19,15 +21,12 @@ export function VersionFromJSONTyped(json, ignoreDiscriminator) {
19
21
  };
20
22
  }
21
23
  export function VersionToJSON(value) {
22
- if (value === void 0) {
23
- return void 0;
24
- }
25
- if (value === null) {
26
- return null;
24
+ if (value == null) {
25
+ return value;
27
26
  }
28
27
  return {
29
- "name": value.name,
30
- "version": value.version,
31
- "builtAt": value.builtAt.toISOString()
28
+ "name": value["name"],
29
+ "version": value["version"],
30
+ "builtAt": value["builtAt"].toISOString()
32
31
  };
33
32
  }
@@ -17,7 +17,7 @@ export interface ConfigurationParameters {
17
17
  queryParamsStringify?: (params: HTTPQuery) => string;
18
18
  username?: string;
19
19
  password?: string;
20
- apiKey?: string | ((name: string) => string);
20
+ apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
21
21
  accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
22
22
  headers?: HTTPHeaders;
23
23
  credentials?: RequestCredentials;
@@ -32,7 +32,7 @@ export declare class Configuration {
32
32
  get queryParamsStringify(): (params: HTTPQuery) => string;
33
33
  get username(): string | undefined;
34
34
  get password(): string | undefined;
35
- get apiKey(): ((name: string) => string) | undefined;
35
+ get apiKey(): ((name: string) => string | Promise<string>) | undefined;
36
36
  get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
37
37
  get headers(): HTTPHeaders | undefined;
38
38
  get credentials(): RequestCredentials | undefined;
@@ -122,7 +122,6 @@ export interface RequestOpts {
122
122
  query?: HTTPQuery;
123
123
  body?: HTTPBody;
124
124
  }
125
- export declare function exists(json: any, key: string): boolean;
126
125
  export declare function querystring(params: HTTPQuery, prefix?: string): string;
127
126
  export declare function mapValues(data: any, fn: (item: any) => any): {};
128
127
  export declare function canConsumeForm(consumes: Consume[]): boolean;
@@ -215,10 +215,6 @@ export const COLLECTION_FORMATS = {
215
215
  tsv: " ",
216
216
  pipes: "|"
217
217
  };
218
- export function exists(json, key) {
219
- const value = json[key];
220
- return value !== null && value !== void 0;
221
- }
222
218
  export function querystring(params, prefix = "") {
223
219
  return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
224
220
  }
@@ -1,4 +1,5 @@
1
1
  import { computed } from "vue";
2
+ import { consola } from "consola";
2
3
  import { useMongocampApi } from "./mongocampApi.mjs";
3
4
  import { useMongocampStorage } from "./mongocampStorage.mjs";
4
5
  import { useMongocampUser } from "./mongocampUser.mjs";
@@ -19,6 +20,7 @@ export function useMongocampAuth() {
19
20
  const result = await authApi.refreshToken();
20
21
  updateUserState(result);
21
22
  } catch (e) {
23
+ consola.log(e);
22
24
  }
23
25
  }
24
26
  function updateUserState(result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfxcode/nuxt-mongocamp-server",
3
- "version": "1.1.2",
3
+ "version": "1.2.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,28 +17,39 @@
17
17
  "build": {
18
18
  "failOnWarn": false
19
19
  },
20
+ "scripts": {
21
+ "prepack": "nuxt-module-build build",
22
+ "dev": "nuxi dev playground",
23
+ "dev:build": "nuxi build playground",
24
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
25
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish --access public && git push --follow-tags",
26
+ "lint": "eslint .",
27
+ "test": "vitest run",
28
+ "test:watch": "vitest watch",
29
+ "test:coverage": "vitest run --coverage",
30
+ "test:update": "vitest run --update",
31
+ "test:update:watch": "vitest run --update --watch",
32
+ "api-codegen": "openapi-generator-cli generate -i ./openapi/docs.yaml -g typescript-fetch -o src/runtime/api --additional-properties=typescriptThreePlus=true,supportsES6=true"
33
+ },
20
34
  "dependencies": {
21
35
  "@nuxt/kit": "^3.10.3",
22
36
  "@vueuse/nuxt": "^10.9.0"
23
37
  },
24
38
  "devDependencies": {
25
- "@iconify-json/mdi": "^1.1.64",
39
+ "@iconify-json/bx": "^1.1.10",
40
+ "@nuxt/devtools": "^1.0.8",
41
+ "@nuxt/eslint-config": "^0.2.0",
26
42
  "@nuxt/module-builder": "^0.5.5",
27
- "@nuxtjs/eslint-config-typescript": "12.1.0",
28
- "@openapitools/openapi-generator-cli": "^2.9.0",
29
- "@types/node": "^20.11.24",
30
- "@unocss/nuxt": "^0.58.5",
31
- "defu": "^6.1.4",
32
- "jiti": "^1.21.0",
33
- "nuxt": "^3.10.3"
34
- },
35
- "scripts": {
36
- "dev": "nuxi dev playground",
37
- "dev:build": "nuxi build playground",
38
- "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
39
- "dev:start": "node playground/.output/server/index.mjs",
40
- "lint:show": "eslint ./src/runtime",
41
- "lint:fix": "eslint --fix ./src/runtime",
42
- "api-codegen": "openapi-generator-cli generate -i ./openapi/docs.yaml -g typescript-fetch -o src/runtime/api --additional-properties=typescriptThreePlus=true,supportsES6=true"
43
+ "@nuxt/schema": "^3.10.3",
44
+ "@nuxt/test-utils": "^3.11.0",
45
+ "@types/node": "^20.11.28",
46
+ "@unocss/nuxt": "^0.58.6",
47
+ "changelogen": "^0.5.5",
48
+ "eslint": "^8.57.0",
49
+ "nuxt": "^3.10.3",
50
+ "nuxt-primevue": "^0.3.1",
51
+ "primeicons": "^6.0.1",
52
+ "vitest": "^1.4.0",
53
+ "@openapitools/openapi-generator-cli": "^2.9.0"
43
54
  }
44
55
  }