@tuturuuu/internal-api 0.9.0 → 0.10.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/dist/account-delete.d.ts +25 -0
- package/dist/account-delete.d.ts.map +1 -0
- package/dist/account-delete.js +22 -0
- package/dist/ai.d.ts +2 -1
- package/dist/ai.d.ts.map +1 -1
- package/dist/api-keys.d.ts +66 -0
- package/dist/api-keys.d.ts.map +1 -0
- package/dist/api-keys.js +93 -0
- package/dist/auth.d.ts +5 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +9 -0
- package/dist/backend.d.ts +556 -0
- package/dist/backend.d.ts.map +1 -0
- package/dist/backend.js +528 -0
- package/dist/calendar.d.ts +29 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +18 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/cron.d.ts +16 -0
- package/dist/cron.d.ts.map +1 -0
- package/dist/cron.js +41 -0
- package/dist/documents.d.ts +38 -0
- package/dist/documents.d.ts.map +1 -0
- package/dist/documents.js +71 -0
- package/dist/education.d.ts +228 -12
- package/dist/education.d.ts.map +1 -1
- package/dist/education.js +229 -0
- package/dist/group-tags.d.ts +87 -0
- package/dist/group-tags.d.ts.map +1 -0
- package/dist/group-tags.js +116 -0
- package/dist/index.d.ts +24 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +164 -14
- package/dist/infrastructure/abuse.d.ts +7 -0
- package/dist/infrastructure/abuse.d.ts.map +1 -0
- package/dist/infrastructure/abuse.js +39 -0
- package/dist/infrastructure/ai.d.ts +53 -0
- package/dist/infrastructure/ai.d.ts.map +1 -0
- package/dist/infrastructure/ai.js +331 -0
- package/dist/infrastructure/apps.d.ts +9 -0
- package/dist/infrastructure/apps.d.ts.map +1 -0
- package/dist/infrastructure/apps.js +49 -0
- package/dist/infrastructure/blocked-ips.d.ts +65 -0
- package/dist/infrastructure/blocked-ips.d.ts.map +1 -0
- package/dist/infrastructure/blocked-ips.js +56 -0
- package/dist/infrastructure/github-bot.d.ts +10 -0
- package/dist/infrastructure/github-bot.d.ts.map +1 -0
- package/dist/infrastructure/github-bot.js +73 -0
- package/dist/infrastructure/index.d.ts +11 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +26 -0
- package/dist/infrastructure/mobile.d.ts +23 -0
- package/dist/infrastructure/mobile.d.ts.map +1 -0
- package/dist/infrastructure/mobile.js +183 -0
- package/dist/infrastructure/monitoring.d.ts +34 -0
- package/dist/infrastructure/monitoring.d.ts.map +1 -0
- package/dist/infrastructure/monitoring.js +356 -0
- package/dist/infrastructure/realtime.d.ts +55 -0
- package/dist/infrastructure/realtime.d.ts.map +1 -0
- package/dist/infrastructure/realtime.js +29 -0
- package/dist/infrastructure/types.d.ts +1652 -0
- package/dist/infrastructure/types.d.ts.map +1 -0
- package/dist/infrastructure/types.js +2 -0
- package/dist/infrastructure/workspace.d.ts +5 -0
- package/dist/infrastructure/workspace.d.ts.map +1 -0
- package/dist/infrastructure/workspace.js +15 -0
- package/dist/infrastructure.d.ts +10 -1725
- package/dist/infrastructure.d.ts.map +1 -1
- package/dist/infrastructure.js +24 -1019
- package/dist/inventory.d.ts +34 -0
- package/dist/inventory.d.ts.map +1 -1
- package/dist/inventory.js +7 -0
- package/dist/notifications.d.ts +90 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/notifications.js +62 -0
- package/dist/promotions.d.ts +3 -0
- package/dist/promotions.d.ts.map +1 -1
- package/dist/promotions.js +8 -0
- package/dist/rate-limits.d.ts +18 -5
- package/dist/rate-limits.d.ts.map +1 -1
- package/dist/task-plans.d.ts +220 -0
- package/dist/task-plans.d.ts.map +1 -0
- package/dist/task-plans.js +153 -0
- package/dist/tasks.d.ts +200 -0
- package/dist/tasks.d.ts.map +1 -1
- package/dist/tasks.js +143 -0
- package/dist/teach.d.ts +67 -0
- package/dist/teach.d.ts.map +1 -1
- package/dist/teach.js +20 -0
- package/dist/templates.d.ts +2 -0
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +8 -0
- package/dist/tulearn.d.ts +46 -0
- package/dist/tulearn.d.ts.map +1 -1
- package/dist/tulearn.js +36 -0
- package/dist/user-group-attendance.d.ts +29 -0
- package/dist/user-group-attendance.d.ts.map +1 -0
- package/dist/user-group-attendance.js +38 -0
- package/dist/user-group-schedule.d.ts +193 -0
- package/dist/user-group-schedule.d.ts.map +1 -0
- package/dist/user-group-schedule.js +84 -0
- package/dist/user-groups.d.ts +18 -0
- package/dist/user-groups.d.ts.map +1 -1
- package/dist/user-groups.js +18 -0
- package/dist/users-server.d.ts +14 -0
- package/dist/users-server.d.ts.map +1 -0
- package/dist/users-server.js +37 -0
- package/dist/users.d.ts +64 -1
- package/dist/users.d.ts.map +1 -1
- package/dist/users.js +78 -6
- package/dist/workspace-config-ids.d.ts +6 -0
- package/dist/workspace-config-ids.d.ts.map +1 -1
- package/dist/workspace-config-ids.js +13 -1
- package/dist/workspace-configs.d.ts +4 -1
- package/dist/workspace-configs.d.ts.map +1 -1
- package/dist/workspace-configs.js +25 -1
- package/package.json +63 -8
package/dist/education.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.createWorkspaceCourse = createWorkspaceCourse;
|
|
|
6
6
|
exports.listWorkspaceCourses = listWorkspaceCourses;
|
|
7
7
|
exports.getValseaClassroomConfig = getValseaClassroomConfig;
|
|
8
8
|
exports.generateValseaClassroomScenario = generateValseaClassroomScenario;
|
|
9
|
+
exports.generateWorkspaceQuizOptionExplanation = generateWorkspaceQuizOptionExplanation;
|
|
9
10
|
exports.synthesizeValseaClassroomSpeech = synthesizeValseaClassroomSpeech;
|
|
10
11
|
exports.validateValseaClassroomApiKey = validateValseaClassroomApiKey;
|
|
11
12
|
exports.uploadValseaClassroomAudioToDrive = uploadValseaClassroomAudioToDrive;
|
|
@@ -30,6 +31,12 @@ exports.createWorkspaceQuiz = createWorkspaceQuiz;
|
|
|
30
31
|
exports.updateWorkspaceQuiz = updateWorkspaceQuiz;
|
|
31
32
|
exports.deleteWorkspaceQuiz = deleteWorkspaceQuiz;
|
|
32
33
|
exports.getWorkspaceQuizzes = getWorkspaceQuizzes;
|
|
34
|
+
exports.getWorkspaceFlashcards = getWorkspaceFlashcards;
|
|
35
|
+
exports.listAllWorkspaceCourseModules = listAllWorkspaceCourseModules;
|
|
36
|
+
exports.getQuizSetLinkedModules = getQuizSetLinkedModules;
|
|
37
|
+
exports.getQuizSetQuizzes = getQuizSetQuizzes;
|
|
38
|
+
exports.getCourseModuleQuizSets = getCourseModuleQuizSets;
|
|
39
|
+
exports.getWorkspaceQuizSets = getWorkspaceQuizSets;
|
|
33
40
|
exports.createWorkspaceQuizSet = createWorkspaceQuizSet;
|
|
34
41
|
exports.updateWorkspaceQuizSet = updateWorkspaceQuizSet;
|
|
35
42
|
exports.deleteWorkspaceQuizSet = deleteWorkspaceQuizSet;
|
|
@@ -38,6 +45,8 @@ exports.updateWorkspaceFlashcard = updateWorkspaceFlashcard;
|
|
|
38
45
|
exports.deleteWorkspaceFlashcard = deleteWorkspaceFlashcard;
|
|
39
46
|
exports.listWorkspaceEducationAttempts = listWorkspaceEducationAttempts;
|
|
40
47
|
exports.getWorkspaceEducationAttemptDetail = getWorkspaceEducationAttemptDetail;
|
|
48
|
+
exports.getWorkspaceCourseTestQuestions = getWorkspaceCourseTestQuestions;
|
|
49
|
+
exports.createWorkspaceCourseTestQuestions = createWorkspaceCourseTestQuestions;
|
|
41
50
|
exports.deleteWorkspaceStorageObject = deleteWorkspaceStorageObject;
|
|
42
51
|
const client_1 = require("./client");
|
|
43
52
|
async function listWorkspaceCourseModules(workspaceId, groupId, options) {
|
|
@@ -84,6 +93,22 @@ async function generateValseaClassroomScenario(workspaceId, payload = {}, option
|
|
|
84
93
|
method: 'POST',
|
|
85
94
|
});
|
|
86
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Generate an AI explanation for a single quiz option via
|
|
98
|
+
* `POST /api/ai/objects/quizzes/explanation` (note: not under `/api/v1`; the
|
|
99
|
+
* workspace id travels in the body as `wsId`). Forwards the caller's auth.
|
|
100
|
+
*/
|
|
101
|
+
async function generateWorkspaceQuizOptionExplanation(workspaceId, payload, options) {
|
|
102
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
103
|
+
return client.json('/api/ai/objects/quizzes/explanation', {
|
|
104
|
+
body: JSON.stringify({ wsId: workspaceId, ...payload }),
|
|
105
|
+
cache: 'no-store',
|
|
106
|
+
headers: {
|
|
107
|
+
'Content-Type': 'application/json',
|
|
108
|
+
},
|
|
109
|
+
method: 'POST',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
87
112
|
async function synthesizeValseaClassroomSpeech(workspaceId, payload, options) {
|
|
88
113
|
const client = (0, client_1.getInternalApiClient)(options);
|
|
89
114
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/education/valsea/speech`, {
|
|
@@ -371,6 +396,190 @@ async function getWorkspaceQuizzes(workspaceId, params, options) {
|
|
|
371
396
|
cache: 'no-store',
|
|
372
397
|
});
|
|
373
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* Paginated read of a workspace's flashcard library via
|
|
401
|
+
* `GET /api/v1/workspaces/:wsId/flashcards`. Forwards the caller's auth.
|
|
402
|
+
*/
|
|
403
|
+
async function getWorkspaceFlashcards(workspaceId, params, options) {
|
|
404
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
405
|
+
const searchParams = new URLSearchParams();
|
|
406
|
+
if (params?.page)
|
|
407
|
+
searchParams.set('page', params.page.toString());
|
|
408
|
+
if (params?.pageSize)
|
|
409
|
+
searchParams.set('pageSize', params.pageSize.toString());
|
|
410
|
+
if (params?.q)
|
|
411
|
+
searchParams.set('q', params.q);
|
|
412
|
+
const query = searchParams.toString();
|
|
413
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/flashcards${query ? `?${query}` : ''}`, {
|
|
414
|
+
method: 'GET',
|
|
415
|
+
cache: 'no-store',
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Paginated read of EVERY course module in a workspace (across all course
|
|
420
|
+
* groups) via `GET /api/v1/workspaces/:wsId/course-modules`.
|
|
421
|
+
*/
|
|
422
|
+
async function listAllWorkspaceCourseModules(workspaceId, params, options) {
|
|
423
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
424
|
+
const searchParams = new URLSearchParams();
|
|
425
|
+
if (params?.page)
|
|
426
|
+
searchParams.set('page', params.page.toString());
|
|
427
|
+
if (params?.pageSize)
|
|
428
|
+
searchParams.set('pageSize', params.pageSize.toString());
|
|
429
|
+
if (params?.q)
|
|
430
|
+
searchParams.set('q', params.q);
|
|
431
|
+
const query = searchParams.toString();
|
|
432
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/course-modules${query ? `?${query}` : ''}`, {
|
|
433
|
+
method: 'GET',
|
|
434
|
+
cache: 'no-store',
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Paginated read of the course modules linked to a quiz set via
|
|
439
|
+
* `GET /api/v1/workspaces/:wsId/quiz-sets/:setId/linked-modules`.
|
|
440
|
+
*/
|
|
441
|
+
async function getQuizSetLinkedModules(workspaceId, setId, params, options) {
|
|
442
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
443
|
+
const searchParams = new URLSearchParams();
|
|
444
|
+
if (params?.page)
|
|
445
|
+
searchParams.set('page', params.page.toString());
|
|
446
|
+
if (params?.pageSize)
|
|
447
|
+
searchParams.set('pageSize', params.pageSize.toString());
|
|
448
|
+
if (params?.q)
|
|
449
|
+
searchParams.set('q', params.q);
|
|
450
|
+
const query = searchParams.toString();
|
|
451
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/quiz-sets/${(0, client_1.encodePathSegment)(setId)}/linked-modules${query ? `?${query}` : ''}`, {
|
|
452
|
+
method: 'GET',
|
|
453
|
+
cache: 'no-store',
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Paginated read of the quizzes (with options) that belong to a quiz set via
|
|
458
|
+
* `GET /api/v1/workspaces/:wsId/quiz-sets/:setId/quizzes`.
|
|
459
|
+
*/
|
|
460
|
+
async function getQuizSetQuizzes(workspaceId, setId, params, options) {
|
|
461
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
462
|
+
const searchParams = new URLSearchParams();
|
|
463
|
+
if (params?.page)
|
|
464
|
+
searchParams.set('page', params.page.toString());
|
|
465
|
+
if (params?.pageSize)
|
|
466
|
+
searchParams.set('pageSize', params.pageSize.toString());
|
|
467
|
+
if (params?.q)
|
|
468
|
+
searchParams.set('q', params.q);
|
|
469
|
+
const query = searchParams.toString();
|
|
470
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/quiz-sets/${(0, client_1.encodePathSegment)(setId)}/quizzes${query ? `?${query}` : ''}`, {
|
|
471
|
+
method: 'GET',
|
|
472
|
+
cache: 'no-store',
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Paginated read of the quiz sets linked to a single course module via
|
|
477
|
+
* `GET /api/v1/workspaces/:wsId/course-modules/:moduleId/quiz-sets`.
|
|
478
|
+
*/
|
|
479
|
+
async function getCourseModuleQuizSets(workspaceId, moduleId, params, options) {
|
|
480
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
481
|
+
const searchParams = new URLSearchParams();
|
|
482
|
+
if (params?.page)
|
|
483
|
+
searchParams.set('page', params.page.toString());
|
|
484
|
+
if (params?.pageSize)
|
|
485
|
+
searchParams.set('pageSize', params.pageSize.toString());
|
|
486
|
+
if (params?.q)
|
|
487
|
+
searchParams.set('q', params.q);
|
|
488
|
+
const query = searchParams.toString();
|
|
489
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/course-modules/${(0, client_1.encodePathSegment)(moduleId)}/quiz-sets${query ? `?${query}` : ''}`, {
|
|
490
|
+
method: 'GET',
|
|
491
|
+
cache: 'no-store',
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
const LINKED_MODULES_PAGE_SIZE = 100;
|
|
495
|
+
const COURSE_LOOKUP_PAGE_SIZE = 100;
|
|
496
|
+
async function listAllQuizSetLinkedModules(workspaceId, setId, options) {
|
|
497
|
+
const modules = [];
|
|
498
|
+
let page = 1;
|
|
499
|
+
let count = 0;
|
|
500
|
+
do {
|
|
501
|
+
const result = await getQuizSetLinkedModules(workspaceId, setId, { page, pageSize: LINKED_MODULES_PAGE_SIZE }, options);
|
|
502
|
+
modules.push(...result.data);
|
|
503
|
+
count = result.count;
|
|
504
|
+
page += 1;
|
|
505
|
+
if (result.data.length === 0)
|
|
506
|
+
break;
|
|
507
|
+
} while (modules.length < count);
|
|
508
|
+
return modules;
|
|
509
|
+
}
|
|
510
|
+
async function listAllWorkspaceCoursesForLookup(workspaceId, options) {
|
|
511
|
+
const courses = [];
|
|
512
|
+
let page = 1;
|
|
513
|
+
let count = 0;
|
|
514
|
+
do {
|
|
515
|
+
const result = await listWorkspaceCourses(workspaceId, { page, pageSize: COURSE_LOOKUP_PAGE_SIZE, status: 'all' }, options);
|
|
516
|
+
courses.push(...result.data);
|
|
517
|
+
count = result.count;
|
|
518
|
+
page += 1;
|
|
519
|
+
if (result.data.length === 0)
|
|
520
|
+
break;
|
|
521
|
+
} while (courses.length < count);
|
|
522
|
+
return new Map(courses.map((course) => [course.id, course.name]));
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Paginated read of a workspace's quiz-set library via
|
|
526
|
+
* `GET /api/v1/workspaces/:wsId/quiz-sets`. Forwards the caller's auth.
|
|
527
|
+
*/
|
|
528
|
+
async function getWorkspaceQuizSets(workspaceId, params, options) {
|
|
529
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
530
|
+
const searchParams = new URLSearchParams();
|
|
531
|
+
if (params?.page)
|
|
532
|
+
searchParams.set('page', params.page.toString());
|
|
533
|
+
if (params?.pageSize)
|
|
534
|
+
searchParams.set('pageSize', params.pageSize.toString());
|
|
535
|
+
if (params?.q)
|
|
536
|
+
searchParams.set('q', params.q);
|
|
537
|
+
const query = searchParams.toString();
|
|
538
|
+
const result = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/quiz-sets${query ? `?${query}` : ''}`, {
|
|
539
|
+
method: 'GET',
|
|
540
|
+
cache: 'no-store',
|
|
541
|
+
});
|
|
542
|
+
if (result.data.length === 0) {
|
|
543
|
+
return result;
|
|
544
|
+
}
|
|
545
|
+
const linkedModulesBySetId = await Promise.all(result.data.map(async (quizSet) => {
|
|
546
|
+
const knownLinkedModulesCount = quizSet.linked_modules_count ?? quizSet.course_module_quiz_sets?.length;
|
|
547
|
+
return {
|
|
548
|
+
quizSetId: quizSet.id,
|
|
549
|
+
linkedModules: knownLinkedModulesCount === 0
|
|
550
|
+
? []
|
|
551
|
+
: await listAllQuizSetLinkedModules(workspaceId, quizSet.id, options),
|
|
552
|
+
};
|
|
553
|
+
}));
|
|
554
|
+
const courseIds = new Set(linkedModulesBySetId.flatMap(({ linkedModules }) => linkedModules
|
|
555
|
+
.map((module) => module.group_id)
|
|
556
|
+
.filter((groupId) => Boolean(groupId))));
|
|
557
|
+
const courseNameById = courseIds.size > 0
|
|
558
|
+
? await listAllWorkspaceCoursesForLookup(workspaceId, options)
|
|
559
|
+
: new Map();
|
|
560
|
+
return {
|
|
561
|
+
...result,
|
|
562
|
+
data: result.data.map((quizSet) => {
|
|
563
|
+
const linkedModules = linkedModulesBySetId.find(({ quizSetId }) => quizSetId === quizSet.id)
|
|
564
|
+
?.linkedModules ?? [];
|
|
565
|
+
return {
|
|
566
|
+
...quizSet,
|
|
567
|
+
linked_modules: linkedModules.flatMap((module) => {
|
|
568
|
+
const courseId = module.group_id;
|
|
569
|
+
if (!courseId)
|
|
570
|
+
return [];
|
|
571
|
+
return {
|
|
572
|
+
course_id: courseId,
|
|
573
|
+
course_name: courseNameById.get(courseId) ?? courseId,
|
|
574
|
+
module_id: module.id,
|
|
575
|
+
module_name: module.name ?? '',
|
|
576
|
+
};
|
|
577
|
+
}),
|
|
578
|
+
linked_modules_count: linkedModules.length,
|
|
579
|
+
};
|
|
580
|
+
}),
|
|
581
|
+
};
|
|
582
|
+
}
|
|
374
583
|
async function createWorkspaceQuizSet(workspaceId, payload, options) {
|
|
375
584
|
const client = (0, client_1.getInternalApiClient)(options);
|
|
376
585
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/quiz-sets`, {
|
|
@@ -451,6 +660,26 @@ async function getWorkspaceEducationAttemptDetail(workspaceId, attemptId, option
|
|
|
451
660
|
cache: 'no-store',
|
|
452
661
|
});
|
|
453
662
|
}
|
|
663
|
+
async function getWorkspaceCourseTestQuestions(workspaceId, courseId, testId, params, options) {
|
|
664
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
665
|
+
const searchParams = new URLSearchParams();
|
|
666
|
+
if (params?.moduleId)
|
|
667
|
+
searchParams.set('moduleId', params.moduleId);
|
|
668
|
+
const query = searchParams.toString();
|
|
669
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/tests/${(0, client_1.encodePathSegment)(testId)}/questions${query ? `?${query}` : ''}`, {
|
|
670
|
+
method: 'GET',
|
|
671
|
+
cache: 'no-store',
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
async function createWorkspaceCourseTestQuestions(workspaceId, courseId, testId, payload, options) {
|
|
675
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
676
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/tests/${(0, client_1.encodePathSegment)(testId)}/questions`, {
|
|
677
|
+
method: 'POST',
|
|
678
|
+
headers: { 'Content-Type': 'application/json' },
|
|
679
|
+
body: JSON.stringify(payload),
|
|
680
|
+
cache: 'no-store',
|
|
681
|
+
});
|
|
682
|
+
}
|
|
454
683
|
async function deleteWorkspaceStorageObject(workspaceId, path, options) {
|
|
455
684
|
const client = (0, client_1.getInternalApiClient)(options);
|
|
456
685
|
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/storage/object`, {
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { UserGroup } from '@tuturuuu/types/primitives/UserGroup';
|
|
2
|
+
import type { UserGroupTag } from '@tuturuuu/types/primitives/UserGroupTag';
|
|
3
|
+
import { type InternalApiClientOptions } from './client';
|
|
4
|
+
export interface ListWorkspaceGroupTagsParams {
|
|
5
|
+
page?: number;
|
|
6
|
+
pageSize?: number;
|
|
7
|
+
q?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ListWorkspaceGroupTagsResponse {
|
|
10
|
+
data: UserGroupTag[];
|
|
11
|
+
count: number;
|
|
12
|
+
page: number;
|
|
13
|
+
pageSize: number;
|
|
14
|
+
}
|
|
15
|
+
export interface GetWorkspaceGroupTagResponse {
|
|
16
|
+
data: UserGroupTag;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Paginated read of a workspace's user-group tags (with their linked group ids)
|
|
20
|
+
* via `GET /api/v1/workspaces/:wsId/group-tags`. Forwards the caller's auth
|
|
21
|
+
* (RLS-respecting).
|
|
22
|
+
*/
|
|
23
|
+
export declare function listWorkspaceGroupTags(workspaceId: string, params?: ListWorkspaceGroupTagsParams, options?: InternalApiClientOptions): Promise<ListWorkspaceGroupTagsResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Detail read of a workspace user-group tag via
|
|
26
|
+
* `GET /api/v1/workspaces/:wsId/group-tags/:tagId`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getWorkspaceGroupTag(workspaceId: string, tagId: string, options?: InternalApiClientOptions): Promise<GetWorkspaceGroupTagResponse>;
|
|
29
|
+
export interface ListWorkspaceGroupTagUserGroupsParams {
|
|
30
|
+
page?: number;
|
|
31
|
+
pageSize?: number;
|
|
32
|
+
q?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ListWorkspaceGroupTagUserGroupsResponse {
|
|
35
|
+
data: UserGroup[];
|
|
36
|
+
count: number;
|
|
37
|
+
page: number;
|
|
38
|
+
pageSize: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Lists user groups linked to a workspace user-group tag via
|
|
42
|
+
* `GET /api/v1/workspaces/:wsId/group-tags/:tagId/user-groups`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function listWorkspaceGroupTagUserGroups(workspaceId: string, tagId: string, params?: ListWorkspaceGroupTagUserGroupsParams, options?: InternalApiClientOptions): Promise<ListWorkspaceGroupTagUserGroupsResponse>;
|
|
45
|
+
export interface AddWorkspaceGroupTagUserGroupsPayload {
|
|
46
|
+
groupIds: string[];
|
|
47
|
+
}
|
|
48
|
+
export interface WorkspaceGroupTagUserGroupsMutationResponse {
|
|
49
|
+
message: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Links user groups to a workspace user-group tag via
|
|
53
|
+
* `POST /api/v1/workspaces/:wsId/group-tags/:tagId/user-groups`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function addWorkspaceGroupTagUserGroups(workspaceId: string, tagId: string, payload: AddWorkspaceGroupTagUserGroupsPayload, options?: InternalApiClientOptions): Promise<WorkspaceGroupTagUserGroupsMutationResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Unlinks a user group from a workspace user-group tag via
|
|
58
|
+
* `DELETE /api/v1/workspaces/:wsId/group-tags/:tagId/user-groups/:groupId`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function removeWorkspaceGroupTagUserGroup(workspaceId: string, tagId: string, groupId: string, options?: InternalApiClientOptions): Promise<WorkspaceGroupTagUserGroupsMutationResponse>;
|
|
61
|
+
export interface UpsertWorkspaceGroupTagPayload {
|
|
62
|
+
name: string;
|
|
63
|
+
color: string;
|
|
64
|
+
group_ids?: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface UpsertWorkspaceGroupTagResponse {
|
|
67
|
+
message: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a workspace user-group tag via
|
|
71
|
+
* `POST /api/v1/workspaces/:wsId/group-tags`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function createWorkspaceGroupTag(workspaceId: string, payload: UpsertWorkspaceGroupTagPayload, options?: InternalApiClientOptions): Promise<UpsertWorkspaceGroupTagResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* Updates a workspace user-group tag via
|
|
76
|
+
* `PUT /api/v1/workspaces/:wsId/group-tags/:tagId`.
|
|
77
|
+
*/
|
|
78
|
+
export declare function updateWorkspaceGroupTag(workspaceId: string, tagId: string, payload: UpsertWorkspaceGroupTagPayload, options?: InternalApiClientOptions): Promise<UpsertWorkspaceGroupTagResponse>;
|
|
79
|
+
export interface DeleteWorkspaceGroupTagResponse {
|
|
80
|
+
message: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Deletes a workspace user-group tag via
|
|
84
|
+
* `DELETE /api/v1/workspaces/:wsId/group-tags/:tagId`.
|
|
85
|
+
*/
|
|
86
|
+
export declare function deleteWorkspaceGroupTag(workspaceId: string, tagId: string, options?: InternalApiClientOptions): Promise<DeleteWorkspaceGroupTagResponse>;
|
|
87
|
+
//# sourceMappingURL=group-tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-tags.d.ts","sourceRoot":"","sources":["../src/group-tags.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listWorkspaceGroupTags = listWorkspaceGroupTags;
|
|
4
|
+
exports.getWorkspaceGroupTag = getWorkspaceGroupTag;
|
|
5
|
+
exports.listWorkspaceGroupTagUserGroups = listWorkspaceGroupTagUserGroups;
|
|
6
|
+
exports.addWorkspaceGroupTagUserGroups = addWorkspaceGroupTagUserGroups;
|
|
7
|
+
exports.removeWorkspaceGroupTagUserGroup = removeWorkspaceGroupTagUserGroup;
|
|
8
|
+
exports.createWorkspaceGroupTag = createWorkspaceGroupTag;
|
|
9
|
+
exports.updateWorkspaceGroupTag = updateWorkspaceGroupTag;
|
|
10
|
+
exports.deleteWorkspaceGroupTag = deleteWorkspaceGroupTag;
|
|
11
|
+
const client_1 = require("./client");
|
|
12
|
+
/**
|
|
13
|
+
* Paginated read of a workspace's user-group tags (with their linked group ids)
|
|
14
|
+
* via `GET /api/v1/workspaces/:wsId/group-tags`. Forwards the caller's auth
|
|
15
|
+
* (RLS-respecting).
|
|
16
|
+
*/
|
|
17
|
+
async function listWorkspaceGroupTags(workspaceId, params, options) {
|
|
18
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
19
|
+
const searchParams = new URLSearchParams();
|
|
20
|
+
if (params?.page)
|
|
21
|
+
searchParams.set('page', params.page.toString());
|
|
22
|
+
if (params?.pageSize)
|
|
23
|
+
searchParams.set('pageSize', params.pageSize.toString());
|
|
24
|
+
if (params?.q)
|
|
25
|
+
searchParams.set('q', params.q);
|
|
26
|
+
const query = searchParams.toString();
|
|
27
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/group-tags${query ? `?${query}` : ''}`, {
|
|
28
|
+
method: 'GET',
|
|
29
|
+
cache: 'no-store',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Detail read of a workspace user-group tag via
|
|
34
|
+
* `GET /api/v1/workspaces/:wsId/group-tags/:tagId`.
|
|
35
|
+
*/
|
|
36
|
+
async function getWorkspaceGroupTag(workspaceId, tagId, options) {
|
|
37
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
38
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/group-tags/${(0, client_1.encodePathSegment)(tagId)}`, {
|
|
39
|
+
method: 'GET',
|
|
40
|
+
cache: 'no-store',
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Lists user groups linked to a workspace user-group tag via
|
|
45
|
+
* `GET /api/v1/workspaces/:wsId/group-tags/:tagId/user-groups`.
|
|
46
|
+
*/
|
|
47
|
+
async function listWorkspaceGroupTagUserGroups(workspaceId, tagId, params, options) {
|
|
48
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
49
|
+
const searchParams = new URLSearchParams();
|
|
50
|
+
if (params?.page)
|
|
51
|
+
searchParams.set('page', params.page.toString());
|
|
52
|
+
if (params?.pageSize)
|
|
53
|
+
searchParams.set('pageSize', params.pageSize.toString());
|
|
54
|
+
if (params?.q)
|
|
55
|
+
searchParams.set('q', params.q);
|
|
56
|
+
const query = searchParams.toString();
|
|
57
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/group-tags/${(0, client_1.encodePathSegment)(tagId)}/user-groups${query ? `?${query}` : ''}`, {
|
|
58
|
+
method: 'GET',
|
|
59
|
+
cache: 'no-store',
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Links user groups to a workspace user-group tag via
|
|
64
|
+
* `POST /api/v1/workspaces/:wsId/group-tags/:tagId/user-groups`.
|
|
65
|
+
*/
|
|
66
|
+
async function addWorkspaceGroupTagUserGroups(workspaceId, tagId, payload, options) {
|
|
67
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
68
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/group-tags/${(0, client_1.encodePathSegment)(tagId)}/user-groups`, {
|
|
69
|
+
cache: 'no-store',
|
|
70
|
+
method: 'POST',
|
|
71
|
+
headers: { 'Content-Type': 'application/json' },
|
|
72
|
+
body: JSON.stringify(payload),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Unlinks a user group from a workspace user-group tag via
|
|
77
|
+
* `DELETE /api/v1/workspaces/:wsId/group-tags/:tagId/user-groups/:groupId`.
|
|
78
|
+
*/
|
|
79
|
+
async function removeWorkspaceGroupTagUserGroup(workspaceId, tagId, groupId, options) {
|
|
80
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
81
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/group-tags/${(0, client_1.encodePathSegment)(tagId)}/user-groups/${(0, client_1.encodePathSegment)(groupId)}`, { cache: 'no-store', method: 'DELETE' });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Creates a workspace user-group tag via
|
|
85
|
+
* `POST /api/v1/workspaces/:wsId/group-tags`.
|
|
86
|
+
*/
|
|
87
|
+
async function createWorkspaceGroupTag(workspaceId, payload, options) {
|
|
88
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
89
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/group-tags`, {
|
|
90
|
+
cache: 'no-store',
|
|
91
|
+
method: 'POST',
|
|
92
|
+
headers: { 'Content-Type': 'application/json' },
|
|
93
|
+
body: JSON.stringify(payload),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Updates a workspace user-group tag via
|
|
98
|
+
* `PUT /api/v1/workspaces/:wsId/group-tags/:tagId`.
|
|
99
|
+
*/
|
|
100
|
+
async function updateWorkspaceGroupTag(workspaceId, tagId, payload, options) {
|
|
101
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
102
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/group-tags/${(0, client_1.encodePathSegment)(tagId)}`, {
|
|
103
|
+
cache: 'no-store',
|
|
104
|
+
method: 'PUT',
|
|
105
|
+
headers: { 'Content-Type': 'application/json' },
|
|
106
|
+
body: JSON.stringify(payload),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Deletes a workspace user-group tag via
|
|
111
|
+
* `DELETE /api/v1/workspaces/:wsId/group-tags/:tagId`.
|
|
112
|
+
*/
|
|
113
|
+
async function deleteWorkspaceGroupTag(workspaceId, tagId, options) {
|
|
114
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
115
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/group-tags/${(0, client_1.encodePathSegment)(tagId)}`, { cache: 'no-store', method: 'DELETE' });
|
|
116
|
+
}
|