@jskit-ai/users-core 0.1.67 → 0.1.68

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.
@@ -1,7 +1,7 @@
1
1
  export default Object.freeze({
2
2
  packageVersion: 1,
3
3
  packageId: "@jskit-ai/users-core",
4
- version: "0.1.67",
4
+ version: "0.1.68",
5
5
  kind: "runtime",
6
6
  description: "Users/account runtime plus HTTP routes for account features.",
7
7
  dependsOn: [
@@ -132,16 +132,16 @@ export default Object.freeze({
132
132
  mutations: {
133
133
  dependencies: {
134
134
  runtime: {
135
- "@jskit-ai/auth-core": "0.1.56",
136
- "@jskit-ai/crud-core": "0.1.65",
137
- "@jskit-ai/database-runtime": "0.1.57",
138
- "@jskit-ai/http-runtime": "0.1.56",
139
- "@jskit-ai/json-rest-api-core": "0.1.2",
140
- "@jskit-ai/kernel": "0.1.57",
141
- "@jskit-ai/resource-core": "0.1.2",
142
- "@jskit-ai/resource-crud-core": "0.1.2",
135
+ "@jskit-ai/auth-core": "0.1.57",
136
+ "@jskit-ai/crud-core": "0.1.66",
137
+ "@jskit-ai/database-runtime": "0.1.58",
138
+ "@jskit-ai/http-runtime": "0.1.57",
139
+ "@jskit-ai/json-rest-api-core": "0.1.3",
140
+ "@jskit-ai/kernel": "0.1.58",
141
+ "@jskit-ai/resource-core": "0.1.3",
142
+ "@jskit-ai/resource-crud-core": "0.1.3",
143
143
  "@local/users": "file:packages/users",
144
- "@jskit-ai/uploads-runtime": "0.1.35"
144
+ "@jskit-ai/uploads-runtime": "0.1.36"
145
145
  },
146
146
  dev: {}
147
147
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/users-core",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
@@ -11,14 +11,14 @@
11
11
  "./shared/resources/userSettingsResource": "./src/shared/resources/userSettingsResource.js"
12
12
  },
13
13
  "dependencies": {
14
- "@jskit-ai/auth-core": "0.1.56",
15
- "@jskit-ai/database-runtime": "0.1.57",
16
- "@jskit-ai/http-runtime": "0.1.56",
17
- "@jskit-ai/json-rest-api-core": "0.1.2",
18
- "@jskit-ai/kernel": "0.1.57",
19
- "@jskit-ai/resource-crud-core": "0.1.2",
20
- "@jskit-ai/resource-core": "0.1.2",
21
- "@jskit-ai/uploads-runtime": "0.1.35",
14
+ "@jskit-ai/auth-core": "0.1.57",
15
+ "@jskit-ai/database-runtime": "0.1.58",
16
+ "@jskit-ai/http-runtime": "0.1.57",
17
+ "@jskit-ai/json-rest-api-core": "0.1.3",
18
+ "@jskit-ai/kernel": "0.1.58",
19
+ "@jskit-ai/resource-crud-core": "0.1.3",
20
+ "@jskit-ai/resource-core": "0.1.3",
21
+ "@jskit-ai/uploads-runtime": "0.1.36",
22
22
  "json-rest-schema": "1.x.x"
23
23
  }
24
24
  }
@@ -42,6 +42,13 @@ const userProfileBodySchema = createSchema({
42
42
  });
43
43
 
44
44
  const avatarUploadBodySchema = createSchema({
45
+ stream: {
46
+ type: "none",
47
+ required: true,
48
+ messages: {
49
+ default: "Avatar stream is missing."
50
+ }
51
+ },
45
52
  mimeType: {
46
53
  type: "string",
47
54
  required: false,
@@ -3,6 +3,8 @@ import test from "node:test";
3
3
  import { UsersCoreServiceProvider } from "../src/server/UsersCoreServiceProvider.js";
4
4
  import { INTERNAL_JSON_REST_API } from "@jskit-ai/json-rest-api-core/server/jsonRestApiHost";
5
5
  import { createRouter } from "../../kernel/server/http/lib/router.js";
6
+ import { validateOperationSection } from "../../http-runtime/src/shared/validators/operationValidation.js";
7
+ import { userProfileResource } from "../src/shared/resources/userProfileResource.js";
6
8
 
7
9
  function createReplyDouble() {
8
10
  return {
@@ -268,3 +270,19 @@ test("account settings jsonapi transport resolves response resource id from requ
268
270
  }
269
271
  });
270
272
  });
273
+
274
+ test("avatar upload operation accepts the internal multipart stream field", () => {
275
+ const parsed = validateOperationSection({
276
+ operation: userProfileResource.operations.avatarUpload,
277
+ section: "body",
278
+ value: {
279
+ stream: {},
280
+ mimeType: "image/png",
281
+ fileName: "avatar.png"
282
+ }
283
+ });
284
+
285
+ assert.equal(parsed.ok, true);
286
+ assert.equal(parsed.value.mimeType, "image/png");
287
+ assert.equal(parsed.value.fileName, "avatar.png");
288
+ });