@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.
Files changed (88) hide show
  1. package/dist/ai.d.ts +43 -0
  2. package/dist/ai.d.ts.map +1 -0
  3. package/dist/ai.js +57 -0
  4. package/dist/auth.d.ts +46 -0
  5. package/dist/auth.d.ts.map +1 -0
  6. package/dist/auth.js +47 -0
  7. package/dist/calendar.d.ts +99 -0
  8. package/dist/calendar.d.ts.map +1 -0
  9. package/dist/calendar.js +94 -0
  10. package/dist/chat.d.ts +46 -0
  11. package/dist/chat.d.ts.map +1 -0
  12. package/dist/chat.js +67 -0
  13. package/dist/client.d.ts +35 -0
  14. package/dist/client.d.ts.map +1 -0
  15. package/dist/client.js +216 -0
  16. package/dist/education.d.ts +167 -0
  17. package/dist/education.d.ts.map +1 -0
  18. package/dist/education.js +288 -0
  19. package/dist/external-projects.d.ts +425 -0
  20. package/dist/external-projects.d.ts.map +1 -0
  21. package/dist/external-projects.js +466 -0
  22. package/dist/finance.d.ts +109 -0
  23. package/dist/finance.d.ts.map +1 -0
  24. package/dist/finance.js +143 -0
  25. package/dist/habit-trackers.d.ts +25 -0
  26. package/dist/habit-trackers.d.ts.map +1 -0
  27. package/dist/habit-trackers.js +108 -0
  28. package/dist/index.d.ts +34 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +280 -0
  31. package/dist/infrastructure.d.ts +354 -0
  32. package/dist/infrastructure.d.ts.map +1 -0
  33. package/dist/infrastructure.js +100 -0
  34. package/dist/inquiries.d.ts +12 -0
  35. package/dist/inquiries.d.ts.map +1 -0
  36. package/dist/inquiries.js +28 -0
  37. package/dist/mail.d.ts +19 -0
  38. package/dist/mail.d.ts.map +1 -0
  39. package/dist/mail.js +12 -0
  40. package/dist/nova.d.ts +5 -0
  41. package/dist/nova.d.ts.map +1 -0
  42. package/dist/nova.js +10 -0
  43. package/dist/posts.d.ts +9 -0
  44. package/dist/posts.d.ts.map +1 -0
  45. package/dist/posts.js +15 -0
  46. package/dist/promotions.d.ts +11 -0
  47. package/dist/promotions.d.ts.map +1 -0
  48. package/dist/promotions.js +15 -0
  49. package/dist/reports.d.ts +42 -0
  50. package/dist/reports.d.ts.map +1 -0
  51. package/dist/reports.js +48 -0
  52. package/dist/roles.d.ts +45 -0
  53. package/dist/roles.d.ts.map +1 -0
  54. package/dist/roles.js +96 -0
  55. package/dist/settings.d.ts +48 -0
  56. package/dist/settings.d.ts.map +1 -0
  57. package/dist/settings.js +66 -0
  58. package/dist/storage.d.ts +187 -0
  59. package/dist/storage.d.ts.map +1 -0
  60. package/dist/storage.js +371 -0
  61. package/dist/tasks-scheduling.d.ts +14 -0
  62. package/dist/tasks-scheduling.d.ts.map +1 -0
  63. package/dist/tasks-scheduling.js +14 -0
  64. package/dist/tasks.d.ts +311 -0
  65. package/dist/tasks.d.ts.map +1 -0
  66. package/dist/tasks.js +396 -0
  67. package/dist/templates.d.ts +48 -0
  68. package/dist/templates.d.ts.map +1 -0
  69. package/dist/templates.js +19 -0
  70. package/dist/time-tracking.d.ts +88 -0
  71. package/dist/time-tracking.d.ts.map +1 -0
  72. package/dist/time-tracking.js +101 -0
  73. package/dist/users-feedbacks.d.ts +66 -0
  74. package/dist/users-feedbacks.d.ts.map +1 -0
  75. package/dist/users-feedbacks.js +46 -0
  76. package/dist/users.d.ts +89 -0
  77. package/dist/users.d.ts.map +1 -0
  78. package/dist/users.js +139 -0
  79. package/dist/workspace-configs.d.ts +24 -0
  80. package/dist/workspace-configs.d.ts.map +1 -0
  81. package/dist/workspace-configs.js +76 -0
  82. package/dist/workspace-user-audit.d.ts +66 -0
  83. package/dist/workspace-user-audit.d.ts.map +1 -0
  84. package/dist/workspace-user-audit.js +23 -0
  85. package/dist/workspaces.d.ts +59 -0
  86. package/dist/workspaces.d.ts.map +1 -0
  87. package/dist/workspaces.js +131 -0
  88. package/package.json +141 -0
