@tuturuuu/internal-api 0.0.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.
- package/dist/ai.d.ts +43 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +57 -0
- package/dist/auth.d.ts +46 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +47 -0
- package/dist/calendar.d.ts +99 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +94 -0
- package/dist/chat.d.ts +46 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +67 -0
- package/dist/client.d.ts +35 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +216 -0
- package/dist/education.d.ts +167 -0
- package/dist/education.d.ts.map +1 -0
- package/dist/education.js +288 -0
- package/dist/external-projects.d.ts +425 -0
- package/dist/external-projects.d.ts.map +1 -0
- package/dist/external-projects.js +466 -0
- package/dist/finance.d.ts +109 -0
- package/dist/finance.d.ts.map +1 -0
- package/dist/finance.js +143 -0
- package/dist/habit-trackers.d.ts +25 -0
- package/dist/habit-trackers.d.ts.map +1 -0
- package/dist/habit-trackers.js +108 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +280 -0
- package/dist/infrastructure.d.ts +354 -0
- package/dist/infrastructure.d.ts.map +1 -0
- package/dist/infrastructure.js +100 -0
- package/dist/inquiries.d.ts +12 -0
- package/dist/inquiries.d.ts.map +1 -0
- package/dist/inquiries.js +28 -0
- package/dist/mail.d.ts +19 -0
- package/dist/mail.d.ts.map +1 -0
- package/dist/mail.js +12 -0
- package/dist/nova.d.ts +5 -0
- package/dist/nova.d.ts.map +1 -0
- package/dist/nova.js +10 -0
- package/dist/posts.d.ts +9 -0
- package/dist/posts.d.ts.map +1 -0
- package/dist/posts.js +15 -0
- package/dist/promotions.d.ts +11 -0
- package/dist/promotions.d.ts.map +1 -0
- package/dist/promotions.js +15 -0
- package/dist/reports.d.ts +42 -0
- package/dist/reports.d.ts.map +1 -0
- package/dist/reports.js +48 -0
- package/dist/roles.d.ts +45 -0
- package/dist/roles.d.ts.map +1 -0
- package/dist/roles.js +96 -0
- package/dist/settings.d.ts +48 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +66 -0
- package/dist/storage.d.ts +187 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +371 -0
- package/dist/tasks-scheduling.d.ts +14 -0
- package/dist/tasks-scheduling.d.ts.map +1 -0
- package/dist/tasks-scheduling.js +14 -0
- package/dist/tasks.d.ts +311 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +396 -0
- package/dist/templates.d.ts +48 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +19 -0
- package/dist/time-tracking.d.ts +88 -0
- package/dist/time-tracking.d.ts.map +1 -0
- package/dist/time-tracking.js +101 -0
- package/dist/users-feedbacks.d.ts +66 -0
- package/dist/users-feedbacks.d.ts.map +1 -0
- package/dist/users-feedbacks.js +46 -0
- package/dist/users.d.ts +89 -0
- package/dist/users.d.ts.map +1 -0
- package/dist/users.js +139 -0
- package/dist/workspace-configs.d.ts +24 -0
- package/dist/workspace-configs.d.ts.map +1 -0
- package/dist/workspace-configs.js +76 -0
- package/dist/workspace-user-audit.d.ts +66 -0
- package/dist/workspace-user-audit.d.ts.map +1 -0
- package/dist/workspace-user-audit.js +23 -0
- package/dist/workspaces.d.ts +59 -0
- package/dist/workspaces.d.ts.map +1 -0
- package/dist/workspaces.js +131 -0
- package/package.json +141 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type InternalApiClientOptions, type InternalApiQuery } from './client';
|
|
2
|
+
export interface ListWorkspaceUserFeedbacksParams extends InternalApiQuery {
|
|
3
|
+
q?: string;
|
|
4
|
+
page?: number;
|
|
5
|
+
pageSize?: number;
|
|
6
|
+
requireAttention?: 'all' | 'true' | 'false';
|
|
7
|
+
groupId?: string;
|
|
8
|
+
userId?: string;
|
|
9
|
+
creatorId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface WorkspaceUserFeedbackRecord {
|
|
12
|
+
id: string;
|
|
13
|
+
user_id: string;
|
|
14
|
+
group_id: string;
|
|
15
|
+
creator_id: string | null;
|
|
16
|
+
content: string;
|
|
17
|
+
require_attention: boolean;
|
|
18
|
+
created_at: string;
|
|
19
|
+
user: {
|
|
20
|
+
id: string | null;
|
|
21
|
+
full_name: string | null;
|
|
22
|
+
display_name: string | null;
|
|
23
|
+
email: string | null;
|
|
24
|
+
} | null;
|
|
25
|
+
creator: {
|
|
26
|
+
id: string | null;
|
|
27
|
+
full_name: string | null;
|
|
28
|
+
display_name: string | null;
|
|
29
|
+
email: string | null;
|
|
30
|
+
} | null;
|
|
31
|
+
group: {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string | null;
|
|
34
|
+
} | null;
|
|
35
|
+
user_name: string;
|
|
36
|
+
creator_name: string;
|
|
37
|
+
group_name: string;
|
|
38
|
+
}
|
|
39
|
+
export interface WorkspaceUserFeedbacksResponse {
|
|
40
|
+
data: WorkspaceUserFeedbackRecord[];
|
|
41
|
+
count: number;
|
|
42
|
+
page: number;
|
|
43
|
+
pageSize: number;
|
|
44
|
+
totalPages: number;
|
|
45
|
+
}
|
|
46
|
+
export interface CreateWorkspaceUserFeedbackPayload {
|
|
47
|
+
userId: string;
|
|
48
|
+
groupId: string;
|
|
49
|
+
content: string;
|
|
50
|
+
require_attention?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface UpdateWorkspaceUserFeedbackPayload {
|
|
53
|
+
content: string;
|
|
54
|
+
require_attention?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export declare function listWorkspaceUserFeedbacks(workspaceId: string, params?: ListWorkspaceUserFeedbacksParams, options?: InternalApiClientOptions): Promise<WorkspaceUserFeedbacksResponse>;
|
|
57
|
+
export declare function createWorkspaceUserFeedback(workspaceId: string, payload: CreateWorkspaceUserFeedbackPayload, options?: InternalApiClientOptions): Promise<{
|
|
58
|
+
message: string;
|
|
59
|
+
}>;
|
|
60
|
+
export declare function updateWorkspaceUserFeedback(workspaceId: string, feedbackId: string, payload: UpdateWorkspaceUserFeedbackPayload, options?: InternalApiClientOptions): Promise<{
|
|
61
|
+
message: string;
|
|
62
|
+
}>;
|
|
63
|
+
export declare function deleteWorkspaceUserFeedback(workspaceId: string, feedbackId: string, options?: InternalApiClientOptions): Promise<{
|
|
64
|
+
message: string;
|
|
65
|
+
}>;
|
|
66
|
+
//# sourceMappingURL=users-feedbacks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users-feedbacks.d.ts","sourceRoot":"","sources":["../src/users-feedbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,gCAAiC,SAAQ,gBAAgB;IACxE,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;QAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,YAAY,EAAE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AAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,kCAAkC,EAC3C,OAAO,CAAC,EAAE,wBAAwB;aAIJ,MAAM;GAUrC;AAED,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,wBAAwB;aAIJ,MAAM;GAMrC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listWorkspaceUserFeedbacks = listWorkspaceUserFeedbacks;
|
|
4
|
+
exports.createWorkspaceUserFeedback = createWorkspaceUserFeedback;
|
|
5
|
+
exports.updateWorkspaceUserFeedback = updateWorkspaceUserFeedback;
|
|
6
|
+
exports.deleteWorkspaceUserFeedback = deleteWorkspaceUserFeedback;
|
|
7
|
+
const client_1 = require("./client");
|
|
8
|
+
function buildWorkspaceFeedbackPath(workspaceId, feedbackId) {
|
|
9
|
+
const base = `/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/users/feedbacks`;
|
|
10
|
+
return feedbackId
|
|
11
|
+
? `${base}?feedbackId=${encodeURIComponent(feedbackId)}`
|
|
12
|
+
: base;
|
|
13
|
+
}
|
|
14
|
+
async function listWorkspaceUserFeedbacks(workspaceId, params = {}, options) {
|
|
15
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
16
|
+
return client.json(buildWorkspaceFeedbackPath(workspaceId), {
|
|
17
|
+
cache: 'no-store',
|
|
18
|
+
query: params,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async function createWorkspaceUserFeedback(workspaceId, payload, options) {
|
|
22
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
23
|
+
return client.json(buildWorkspaceFeedbackPath(workspaceId), {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
headers: {
|
|
26
|
+
'Content-Type': 'application/json',
|
|
27
|
+
},
|
|
28
|
+
body: JSON.stringify(payload),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async function updateWorkspaceUserFeedback(workspaceId, feedbackId, payload, options) {
|
|
32
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
33
|
+
return client.json(buildWorkspaceFeedbackPath(workspaceId, feedbackId), {
|
|
34
|
+
method: 'PUT',
|
|
35
|
+
headers: {
|
|
36
|
+
'Content-Type': 'application/json',
|
|
37
|
+
},
|
|
38
|
+
body: JSON.stringify(payload),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async function deleteWorkspaceUserFeedback(workspaceId, feedbackId, options) {
|
|
42
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
43
|
+
return client.json(buildWorkspaceFeedbackPath(workspaceId, feedbackId), {
|
|
44
|
+
method: 'DELETE',
|
|
45
|
+
});
|
|
46
|
+
}
|
package/dist/users.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type InternalApiClientOptions } from './client';
|
|
2
|
+
type UserConfigResponse = {
|
|
3
|
+
value: string | null;
|
|
4
|
+
};
|
|
5
|
+
export type CurrentUserProfileResponse = {
|
|
6
|
+
id: string;
|
|
7
|
+
email: string | null;
|
|
8
|
+
display_name: string | null;
|
|
9
|
+
avatar_url: string | null;
|
|
10
|
+
full_name: string | null;
|
|
11
|
+
new_email: string | null;
|
|
12
|
+
created_at: string;
|
|
13
|
+
default_workspace_id: string | null;
|
|
14
|
+
};
|
|
15
|
+
export type CurrentUserDefaultWorkspaceResponse = {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
personal?: boolean | null;
|
|
19
|
+
} | null;
|
|
20
|
+
export interface WorkspaceAttendanceExportRecord {
|
|
21
|
+
date: string;
|
|
22
|
+
groupId: string;
|
|
23
|
+
groupName: string | null;
|
|
24
|
+
notes: string;
|
|
25
|
+
status: string;
|
|
26
|
+
userDisplayName: string | null;
|
|
27
|
+
userEmail: string | null;
|
|
28
|
+
userFullName: string | null;
|
|
29
|
+
userId: string;
|
|
30
|
+
userName: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ListWorkspaceAttendanceExportResponse {
|
|
33
|
+
count: number;
|
|
34
|
+
data: WorkspaceAttendanceExportRecord[];
|
|
35
|
+
nextOffset?: number;
|
|
36
|
+
}
|
|
37
|
+
export type UpdateCurrentUserDefaultWorkspaceResponse = {
|
|
38
|
+
success: boolean;
|
|
39
|
+
};
|
|
40
|
+
type CurrentUserAvatarUploadUrlResponse = {
|
|
41
|
+
uploadUrl: string;
|
|
42
|
+
publicUrl: string;
|
|
43
|
+
};
|
|
44
|
+
export type UploadCurrentUserAvatarResult = {
|
|
45
|
+
publicUrl: string;
|
|
46
|
+
finalizeOk: boolean;
|
|
47
|
+
finalizeError?: string;
|
|
48
|
+
};
|
|
49
|
+
export type UpdateCurrentUserProfilePayload = {
|
|
50
|
+
avatar_url?: string | null;
|
|
51
|
+
display_name?: string | null;
|
|
52
|
+
full_name?: string | null;
|
|
53
|
+
};
|
|
54
|
+
export interface CreateSupportInquiryPayload {
|
|
55
|
+
name: string;
|
|
56
|
+
email: string;
|
|
57
|
+
type: 'bug' | 'feature-request' | 'support' | 'job-application';
|
|
58
|
+
product: 'web' | 'nova' | 'rewise' | 'calendar' | 'finance' | 'tudo' | 'tumeet' | 'shortener' | 'qr' | 'drive' | 'mail' | 'other';
|
|
59
|
+
subject: string;
|
|
60
|
+
message: string;
|
|
61
|
+
}
|
|
62
|
+
export declare function getUserConfig(configId: string, options?: InternalApiClientOptions): Promise<UserConfigResponse>;
|
|
63
|
+
export declare function updateUserConfig(configId: string, value: string, options?: InternalApiClientOptions): Promise<{
|
|
64
|
+
message: string;
|
|
65
|
+
}>;
|
|
66
|
+
export declare function getCurrentUserProfile(options?: InternalApiClientOptions): Promise<CurrentUserProfileResponse>;
|
|
67
|
+
export declare function getCurrentUserDefaultWorkspace(options?: InternalApiClientOptions): Promise<CurrentUserDefaultWorkspaceResponse>;
|
|
68
|
+
export declare function updateCurrentUserDefaultWorkspace(workspaceId: string | null, options?: InternalApiClientOptions): Promise<UpdateCurrentUserDefaultWorkspaceResponse>;
|
|
69
|
+
export declare function createCurrentUserAvatarUploadUrl(filename: string, options?: InternalApiClientOptions): Promise<CurrentUserAvatarUploadUrlResponse>;
|
|
70
|
+
export declare function updateCurrentUserProfile(payload: UpdateCurrentUserProfilePayload, options?: InternalApiClientOptions): Promise<CurrentUserProfileResponse>;
|
|
71
|
+
export declare function uploadCurrentUserAvatar(file: File, filename?: string, options?: InternalApiClientOptions): Promise<UploadCurrentUserAvatarResult>;
|
|
72
|
+
export declare function removeCurrentUserAvatar(options?: InternalApiClientOptions): Promise<void>;
|
|
73
|
+
export declare function getUserCalendarSettings(options?: InternalApiClientOptions): Promise<{
|
|
74
|
+
timezone?: string | null;
|
|
75
|
+
first_day_of_week?: string | null;
|
|
76
|
+
time_format?: string | null;
|
|
77
|
+
}>;
|
|
78
|
+
export declare function createSupportInquiry(payload: CreateSupportInquiryPayload, options?: InternalApiClientOptions): Promise<{
|
|
79
|
+
success: true;
|
|
80
|
+
inquiryId: string;
|
|
81
|
+
}>;
|
|
82
|
+
export declare function listWorkspaceAttendanceExportRecords(workspaceId: string, { endDate, limit, offset, startDate, }: {
|
|
83
|
+
endDate: string;
|
|
84
|
+
limit?: number;
|
|
85
|
+
offset?: number;
|
|
86
|
+
startDate: string;
|
|
87
|
+
}, options?: InternalApiClientOptions): Promise<ListWorkspaceAttendanceExportResponse>;
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../src/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,UAAU,CAAC;AAElB,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,0BAA0B,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ACxC,OAAO,CAAC,EAAE,wBAAwB,uCAWnC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,EACV,QAAQ,SAAY,EACpB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,6BAA6B,CAAC,CAiCxC;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,CAAC,EAAE,wBAAwB,iBAOnC;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,CAAC,EAAE,wBAAwB;eAIrB,MAAM,GAAG,IAAI;wBACJ,MAAM,GAAG,IAAI;kBACnB,MAAM,GAAG,IAAI;GAI9B;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,2BAA2B,EACpC,OAAO,CAAC,EAAE,wBAAwB;aAGJ,IAAI;eAAa,MAAM;GAWtD;AAED,wBAAsB,oCAAoC,CACxD,WAAW,EAAE,MAAM,EACnB,EACE,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,EACD,OAAO,CAAC,EAAE,wBAAwB,kDAenC"}
|
package/dist/users.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserConfig = getUserConfig;
|
|
4
|
+
exports.updateUserConfig = updateUserConfig;
|
|
5
|
+
exports.getCurrentUserProfile = getCurrentUserProfile;
|
|
6
|
+
exports.getCurrentUserDefaultWorkspace = getCurrentUserDefaultWorkspace;
|
|
7
|
+
exports.updateCurrentUserDefaultWorkspace = updateCurrentUserDefaultWorkspace;
|
|
8
|
+
exports.createCurrentUserAvatarUploadUrl = createCurrentUserAvatarUploadUrl;
|
|
9
|
+
exports.updateCurrentUserProfile = updateCurrentUserProfile;
|
|
10
|
+
exports.uploadCurrentUserAvatar = uploadCurrentUserAvatar;
|
|
11
|
+
exports.removeCurrentUserAvatar = removeCurrentUserAvatar;
|
|
12
|
+
exports.getUserCalendarSettings = getUserCalendarSettings;
|
|
13
|
+
exports.createSupportInquiry = createSupportInquiry;
|
|
14
|
+
exports.listWorkspaceAttendanceExportRecords = listWorkspaceAttendanceExportRecords;
|
|
15
|
+
const client_1 = require("./client");
|
|
16
|
+
async function getUserConfig(configId, options) {
|
|
17
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
18
|
+
return client.json(`/api/v1/users/me/configs/${(0, client_1.encodePathSegment)(configId)}`, {
|
|
19
|
+
cache: 'no-store',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function updateUserConfig(configId, value, options) {
|
|
23
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
24
|
+
return client.json(`/api/v1/users/me/configs/${(0, client_1.encodePathSegment)(configId)}`, {
|
|
25
|
+
method: 'PUT',
|
|
26
|
+
headers: {
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
},
|
|
29
|
+
body: JSON.stringify({ value }),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async function getCurrentUserProfile(options) {
|
|
33
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
34
|
+
return client.json('/api/v1/users/me/profile', {
|
|
35
|
+
cache: 'no-store',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async function getCurrentUserDefaultWorkspace(options) {
|
|
39
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
40
|
+
return client.json('/api/v1/users/me/default-workspace', {
|
|
41
|
+
cache: 'no-store',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async function updateCurrentUserDefaultWorkspace(workspaceId, options) {
|
|
45
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
46
|
+
return client.json('/api/v1/users/me/default-workspace', {
|
|
47
|
+
method: 'PATCH',
|
|
48
|
+
headers: {
|
|
49
|
+
'Content-Type': 'application/json',
|
|
50
|
+
},
|
|
51
|
+
body: JSON.stringify({ workspaceId }),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async function createCurrentUserAvatarUploadUrl(filename, options) {
|
|
55
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
56
|
+
return client.json('/api/v1/users/me/avatar/upload-url', {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
headers: {
|
|
59
|
+
'Content-Type': 'application/json',
|
|
60
|
+
},
|
|
61
|
+
body: JSON.stringify({ filename }),
|
|
62
|
+
cache: 'no-store',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async function updateCurrentUserProfile(payload, options) {
|
|
66
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
67
|
+
return client.json('/api/v1/users/me/profile', {
|
|
68
|
+
method: 'PATCH',
|
|
69
|
+
headers: {
|
|
70
|
+
'Content-Type': 'application/json',
|
|
71
|
+
},
|
|
72
|
+
body: JSON.stringify(payload),
|
|
73
|
+
cache: 'no-store',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async function uploadCurrentUserAvatar(file, filename = file.name, options) {
|
|
77
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
78
|
+
const { uploadUrl, publicUrl } = await createCurrentUserAvatarUploadUrl(filename, options);
|
|
79
|
+
const uploadResponse = await client.fetch(uploadUrl, {
|
|
80
|
+
method: 'PUT',
|
|
81
|
+
headers: {
|
|
82
|
+
'Content-Type': file.type,
|
|
83
|
+
},
|
|
84
|
+
body: file,
|
|
85
|
+
cache: 'no-store',
|
|
86
|
+
});
|
|
87
|
+
if (!uploadResponse.ok) {
|
|
88
|
+
throw new Error('Failed to upload file');
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
await updateCurrentUserProfile({ avatar_url: publicUrl }, options);
|
|
92
|
+
return { publicUrl, finalizeOk: true };
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return {
|
|
96
|
+
publicUrl,
|
|
97
|
+
finalizeOk: false,
|
|
98
|
+
finalizeError: error instanceof Error
|
|
99
|
+
? error.message
|
|
100
|
+
: 'Failed to finalize avatar profile update',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function removeCurrentUserAvatar(options) {
|
|
105
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
106
|
+
return client.json('/api/v1/users/me/avatar', {
|
|
107
|
+
method: 'DELETE',
|
|
108
|
+
cache: 'no-store',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
async function getUserCalendarSettings(options) {
|
|
112
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
113
|
+
return client.json('/api/v1/users/calendar-settings', {
|
|
114
|
+
cache: 'no-store',
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
async function createSupportInquiry(payload, options) {
|
|
118
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
119
|
+
return client.json('/api/v1/inquiries', {
|
|
120
|
+
method: 'POST',
|
|
121
|
+
headers: {
|
|
122
|
+
'Content-Type': 'application/json',
|
|
123
|
+
},
|
|
124
|
+
body: JSON.stringify(payload),
|
|
125
|
+
cache: 'no-store',
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async function listWorkspaceAttendanceExportRecords(workspaceId, { endDate, limit, offset, startDate, }, options) {
|
|
129
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
130
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/users/attendance/export`, {
|
|
131
|
+
cache: 'no-store',
|
|
132
|
+
query: {
|
|
133
|
+
endDate,
|
|
134
|
+
limit,
|
|
135
|
+
offset,
|
|
136
|
+
startDate,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type InternalApiClientOptions } from './client';
|
|
2
|
+
export declare const DATABASE_DEFAULT_EXCLUDED_GROUPS_CONFIG_ID = "DATABASE_DEFAULT_EXCLUDED_GROUPS";
|
|
3
|
+
export declare const DATABASE_DEFAULT_INCLUDED_GROUPS_CONFIG_ID = "DATABASE_DEFAULT_INCLUDED_GROUPS";
|
|
4
|
+
export declare const DATABASE_FEATURED_GROUPS_CONFIG_ID = "DATABASE_FEATURED_GROUPS";
|
|
5
|
+
export declare const DATABASE_AUTO_ADD_NEW_GROUPS_TO_DEFAULT_INCLUDED_GROUPS_CONFIG_ID = "DATABASE_AUTO_ADD_NEW_GROUPS_TO_DEFAULT_INCLUDED_GROUPS";
|
|
6
|
+
export declare const ENABLE_GUEST_SELF_JOIN_FROM_WORKSPACE_USER_EMAIL_CONFIG_ID = "ENABLE_GUEST_SELF_JOIN_FROM_WORKSPACE_USER_EMAIL";
|
|
7
|
+
export declare const ENABLE_CMS_GAMES_CONFIG_ID = "ENABLE_CMS_GAMES";
|
|
8
|
+
type WorkspaceConfigResponse = {
|
|
9
|
+
value: string | null;
|
|
10
|
+
};
|
|
11
|
+
export declare function parseWorkspaceConfigIdList(value: string | null | undefined): string[];
|
|
12
|
+
export declare function getWorkspaceConfig(workspaceId: string, configId: string, options?: InternalApiClientOptions): Promise<WorkspaceConfigResponse>;
|
|
13
|
+
export declare function getOptionalWorkspaceConfig(workspaceId: string, configId: string, options?: InternalApiClientOptions): Promise<WorkspaceConfigResponse | null>;
|
|
14
|
+
export declare function updateWorkspaceConfig(workspaceId: string, configId: string, value: string, options?: InternalApiClientOptions): Promise<{
|
|
15
|
+
message: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function getWorkspaceConfigIdList(workspaceId: string, configId: string, options?: InternalApiClientOptions): Promise<string[]>;
|
|
18
|
+
export declare function getWorkspaceUsersDatabaseFilterSettings(workspaceId: string, options?: InternalApiClientOptions): Promise<{
|
|
19
|
+
defaultIncludedGroupIds: string[];
|
|
20
|
+
defaultExcludedGroupIds: string[];
|
|
21
|
+
featuredGroupIds: string[];
|
|
22
|
+
}>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=workspace-configs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-configs.d.ts","sourceRoot":"","sources":["../src/workspace-configs.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,0CAA0C,qCACnB,CAAC;AACrC,eAAO,MAAM,0CAA0C,qCACnB,CAAC;AACrC,eAAO,MAAM,kCAAkC,6BAA6B,CAAC;AAC7E,eAAO,MAAM,iEAAiE,4DACnB,CAAC;AAC5D,eAAO,MAAM,0DAA0D,qDACnB,CAAC;AACrD,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,EAAE,CAKV;AAED,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wBAAwB,oCASnC;AAED,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wBAAwB,2CAgCnC;AAED,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,wBAAwB;aAGJ,MAAM;GAUrC;AAED,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wBAAwB,qBAQnC;AAED,wBAAsB,uCAAuC,CAC3D,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,wBAAwB;;;;GA0BnC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENABLE_CMS_GAMES_CONFIG_ID = exports.ENABLE_GUEST_SELF_JOIN_FROM_WORKSPACE_USER_EMAIL_CONFIG_ID = exports.DATABASE_AUTO_ADD_NEW_GROUPS_TO_DEFAULT_INCLUDED_GROUPS_CONFIG_ID = exports.DATABASE_FEATURED_GROUPS_CONFIG_ID = exports.DATABASE_DEFAULT_INCLUDED_GROUPS_CONFIG_ID = exports.DATABASE_DEFAULT_EXCLUDED_GROUPS_CONFIG_ID = void 0;
|
|
4
|
+
exports.parseWorkspaceConfigIdList = parseWorkspaceConfigIdList;
|
|
5
|
+
exports.getWorkspaceConfig = getWorkspaceConfig;
|
|
6
|
+
exports.getOptionalWorkspaceConfig = getOptionalWorkspaceConfig;
|
|
7
|
+
exports.updateWorkspaceConfig = updateWorkspaceConfig;
|
|
8
|
+
exports.getWorkspaceConfigIdList = getWorkspaceConfigIdList;
|
|
9
|
+
exports.getWorkspaceUsersDatabaseFilterSettings = getWorkspaceUsersDatabaseFilterSettings;
|
|
10
|
+
const client_1 = require("./client");
|
|
11
|
+
exports.DATABASE_DEFAULT_EXCLUDED_GROUPS_CONFIG_ID = 'DATABASE_DEFAULT_EXCLUDED_GROUPS';
|
|
12
|
+
exports.DATABASE_DEFAULT_INCLUDED_GROUPS_CONFIG_ID = 'DATABASE_DEFAULT_INCLUDED_GROUPS';
|
|
13
|
+
exports.DATABASE_FEATURED_GROUPS_CONFIG_ID = 'DATABASE_FEATURED_GROUPS';
|
|
14
|
+
exports.DATABASE_AUTO_ADD_NEW_GROUPS_TO_DEFAULT_INCLUDED_GROUPS_CONFIG_ID = 'DATABASE_AUTO_ADD_NEW_GROUPS_TO_DEFAULT_INCLUDED_GROUPS';
|
|
15
|
+
exports.ENABLE_GUEST_SELF_JOIN_FROM_WORKSPACE_USER_EMAIL_CONFIG_ID = 'ENABLE_GUEST_SELF_JOIN_FROM_WORKSPACE_USER_EMAIL';
|
|
16
|
+
exports.ENABLE_CMS_GAMES_CONFIG_ID = 'ENABLE_CMS_GAMES';
|
|
17
|
+
function parseWorkspaceConfigIdList(value) {
|
|
18
|
+
return (value || '')
|
|
19
|
+
.split(',')
|
|
20
|
+
.map((entry) => entry.trim())
|
|
21
|
+
.filter(Boolean);
|
|
22
|
+
}
|
|
23
|
+
async function getWorkspaceConfig(workspaceId, configId, options) {
|
|
24
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
25
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/settings/${(0, client_1.encodePathSegment)(configId)}`, {
|
|
26
|
+
cache: 'no-store',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async function getOptionalWorkspaceConfig(workspaceId, configId, options) {
|
|
30
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
31
|
+
const response = await client.fetch(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/settings/${(0, client_1.encodePathSegment)(configId)}`, {
|
|
32
|
+
cache: 'no-store',
|
|
33
|
+
});
|
|
34
|
+
if (response.status === 404) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if (!response.ok) {
|
|
38
|
+
const fallbackMessage = `Internal API request failed: ${response.status}`;
|
|
39
|
+
let message = fallbackMessage;
|
|
40
|
+
try {
|
|
41
|
+
const data = (await response.json());
|
|
42
|
+
message = data.message || data.error || fallbackMessage;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
message = fallbackMessage;
|
|
46
|
+
}
|
|
47
|
+
throw new Error(message);
|
|
48
|
+
}
|
|
49
|
+
return (await response.json());
|
|
50
|
+
}
|
|
51
|
+
async function updateWorkspaceConfig(workspaceId, configId, value, options) {
|
|
52
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
53
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/settings/${(0, client_1.encodePathSegment)(configId)}`, {
|
|
54
|
+
method: 'PUT',
|
|
55
|
+
headers: {
|
|
56
|
+
'Content-Type': 'application/json',
|
|
57
|
+
},
|
|
58
|
+
body: JSON.stringify({ value }),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async function getWorkspaceConfigIdList(workspaceId, configId, options) {
|
|
62
|
+
const config = await getOptionalWorkspaceConfig(workspaceId, configId, options);
|
|
63
|
+
return parseWorkspaceConfigIdList(config?.value);
|
|
64
|
+
}
|
|
65
|
+
async function getWorkspaceUsersDatabaseFilterSettings(workspaceId, options) {
|
|
66
|
+
const [defaultIncludedGroupIds, defaultExcludedGroupIds, featuredGroupIds] = await Promise.all([
|
|
67
|
+
getWorkspaceConfigIdList(workspaceId, exports.DATABASE_DEFAULT_INCLUDED_GROUPS_CONFIG_ID, options),
|
|
68
|
+
getWorkspaceConfigIdList(workspaceId, exports.DATABASE_DEFAULT_EXCLUDED_GROUPS_CONFIG_ID, options),
|
|
69
|
+
getWorkspaceConfigIdList(workspaceId, exports.DATABASE_FEATURED_GROUPS_CONFIG_ID, options),
|
|
70
|
+
]);
|
|
71
|
+
return {
|
|
72
|
+
defaultIncludedGroupIds,
|
|
73
|
+
defaultExcludedGroupIds,
|
|
74
|
+
featuredGroupIds,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type InternalApiClientOptions, type InternalApiQuery } from './client';
|
|
2
|
+
export interface WorkspaceUserAuditEventResponse {
|
|
3
|
+
auditRecordId: number;
|
|
4
|
+
eventKind: 'created' | 'updated' | 'archived' | 'reactivated' | 'archive_until_changed' | 'deleted';
|
|
5
|
+
summary: string;
|
|
6
|
+
changedFields: string[];
|
|
7
|
+
fieldChanges: Array<{
|
|
8
|
+
field: string;
|
|
9
|
+
label: string;
|
|
10
|
+
before: string | null;
|
|
11
|
+
after: string | null;
|
|
12
|
+
}>;
|
|
13
|
+
before: Record<string, string | null>;
|
|
14
|
+
after: Record<string, string | null>;
|
|
15
|
+
affectedUser: {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string | null;
|
|
18
|
+
email: string | null;
|
|
19
|
+
};
|
|
20
|
+
actor: {
|
|
21
|
+
authUid: string | null;
|
|
22
|
+
workspaceUserId: string | null;
|
|
23
|
+
id: string | null;
|
|
24
|
+
name: string | null;
|
|
25
|
+
email: string | null;
|
|
26
|
+
};
|
|
27
|
+
occurredAt: string;
|
|
28
|
+
source: 'live' | 'backfilled';
|
|
29
|
+
}
|
|
30
|
+
export interface WorkspaceUserAuditLogsResponse {
|
|
31
|
+
data: WorkspaceUserAuditEventResponse[];
|
|
32
|
+
count: number;
|
|
33
|
+
}
|
|
34
|
+
export interface WorkspaceUserAuditLogQuery extends InternalApiQuery {
|
|
35
|
+
start: string;
|
|
36
|
+
end: string;
|
|
37
|
+
eventKind?: 'created' | 'updated' | 'archived' | 'reactivated' | 'archive_until_changed' | 'deleted' | 'all';
|
|
38
|
+
source?: 'live' | 'backfilled' | 'all';
|
|
39
|
+
affectedUserQuery?: string;
|
|
40
|
+
actorQuery?: string;
|
|
41
|
+
offset?: number;
|
|
42
|
+
limit?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface BackfillWorkspaceUserStatusChangesPayload {
|
|
45
|
+
dryRun?: boolean;
|
|
46
|
+
limit?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface BackfillWorkspaceUserStatusChangesResponse {
|
|
49
|
+
rows: Array<{
|
|
50
|
+
audit_record_version_id: number;
|
|
51
|
+
user_id: string;
|
|
52
|
+
ws_id: string;
|
|
53
|
+
archived: boolean;
|
|
54
|
+
archived_until: string | null;
|
|
55
|
+
actor_auth_uid: string | null;
|
|
56
|
+
creator_id: string | null;
|
|
57
|
+
source: 'backfilled' | 'live';
|
|
58
|
+
created_at: string;
|
|
59
|
+
event_kind: 'archived' | 'reactivated' | 'archive_until_changed';
|
|
60
|
+
}>;
|
|
61
|
+
count: number;
|
|
62
|
+
dryRun: boolean;
|
|
63
|
+
}
|
|
64
|
+
export declare function listWorkspaceUserAuditLogs(workspaceId: string, query: WorkspaceUserAuditLogQuery, options?: InternalApiClientOptions): Promise<WorkspaceUserAuditLogsResponse>;
|
|
65
|
+
export declare function backfillWorkspaceUserStatusChanges(workspaceId: string, payload?: BackfillWorkspaceUserStatusChangesPayload, options?: InternalApiClientOptions): Promise<BackfillWorkspaceUserStatusChangesResponse>;
|
|
66
|
+
//# sourceMappingURL=workspace-user-audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-user-audit.d.ts","sourceRoot":"","sources":["../src/workspace-user-audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EACL,SAAS,GACT,SAAS,GACT,UAAU,GACV,aAAa,GACb,uBAAuB,GACvB,SAAS,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,KAAK,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB,CAAC,CAAC;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACrC,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB,CAAC;IACF,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,GAAG,IA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CAAC;QAC9B,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,UAAU,GAAG,aAAa,GAAG,uBAAuB,CAAC;KAClE,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,0BAA0B,EACjC,OAAO,CAAC,EAAE,wBAAwB,2CAWnC;AAED,wBAAsB,kCAAkC,CACtD,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,yCAA8C,EACvD,OAAO,CAAC,EAAE,wBAAwB,uDAenC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listWorkspaceUserAuditLogs = listWorkspaceUserAuditLogs;
|
|
4
|
+
exports.backfillWorkspaceUserStatusChanges = backfillWorkspaceUserStatusChanges;
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
async function listWorkspaceUserAuditLogs(workspaceId, query, options) {
|
|
7
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
8
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/users/audit-logs`, {
|
|
9
|
+
cache: 'no-store',
|
|
10
|
+
query,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async function backfillWorkspaceUserStatusChanges(workspaceId, payload = {}, options) {
|
|
14
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
15
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/users/audit-logs/backfill`, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
cache: 'no-store',
|
|
18
|
+
headers: {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
},
|
|
21
|
+
body: JSON.stringify(payload),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { InternalApiEnhancedWorkspaceMember, InternalApiWorkspaceMember, InternalApiWorkspaceSummary } from '@tuturuuu/types';
|
|
2
|
+
import { type InternalApiClientOptions } from './client';
|
|
3
|
+
export declare function listWorkspaces(options?: InternalApiClientOptions): Promise<InternalApiWorkspaceSummary[]>;
|
|
4
|
+
export declare function listCmsWorkspaces(options?: InternalApiClientOptions): Promise<InternalApiWorkspaceSummary[]>;
|
|
5
|
+
export declare function getWorkspace(workspaceId: string, options?: InternalApiClientOptions): Promise<{
|
|
6
|
+
avatar_url: string | null;
|
|
7
|
+
created_at: string | null;
|
|
8
|
+
creator_id: string;
|
|
9
|
+
deleted: boolean | null;
|
|
10
|
+
energy_profile: string | null;
|
|
11
|
+
first_day_of_week: string | null;
|
|
12
|
+
handle: string | null;
|
|
13
|
+
id: string;
|
|
14
|
+
logo_url: string | null;
|
|
15
|
+
name: string | null;
|
|
16
|
+
personal: boolean;
|
|
17
|
+
scheduling_settings: import("@tuturuuu/types").Json | null;
|
|
18
|
+
timezone: string | null;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function getWorkspaceExternalProjectMembersContext(workspaceId: string, options?: InternalApiClientOptions): Promise<{
|
|
21
|
+
boundProjectName: null | string;
|
|
22
|
+
canManageMembers: boolean;
|
|
23
|
+
canManageRoles: boolean;
|
|
24
|
+
currentUserEmail: null | string;
|
|
25
|
+
workspaceId: string;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function listWorkspaceMembers(workspaceId: string, options?: InternalApiClientOptions): Promise<InternalApiWorkspaceMember[]>;
|
|
28
|
+
export declare function listEnhancedWorkspaceMembers(workspaceId: string, status?: 'all' | 'joined' | 'invited', options?: InternalApiClientOptions): Promise<InternalApiEnhancedWorkspaceMember[]>;
|
|
29
|
+
export declare function inviteWorkspaceMembers(workspaceId: string, emails: string[], options?: InternalApiClientOptions): Promise<{
|
|
30
|
+
message: string;
|
|
31
|
+
results: Array<{
|
|
32
|
+
email: string;
|
|
33
|
+
success: boolean;
|
|
34
|
+
error?: string;
|
|
35
|
+
}>;
|
|
36
|
+
successCount: number;
|
|
37
|
+
totalRequested: number;
|
|
38
|
+
}>;
|
|
39
|
+
export declare function inviteWorkspaceMember(workspaceId: string, payload: {
|
|
40
|
+
email: string;
|
|
41
|
+
memberType: 'MEMBER' | 'GUEST';
|
|
42
|
+
}, options?: InternalApiClientOptions): Promise<{
|
|
43
|
+
message?: string;
|
|
44
|
+
errorCode?: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare function acceptWorkspaceInvite(workspaceId: string, options?: InternalApiClientOptions): Promise<{
|
|
47
|
+
message?: string;
|
|
48
|
+
}>;
|
|
49
|
+
export declare function declineWorkspaceInvite(workspaceId: string, options?: InternalApiClientOptions): Promise<{
|
|
50
|
+
message?: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare function removeWorkspaceMember(workspaceId: string, payload: {
|
|
53
|
+
email?: string | null;
|
|
54
|
+
userId?: string | null;
|
|
55
|
+
}, options?: InternalApiClientOptions): Promise<{
|
|
56
|
+
message: string;
|
|
57
|
+
workspace_deleted?: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kCAAkC,EAClC,0BAA0B,EAC1B,2BAA2B,EAE5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,UAAU,CAAC;AA2BlB,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE,wBAAwB,0CAKtE;AAED,wBAAsB,iBAAiB,CAAC,OAAO,CAAC,EAAE,wBAAwB,0CAKzE;AAED,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,wBAAwB;;;;;;;;;;;;;;GASnC;AAED,wBAAsB,yCAAyC,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