@nurama/sdk 0.0.0-stage → 1.4.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.
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +1080 -2
- package/dist/BotClient.d.ts +66 -0
- package/dist/BotClient.d.ts.map +1 -0
- package/dist/BotClient.js +68 -0
- package/dist/BotClient.js.map +1 -0
- package/dist/NuramaClient.d.ts +448 -0
- package/dist/NuramaClient.d.ts.map +1 -0
- package/dist/NuramaClient.js +864 -0
- package/dist/NuramaClient.js.map +1 -0
- package/dist/browser/nurama-bot-sdk.js +11780 -0
- package/dist/browser/nurama-bot-sdk.min.js +1 -0
- package/dist/browser/nurama-sdk.js +11732 -0
- package/dist/browser/nurama-sdk.min.js +1 -0
- package/dist/routes/ai.d.ts +280 -0
- package/dist/routes/ai.d.ts.map +1 -0
- package/dist/routes/ai.js +173 -0
- package/dist/routes/ai.js.map +1 -0
- package/dist/routes/asset.d.ts +493 -0
- package/dist/routes/asset.d.ts.map +1 -0
- package/dist/routes/asset.js +848 -0
- package/dist/routes/asset.js.map +1 -0
- package/dist/routes/auth.d.ts +218 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/auth.js +454 -0
- package/dist/routes/auth.js.map +1 -0
- package/dist/routes/blogPosts.d.ts +17 -0
- package/dist/routes/blogPosts.d.ts.map +1 -0
- package/dist/routes/blogPosts.js +29 -0
- package/dist/routes/blogPosts.js.map +1 -0
- package/dist/routes/board.d.ts +187 -0
- package/dist/routes/board.d.ts.map +1 -0
- package/dist/routes/board.js +270 -0
- package/dist/routes/board.js.map +1 -0
- package/dist/routes/bot.d.ts +147 -0
- package/dist/routes/bot.d.ts.map +1 -0
- package/dist/routes/bot.js +157 -0
- package/dist/routes/bot.js.map +1 -0
- package/dist/routes/chat.d.ts +842 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +863 -0
- package/dist/routes/chat.js.map +1 -0
- package/dist/routes/chatAi.d.ts +51 -0
- package/dist/routes/chatAi.d.ts.map +1 -0
- package/dist/routes/chatAi.js +109 -0
- package/dist/routes/chatAi.js.map +1 -0
- package/dist/routes/config.d.ts +11 -0
- package/dist/routes/config.d.ts.map +1 -0
- package/dist/routes/config.js +24 -0
- package/dist/routes/config.js.map +1 -0
- package/dist/routes/convo.d.ts +169 -0
- package/dist/routes/convo.d.ts.map +1 -0
- package/dist/routes/convo.js +284 -0
- package/dist/routes/convo.js.map +1 -0
- package/dist/routes/credits.d.ts +82 -0
- package/dist/routes/credits.d.ts.map +1 -0
- package/dist/routes/credits.js +49 -0
- package/dist/routes/credits.js.map +1 -0
- package/dist/routes/device.d.ts +74 -0
- package/dist/routes/device.d.ts.map +1 -0
- package/dist/routes/device.js +122 -0
- package/dist/routes/device.js.map +1 -0
- package/dist/routes/folder.d.ts +75 -0
- package/dist/routes/folder.d.ts.map +1 -0
- package/dist/routes/folder.js +99 -0
- package/dist/routes/folder.js.map +1 -0
- package/dist/routes/invite.d.ts +61 -0
- package/dist/routes/invite.d.ts.map +1 -0
- package/dist/routes/invite.js +86 -0
- package/dist/routes/invite.js.map +1 -0
- package/dist/routes/joinLink.d.ts +38 -0
- package/dist/routes/joinLink.d.ts.map +1 -0
- package/dist/routes/joinLink.js +81 -0
- package/dist/routes/joinLink.js.map +1 -0
- package/dist/routes/membership.d.ts +116 -0
- package/dist/routes/membership.d.ts.map +1 -0
- package/dist/routes/membership.js +183 -0
- package/dist/routes/membership.js.map +1 -0
- package/dist/routes/notification.d.ts +103 -0
- package/dist/routes/notification.d.ts.map +1 -0
- package/dist/routes/notification.js +89 -0
- package/dist/routes/notification.js.map +1 -0
- package/dist/routes/payment.d.ts +56 -0
- package/dist/routes/payment.d.ts.map +1 -0
- package/dist/routes/payment.js +78 -0
- package/dist/routes/payment.js.map +1 -0
- package/dist/routes/product.d.ts +43 -0
- package/dist/routes/product.d.ts.map +1 -0
- package/dist/routes/product.js +53 -0
- package/dist/routes/product.js.map +1 -0
- package/dist/routes/project.d.ts +821 -0
- package/dist/routes/project.d.ts.map +1 -0
- package/dist/routes/project.js +1153 -0
- package/dist/routes/project.js.map +1 -0
- package/dist/routes/public.d.ts +269 -0
- package/dist/routes/public.d.ts.map +1 -0
- package/dist/routes/public.js +412 -0
- package/dist/routes/public.js.map +1 -0
- package/dist/routes/scratch.d.ts +70 -0
- package/dist/routes/scratch.d.ts.map +1 -0
- package/dist/routes/scratch.js +67 -0
- package/dist/routes/scratch.js.map +1 -0
- package/dist/routes/settings.d.ts +102 -0
- package/dist/routes/settings.d.ts.map +1 -0
- package/dist/routes/settings.js +94 -0
- package/dist/routes/settings.js.map +1 -0
- package/dist/routes/shortlink.d.ts +79 -0
- package/dist/routes/shortlink.d.ts.map +1 -0
- package/dist/routes/shortlink.js +25 -0
- package/dist/routes/shortlink.js.map +1 -0
- package/dist/routes/socket.d.ts +108 -0
- package/dist/routes/socket.d.ts.map +1 -0
- package/dist/routes/socket.js +555 -0
- package/dist/routes/socket.js.map +1 -0
- package/dist/routes/storage.d.ts +44 -0
- package/dist/routes/storage.d.ts.map +1 -0
- package/dist/routes/storage.js +49 -0
- package/dist/routes/storage.js.map +1 -0
- package/dist/routes/subscription.d.ts +184 -0
- package/dist/routes/subscription.d.ts.map +1 -0
- package/dist/routes/subscription.js +219 -0
- package/dist/routes/subscription.js.map +1 -0
- package/dist/routes/supportChat.d.ts +40 -0
- package/dist/routes/supportChat.d.ts.map +1 -0
- package/dist/routes/supportChat.js +53 -0
- package/dist/routes/supportChat.js.map +1 -0
- package/dist/routes/supportTicket.d.ts +89 -0
- package/dist/routes/supportTicket.d.ts.map +1 -0
- package/dist/routes/supportTicket.js +54 -0
- package/dist/routes/supportTicket.js.map +1 -0
- package/dist/routes/tag.d.ts +72 -0
- package/dist/routes/tag.d.ts.map +1 -0
- package/dist/routes/tag.js +81 -0
- package/dist/routes/tag.js.map +1 -0
- package/dist/routes/task.d.ts +252 -0
- package/dist/routes/task.d.ts.map +1 -0
- package/dist/routes/task.js +284 -0
- package/dist/routes/task.js.map +1 -0
- package/dist/routes/taskRelation.d.ts +80 -0
- package/dist/routes/taskRelation.d.ts.map +1 -0
- package/dist/routes/taskRelation.js +71 -0
- package/dist/routes/taskRelation.js.map +1 -0
- package/dist/routes/token.d.ts +75 -0
- package/dist/routes/token.d.ts.map +1 -0
- package/dist/routes/token.js +51 -0
- package/dist/routes/token.js.map +1 -0
- package/dist/routes/user.d.ts +112 -0
- package/dist/routes/user.d.ts.map +1 -0
- package/dist/routes/user.js +151 -0
- package/dist/routes/user.js.map +1 -0
- package/dist/routes/version.d.ts +42 -0
- package/dist/routes/version.d.ts.map +1 -0
- package/dist/routes/version.js +38 -0
- package/dist/routes/version.js.map +1 -0
- package/dist/routes/webhook.d.ts +170 -0
- package/dist/routes/webhook.d.ts.map +1 -0
- package/dist/routes/webhook.js +173 -0
- package/dist/routes/webhook.js.map +1 -0
- package/dist/routes/workspace.d.ts +120 -0
- package/dist/routes/workspace.d.ts.map +1 -0
- package/dist/routes/workspace.js +199 -0
- package/dist/routes/workspace.js.map +1 -0
- package/dist/utils/uploadSessionManager.d.ts +133 -0
- package/dist/utils/uploadSessionManager.d.ts.map +1 -0
- package/dist/utils/uploadSessionManager.js +321 -0
- package/dist/utils/uploadSessionManager.js.map +1 -0
- package/dist/utils/urlParams.d.ts +35 -0
- package/dist/utils/urlParams.d.ts.map +1 -0
- package/dist/utils/urlParams.js +146 -0
- package/dist/utils/urlParams.js.map +1 -0
- package/dist/version.d.ts +15 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +12 -0
- package/dist/version.js.map +1 -0
- package/package.json +87 -3
- package/src/BotClient.ts +113 -0
- package/src/NuramaClient.ts +1193 -0
- package/src/bot-browser-entry.js +15 -0
- package/src/browser-entry.js +20 -0
- package/src/routes/ai.ts +378 -0
- package/src/routes/asset.ts +1104 -0
- package/src/routes/auth.ts +587 -0
- package/src/routes/blogPosts.ts +29 -0
- package/src/routes/board.ts +403 -0
- package/src/routes/bot.ts +257 -0
- package/src/routes/chat.ts +1292 -0
- package/src/routes/chatAi.ts +125 -0
- package/src/routes/config.ts +31 -0
- package/src/routes/convo.ts +321 -0
- package/src/routes/credits.ts +112 -0
- package/src/routes/device.ts +133 -0
- package/src/routes/folder.ts +154 -0
- package/src/routes/invite.ts +133 -0
- package/src/routes/joinLink.ts +100 -0
- package/src/routes/membership.ts +237 -0
- package/src/routes/notification.ts +166 -0
- package/src/routes/payment.ts +104 -0
- package/src/routes/product.ts +67 -0
- package/src/routes/project.ts +1528 -0
- package/src/routes/public.ts +496 -0
- package/src/routes/scratch.ts +94 -0
- package/src/routes/settings.ts +152 -0
- package/src/routes/shortlink.ts +90 -0
- package/src/routes/socket.ts +739 -0
- package/src/routes/storage.ts +83 -0
- package/src/routes/subscription.ts +307 -0
- package/src/routes/supportChat.ts +62 -0
- package/src/routes/supportTicket.ts +114 -0
- package/src/routes/tag.ts +131 -0
- package/src/routes/task.ts +431 -0
- package/src/routes/taskRelation.ts +125 -0
- package/src/routes/token.ts +113 -0
- package/src/routes/user.ts +214 -0
- package/src/routes/version.ts +62 -0
- package/src/routes/webhook.ts +295 -0
- package/src/routes/workspace.ts +223 -0
- package/src/utils/uploadSessionManager.ts +407 -0
- package/src/utils/urlParams.ts +181 -0
- package/src/version.ts +22 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import NuramaClient from '../NuramaClient.js';
|
|
2
|
+
import { type User, type PublicUser } from '@nurama/types';
|
|
3
|
+
export interface FileData {
|
|
4
|
+
name: string;
|
|
5
|
+
checksum: string;
|
|
6
|
+
sizeInMB: number;
|
|
7
|
+
}
|
|
8
|
+
export interface UpdateUserData {
|
|
9
|
+
email?: string;
|
|
10
|
+
userName?: string;
|
|
11
|
+
password?: string;
|
|
12
|
+
firstName?: string;
|
|
13
|
+
middleName?: string;
|
|
14
|
+
lastName?: string;
|
|
15
|
+
company?: string;
|
|
16
|
+
displayName?: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
allowOauthAutolink?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface PreferencesData {
|
|
21
|
+
hide?: string[];
|
|
22
|
+
dismissed?: {
|
|
23
|
+
todos?: string[];
|
|
24
|
+
};
|
|
25
|
+
dailyTips?: {
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
lastShownDate?: string;
|
|
28
|
+
};
|
|
29
|
+
featureIntros?: Record<string, string[]>;
|
|
30
|
+
dateFormat?: 'european' | 'american' | 'iso';
|
|
31
|
+
}
|
|
32
|
+
export interface UserTodo {
|
|
33
|
+
id: string;
|
|
34
|
+
dismissible: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Defines user-related methods for the NuramaClient.
|
|
38
|
+
* @param {NuramaClient} client - The NuramaClient instance.
|
|
39
|
+
* @returns {object} An object containing the user-related methods.
|
|
40
|
+
*/
|
|
41
|
+
export default function createUserMethods(client: NuramaClient): {
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves the public profile of a specific user.
|
|
44
|
+
* Requires authentication.
|
|
45
|
+
* @param {string} userId - The ID of the user to retrieve.
|
|
46
|
+
* @returns {Promise<object>} Public user object.
|
|
47
|
+
*/
|
|
48
|
+
getUser(userId: string): Promise<PublicUser>;
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the current user's profile.
|
|
51
|
+
* Requires authentication.
|
|
52
|
+
* @returns {Promise<PublicUser>} The current user's profile.
|
|
53
|
+
* @throws {Error} If no user ID is found in the token.
|
|
54
|
+
*/
|
|
55
|
+
getSelf(): Promise<PublicUser>;
|
|
56
|
+
/**
|
|
57
|
+
* Deletes the current user.
|
|
58
|
+
* Requires authentication.
|
|
59
|
+
* @returns {Promise<void>}
|
|
60
|
+
*/
|
|
61
|
+
deleteCurrentUser(): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Updates the user's avatar.
|
|
64
|
+
* @param {object} fileData - File metadata (e.g., { name, checksum, sizeInMB }).
|
|
65
|
+
* @returns {Promise<object>} Object containing signed URL data and updated user info.
|
|
66
|
+
*/
|
|
67
|
+
updateAvatar(fileData: FileData): Promise<any>;
|
|
68
|
+
/**
|
|
69
|
+
* Creates a new avatar for the user.
|
|
70
|
+
* @param {object} fileData - File metadata (e.g., { name, checksum, sizeInMB }).
|
|
71
|
+
* @returns {Promise<object>} Object containing signed URL data and updated user info.
|
|
72
|
+
*/
|
|
73
|
+
createAvatar(fileData: FileData): Promise<any>;
|
|
74
|
+
/**
|
|
75
|
+
* Updates the user's preferences.
|
|
76
|
+
* @param {object} preferenceData - Preference data to update (e.g., { hide: ['feedHint'] }).
|
|
77
|
+
* @returns {Promise<object>} Updated user object.
|
|
78
|
+
*/
|
|
79
|
+
updatePreferences(preferenceData: PreferencesData): Promise<User>;
|
|
80
|
+
/**
|
|
81
|
+
* Record that the current user has seen a one-time UI element (welcome
|
|
82
|
+
* video, tutorial coachmark). Idempotent. Returns the updated user.
|
|
83
|
+
* @param {string} element - one-time element key (see backend oneTimeElements).
|
|
84
|
+
*/
|
|
85
|
+
markSeen(element: string): Promise<User>;
|
|
86
|
+
/**
|
|
87
|
+
* Remove one-time UI elements from the current user's `hasSeen` so they
|
|
88
|
+
* display again. Pass specific element keys, or omit to clear ALL.
|
|
89
|
+
* Returns the updated user.
|
|
90
|
+
* @param {string[]} [elements] - elements to remove; omit to clear all.
|
|
91
|
+
*/
|
|
92
|
+
unmarkSeen(elements?: string[]): Promise<User>;
|
|
93
|
+
/**
|
|
94
|
+
* Updates the logged-in user's profile.
|
|
95
|
+
* Requires authentication.
|
|
96
|
+
* At least one field must be provided.
|
|
97
|
+
* @param {UpdateUserData} updateData - The user data fields to update.
|
|
98
|
+
* @returns {Promise<User>} The updated user object.
|
|
99
|
+
*/
|
|
100
|
+
updateSelf(updateData: UpdateUserData): Promise<User>;
|
|
101
|
+
/**
|
|
102
|
+
* Get the current user's active site-level Todos for the onboarding
|
|
103
|
+
* drawer. Returns only todos whose completion condition isn't met and
|
|
104
|
+
* (for dismissibles) that the user hasn't opted out of. Server
|
|
105
|
+
* computes from live state — no caching on the server side, so a
|
|
106
|
+
* fresh call always reflects ground truth.
|
|
107
|
+
*/
|
|
108
|
+
getTodos(): Promise<{
|
|
109
|
+
todos: UserTodo[];
|
|
110
|
+
}>;
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/routes/user.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC5B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAMhB,SAAS,CAAC,EAAE;QACV,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IAIF,SAAS,CAAC,EAAE;QACV,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAGF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAIzC,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,KAAK,CAAC;CAEhD;AAKD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,MAAM,EAAE,YAAY;IAG1D;;;;;OAKG;oBACmB,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAWlD;;;;;OAKG;eACc,OAAO,CAAC,UAAU,CAAC;IAQpC;;;;OAIG;yBACwB,OAAO,CAAC,IAAI,CAAC;IAOxC;;;;OAIG;2BAC0B,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAQpD;;;;OAIG;2BAC0B,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAQpD;;;;OAIG;sCACqC,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IASvE;;;;OAIG;sBACqB,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS9C;;;;;OAKG;0BACyB,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IASpD;;;;;;OAMG;2BAC0B,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAa3D;;;;;;OAMG;gBACe,OAAO,CAAC;QAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAC;EAQnD"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines user-related methods for the NuramaClient.
|
|
3
|
+
* @param {NuramaClient} client - The NuramaClient instance.
|
|
4
|
+
* @returns {object} An object containing the user-related methods.
|
|
5
|
+
*/
|
|
6
|
+
export default function createUserMethods(client) {
|
|
7
|
+
// Specify return type more accurately if possible, using UserMethods interface
|
|
8
|
+
return {
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves the public profile of a specific user.
|
|
11
|
+
* Requires authentication.
|
|
12
|
+
* @param {string} userId - The ID of the user to retrieve.
|
|
13
|
+
* @returns {Promise<object>} Public user object.
|
|
14
|
+
*/
|
|
15
|
+
async getUser(userId) {
|
|
16
|
+
if (!userId) {
|
|
17
|
+
throw new Error('userId is required.');
|
|
18
|
+
}
|
|
19
|
+
return client._request({
|
|
20
|
+
method: 'GET',
|
|
21
|
+
endpoint: `/v1/users/${userId}`,
|
|
22
|
+
sendJWT: true,
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves the current user's profile.
|
|
27
|
+
* Requires authentication.
|
|
28
|
+
* @returns {Promise<PublicUser>} The current user's profile.
|
|
29
|
+
* @throws {Error} If no user ID is found in the token.
|
|
30
|
+
*/
|
|
31
|
+
async getSelf() {
|
|
32
|
+
return client._request({
|
|
33
|
+
method: 'GET',
|
|
34
|
+
endpoint: '/v1/users',
|
|
35
|
+
sendJWT: true,
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Deletes the current user.
|
|
40
|
+
* Requires authentication.
|
|
41
|
+
* @returns {Promise<void>}
|
|
42
|
+
*/
|
|
43
|
+
async deleteCurrentUser() {
|
|
44
|
+
return client._request({
|
|
45
|
+
method: 'DELETE',
|
|
46
|
+
endpoint: '/v1/users',
|
|
47
|
+
sendJWT: true,
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Updates the user's avatar.
|
|
52
|
+
* @param {object} fileData - File metadata (e.g., { name, checksum, sizeInMB }).
|
|
53
|
+
* @returns {Promise<object>} Object containing signed URL data and updated user info.
|
|
54
|
+
*/
|
|
55
|
+
async updateAvatar(fileData) {
|
|
56
|
+
return client._request({
|
|
57
|
+
method: 'PUT',
|
|
58
|
+
endpoint: '/v1/users/avatar',
|
|
59
|
+
body: fileData,
|
|
60
|
+
sendJWT: true,
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* Creates a new avatar for the user.
|
|
65
|
+
* @param {object} fileData - File metadata (e.g., { name, checksum, sizeInMB }).
|
|
66
|
+
* @returns {Promise<object>} Object containing signed URL data and updated user info.
|
|
67
|
+
*/
|
|
68
|
+
async createAvatar(fileData) {
|
|
69
|
+
return client._request({
|
|
70
|
+
method: 'POST',
|
|
71
|
+
endpoint: '/v1/users/avatar',
|
|
72
|
+
body: fileData,
|
|
73
|
+
sendJWT: true,
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Updates the user's preferences.
|
|
78
|
+
* @param {object} preferenceData - Preference data to update (e.g., { hide: ['feedHint'] }).
|
|
79
|
+
* @returns {Promise<object>} Updated user object.
|
|
80
|
+
*/
|
|
81
|
+
async updatePreferences(preferenceData) {
|
|
82
|
+
return client._request({
|
|
83
|
+
method: 'PATCH',
|
|
84
|
+
endpoint: '/v1/users/preferences',
|
|
85
|
+
body: preferenceData,
|
|
86
|
+
sendJWT: true,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Record that the current user has seen a one-time UI element (welcome
|
|
91
|
+
* video, tutorial coachmark). Idempotent. Returns the updated user.
|
|
92
|
+
* @param {string} element - one-time element key (see backend oneTimeElements).
|
|
93
|
+
*/
|
|
94
|
+
async markSeen(element) {
|
|
95
|
+
return client._request({
|
|
96
|
+
method: 'POST',
|
|
97
|
+
endpoint: '/v1/users/has-seen',
|
|
98
|
+
body: { element },
|
|
99
|
+
sendJWT: true,
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* Remove one-time UI elements from the current user's `hasSeen` so they
|
|
104
|
+
* display again. Pass specific element keys, or omit to clear ALL.
|
|
105
|
+
* Returns the updated user.
|
|
106
|
+
* @param {string[]} [elements] - elements to remove; omit to clear all.
|
|
107
|
+
*/
|
|
108
|
+
async unmarkSeen(elements) {
|
|
109
|
+
return client._request({
|
|
110
|
+
method: 'DELETE',
|
|
111
|
+
endpoint: '/v1/users/has-seen',
|
|
112
|
+
body: elements ? { elements } : {},
|
|
113
|
+
sendJWT: true,
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* Updates the logged-in user's profile.
|
|
118
|
+
* Requires authentication.
|
|
119
|
+
* At least one field must be provided.
|
|
120
|
+
* @param {UpdateUserData} updateData - The user data fields to update.
|
|
121
|
+
* @returns {Promise<User>} The updated user object.
|
|
122
|
+
*/
|
|
123
|
+
async updateSelf(updateData) {
|
|
124
|
+
// Ensure at least one key is present, matching backend validation .min(1)
|
|
125
|
+
if (Object.keys(updateData).length === 0) {
|
|
126
|
+
throw new Error('At least one field must be provided to update the user.');
|
|
127
|
+
}
|
|
128
|
+
return client._request({
|
|
129
|
+
method: 'PATCH',
|
|
130
|
+
endpoint: '/v1/users', // Endpoint for updating the logged-in user
|
|
131
|
+
body: updateData,
|
|
132
|
+
sendJWT: true,
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* Get the current user's active site-level Todos for the onboarding
|
|
137
|
+
* drawer. Returns only todos whose completion condition isn't met and
|
|
138
|
+
* (for dismissibles) that the user hasn't opted out of. Server
|
|
139
|
+
* computes from live state — no caching on the server side, so a
|
|
140
|
+
* fresh call always reflects ground truth.
|
|
141
|
+
*/
|
|
142
|
+
async getTodos() {
|
|
143
|
+
return client._request({
|
|
144
|
+
method: 'GET',
|
|
145
|
+
endpoint: '/v1/users/todos',
|
|
146
|
+
sendJWT: true,
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/routes/user.ts"],"names":[],"mappings":"AA0DA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,MAAoB;IAC5D,+EAA+E;IAC/E,OAAO;QACL;;;;;WAKG;QAC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|
|
|
1
|
+
import NuramaClient from '../NuramaClient.js';
|
|
2
|
+
export interface CommitResponse {
|
|
3
|
+
buildCommit: string;
|
|
4
|
+
}
|
|
5
|
+
export interface HealthStatus {
|
|
6
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
7
|
+
/** Epoch milliseconds when the check ran. */
|
|
8
|
+
timestamp: number;
|
|
9
|
+
/** Process uptime in seconds. */
|
|
10
|
+
uptime: number;
|
|
11
|
+
/** Present when status is `degraded` or `unhealthy`. */
|
|
12
|
+
reason?: string;
|
|
13
|
+
postgres: {
|
|
14
|
+
status: 'connected' | 'disconnected';
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
memory: Record<string, unknown>;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Defines version-related methods for the NuramaClient.
|
|
22
|
+
* @param {NuramaClient} client - The NuramaClient instance.
|
|
23
|
+
* @returns {object} An object containing the version-related methods.
|
|
24
|
+
*/
|
|
25
|
+
export default function createVersionMethods(client: NuramaClient): {
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves the latest git commit hash of the deployed application.
|
|
28
|
+
* This is a public endpoint and does not require authentication.
|
|
29
|
+
* @returns {Promise<CommitResponse>} An object containing the buildCommit hash.
|
|
30
|
+
*/
|
|
31
|
+
getCommitHash(): Promise<CommitResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the API health report (database connectivity, memory, uptime).
|
|
34
|
+
* Public endpoint. Resolves normally for `healthy` and `degraded`; the API
|
|
35
|
+
* responds 503 for `unhealthy`, which surfaces as a thrown error with `status: 503`
|
|
36
|
+
* and the report on `data`.
|
|
37
|
+
* @returns {Promise<HealthStatus>} The health report.
|
|
38
|
+
*/
|
|
39
|
+
getHealth(): Promise<HealthStatus>;
|
|
40
|
+
};
|
|
41
|
+
export type VersionMethods = ReturnType<typeof createVersionMethods>;
|
|
42
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/routes/version.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAG9C,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;IAC7C,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QAAE,MAAM,EAAE,WAAW,GAAG,cAAc,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC3E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAID;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAM,EAAE,YAAY;IAE7D;;;;OAIG;qBACoB,OAAO,CAAC,cAAc,CAAC;IAQ9C;;;;;;OAMG;iBACgB,OAAO,CAAC,YAAY,CAAC;EAS3C;AAGD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// --- Method Definitions ---
|
|
2
|
+
/**
|
|
3
|
+
* Defines version-related methods for the NuramaClient.
|
|
4
|
+
* @param {NuramaClient} client - The NuramaClient instance.
|
|
5
|
+
* @returns {object} An object containing the version-related methods.
|
|
6
|
+
*/
|
|
7
|
+
export default function createVersionMethods(client) {
|
|
8
|
+
return {
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves the latest git commit hash of the deployed application.
|
|
11
|
+
* This is a public endpoint and does not require authentication.
|
|
12
|
+
* @returns {Promise<CommitResponse>} An object containing the buildCommit hash.
|
|
13
|
+
*/
|
|
14
|
+
async getCommitHash() {
|
|
15
|
+
return client._request({
|
|
16
|
+
method: 'GET',
|
|
17
|
+
endpoint: '/v1/version/commit',
|
|
18
|
+
sendJWT: false,
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves the API health report (database connectivity, memory, uptime).
|
|
23
|
+
* Public endpoint. Resolves normally for `healthy` and `degraded`; the API
|
|
24
|
+
* responds 503 for `unhealthy`, which surfaces as a thrown error with `status: 503`
|
|
25
|
+
* and the report on `data`.
|
|
26
|
+
* @returns {Promise<HealthStatus>} The health report.
|
|
27
|
+
*/
|
|
28
|
+
async getHealth() {
|
|
29
|
+
return client._request({
|
|
30
|
+
method: 'GET',
|
|
31
|
+
endpoint: '/v1/version/health',
|
|
32
|
+
sendJWT: false,
|
|
33
|
+
bypassCache: true,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/routes/version.ts"],"names":[],"mappings":"AAoBA,6BAA6B;AAE7B;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAoB;IAC/D,OAAO;QACL;;;;WAIG;QACH,KAAK,CAAC,aAAa;YACjB,OAAO,MAAM,CAAC,QAAQ,CAAiB;gBACrC,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,oBAAoB;gBAC9B,OAAO,EAAE,KAAK;aACf,CAAC,CAAC;QACL,CAAC;QAED;;;;;;WAMG;QACH,KAAK,CAAC,SAAS;YACb,OAAO,MAAM,CAAC,QAAQ,CAAe;gBACnC,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,oBAAoB;gBAC9B,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,IAAI;aAClB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import NuramaClient from '../NuramaClient.js';
|
|
2
|
+
/**
|
|
3
|
+
* Wire-format webhook event names. Mirrors the backend's
|
|
4
|
+
* `@config/webhookEvents` registry. New events land here and on the
|
|
5
|
+
* backend together; the additive-only payload contract means receivers
|
|
6
|
+
* pinned to a specific event name keep working as fields are added.
|
|
7
|
+
*/
|
|
8
|
+
export type WebhookEvent = 'task.created' | 'task.updated' | 'task.deleted' | 'chat.message.created' | 'asset.published' | 'webhook.test';
|
|
9
|
+
export type WebhookSubscriptionStatus = 'active' | 'paused' | 'failedOut';
|
|
10
|
+
/**
|
|
11
|
+
* Public shape of a webhook subscription. Never includes the signing
|
|
12
|
+
* secret or the encrypted ciphertext — those are server-only fields.
|
|
13
|
+
*/
|
|
14
|
+
export interface WebhookSubscription {
|
|
15
|
+
id: string;
|
|
16
|
+
workspaceId: string;
|
|
17
|
+
appId?: string | null;
|
|
18
|
+
name: string;
|
|
19
|
+
url: string;
|
|
20
|
+
events: WebhookEvent[];
|
|
21
|
+
status: WebhookSubscriptionStatus;
|
|
22
|
+
failedOutAt?: string | null;
|
|
23
|
+
failedOutReason?: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Optional expiration. When set and in the past, the worker stops
|
|
26
|
+
* fanning new attempts to this subscription, and any in-flight
|
|
27
|
+
* attempts DLQ with a clear reason rather than retrying. Null = no
|
|
28
|
+
* expiry; the subscription delivers indefinitely until manually
|
|
29
|
+
* paused or deleted.
|
|
30
|
+
*/
|
|
31
|
+
expiresAt?: string | null;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
createdById: string;
|
|
35
|
+
lastDeliveryAt?: string | null;
|
|
36
|
+
lastSuccessAt?: string | null;
|
|
37
|
+
lastFailureAt?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface CreateWebhookData {
|
|
40
|
+
name: string;
|
|
41
|
+
url: string;
|
|
42
|
+
events: WebhookEvent[];
|
|
43
|
+
/** Optional ISO timestamp. Must be in the future when set. */
|
|
44
|
+
expiresAt?: string | null;
|
|
45
|
+
}
|
|
46
|
+
export interface UpdateWebhookData {
|
|
47
|
+
name?: string;
|
|
48
|
+
url?: string;
|
|
49
|
+
events?: WebhookEvent[];
|
|
50
|
+
status?: 'active' | 'paused';
|
|
51
|
+
/** Pass null to clear an existing expiry; pass a future ISO date to set / extend. */
|
|
52
|
+
expiresAt?: string | null;
|
|
53
|
+
}
|
|
54
|
+
export interface CreateWebhookResponse {
|
|
55
|
+
subscription: WebhookSubscription;
|
|
56
|
+
/**
|
|
57
|
+
* The HMAC signing secret. Returned ONLY here (and from
|
|
58
|
+
* `rotateWebhookSecret`). The server keeps the ciphertext on the row
|
|
59
|
+
* and cannot recover the plaintext later — the customer must capture
|
|
60
|
+
* it now or rotate.
|
|
61
|
+
*/
|
|
62
|
+
signingSecret: string;
|
|
63
|
+
}
|
|
64
|
+
export interface RotateWebhookSecretResponse extends CreateWebhookResponse {
|
|
65
|
+
}
|
|
66
|
+
export type WebhookAttemptStatus = 'pending' | 'inflight' | 'succeeded' | 'failed' | 'dlq';
|
|
67
|
+
export interface WebhookAttempt {
|
|
68
|
+
id: string;
|
|
69
|
+
notificationId: string;
|
|
70
|
+
subscriptionId: string;
|
|
71
|
+
attempt: number;
|
|
72
|
+
maxAttempts: number;
|
|
73
|
+
status: WebhookAttemptStatus;
|
|
74
|
+
signatureV1: string;
|
|
75
|
+
scheduledAt: string;
|
|
76
|
+
startedAt?: string | null;
|
|
77
|
+
deliveredAt?: string | null;
|
|
78
|
+
nextRetryAt?: string | null;
|
|
79
|
+
responseCode?: number | null;
|
|
80
|
+
responseBody?: string | null;
|
|
81
|
+
responseHeaders?: Record<string, any> | null;
|
|
82
|
+
errorMessage?: string | null;
|
|
83
|
+
createdAt: string;
|
|
84
|
+
updatedAt: string;
|
|
85
|
+
}
|
|
86
|
+
export interface ListDeliveriesParams {
|
|
87
|
+
limit?: number;
|
|
88
|
+
cursor?: string;
|
|
89
|
+
status?: WebhookAttemptStatus;
|
|
90
|
+
}
|
|
91
|
+
export interface ListDeliveriesResponse {
|
|
92
|
+
items: WebhookAttempt[];
|
|
93
|
+
nextCursor: string | null;
|
|
94
|
+
}
|
|
95
|
+
export interface TestWebhookResponse {
|
|
96
|
+
queued: true;
|
|
97
|
+
message: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Outbound webhook subscription management. Admin-gated server-side
|
|
101
|
+
* by `canManageWebhooks`. All operations are workspace-scoped — there
|
|
102
|
+
* is no app-owned surface here yet (Phase 3 / OAuth).
|
|
103
|
+
*/
|
|
104
|
+
export default function createWebhookMethods(client: NuramaClient): {
|
|
105
|
+
/**
|
|
106
|
+
* Create a webhook subscription. The signing secret is in the
|
|
107
|
+
* response's `secret` field — store it immediately, it cannot be
|
|
108
|
+
* retrieved again.
|
|
109
|
+
*
|
|
110
|
+
* @requires `canManageWebhooks` on the workspace.
|
|
111
|
+
*/
|
|
112
|
+
createWebhook(workspaceId: string, data: CreateWebhookData): Promise<CreateWebhookResponse>;
|
|
113
|
+
/**
|
|
114
|
+
* List webhook subscriptions in a workspace. Secrets are never returned.
|
|
115
|
+
*
|
|
116
|
+
* @requires `canManageWebhooks` on the workspace.
|
|
117
|
+
*/
|
|
118
|
+
listWebhooks(workspaceId: string): Promise<WebhookSubscription[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Fetch a single webhook subscription by id.
|
|
121
|
+
*
|
|
122
|
+
* @requires `canManageWebhooks` on the workspace.
|
|
123
|
+
*/
|
|
124
|
+
getWebhook(workspaceId: string, webhookId: string): Promise<WebhookSubscription>;
|
|
125
|
+
/**
|
|
126
|
+
* Update a webhook subscription's url, event filter, or active state.
|
|
127
|
+
*
|
|
128
|
+
* @requires `canManageWebhooks` on the workspace.
|
|
129
|
+
*/
|
|
130
|
+
updateWebhook(workspaceId: string, webhookId: string, data: UpdateWebhookData): Promise<WebhookSubscription>;
|
|
131
|
+
/**
|
|
132
|
+
* Delete a webhook subscription. In-flight deliveries continue to
|
|
133
|
+
* the receiver until they exhaust retries; no new deliveries fire.
|
|
134
|
+
*
|
|
135
|
+
* @requires `canManageWebhooks` on the workspace.
|
|
136
|
+
*/
|
|
137
|
+
deleteWebhook(workspaceId: string, webhookId: string): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Generate a new HMAC signing secret for a subscription and return
|
|
140
|
+
* it once. The old secret is invalidated immediately.
|
|
141
|
+
*
|
|
142
|
+
* @requires `canManageWebhooks` on the workspace.
|
|
143
|
+
*/
|
|
144
|
+
rotateWebhookSecret(workspaceId: string, webhookId: string): Promise<RotateWebhookSecretResponse>;
|
|
145
|
+
/**
|
|
146
|
+
* Fire a synthetic `webhook.test` delivery to the subscription's
|
|
147
|
+
* URL. The receiver gets a small payload they can use to verify
|
|
148
|
+
* their HMAC + parsing setup. Returns immediately; check the
|
|
149
|
+
* delivery log for the outcome.
|
|
150
|
+
*/
|
|
151
|
+
testWebhook(workspaceId: string, webhookId: string): Promise<TestWebhookResponse>;
|
|
152
|
+
/**
|
|
153
|
+
* Paginated list of delivery attempts for a webhook subscription.
|
|
154
|
+
* Useful for diagnosing failures (HTTP status, response body snippet,
|
|
155
|
+
* retry timing).
|
|
156
|
+
*
|
|
157
|
+
* @requires `canManageWebhooks` on the workspace.
|
|
158
|
+
*/
|
|
159
|
+
listWebhookDeliveries(workspaceId: string, webhookId: string, params?: ListDeliveriesParams): Promise<ListDeliveriesResponse>;
|
|
160
|
+
/**
|
|
161
|
+
* Re-fire a specific past delivery attempt. Useful for confirming a
|
|
162
|
+
* receiver fix without waiting for the next real event.
|
|
163
|
+
*
|
|
164
|
+
* @requires `canManageWebhooks` on the workspace.
|
|
165
|
+
*/
|
|
166
|
+
replayWebhookDelivery(workspaceId: string, webhookId: string, attemptId: string): Promise<{
|
|
167
|
+
attempt: WebhookAttempt;
|
|
168
|
+
}>;
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=webhook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/routes/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,cAAc,GACd,cAAc,GACd,sBAAsB,GACtB,iBAAiB,GACjB,cAAc,CAAC;AAEnB,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,EAAE,yBAAyB,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,8DAA8D;IAC9D,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