@excali-boards/boards-api-client 1.1.50 → 1.1.52

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 (83) hide show
  1. package/dist/classes/admin.d.ts +6 -3
  2. package/dist/classes/admin.js +1 -5
  3. package/dist/classes/analytics.d.ts +5 -5
  4. package/dist/classes/analytics.js +1 -5
  5. package/dist/classes/auth.d.ts +48 -0
  6. package/dist/classes/auth.js +12 -0
  7. package/dist/classes/boards.d.ts +26 -8
  8. package/dist/classes/boards.js +7 -5
  9. package/dist/classes/calendar.d.ts +6 -6
  10. package/dist/classes/calendar.js +1 -5
  11. package/dist/classes/categories.d.ts +25 -7
  12. package/dist/classes/categories.js +7 -5
  13. package/dist/classes/files.d.ts +3 -3
  14. package/dist/classes/files.js +1 -5
  15. package/dist/classes/flashcards.d.ts +10 -10
  16. package/dist/classes/flashcards.js +1 -5
  17. package/dist/classes/groups.d.ts +15 -11
  18. package/dist/classes/groups.js +1 -5
  19. package/dist/classes/invites.d.ts +7 -7
  20. package/dist/classes/invites.js +1 -5
  21. package/dist/classes/metrics.d.ts +2 -2
  22. package/dist/classes/metrics.js +1 -5
  23. package/dist/classes/permissions.d.ts +4 -4
  24. package/dist/classes/permissions.js +1 -5
  25. package/dist/classes/sessions.d.ts +6 -5
  26. package/dist/classes/sessions.js +1 -5
  27. package/dist/classes/users.d.ts +3 -3
  28. package/dist/classes/users.js +1 -5
  29. package/dist/classes/utils.d.ts +1 -1
  30. package/dist/classes/utils.js +1 -5
  31. package/dist/core/manager.d.ts +3 -1
  32. package/dist/core/manager.js +35 -40
  33. package/dist/core/utils.js +4 -10
  34. package/dist/external/types.d.ts +11 -0
  35. package/dist/external/types.js +2 -5
  36. package/dist/external/vars.js +15 -18
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +20 -35
  39. package/dist/src/classes/admin.d.ts +23 -0
  40. package/dist/src/classes/admin.js +20 -0
  41. package/dist/src/classes/analytics.d.ts +62 -0
  42. package/dist/src/classes/analytics.js +38 -0
  43. package/dist/src/classes/auth.d.ts +48 -0
  44. package/dist/src/classes/auth.js +12 -0
  45. package/dist/src/classes/boards.d.ts +99 -0
  46. package/dist/src/classes/boards.js +62 -0
  47. package/dist/src/classes/calendar.d.ts +84 -0
  48. package/dist/src/classes/calendar.js +45 -0
  49. package/dist/src/classes/categories.d.ts +75 -0
  50. package/dist/src/classes/categories.js +50 -0
  51. package/dist/src/classes/files.d.ts +45 -0
  52. package/dist/src/classes/files.js +31 -0
  53. package/dist/src/classes/flashcards.d.ts +120 -0
  54. package/dist/src/classes/flashcards.js +68 -0
  55. package/dist/src/classes/groups.d.ts +80 -0
  56. package/dist/src/classes/groups.js +62 -0
  57. package/dist/src/classes/invites.d.ts +116 -0
  58. package/dist/src/classes/invites.js +50 -0
  59. package/dist/src/classes/metrics.d.ts +31 -0
  60. package/dist/src/classes/metrics.js +20 -0
  61. package/dist/src/classes/permissions.d.ts +48 -0
  62. package/dist/src/classes/permissions.js +32 -0
  63. package/dist/src/classes/sessions.d.ts +61 -0
  64. package/dist/src/classes/sessions.js +38 -0
  65. package/dist/src/classes/users.d.ts +37 -0
  66. package/dist/src/classes/users.js +26 -0
  67. package/dist/src/classes/utils.d.ts +19 -0
  68. package/dist/src/classes/utils.js +16 -0
  69. package/dist/src/core/manager.d.ts +44 -0
  70. package/dist/src/core/manager.js +92 -0
  71. package/dist/src/core/utils.d.ts +9 -0
  72. package/dist/src/core/utils.js +52 -0
  73. package/dist/src/external/types.d.ts +87 -0
  74. package/dist/src/external/types.js +4 -0
  75. package/dist/src/external/vars.d.ts +99 -0
  76. package/dist/src/external/vars.js +65 -0
  77. package/dist/src/index.d.ts +20 -0
  78. package/dist/src/index.js +20 -0
  79. package/dist/src/types.d.ts +61 -0
  80. package/dist/src/types.js +1 -0
  81. package/dist/types.js +1 -2
  82. package/package.json +2 -2
  83. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,44 @@