package/dist/ai.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ import { type InternalApiClientOptions } from './client';
2
+ export interface InternalAiChatSummary {
3
+ id: string;
4
+ title: string | null;
5
+ created_at: string;
6
+ pinned?: boolean | null;
7
+ is_public?: boolean | null;
8
+ model?: string | null;
9
+ }
10
+ export interface GenerateWorkspaceCourseModulesFromStoragePayload {
11
+ fileName?: string;
12
+ groupId: string;
13
+ maxCharacters?: number;
14
+ storagePath: string;
15
+ }
16
+ export interface GeneratedWorkspaceCourseModule {
17
+ id: string;
18
+ name?: string | null;
19
+ content?: string | null;
20
+ sort_key?: number | null;
21
+ }
22
+ export interface GenerateWorkspaceCourseModulesFromStorageResponse {
23
+ data: unknown;
24
+ createdModules: GeneratedWorkspaceCourseModule[] | null;
25
+ metadata?: {
26
+ title?: string | null;
27
+ creditsCharged?: number;
28
+ truncated?: boolean;
29
+ };
30
+ }
31
+ export declare function listWorkspaceAiModelFavorites(workspaceId: string, options?: InternalApiClientOptions): Promise<string[]>;
32
+ export declare function toggleWorkspaceAiModelFavorite(workspaceId: string, payload: {
33
+ modelId: string;
34
+ isFavorited: boolean;
35
+ }, options?: InternalApiClientOptions): Promise<{
36
+ success: true;
37
+ }>;
38
+ export declare function listCurrentUserAiChats(options?: InternalApiClientOptions): Promise<InternalAiChatSummary[]>;
39
+ export declare function updateAiChat(chatId: string, payload: Partial<Pick<InternalAiChatSummary, 'is_public' | 'title' | 'pinned'>>, options?: InternalApiClientOptions): Promise<{
40
+ success: true;
41
+ }>;
42
+ export declare function generateWorkspaceCourseModulesFromStorage(workspaceId: string, payload: GenerateWorkspaceCourseModulesFromStoragePayload, options?: InternalApiClientOptions): Promise<GenerateWorkspaceCourseModulesFromStorageResponse>;
43
+ //# sourceMappingURL=ai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,qBAAq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,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,CACd,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC,CAC9D,EACD,OAAO,CAAC,EAAE,wBAAwB;aAGJ,IAAI;GAWnC;AAED,wBAAsB,yCAAyC,CAC7D,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,gDAAgD,EACzD,OAAO,CAAC,EAAE,wBAAwB,8DAiBnC"}
package/dist/ai.js ADDED
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listWorkspaceAiModelFavorites = listWorkspaceAiModelFavorites;
4
+ exports.toggleWorkspaceAiModelFavorite = toggleWorkspaceAiModelFavorite;
5
+ exports.listCurrentUserAiChats = listCurrentUserAiChats;
6
+ exports.updateAiChat = updateAiChat;
7
+ exports.generateWorkspaceCourseModulesFromStorage = generateWorkspaceCourseModulesFromStorage;
8
+ const client_1 = require("./client");
9
+ async function listWorkspaceAiModelFavorites(workspaceId, options) {
10
+ const client = (0, client_1.getInternalApiClient)(options);
11
+ const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/ai/model-favorites`, {
12
+ cache: 'no-store',
13
+ });
14
+ return payload.favoriteIds ?? [];
15
+ }
16
+ async function toggleWorkspaceAiModelFavorite(workspaceId, payload, options) {
17
+ const client = (0, client_1.getInternalApiClient)(options);
18
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/ai/model-favorites`, {
19
+ method: 'PATCH',
20
+ headers: {
21
+ 'Content-Type': 'application/json',
22
+ },
23
+ body: JSON.stringify(payload),
24
+ cache: 'no-store',
25
+ });
26
+ }
27
+ async function listCurrentUserAiChats(options) {
28
+ const client = (0, client_1.getInternalApiClient)(options);
29
+ return client.json('/api/v1/ai/chats', {
30
+ cache: 'no-store',
31
+ });
32
+ }
33
+ async function updateAiChat(chatId, payload, options) {
34
+ const client = (0, client_1.getInternalApiClient)(options);
35
+ return client.json(`/api/v1/ai/chats/${(0, client_1.encodePathSegment)(chatId)}`, {
36
+ method: 'PATCH',
37
+ headers: {
38
+ 'Content-Type': 'application/json',
39
+ },
40
+ body: JSON.stringify(payload),
41
+ cache: 'no-store',
42
+ });
43
+ }
44
+ async function generateWorkspaceCourseModulesFromStorage(workspaceId, payload, options) {
45
+ const client = (0, client_1.getInternalApiClient)(options);
46
+ return client.json('/api/ai/course', {
47
+ method: 'POST',
48
+ headers: {
49
+ 'Content-Type': 'application/json',
50
+ },
51
+ body: JSON.stringify({
52
+ wsId: workspaceId,
53
+ ...payload,
54
+ }),
55
+ cache: 'no-store',
56
+ });
57
+ }
package/dist/auth.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ import { type InternalApiClientOptions } from './client';
2
+ export type InternalOtpClient = 'mobile' | 'web';
3
+ export type InternalOtpPlatform = 'android' | 'ios';
4
+ export interface OtpSettingsResponse {
5
+ otpEnabled: boolean;
6
+ }
7
+ export interface SendOtpPayload {
8
+ captchaToken?: string;
9
+ client: InternalOtpClient;
10
+ deviceId?: string;
11
+ email: string;
12
+ locale?: string;
13
+ platform?: InternalOtpPlatform;
14
+ }
15
+ export interface SendOtpResponse {
16
+ error?: string;
17
+ retryAfter?: number;
18
+ success?: boolean;
19
+ }
20
+ export interface VerifyOtpPayload {
21
+ client: InternalOtpClient;
22
+ deviceId?: string;
23
+ email: string;
24
+ locale?: string;
25
+ otp: string;
26
+ platform?: InternalOtpPlatform;
27
+ }
28
+ export interface VerifyOtpResponse {
29
+ error?: string;
30
+ retryAfter?: number;
31
+ session?: {
32
+ access_token: string;
33
+ expires_at: number | null;
34
+ expires_in: number;
35
+ refresh_token: string;
36
+ token_type: string;
37
+ };
38
+ success?: boolean;
39
+ }
40
+ export declare function getOtpSettings(payload: {
41
+ client: InternalOtpClient;
42
+ platform?: InternalOtpPlatform;
43
+ }, options?: InternalApiClientOptions): Promise<OtpSettingsResponse>;
44
+ export declare function sendOtpWithInternalApi(payload: SendOtpPayload, options?: InternalApiClientOptions): Promise<SendOtpResponse>;
45
+ export declare function verifyOtpWithInternalApi(payload: VerifyOtpPayload, options?: InternalApiClientOptions): Promise<VerifyOtpResponse>;
46
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAE/E,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,KAAK,CAAC;AACjD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,KAAK,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAgBD,wBAAsB,cAAc,CAClC,OAAO,EAAE;IACP,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC,EACD,OAAO,CAAC,EAAE,wBAAwB,gCAOnC;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,wBAAwB,4BAYnC;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,wBAAwB,8BAYnC"}
package/dist/auth.js ADDED
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOtpSettings = getOtpSettings;
4
+ exports.sendOtpWithInternalApi = sendOtpWithInternalApi;
5
+ exports.verifyOtpWithInternalApi = verifyOtpWithInternalApi;
6
+ const client_1 = require("./client");
7
+ async function parseAuthResponse(response) {
8
+ const payload = (await response.json().catch(() => null));
9
+ if (payload) {
10
+ return payload;
11
+ }
12
+ if (!response.ok) {
13
+ throw new Error(`Internal API request failed: ${response.status}`);
14
+ }
15
+ return {};
16
+ }
17
+ async function getOtpSettings(payload, options) {
18
+ const client = (0, client_1.getInternalApiClient)(options);
19
+ return client.json('/api/v1/auth/otp/settings', {
20
+ cache: 'no-store',
21
+ query: payload,
22
+ });
23
+ }
24
+ async function sendOtpWithInternalApi(payload, options) {
25
+ const client = (0, client_1.getInternalApiClient)(options);
26
+ const response = await client.fetch('/api/v1/auth/otp/send', {
27
+ body: JSON.stringify(payload),
28
+ cache: 'no-store',
29
+ headers: {
30
+ 'Content-Type': 'application/json',
31
+ },
32
+ method: 'POST',
33
+ });
34
+ return parseAuthResponse(response);
35
+ }
36
+ async function verifyOtpWithInternalApi(payload, options) {
37
+ const client = (0, client_1.getInternalApiClient)(options);
38
+ const response = await client.fetch('/api/v1/auth/otp/verify', {
39
+ body: JSON.stringify(payload),
40
+ cache: 'no-store',
41
+ headers: {
42
+ 'Content-Type': 'application/json',
43
+ },
44
+ method: 'POST',
45
+ });
46
+ return parseAuthResponse(response);
47
+ }
@@ -0,0 +1,99 @@
1
+ import type { TaskWithScheduling } from '@tuturuuu/types';
2
+ import type { CalendarEvent } from '@tuturuuu/types/primitives/calendar-event';
3
+ import type { InternalApiClientOptions } from './client';
4
+ export interface WorkspaceCalendarEventUpdatePayload {
5
+ locked?: boolean;
6
+ }
7
+ export interface WorkspaceCalendarEventCreatePayload {
8
+ title: string;
9
+ start_at: string;
10
+ end_at: string;
11
+ description?: string | null;
12
+ location?: string | null;
13
+ color?: string;
14
+ locked?: boolean;
15
+ task_id?: string | null;
16
+ }
17
+ export interface SchedulePreviewRequestPayload {
18
+ windowDays?: number;
19
+ clientTimezone?: string;
20
+ }
21
+ export interface ScheduleApplyRequestPayload extends SchedulePreviewRequestPayload {
22
+ forceReschedule?: boolean;
23
+ mode?: 'safe-apply' | 'full-apply';
24
+ scope?: 'impacted-only' | 'full-window';
25
+ warnings?: string[];
26
+ summary?: {
27
+ totalEvents: number;
28
+ habitsScheduled: number;
29
+ tasksScheduled: number;
30
+ partiallyScheduledTasks: number;
31
+ unscheduledTasks: number;
32
+ };
33
+ previewEvents?: Array<Record<string, unknown> | unknown>;
34
+ }
35
+ export interface SchedulableTasksResponse {
36
+ tasks: TaskWithScheduling[];
37
+ }
38
+ export interface TaskScheduleHistoryEntry {
39
+ event_id: string | null;
40
+ date: string;
41
+ start_at: string | null;
42
+ end_at: string | null;
43
+ scheduled_minutes: number;
44
+ status: 'completed' | 'scheduled' | 'trimmed';
45
+ }
46
+ export interface TaskScheduleHistoryResponse {
47
+ entries: TaskScheduleHistoryEntry[];
48
+ summary: {
49
+ totalMinutes: number;
50
+ scheduledMinutes: number;
51
+ remainingMinutes: number;
52
+ };
53
+ }
54
+ export interface HabitScheduleHistoryEntry {
55
+ occurrence_date: string;
56
+ status: 'completed' | 'scheduled' | 'skipped' | 'to_be_scheduled';
57
+ event_id: string | null;
58
+ start_at: string | null;
59
+ end_at: string | null;
60
+ canRevoke: boolean;
61
+ revoked_at?: string | null;
62
+ }
63
+ export interface HabitScheduleHistoryResponse {
64
+ entries: HabitScheduleHistoryEntry[];
65
+ summary: {
66
+ scheduledCount: number;
67
+ completedCount: number;
68
+ skippedCount: number;
69
+ toBeScheduledCount: number;
70
+ };
71
+ }
72
+ export interface HabitSkipPayload {
73
+ occurrenceDate: string;
74
+ sourceEventId?: string | null;
75
+ }
76
+ export declare function updateWorkspaceCalendarEvent(wsId: string, eventId: string, payload: WorkspaceCalendarEventUpdatePayload, options?: InternalApiClientOptions): Promise<CalendarEvent>;
77
+ export declare function createWorkspaceCalendarEvent(wsId: string, payload: WorkspaceCalendarEventCreatePayload, options?: InternalApiClientOptions): Promise<CalendarEvent>;
78
+ export declare function listWorkspaceSchedulableTasks(wsId: string, query?: {
79
+ q?: string;
80
+ }, options?: InternalApiClientOptions): Promise<SchedulableTasksResponse>;
81
+ export declare function previewWorkspaceCalendarSchedule<TResponse>(wsId: string, payload: SchedulePreviewRequestPayload, options?: InternalApiClientOptions): Promise<TResponse>;
82
+ export declare function applyWorkspaceCalendarSchedule<TResponse>(wsId: string, payload: ScheduleApplyRequestPayload, options?: InternalApiClientOptions): Promise<TResponse>;
83
+ export declare function getWorkspaceTaskScheduleHistory(wsId: string, taskId: string, query?: {
84
+ start?: string;
85
+ end?: string;
86
+ }, options?: InternalApiClientOptions): Promise<TaskScheduleHistoryResponse>;
87
+ export declare function getWorkspaceHabitScheduleHistory(wsId: string, habitId: string, query?: {
88
+ start?: string;
89
+ end?: string;
90
+ }, options?: InternalApiClientOptions): Promise<HabitScheduleHistoryResponse>;
91
+ export declare function createWorkspaceHabitSkip(wsId: string, habitId: string, payload: HabitSkipPayload, options?: InternalApiClientOptions): Promise<{
92
+ success: true;
93
+ occurrenceDate: string;
94
+ }>;
95
+ export declare function revokeWorkspaceHabitSkip(wsId: string, habitId: string, payload: HabitSkipPayload, options?: InternalApiClientOptions): Promise<{
96
+ success: true;
97
+ occurrenceDate: string;
98
+ }>;
99
+ //# sourceMappingURL=calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../src/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGzD,MAAM,WAAW,mCAAmC;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,mCAAmC;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,2BACf,SAAQ,6BAA6B;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACnC,KAAK,CAAC,EAAE,eAAe,GAAG,aAAa,CAA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EACZ,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EACxC,OAAO,CAAC,EAAE,wBAAwB,yCAUnC;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,wBAAwB;aAGJ,IAAI;oBAAkB,MAAM;GAW3D;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,wBAAwB;aAGJ,IAAI;oBAAkB,MAAM;GAW3D"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateWorkspaceCalendarEvent = updateWorkspaceCalendarEvent;
4
+ exports.createWorkspaceCalendarEvent = createWorkspaceCalendarEvent;
5
+ exports.listWorkspaceSchedulableTasks = listWorkspaceSchedulableTasks;
6
+ exports.previewWorkspaceCalendarSchedule = previewWorkspaceCalendarSchedule;
7
+ exports.applyWorkspaceCalendarSchedule = applyWorkspaceCalendarSchedule;
8
+ exports.getWorkspaceTaskScheduleHistory = getWorkspaceTaskScheduleHistory;
9
+ exports.getWorkspaceHabitScheduleHistory = getWorkspaceHabitScheduleHistory;
10
+ exports.createWorkspaceHabitSkip = createWorkspaceHabitSkip;
11
+ exports.revokeWorkspaceHabitSkip = revokeWorkspaceHabitSkip;
12
+ const client_1 = require("./client");
13
+ async function updateWorkspaceCalendarEvent(wsId, eventId, payload, options) {
14
+ const client = (0, client_1.getInternalApiClient)(options);
15
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/calendar/events/${(0, client_1.encodePathSegment)(eventId)}`, {
16
+ method: 'PUT',
17
+ headers: {
18
+ 'Content-Type': 'application/json',
19
+ },
20
+ body: JSON.stringify(payload),
21
+ });
22
+ }
23
+ async function createWorkspaceCalendarEvent(wsId, payload, options) {
24
+ const client = (0, client_1.getInternalApiClient)(options);
25
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/calendar/events`, {
26
+ method: 'POST',
27
+ headers: {
28
+ 'Content-Type': 'application/json',
29
+ },
30
+ body: JSON.stringify(payload),
31
+ });
32
+ }
33
+ async function listWorkspaceSchedulableTasks(wsId, query, options) {
34
+ const client = (0, client_1.getInternalApiClient)(options);
35
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/calendar/schedulable-tasks`, {
36
+ query,
37
+ });
38
+ }
39
+ async function previewWorkspaceCalendarSchedule(wsId, payload, options) {
40
+ const client = (0, client_1.getInternalApiClient)(options);
41
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/calendar/schedule/preview`, {
42
+ method: 'POST',
43
+ headers: {
44
+ 'Content-Type': 'application/json',
45
+ },
46
+ body: JSON.stringify(payload),
47
+ });
48
+ }
49
+ async function applyWorkspaceCalendarSchedule(wsId, payload, options) {
50
+ const client = (0, client_1.getInternalApiClient)(options);
51
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/calendar/schedule`, {
52
+ method: 'POST',
53
+ headers: {
54
+ 'Content-Type': 'application/json',
55
+ },
56
+ body: JSON.stringify(payload),
57
+ });
58
+ }
59
+ async function getWorkspaceTaskScheduleHistory(wsId, taskId, query, options) {
60
+ const client = (0, client_1.getInternalApiClient)(options);
61
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/schedule/history`, {
62
+ query,
63
+ cache: 'no-store',
64
+ });
65
+ }
66
+ async function getWorkspaceHabitScheduleHistory(wsId, habitId, query, options) {
67
+ const client = (0, client_1.getInternalApiClient)(options);
68
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/habits/${(0, client_1.encodePathSegment)(habitId)}/schedule/history`, {
69
+ query,
70
+ cache: 'no-store',
71
+ });
72
+ }
73
+ async function createWorkspaceHabitSkip(wsId, habitId, payload, options) {
74
+ const client = (0, client_1.getInternalApiClient)(options);
75
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/habits/${(0, client_1.encodePathSegment)(habitId)}/skips`, {
76
+ method: 'POST',
77
+ headers: {
78
+ 'Content-Type': 'application/json',
79
+ },
80
+ body: JSON.stringify(payload),
81
+ cache: 'no-store',
82
+ });
83
+ }
84
+ async function revokeWorkspaceHabitSkip(wsId, habitId, payload, options) {
85
+ const client = (0, client_1.getInternalApiClient)(options);
86
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(wsId)}/habits/${(0, client_1.encodePathSegment)(habitId)}/skips`, {
87
+ method: 'DELETE',
88
+ headers: {
89
+ 'Content-Type': 'application/json',
90
+ },
91
+ body: JSON.stringify(payload),
92
+ cache: 'no-store',
93
+ });
94
+ }
package/dist/chat.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ import { type InternalApiClientOptions } from './client';
2
+ export interface WorkspaceChatChannel {
3
+ id: string;
4
+ ws_id: string;
5
+ name: string;
6
+ created_at: string | null;
7
+ created_by: string | null;
8
+ updated_at?: string | null;
9
+ description?: string | null;
10
+ is_private?: boolean | null;
11
+ }
12
+ export interface WorkspaceChatMessage {
13
+ id: string;
14
+ channel_id: string;
15
+ user_id: string;
16
+ content: string;
17
+ created_at: string;
18
+ updated_at: string | null;
19
+ deleted_at: string | null;
20
+ }
21
+ export interface WorkspaceChatParticipant {
22
+ channel_id: string;
23
+ user_id: string;
24
+ last_read_at: string | null;
25
+ }
26
+ export declare function listWorkspaceChatChannels(workspaceId: string, options?: InternalApiClientOptions): Promise<WorkspaceChatChannel[]>;
27
+ export declare function createWorkspaceChatChannel(workspaceId: string, name: string, options?: InternalApiClientOptions): Promise<{
28
+ channel: WorkspaceChatChannel;
29
+ }>;
30
+ export declare function listWorkspaceChatMessages(workspaceId: string, channelId: string, options?: InternalApiClientOptions): Promise<WorkspaceChatMessage[]>;
31
+ export declare function createWorkspaceChatMessage(workspaceId: string, channelId: string, content: string, options?: InternalApiClientOptions): Promise<{
32
+ message: WorkspaceChatMessage;
33
+ }>;
34
+ export declare function listWorkspaceChatParticipants(workspaceId: string, channelId: string, options?: InternalApiClientOptions): Promise<WorkspaceChatParticipant[]>;
35
+ export declare function upsertWorkspaceChatParticipant(workspaceId: string, channelId: string, payload: {
36
+ last_read_at?: string;
37
+ }, options?: InternalApiClientOptions): Promise<{
38
+ success: true;
39
+ }>;
40
+ export declare function upsertWorkspaceChatTyping(workspaceId: string, channelId: string, options?: InternalApiClientOptions): Promise<{
41
+ success: true;
42
+ }>;
43
+ export declare function deleteWorkspaceChatTyping(workspaceId: string, channelId: string, options?: InternalApiClientOptions): Promise<{
44
+ success: true;
45
+ }>;
46
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;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AS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,wBAAwB;aAGJ,IAAI;GAOnC"}
package/dist/chat.js ADDED
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listWorkspaceChatChannels = listWorkspaceChatChannels;
4
+ exports.createWorkspaceChatChannel = createWorkspaceChatChannel;
5
+ exports.listWorkspaceChatMessages = listWorkspaceChatMessages;
6
+ exports.createWorkspaceChatMessage = createWorkspaceChatMessage;
7
+ exports.listWorkspaceChatParticipants = listWorkspaceChatParticipants;
8
+ exports.upsertWorkspaceChatParticipant = upsertWorkspaceChatParticipant;
9
+ exports.upsertWorkspaceChatTyping = upsertWorkspaceChatTyping;
10
+ exports.deleteWorkspaceChatTyping = deleteWorkspaceChatTyping;
11
+ const client_1 = require("./client");
12
+ async function listWorkspaceChatChannels(workspaceId, options) {
13
+ const client = (0, client_1.getInternalApiClient)(options);
14
+ const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/chat/channels`, { cache: 'no-store' });
15
+ return payload.channels ?? [];
16
+ }
17
+ async function createWorkspaceChatChannel(workspaceId, name, options) {
18
+ const client = (0, client_1.getInternalApiClient)(options);
19
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/chat/channels`, {
20
+ method: 'POST',
21
+ headers: { 'Content-Type': 'application/json' },
22
+ body: JSON.stringify({ name }),
23
+ cache: 'no-store',
24
+ });
25
+ }
26
+ async function listWorkspaceChatMessages(workspaceId, channelId, options) {
27
+ const client = (0, client_1.getInternalApiClient)(options);
28
+ const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/chat/channels/${(0, client_1.encodePathSegment)(channelId)}/messages`, { cache: 'no-store' });
29
+ return payload.messages ?? [];
30
+ }
31
+ async function createWorkspaceChatMessage(workspaceId, channelId, content, options) {
32
+ const client = (0, client_1.getInternalApiClient)(options);
33
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/chat/channels/${(0, client_1.encodePathSegment)(channelId)}/messages`, {
34
+ method: 'POST',
35
+ headers: { 'Content-Type': 'application/json' },
36
+ body: JSON.stringify({ content }),
37
+ cache: 'no-store',
38
+ });
39
+ }
40
+ async function listWorkspaceChatParticipants(workspaceId, channelId, options) {
41
+ const client = (0, client_1.getInternalApiClient)(options);
42
+ const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/chat/channels/${(0, client_1.encodePathSegment)(channelId)}/participants`, { cache: 'no-store' });
43
+ return payload.participants ?? [];
44
+ }
45
+ async function upsertWorkspaceChatParticipant(workspaceId, channelId, payload, options) {
46
+ const client = (0, client_1.getInternalApiClient)(options);
47
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/chat/channels/${(0, client_1.encodePathSegment)(channelId)}/participants`, {
48
+ method: 'POST',
49
+ headers: { 'Content-Type': 'application/json' },
50
+ body: JSON.stringify(payload),
51
+ cache: 'no-store',
52
+ });
53
+ }
54
+ async function upsertWorkspaceChatTyping(workspaceId, channelId, options) {
55
+ const client = (0, client_1.getInternalApiClient)(options);
56
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/chat/channels/${(0, client_1.encodePathSegment)(channelId)}/typing`, {
57
+ method: 'POST',
58
+ cache: 'no-store',
59
+ });
60
+ }
61
+ async function deleteWorkspaceChatTyping(workspaceId, channelId, options) {
62
+ const client = (0, client_1.getInternalApiClient)(options);
63
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/chat/channels/${(0, client_1.encodePathSegment)(channelId)}/typing`, {
64
+ method: 'DELETE',
65
+ cache: 'no-store',
66
+ });
67
+ }
@@ -0,0 +1,35 @@
1
+ export type InternalApiQueryValue = string | number | boolean | null | undefined;
2
+ export type InternalApiQuery = Record<string, InternalApiQueryValue>;
3
+ export type InternalApiFetchInit = Omit<RequestInit, 'headers'> & {
4
+ baseUrl?: string;
5
+ headers?: HeadersInit;
6
+ query?: InternalApiQuery;
7
+ };
8
+ export type InternalApiClientOptions = {
9
+ baseUrl?: string;
10
+ defaultHeaders?: HeadersInit;
11
+ fetch?: typeof fetch;
12
+ };
13
+ type HeaderAccessor = Pick<Headers, 'get'>;
14
+ export declare function encodePathSegment(value: string): string;
15
+ export declare function getConfiguredInternalApiBaseUrl(): string;
16
+ export declare function resolveInternalApiUrl(path: string, baseUrl?: string): string;
17
+ export declare function createInternalApiClient(options?: InternalApiClientOptions): {
18
+ fetch: (path: string, init?: InternalApiFetchInit) => Promise<Response>;
19
+ json<T>(path: string, init?: InternalApiFetchInit): Promise<T>;
20
+ };
21
+ /**
22
+ * Creates Internal API client options that forward auth-relevant headers
23
+ * from an incoming request context (for example `next/headers()` in RSC).
24
+ */
25
+ export declare function withForwardedInternalApiAuth(requestHeaders: HeaderAccessor, options?: InternalApiClientOptions): InternalApiClientOptions;
26
+ export declare const internalApiClient: {
27
+ fetch: (path: string, init?: InternalApiFetchInit) => Promise<Response>;
28
+ json<T>(path: string, init?: InternalApiFetchInit): Promise<T>;
29
+ };
30
+ export declare function getInternalApiClient(options?: InternalApiClientOptions): {
31
+ fetch: (path: string, init?: InternalApiFetchInit) => Promise<Response>;
32
+ json<T>(path: string, init?: InternalApiFetchInit): Promise<T>;
33
+ };
34
+ export {};
35
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,CAAC;AAEd,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAChE,OAAO,CAAC,E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