@supernova-studio/client 0.55.2 → 0.55.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.
- package/dist/index.d.mts +110 -1
- package/dist/index.d.ts +110 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/users/user.ts +4 -0
- package/src/api/endpoints/users.ts +9 -1
- package/src/yjs/version-room/backend.ts +11 -0
- package/src/yjs/version-room/base.ts +1 -1
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserProfileUpdate } from "@supernova-studio/model";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -22,6 +23,9 @@ export const DTOUserGetResponse = z.object({
|
|
|
22
23
|
user: DTOUser,
|
|
23
24
|
});
|
|
24
25
|
|
|
26
|
+
export const DTOUserProfileUpdate = UserProfileUpdate;
|
|
27
|
+
|
|
25
28
|
export type DTOUserProfile = z.infer<typeof DTOUserProfile>;
|
|
26
29
|
export type DTOUser = z.infer<typeof DTOUser>;
|
|
27
30
|
export type DTOUserGetResponse = z.infer<typeof DTOUserGetResponse>;
|
|
31
|
+
export type DTOUserProfileUpdate = z.infer<typeof DTOUserProfileUpdate>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserProfileUpdate } from "@supernova-studio/model";
|
|
2
|
+
import { DTOUserProfileUpdate, DTOUserWorkspaceMembershipsResponse } from "../dto";
|
|
2
3
|
import { DTOAuthenticatedUserResponse } from "../dto/users/authenticated-user";
|
|
3
4
|
import { RequestExecutor } from "../transport/request-executor";
|
|
4
5
|
|
|
@@ -16,4 +17,11 @@ export class UsersEndpoint {
|
|
|
16
17
|
delete(uid: string) {
|
|
17
18
|
return this.requestExecutor.json(`/users/${uid}`, DTOAuthenticatedUserResponse, { method: "DELETE" });
|
|
18
19
|
}
|
|
20
|
+
|
|
21
|
+
updateProfile(uid: string, body: DTOUserProfileUpdate) {
|
|
22
|
+
return this.requestExecutor.json(`/users/${uid}/profile`, DTOAuthenticatedUserResponse, {
|
|
23
|
+
method: "PUT",
|
|
24
|
+
body,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
19
27
|
}
|
|
@@ -64,4 +64,15 @@ export class BackendVersionRoomYDoc {
|
|
|
64
64
|
transaction.pageApprovalIdsToDelete && yDoc.removeApprovalStates(transaction.pageApprovalIdsToDelete);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
+
|
|
68
|
+
getDocumentationPageContentHashes() {
|
|
69
|
+
const versionDoc = new VersionRoomBaseYDoc(this.yDoc);
|
|
70
|
+
|
|
71
|
+
// Limit each hash string by 100 characters
|
|
72
|
+
const validHashes = Object.entries(versionDoc.getDocumentationPageContentHashes()).filter(e => {
|
|
73
|
+
return e[1].length < 100;
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return Object.fromEntries(validHashes);
|
|
77
|
+
}
|
|
67
78
|
}
|