1
+ import { APIPermissions } from '../classes/permissions';
2
+ import { APIFlashcards } from '../classes/flashcards';
3
+ import { APICategories } from '../classes/categories';
4
+ import { APIAnalytics } from '../classes/analytics';
5
+ import { APISessions } from '../classes/sessions';
6
+ import { APICalendar } from '../classes/calendar';
7
+ import { APIMetrics } from '../classes/metrics';
8
+ import { APIInvites } from '../classes/invites';
9
+ import { APIGroups } from '../classes/groups';
10
+ import { APIBoards } from '../classes/boards';
11
+ import { APIUtils } from '../classes/utils';
12
+ import { APIUsers } from '../classes/users';
13
+ import { APIFiles } from '../classes/files';
14
+ import { APIAdmin } from '../classes/admin';
15
+ import { APIAuth } from '../classes/auth';
16
+ import { RequestMethod, WebResponse } from '../types';
17
+ export declare class BoardsManager {
18
+ url: string;
19
+ readonly permissions: APIPermissions;
20
+ readonly categories: APICategories;
21
+ readonly flashcards: APIFlashcards;
22
+ readonly analytics: APIAnalytics;
23
+ readonly calendar: APICalendar;
24
+ readonly sessions: APISessions;
25
+ readonly invites: APIInvites;
26
+ readonly metrics: APIMetrics;
27
+ readonly groups: APIGroups;
28
+ readonly boards: APIBoards;
29
+ readonly admin: APIAdmin;
30
+ readonly users: APIUsers;
31
+ readonly utils: APIUtils;
32
+ readonly files: APIFiles;
33
+ readonly auth: APIAuth;
34
+ constructor(url: string);
35
+ request<O, T = unknown>(data: {
36
+ endpoint: string;
37
+ method: RequestMethod;
38
+ body?: T;
39
+ auth?: string;
40
+ headers?: Record<string, string> | null;
41
+ }): Promise<WebResponse<O>>;
42
+ qp<T extends Record<string, unknown>>(url: string, params?: T): string;
43
+ private isResponse;
44
+ }
@@ -0,0 +1,92 @@
1
+ import { APIPermissions } from '../classes/permissions';
2
+ import { APIFlashcards } from '../classes/flashcards';
3
+ import { APICategories } from '../classes/categories';
4
+ import { APIAnalytics } from '../classes/analytics';
5
+ import { APISessions } from '../classes/sessions';
6
+ import { APICalendar } from '../classes/calendar';
7
+ import { APIMetrics } from '../classes/metrics';
8
+ import { APIInvites } from '../classes/invites';
9
+ import { APIGroups } from '../classes/groups';
10
+ import { APIBoards } from '../classes/boards';
11
+ import { APIUtils } from '../classes/utils';
12
+ import { APIUsers } from '../classes/users';
13
+ import { APIFiles } from '../classes/files';
14
+ import { APIAdmin } from '../classes/admin';
15
+ import { APIAuth } from '../classes/auth';
16
+ import axios from 'axios';
17
+ import { transformDates } from './utils';
18
+ export class BoardsManager {
19
+ url;
20
+ permissions = new APIPermissions(this);
21
+ categories = new APICategories(this);
22
+ flashcards = new APIFlashcards(this);
23
+ analytics = new APIAnalytics(this);
24
+ calendar = new APICalendar(this);
25
+ sessions = new APISessions(this);
26
+ invites = new APIInvites(this);
27
+ metrics = new APIMetrics(this);
28
+ groups = new APIGroups(this);
29
+ boards = new APIBoards(this);
30
+ admin = new APIAdmin(this);
31
+ users = new APIUsers(this);
32
+ utils = new APIUtils(this);
33
+ files = new APIFiles(this);
34
+ auth = new APIAuth(this);
35
+ constructor(url) {
36
+ this.url = url;
37
+ }
38
+ async request(data) {
39
+ try {
40
+ axios.interceptors.response.use(transformDates);
41
+ let requestData;
42
+ let contentType;
43
+ if (data.body instanceof FormData) {
44
+ requestData = data.body;
45
+ contentType = 'multipart/form-data';
46
+ }
47
+ else if (data.body !== undefined) {
48
+ requestData = JSON.stringify(data.body);
49
+ contentType = 'application/json';
50
+ }
51
+ else {
52
+ requestData = undefined;
53
+ contentType = undefined;
54
+ }
55
+ const res = await axios(this.url + data.endpoint, {
56
+ method: data.method,
57
+ data: requestData,
58
+ headers: {
59
+ ...(data.headers === null ? {} : contentType ? { 'Content-Type': contentType } : {}),
60
+ ...(data.auth ? { 'Authorization': data.auth } : {}),
61
+ ...(data.headers || {}),
62
+ },
63
+ })
64
+ .then((res) => res.data)
65
+ .catch((err) => err.response?.data);
66
+ if (!this.isResponse(res)) {
67
+ throw new Error('Invalid response received.');
68
+ }
69
+ return res;
70
+ }
71
+ catch {
72
+ return {
73
+ status: 500,
74
+ error: 'An error occurred while processing the request.',
75
+ };
76
+ }
77
+ }
78
+ qp(url, params) {
79
+ if (!params)
80
+ return url;
81
+ const query = new URLSearchParams();
82
+ for (const [key, value] of Object.entries(params)) {
83
+ if (value === undefined)
84
+ continue;
85
+ query.append(key, String(value));
86
+ }
87
+ return url + '?' + query.toString();
88
+ }
89
+ isResponse(obj) {
90
+ return (obj && typeof obj === 'object' && 'status' in obj);
91
+ }
92
+ }
@@ -0,0 +1,9 @@
1
+ import { Paginated, PaginatedWebResponse, WebResponse } from '../types';
2
+ import { AxiosResponse } from 'axios';
3
+ export declare function isDateStringRegex(value: unknown): value is string;
4
+ export declare function recursiveDateConversion<T>(data: T): T;
5
+ export declare function transformDates<T>(response: AxiosResponse<T>): AxiosResponse<T>;
6
+ export declare function getAll<T>(fetcher: (page: number, limit: number) => Promise<WebResponse<Paginated<T>>>, options?: {
7
+ limit?: number;
8
+ maxItems?: number;
9
+ }): Promise<PaginatedWebResponse<T>>;
@@ -0,0 +1,52 @@
1
+ export function isDateStringRegex(value) {
2
+ const isoPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/;
3
+ return typeof value === 'string' && isoPattern.test(value);
4
+ }
5
+ export function recursiveDateConversion(data) {
6
+ if (data instanceof Date)
7
+ return new Date(data);
8
+ if (Array.isArray(data))
9
+ return data.map(recursiveDateConversion);
10
+ if (typeof data === 'object' && data !== null) {
11
+ for (const key in data) {
12
+ data[key] = recursiveDateConversion(data[key]);
13
+ }
14
+ }
15
+ return isDateStringRegex(data) ? new Date(data) : data;
16
+ }
17
+ export function transformDates(response) {
18
+ if (response.data)
19
+ response.data = recursiveDateConversion(response.data);
20
+ return response;
21
+ }
22
+ export async function getAll(fetcher, options) {
23
+ const limit = options?.limit ?? 50;
24
+ const maxItems = options?.maxItems ?? Infinity;
25
+ const allItems = [];
26
+ let hasMore = true;
27
+ let page = 1;
28
+ while (hasMore && allItems.length < maxItems) {
29
+ const response = await fetcher(page, limit);
30
+ if (response.status !== 200)
31
+ return {
32
+ status: response.status,
33
+ error: response.error || 'An error occurred while fetching items.',
34
+ };
35
+ const items = Array.isArray(response.data.data) ? response.data.data : [response.data.data];
36
+ allItems.push(...items.slice(0, maxItems - allItems.length));
37
+ hasMore = response.data.pagination.hasMore && allItems.length < maxItems;
38
+ page++;
39
+ }
40
+ return {
41
+ status: 200,
42
+ data: {
43
+ data: allItems,
44
+ pagination: {
45
+ page: Math.ceil(allItems.length / limit),
46
+ limit,
47
+ total: allItems.length,
48
+ hasMore: allItems.length >= maxItems ? false : hasMore,
49
+ },
50
+ },
51
+ };
52
+ }
@@ -0,0 +1,87 @@
1
+ import { BoardRole, CategoryRole, GroupRole } from './vars';
2
+ import { BoardType } from '../../prisma/generated/default';
3
+ export type UserRole = BoardRole | CategoryRole | GroupRole | GlobalRole;
4
+ export declare enum GlobalRole {
5
+ Developer = "Developer"
6
+ }
7
+ export type AccessLevel = 'read' | 'write' | 'manage' | 'admin';
8
+ export type ResourceType = 'group' | 'category' | 'board';
9
+ export type GlobalResourceType = ResourceType | 'global';
10
+ export type ResourceId<A extends GlobalResourceType> = A extends 'board' ? {
11
+ boardId: string;
12
+ categoryId: string;
13
+ groupId: string;
14
+ } : A extends 'category' ? {
15
+ categoryId: string;
16
+ groupId: string;
17
+ } : A extends 'group' ? {
18
+ groupId: string;
19
+ } : A extends 'global' ? null : never;
20
+ export type ResourceReturnEnum<A extends GlobalResourceType> = A extends 'board' ? BoardRole : A extends 'category' ? CategoryRole : A extends 'group' ? GroupRole : A extends 'global' ? GlobalRole : never;
21
+ export type PermissionGrantResult = {
22
+ newPermissions: GrantedRoles;
23
+ updatedPermissions: (GrantedRole & {
24
+ dbId: string;
25
+ })[];
26
+ };
27
+ export type PermissionCheckData<T extends ResourceType> = {
28
+ type: T;
29
+ data: ResourceId<T>;
30
+ };
31
+ export type PermUser = {
32
+ email: string;
33
+ userId: string;
34
+ displayName: string;
35
+ avatarUrl: string | null;
36
+ permissions: GrantedEntry[];
37
+ };
38
+ export type GrantedRoles = GrantedRole[];
39
+ export type GrantedRole = {
40
+ type: ResourceType;
41
+ resourceId: string;
42
+ role: UserRole;
43
+ };
44
+ export type SingleOutput = {
45
+ id: string;
46
+ name: string;
47
+ index: number;
48
+ accessLevel: AccessLevel;
49
+ };
50
+ export type NameInput = {
51
+ name: string;
52
+ };
53
+ export type BoardInput = NameInput & {
54
+ type: BoardType;
55
+ };
56
+ export type GrantedEntry = {
57
+ role: UserRole;
58
+ grantType: 'explicit' | 'implicit';
59
+ type: ResourceType;
60
+ resourceId: string;
61
+ basedOnType: ResourceType;
62
+ basedOnResourceId: string;
63
+ basedOnResourceName: string;
64
+ };
65
+ export type AllRooms = {
66
+ boardId: string;
67
+ elements: number;
68
+ type: BoardType;
69
+ collaborators: CollabUser[];
70
+ }[];
71
+ export type RecentlyActiveRoom = {
72
+ boardId: string;
73
+ elements: number;
74
+ type: BoardType;
75
+ lastCollaborators: CollabUser[];
76
+ lastActiveAt: number;
77
+ };
78
+ export type GetActiveRoomsResponse = {
79
+ rooms: AllRooms;
80
+ recentlyActiveRooms: RecentlyActiveRoom[];
81
+ };
82
+ export type CollabUser = {
83
+ id: string;
84
+ socketId: string;
85
+ username: string;
86
+ avatarUrl: string | null;
87
+ };
@@ -0,0 +1,4 @@
1
+ export var GlobalRole;
2
+ (function (GlobalRole) {
3
+ GlobalRole["Developer"] = "Developer";
4
+ })(GlobalRole || (GlobalRole = {}));
@@ -0,0 +1,99 @@
1
+ import { Prisma } from '../../prisma/generated/default';
2
+ import { UserRole } from './types';
3
+ export declare const DBUserSelectArgs: {
4
+ select: {
5
+ email: true;
6
+ userId: true;
7
+ invitedBy: true;
8
+ avatarUrl: true;
9
+ mainGroupId: true;
10
+ displayName: true;
11
+ mainLoginType: true;
12
+ registrationMethod: true;
13
+ groupPermissions: {
14
+ select: {
15
+ groupId: true;
16
+ role: true;
17
+ };
18
+ };
19
+ categoryPermissions: {
20
+ select: {
21
+ categoryId: true;
22
+ role: true;
23
+ };
24
+ };
25
+ boardPermissions: {
26
+ select: {
27
+ boardId: true;
28
+ role: true;
29
+ };
30
+ };
31
+ loginMethods: {
32
+ select: {
33
+ platform: true;
34
+ platformEmail: true;
35
+ };
36
+ };
37
+ };
38
+ };
39
+ export declare const DBUserPartial: {
40
+ select: {
41
+ email: true;
42
+ userId: true;
43
+ invitedBy: true;
44
+ avatarUrl: true;
45
+ mainGroupId: true;
46
+ displayName: true;
47
+ mainLoginType: true;
48
+ registrationMethod: true;
49
+ groupPermissions: {
50
+ select: {
51
+ groupId: true;
52
+ role: true;
53
+ };
54
+ };
55
+ categoryPermissions: {
56
+ select: {
57
+ categoryId: true;
58
+ role: true;
59
+ };
60
+ };
61
+ boardPermissions: {
62
+ select: {
63
+ boardId: true;
64
+ role: true;
65
+ };
66
+ };
67
+ loginMethods: {
68
+ select: {
69
+ platform: true;
70
+ platformEmail: true;
71
+ };
72
+ };
73
+ };
74
+ };
75
+ export type DBUserPartialType = Prisma.UserGetPayload<typeof DBUserPartial>;
76
+ export declare enum Platforms {
77
+ Google = "Google",
78
+ GitHub = "GitHub",
79
+ Discord = "Discord",
80
+ Microsoft = "Microsoft"
81
+ }
82
+ export declare enum BoardRole {
83
+ BoardViewer = "BoardViewer",
84
+ BoardCollaborator = "BoardCollaborator"
85
+ }
86
+ export declare enum CategoryRole {
87
+ CategoryViewer = "CategoryViewer",
88
+ CategoryCollaborator = "CategoryCollaborator",
89
+ CategoryManager = "CategoryManager",
90
+ CategoryAdmin = "CategoryAdmin"
91
+ }
92
+ export declare enum GroupRole {
93
+ GroupViewer = "GroupViewer",
94
+ GroupCollaborator = "GroupCollaborator",
95
+ GroupManager = "GroupManager",
96
+ GroupAdmin = "GroupAdmin"
97
+ }
98
+ export declare const SimplePermissionHierarchy: Record<string, number>;
99
+ export declare const PermissionHierarchy: Record<UserRole, number>;
@@ -0,0 +1,65 @@
1
+ import { Prisma } from '../../prisma/generated/default';
2
+ import { GlobalRole } from './types';
3
+ export const DBUserSelectArgs = {
4
+ select: {
5
+ email: true,
6
+ userId: true,
7
+ invitedBy: true,
8
+ avatarUrl: true,
9
+ mainGroupId: true,
10
+ displayName: true,
11
+ mainLoginType: true,
12
+ registrationMethod: true,
13
+ groupPermissions: { select: { groupId: true, role: true } },
14
+ categoryPermissions: { select: { categoryId: true, role: true } },
15
+ boardPermissions: { select: { boardId: true, role: true } },
16
+ loginMethods: { select: { platform: true, platformEmail: true } },
17
+ },
18
+ };
19
+ export const DBUserPartial = Prisma.validator()(DBUserSelectArgs);
20
+ export var Platforms;
21
+ (function (Platforms) {
22
+ Platforms["Google"] = "Google";
23
+ Platforms["GitHub"] = "GitHub";
24
+ Platforms["Discord"] = "Discord";
25
+ Platforms["Microsoft"] = "Microsoft";
26
+ })(Platforms || (Platforms = {}));
27
+ export var BoardRole;
28
+ (function (BoardRole) {
29
+ BoardRole["BoardViewer"] = "BoardViewer";
30
+ BoardRole["BoardCollaborator"] = "BoardCollaborator";
31
+ })(BoardRole || (BoardRole = {}));
32
+ export var CategoryRole;
33
+ (function (CategoryRole) {
34
+ CategoryRole["CategoryViewer"] = "CategoryViewer";
35
+ CategoryRole["CategoryCollaborator"] = "CategoryCollaborator";
36
+ CategoryRole["CategoryManager"] = "CategoryManager";
37
+ CategoryRole["CategoryAdmin"] = "CategoryAdmin";
38
+ })(CategoryRole || (CategoryRole = {}));
39
+ export var GroupRole;
40
+ (function (GroupRole) {
41
+ GroupRole["GroupViewer"] = "GroupViewer";
42
+ GroupRole["GroupCollaborator"] = "GroupCollaborator";
43
+ GroupRole["GroupManager"] = "GroupManager";
44
+ GroupRole["GroupAdmin"] = "GroupAdmin";
45
+ })(GroupRole || (GroupRole = {}));
46
+ // Variables.
47
+ export const SimplePermissionHierarchy = {
48
+ Viewer: 1,
49
+ Collaborator: 2,
50
+ Manager: 3,
51
+ Admin: 4,
52
+ };
53
+ export const PermissionHierarchy = {
54
+ [BoardRole.BoardViewer]: 1,
55
+ [BoardRole.BoardCollaborator]: 2,
56
+ [CategoryRole.CategoryViewer]: 3,
57
+ [CategoryRole.CategoryCollaborator]: 4,
58
+ [CategoryRole.CategoryManager]: 5,
59
+ [CategoryRole.CategoryAdmin]: 6,
60
+ [GroupRole.GroupViewer]: 7,
61
+ [GroupRole.GroupCollaborator]: 8,
62
+ [GroupRole.GroupManager]: 9,
63
+ [GroupRole.GroupAdmin]: 10,
64
+ [GlobalRole.Developer]: 11,
65
+ };
@@ -0,0 +1,20 @@
1
+ export * from './core/manager';
2
+ export * from './core/utils';
3
+ export * from './types';
4
+ export * from './external/types';
5
+ export * from './external/vars';
6
+ export * from './classes/permissions';
7
+ export * from './classes/categories';
8
+ export * from './classes/flashcards';
9
+ export * from './classes/analytics';
10
+ export * from './classes/calendar';
11
+ export * from './classes/sessions';
12
+ export * from './classes/invites';
13
+ export * from './classes/metrics';
14
+ export * from './classes/groups';
15
+ export * from './classes/boards';
16
+ export * from './classes/utils';
17
+ export * from './classes/admin';
18
+ export * from './classes/users';
19
+ export * from './classes/files';
20
+ export * from './classes/auth';
@@ -0,0 +1,20 @@
1
+ export * from './core/manager';
2
+ export * from './core/utils';
3
+ export * from './types';
4
+ export * from './external/types';
5
+ export * from './external/vars';
6
+ export * from './classes/permissions';
7
+ export * from './classes/categories';
8
+ export * from './classes/flashcards';
9
+ export * from './classes/analytics';
10
+ export * from './classes/calendar';
11
+ export * from './classes/sessions';
12
+ export * from './classes/invites';
13
+ export * from './classes/metrics';
14
+ export * from './classes/groups';
15
+ export * from './classes/boards';
16
+ export * from './classes/utils';
17
+ export * from './classes/admin';
18
+ export * from './classes/users';
19
+ export * from './classes/files';
20
+ export * from './classes/auth';
@@ -0,0 +1,61 @@
1
+ export type StatusWebCode = 200 | 400 | 401 | 403 | 404 | 413 | 429 | 500 | 503;
2
+ export type WebResponse<T, S extends StatusWebCode = StatusWebCode> = S extends 200 ? {
3
+ status: S;
4
+ data: T;
5
+ } : {
6
+ status: S;
7
+ error: string | string[];
8
+ };
9
+ export type Paginated<T> = {
10
+ data: T extends (infer U)[] ? U[] : T[];
11
+ pagination: {
12
+ page: number;
13
+ limit: number;
14
+ total: number;
15
+ hasMore: boolean;
16
+ };
17
+ };
18
+ export type WithHeaders<T> = {
19
+ [P in keyof T]: T[P] & {
20
+ headers?: Record<string, string>;
21
+ };
22
+ };
23
+ export type PaginatedWebResponse<T, S extends StatusWebCode = StatusWebCode> = WebResponse<Paginated<T>, S>;
24
+ export type SuccessWithId<T extends string> = {
25
+ [x in T]: string;
26
+ } & {
27
+ message: string;
28
+ };
29
+ export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
30
+ export type CancelOutWebResponses<T extends WebResponse<unknown>> = T extends {
31
+ status: 200;
32
+ data: infer U;
33
+ } ? U : never;
34
+ export type InferPartial<T> = T extends DeepPartial<infer U> ? U : T;
35
+ export type Simplify<T> = {
36
+ [P in keyof T]: T[P];
37
+ };
38
+ export type Primitive = string | number | boolean | bigint | symbol | null | undefined | Date;
39
+ export type DeepPartial<T, N extends boolean = false> = T extends Primitive ? T | (N extends true ? undefined : never) : T extends Array<infer U> ? Array<DeepPartial<U, N>> : {
40
+ [P in keyof T]?: DeepPartial<T[P], N>;
41
+ };
42
+ export type DeepRequired<T> = T extends Primitive ? NonNullable<T> : T extends Array<infer U> ? Array<DeepRequired<U>> : {
43
+ [P in keyof T]-?: DeepRequired<T[P]>;
44
+ };
45
+ export type DeepNullable<T> = T extends Primitive ? T | null : T extends Array<infer U> ? Array<DeepNullable<U>> : {
46
+ [P in keyof T]: DeepNullable<T[P]>;
47
+ };
48
+ export type AtLeast<T, K extends keyof T> = T & Pick<T, K>;
49
+ export type AtLeastPartial<T, K extends keyof T> = DeepPartial<T> & Pick<T, K>;
50
+ export type MakeRequired<T, P extends keyof T> = T extends Array<infer U> ? U extends object ? Array<MakeRequired<U, P & keyof U>> : T : Omit<T, P> & Required<Pick<T, P>>;
51
+ export type WithoutUndefined<T> = T extends undefined ? never : T;
52
+ export type DeepNonNullable<T> = {
53
+ [P in keyof T]-?: DeepNonNullable<NonNullable<T[P]>>;
54
+ };
55
+ export type DeepNonReadonly<T> = {
56
+ -readonly [P in keyof T]: DeepNonReadonly<T[P]>;
57
+ };
58
+ export type KeysOf<T> = '*' | KeysOfInner<DeepRequired<T>>;
59
+ export type KeysOfInner<T> = T extends Record<string, unknown> ? {
60
+ [K in keyof T]-?: K extends string ? T[K] extends (infer U)[] ? `${K}[]` | `${K}[].${KeysOfInner<U>}` : `${K}` | (T[K] extends null | undefined ? never : `${K}.${KeysOfInner<NonNullable<T[K]>>}`) : never;
61
+ }[keyof T] : never;
@@ -0,0 +1 @@
1
+ export {};
package/dist/types.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.50",
2
+ "version": "1.1.52",
3
3
  "name": "@excali-boards/boards-api-client",
4
4
  "description": "A simple API client for the Boards API.",
5
5
  "repository": "https://github.com/Excali-Boards/boards-api-client",
@@ -35,7 +35,7 @@
35
35
  "@typescript-eslint/eslint-plugin": "6.18.0",
36
36
  "@typescript-eslint/parser": "6.18.0",
37
37
  "eslint": "8.56.0",
38
- "typescript": "5.9.2"
38
+ "typescript": "7.0.2"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=20.2.0"
@@ -1 +0,0 @@
1
- {"root":["../src/index.ts","../src/types.ts","../src/classes/admin.ts","../src/classes/analytics.ts","../src/classes/boards.ts","../src/classes/calendar.ts","../src/classes/categories.ts","../src/classes/files.ts","../src/classes/flashcards.ts","../src/classes/groups.ts","../src/classes/invites.ts","../src/classes/metrics.ts","../src/classes/permissions.ts","../src/classes/sessions.ts","../src/classes/users.ts","../src/classes/utils.ts","../src/core/manager.ts","../src/core/utils.ts","../src/external/types.ts","../src/external/vars.ts"],"version":"5.9.2"}