tonightpass 0.0.135 → 0.0.136
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/index.d.mts +134 -3
- package/dist/index.d.ts +134 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as pathcat from 'pathcat';
|
|
2
2
|
import { ParamValue, Query } from 'pathcat';
|
|
3
3
|
export * from 'pathcat';
|
|
4
|
+
import { Options, Response as Response$1 } from 'redaxios';
|
|
4
5
|
import * as Stripe from 'stripe';
|
|
5
6
|
import Stripe__default from 'stripe';
|
|
6
|
-
import { Options, Response as Response$1 } from 'redaxios';
|
|
7
7
|
import { HealthCheckResult, HealthIndicatorResult } from '@nestjs/terminus';
|
|
8
8
|
|
|
9
9
|
declare const DEFAULT_API_URL = "https://api.tonightpass.com";
|
|
@@ -28,7 +28,7 @@ type Endpoint<M extends Options["method"], Path extends string, Res, Body = unde
|
|
|
28
28
|
res: Res;
|
|
29
29
|
body: Body;
|
|
30
30
|
};
|
|
31
|
-
type Endpoints = AuthEndpoints | CareerEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
|
|
31
|
+
type Endpoints = AuthEndpoints | CareerEndpoints | ChannelEndpoints | ChannelMessageEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
|
|
32
32
|
|
|
33
33
|
declare enum UserNotificationType {
|
|
34
34
|
Follow = "follow"
|
|
@@ -241,6 +241,65 @@ type CareerEndpoints = Endpoint<"GET", "/careers/categories", CareersCategory[],
|
|
|
241
241
|
cityNameLike?: string;
|
|
242
242
|
}>;
|
|
243
243
|
|
|
244
|
+
declare enum AttachmentType {
|
|
245
|
+
Image = "image",
|
|
246
|
+
Video = "video",
|
|
247
|
+
Audio = "audio",
|
|
248
|
+
Document = "document",
|
|
249
|
+
File = "file"
|
|
250
|
+
}
|
|
251
|
+
type Attachment = {
|
|
252
|
+
type: AttachmentType;
|
|
253
|
+
url: string;
|
|
254
|
+
filename?: string;
|
|
255
|
+
size?: number;
|
|
256
|
+
mimeType?: string;
|
|
257
|
+
};
|
|
258
|
+
type ChannelMessage = Base & {
|
|
259
|
+
channel: Channel;
|
|
260
|
+
sender: User;
|
|
261
|
+
content: string;
|
|
262
|
+
attachments: Attachment[];
|
|
263
|
+
sent: boolean;
|
|
264
|
+
delivered: boolean;
|
|
265
|
+
read: boolean;
|
|
266
|
+
readBy?: {
|
|
267
|
+
user: User;
|
|
268
|
+
readAt: Date;
|
|
269
|
+
}[];
|
|
270
|
+
edited: boolean;
|
|
271
|
+
editedAt?: Date;
|
|
272
|
+
replyTo?: ChannelMessage;
|
|
273
|
+
mentions?: User[];
|
|
274
|
+
reactions?: {
|
|
275
|
+
emoji: string;
|
|
276
|
+
users: User[];
|
|
277
|
+
}[];
|
|
278
|
+
};
|
|
279
|
+
type ChannelMessageEndpoints = Endpoint<"GET", "/channels/:channelId/messages", ArrayResult<ChannelMessage>, ArrayOptions<ChannelMessage>> | Endpoint<"GET", "/channels/:channelId/messages/:messageId", ChannelMessage> | Endpoint<"POST", "/channels/:channelId/messages", ChannelMessage, CreateChannelMessageDto> | Endpoint<"PUT", "/channels/:channelId/messages/:messageId", ChannelMessage, UpdateChannelMessageDto> | Endpoint<"DELETE", "/channels/:channelId/messages/:messageId", void, undefined> | Endpoint<"POST", "/channels/:channelId/messages/:messageId/reactions", void, {
|
|
280
|
+
emoji: string;
|
|
281
|
+
}> | Endpoint<"DELETE", "/channels/:channelId/messages/:messageId/reactions/:emoji", void, undefined> | Endpoint<"POST", "/channels/:channelId/messages/:messageId/read", void, null>;
|
|
282
|
+
|
|
283
|
+
declare enum ChannelType {
|
|
284
|
+
Private = "private",
|
|
285
|
+
Group = "group"
|
|
286
|
+
}
|
|
287
|
+
type Channel = Base & {
|
|
288
|
+
type: ChannelType;
|
|
289
|
+
users: User[];
|
|
290
|
+
name?: string;
|
|
291
|
+
description?: string;
|
|
292
|
+
lastMessageAt?: Date;
|
|
293
|
+
unreadCount?: number;
|
|
294
|
+
};
|
|
295
|
+
type ChannelMember = {
|
|
296
|
+
user: User;
|
|
297
|
+
joinedAt: Date;
|
|
298
|
+
role?: "admin" | "member";
|
|
299
|
+
lastReadAt?: Date;
|
|
300
|
+
};
|
|
301
|
+
type ChannelEndpoints = Endpoint<"GET", "/channels", Channel[]> | Endpoint<"GET", "/channels/:channelId", Channel> | Endpoint<"POST", "/channels", Channel, CreateChannelDto> | Endpoint<"PUT", "/channels/:channelId", Channel, UpdateChannelDto> | Endpoint<"DELETE", "/channels/:channelId", void, undefined> | Endpoint<"POST", "/channels/:channelId/members/:userId", void, null> | Endpoint<"DELETE", "/channels/:channelId/members/:userId", void, undefined> | Endpoint<"GET", "/channels/:channelId/members", ChannelMember[]>;
|
|
302
|
+
|
|
244
303
|
declare enum ErrorType {
|
|
245
304
|
AuthEmailAlreadyExists = "auth.email-already-exists",
|
|
246
305
|
AuthUsernameAlreadyExists = "auth.username-already-exists",
|
|
@@ -664,6 +723,37 @@ type ArrayResult<T> = {
|
|
|
664
723
|
limit: number;
|
|
665
724
|
};
|
|
666
725
|
|
|
726
|
+
declare class CreateChannelDto {
|
|
727
|
+
type: ChannelType;
|
|
728
|
+
userIds: string[];
|
|
729
|
+
name?: string;
|
|
730
|
+
description?: string;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare class UpdateChannelDto {
|
|
734
|
+
name?: string;
|
|
735
|
+
description?: string;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
declare class CreateAttachmentDto {
|
|
739
|
+
type: AttachmentType;
|
|
740
|
+
url: string;
|
|
741
|
+
filename?: string;
|
|
742
|
+
mimeType?: string;
|
|
743
|
+
}
|
|
744
|
+
declare class CreateChannelMessageDto {
|
|
745
|
+
content: string;
|
|
746
|
+
attachments?: CreateAttachmentDto[];
|
|
747
|
+
replyToId?: string;
|
|
748
|
+
mentionIds?: string[];
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
declare class UpdateChannelMessageDto {
|
|
752
|
+
content?: string;
|
|
753
|
+
attachments?: CreateAttachmentDto[];
|
|
754
|
+
mentionIds?: string[];
|
|
755
|
+
}
|
|
756
|
+
|
|
667
757
|
declare class GeoPointDto implements GeoPoint {
|
|
668
758
|
type: "Point";
|
|
669
759
|
coordinates: [number, number];
|
|
@@ -948,6 +1038,27 @@ declare const careers: (client: Client) => {
|
|
|
948
1038
|
};
|
|
949
1039
|
};
|
|
950
1040
|
|
|
1041
|
+
declare const channels: (client: Client) => {
|
|
1042
|
+
getAll: () => Promise<Channel[]>;
|
|
1043
|
+
get: (channelId: string) => Promise<Channel>;
|
|
1044
|
+
create: (data: CreateChannelDto) => Promise<Channel>;
|
|
1045
|
+
update: (channelId: string, data: UpdateChannelDto) => Promise<Channel>;
|
|
1046
|
+
delete: (channelId: string) => Promise<void>;
|
|
1047
|
+
addMember: (channelId: string, userId: string) => Promise<void>;
|
|
1048
|
+
removeMember: (channelId: string, userId: string) => Promise<void>;
|
|
1049
|
+
getMembers: (channelId: string) => Promise<ChannelMember[]>;
|
|
1050
|
+
messages: {
|
|
1051
|
+
getAll: (channelId: string, options?: ArrayOptions<ChannelMessage>) => Promise<ArrayResult<ChannelMessage>>;
|
|
1052
|
+
get: (channelId: string, messageId: string) => Promise<ChannelMessage>;
|
|
1053
|
+
create: (channelId: string, data: CreateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1054
|
+
update: (channelId: string, messageId: string, data: UpdateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1055
|
+
delete: (channelId: string, messageId: string) => Promise<void>;
|
|
1056
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1057
|
+
removeReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1058
|
+
markAsRead: (channelId: string, messageId: string) => Promise<void>;
|
|
1059
|
+
};
|
|
1060
|
+
};
|
|
1061
|
+
|
|
951
1062
|
declare function sdk<T>(builder: (client: Client) => T): (client: Client) => T;
|
|
952
1063
|
|
|
953
1064
|
declare const health: (client: Client) => {
|
|
@@ -1091,6 +1202,26 @@ declare class TonightPass {
|
|
|
1091
1202
|
getAll: (query?: pathcat.Query<"/careers/offices">) => Promise<CareersOffice[]>;
|
|
1092
1203
|
};
|
|
1093
1204
|
};
|
|
1205
|
+
readonly channels: {
|
|
1206
|
+
getAll: () => Promise<Channel[]>;
|
|
1207
|
+
get: (channelId: string) => Promise<Channel>;
|
|
1208
|
+
create: (data: CreateChannelDto) => Promise<Channel>;
|
|
1209
|
+
update: (channelId: string, data: UpdateChannelDto) => Promise<Channel>;
|
|
1210
|
+
delete: (channelId: string) => Promise<void>;
|
|
1211
|
+
addMember: (channelId: string, userId: string) => Promise<void>;
|
|
1212
|
+
removeMember: (channelId: string, userId: string) => Promise<void>;
|
|
1213
|
+
getMembers: (channelId: string) => Promise<ChannelMember[]>;
|
|
1214
|
+
messages: {
|
|
1215
|
+
getAll: (channelId: string, options?: ArrayOptions<ChannelMessage>) => Promise<ArrayResult<ChannelMessage>>;
|
|
1216
|
+
get: (channelId: string, messageId: string) => Promise<ChannelMessage>;
|
|
1217
|
+
create: (channelId: string, data: CreateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1218
|
+
update: (channelId: string, messageId: string, data: UpdateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1219
|
+
delete: (channelId: string, messageId: string) => Promise<void>;
|
|
1220
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1221
|
+
removeReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1222
|
+
markAsRead: (channelId: string, messageId: string) => Promise<void>;
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1094
1225
|
readonly health: {
|
|
1095
1226
|
getAll: () => Promise<Health<"database" | "app" | "api">>;
|
|
1096
1227
|
database: () => Promise<Health<"database">>;
|
|
@@ -1196,4 +1327,4 @@ declare class TonightPass {
|
|
|
1196
1327
|
declare const isBrowser: boolean;
|
|
1197
1328
|
declare function buildFileFormData(key: string, files: File | File[] | FileList): FormData;
|
|
1198
1329
|
|
|
1199
|
-
export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, type Base, type BaseProfile, type BaseProfileMetadata, type Body, type CareerEndpoints, type CareersCategory, type CareersEmploymentType, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateLocationDto, CreateOrganizationDto, CreateOrganizationEventDto, type CreateOrganizationEventInput, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, type CreateOrganizationEventTicketInput, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, CreateUserIdentityDto, Currency, DEFAULT_API_URL, type DeepPartial, type Distance, type Endpoint, type Endpoints, ErrorType, type ErroredAPIResponse, type ExcludeBase, type GeoPoint, GeoPointDto, type GeoSearchAggregation, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationEndpoints, type Order, type OrderEndpoints, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventOrderEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationSocialLink, OrganizationSocialType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, type PromisedResponse, type PublicUser, type QueryParams, REGEX, RecoveryDto, RecoveryResetDto, type RecoveryResponse, type Response, type ResponseFor, SignInUserDto, type StringifiedQuery, type StringifiedQueryValue, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateLocationDto, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserBooking, type UserBookingEndpoints, type UserBookingTicket, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, UserFileType, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserNotification, type UserNotificationBase, type UserNotificationEndpoints, type UserNotificationFollow, UserNotificationType, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, type WebhookEndpoints, auth, buildFileFormData, careers, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
|
|
1330
|
+
export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type Attachment, AttachmentType, type AuthEndpoints, type Base, type BaseProfile, type BaseProfileMetadata, type Body, type CareerEndpoints, type CareersCategory, type CareersEmploymentType, type CareersJob, type CareersOffice, type Channel, type ChannelEndpoints, type ChannelMember, type ChannelMessage, type ChannelMessageEndpoints, ChannelType, Client, type ClientOptions, CreateAttachmentDto, CreateChannelDto, CreateChannelMessageDto, CreateLocationDto, CreateOrganizationDto, CreateOrganizationEventDto, type CreateOrganizationEventInput, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, type CreateOrganizationEventTicketInput, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, CreateUserIdentityDto, Currency, DEFAULT_API_URL, type DeepPartial, type Distance, type Endpoint, type Endpoints, ErrorType, type ErroredAPIResponse, type ExcludeBase, type GeoPoint, GeoPointDto, type GeoSearchAggregation, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationEndpoints, type Order, type OrderEndpoints, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventOrderEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationSocialLink, OrganizationSocialType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, type PromisedResponse, type PublicUser, type QueryParams, REGEX, RecoveryDto, RecoveryResetDto, type RecoveryResponse, type Response, type ResponseFor, SignInUserDto, type StringifiedQuery, type StringifiedQueryValue, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateChannelDto, UpdateChannelMessageDto, UpdateLocationDto, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserBooking, type UserBookingEndpoints, type UserBookingTicket, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, UserFileType, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserNotification, type UserNotificationBase, type UserNotificationEndpoints, type UserNotificationFollow, UserNotificationType, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, type WebhookEndpoints, auth, buildFileFormData, careers, channels, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as pathcat from 'pathcat';
|
|
2
2
|
import { ParamValue, Query } from 'pathcat';
|
|
3
3
|
export * from 'pathcat';
|
|
4
|
+
import { Options, Response as Response$1 } from 'redaxios';
|
|
4
5
|
import * as Stripe from 'stripe';
|
|
5
6
|
import Stripe__default from 'stripe';
|
|
6
|
-
import { Options, Response as Response$1 } from 'redaxios';
|
|
7
7
|
import { HealthCheckResult, HealthIndicatorResult } from '@nestjs/terminus';
|
|
8
8
|
|
|
9
9
|
declare const DEFAULT_API_URL = "https://api.tonightpass.com";
|
|
@@ -28,7 +28,7 @@ type Endpoint<M extends Options["method"], Path extends string, Res, Body = unde
|
|
|
28
28
|
res: Res;
|
|
29
29
|
body: Body;
|
|
30
30
|
};
|
|
31
|
-
type Endpoints = AuthEndpoints | CareerEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
|
|
31
|
+
type Endpoints = AuthEndpoints | CareerEndpoints | ChannelEndpoints | ChannelMessageEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
|
|
32
32
|
|
|
33
33
|
declare enum UserNotificationType {
|
|
34
34
|
Follow = "follow"
|
|
@@ -241,6 +241,65 @@ type CareerEndpoints = Endpoint<"GET", "/careers/categories", CareersCategory[],
|
|
|
241
241
|
cityNameLike?: string;
|
|
242
242
|
}>;
|
|
243
243
|
|
|
244
|
+
declare enum AttachmentType {
|
|
245
|
+
Image = "image",
|
|
246
|
+
Video = "video",
|
|
247
|
+
Audio = "audio",
|
|
248
|
+
Document = "document",
|
|
249
|
+
File = "file"
|
|
250
|
+
}
|
|
251
|
+
type Attachment = {
|
|
252
|
+
type: AttachmentType;
|
|
253
|
+
url: string;
|
|
254
|
+
filename?: string;
|
|
255
|
+
size?: number;
|
|
256
|
+
mimeType?: string;
|
|
257
|
+
};
|
|
258
|
+
type ChannelMessage = Base & {
|
|
259
|
+
channel: Channel;
|
|
260
|
+
sender: User;
|
|
261
|
+
content: string;
|
|
262
|
+
attachments: Attachment[];
|
|
263
|
+
sent: boolean;
|
|
264
|
+
delivered: boolean;
|
|
265
|
+
read: boolean;
|
|
266
|
+
readBy?: {
|
|
267
|
+
user: User;
|
|
268
|
+
readAt: Date;
|
|
269
|
+
}[];
|
|
270
|
+
edited: boolean;
|
|
271
|
+
editedAt?: Date;
|
|
272
|
+
replyTo?: ChannelMessage;
|
|
273
|
+
mentions?: User[];
|
|
274
|
+
reactions?: {
|
|
275
|
+
emoji: string;
|
|
276
|
+
users: User[];
|
|
277
|
+
}[];
|
|
278
|
+
};
|
|
279
|
+
type ChannelMessageEndpoints = Endpoint<"GET", "/channels/:channelId/messages", ArrayResult<ChannelMessage>, ArrayOptions<ChannelMessage>> | Endpoint<"GET", "/channels/:channelId/messages/:messageId", ChannelMessage> | Endpoint<"POST", "/channels/:channelId/messages", ChannelMessage, CreateChannelMessageDto> | Endpoint<"PUT", "/channels/:channelId/messages/:messageId", ChannelMessage, UpdateChannelMessageDto> | Endpoint<"DELETE", "/channels/:channelId/messages/:messageId", void, undefined> | Endpoint<"POST", "/channels/:channelId/messages/:messageId/reactions", void, {
|
|
280
|
+
emoji: string;
|
|
281
|
+
}> | Endpoint<"DELETE", "/channels/:channelId/messages/:messageId/reactions/:emoji", void, undefined> | Endpoint<"POST", "/channels/:channelId/messages/:messageId/read", void, null>;
|
|
282
|
+
|
|
283
|
+
declare enum ChannelType {
|
|
284
|
+
Private = "private",
|
|
285
|
+
Group = "group"
|
|
286
|
+
}
|
|
287
|
+
type Channel = Base & {
|
|
288
|
+
type: ChannelType;
|
|
289
|
+
users: User[];
|
|
290
|
+
name?: string;
|
|
291
|
+
description?: string;
|
|
292
|
+
lastMessageAt?: Date;
|
|
293
|
+
unreadCount?: number;
|
|
294
|
+
};
|
|
295
|
+
type ChannelMember = {
|
|
296
|
+
user: User;
|
|
297
|
+
joinedAt: Date;
|
|
298
|
+
role?: "admin" | "member";
|
|
299
|
+
lastReadAt?: Date;
|
|
300
|
+
};
|
|
301
|
+
type ChannelEndpoints = Endpoint<"GET", "/channels", Channel[]> | Endpoint<"GET", "/channels/:channelId", Channel> | Endpoint<"POST", "/channels", Channel, CreateChannelDto> | Endpoint<"PUT", "/channels/:channelId", Channel, UpdateChannelDto> | Endpoint<"DELETE", "/channels/:channelId", void, undefined> | Endpoint<"POST", "/channels/:channelId/members/:userId", void, null> | Endpoint<"DELETE", "/channels/:channelId/members/:userId", void, undefined> | Endpoint<"GET", "/channels/:channelId/members", ChannelMember[]>;
|
|
302
|
+
|
|
244
303
|
declare enum ErrorType {
|
|
245
304
|
AuthEmailAlreadyExists = "auth.email-already-exists",
|
|
246
305
|
AuthUsernameAlreadyExists = "auth.username-already-exists",
|
|
@@ -664,6 +723,37 @@ type ArrayResult<T> = {
|
|
|
664
723
|
limit: number;
|
|
665
724
|
};
|
|
666
725
|
|
|
726
|
+
declare class CreateChannelDto {
|
|
727
|
+
type: ChannelType;
|
|
728
|
+
userIds: string[];
|
|
729
|
+
name?: string;
|
|
730
|
+
description?: string;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare class UpdateChannelDto {
|
|
734
|
+
name?: string;
|
|
735
|
+
description?: string;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
declare class CreateAttachmentDto {
|
|
739
|
+
type: AttachmentType;
|
|
740
|
+
url: string;
|
|
741
|
+
filename?: string;
|
|
742
|
+
mimeType?: string;
|
|
743
|
+
}
|
|
744
|
+
declare class CreateChannelMessageDto {
|
|
745
|
+
content: string;
|
|
746
|
+
attachments?: CreateAttachmentDto[];
|
|
747
|
+
replyToId?: string;
|
|
748
|
+
mentionIds?: string[];
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
declare class UpdateChannelMessageDto {
|
|
752
|
+
content?: string;
|
|
753
|
+
attachments?: CreateAttachmentDto[];
|
|
754
|
+
mentionIds?: string[];
|
|
755
|
+
}
|
|
756
|
+
|
|
667
757
|
declare class GeoPointDto implements GeoPoint {
|
|
668
758
|
type: "Point";
|
|
669
759
|
coordinates: [number, number];
|
|
@@ -948,6 +1038,27 @@ declare const careers: (client: Client) => {
|
|
|
948
1038
|
};
|
|
949
1039
|
};
|
|
950
1040
|
|
|
1041
|
+
declare const channels: (client: Client) => {
|
|
1042
|
+
getAll: () => Promise<Channel[]>;
|
|
1043
|
+
get: (channelId: string) => Promise<Channel>;
|
|
1044
|
+
create: (data: CreateChannelDto) => Promise<Channel>;
|
|
1045
|
+
update: (channelId: string, data: UpdateChannelDto) => Promise<Channel>;
|
|
1046
|
+
delete: (channelId: string) => Promise<void>;
|
|
1047
|
+
addMember: (channelId: string, userId: string) => Promise<void>;
|
|
1048
|
+
removeMember: (channelId: string, userId: string) => Promise<void>;
|
|
1049
|
+
getMembers: (channelId: string) => Promise<ChannelMember[]>;
|
|
1050
|
+
messages: {
|
|
1051
|
+
getAll: (channelId: string, options?: ArrayOptions<ChannelMessage>) => Promise<ArrayResult<ChannelMessage>>;
|
|
1052
|
+
get: (channelId: string, messageId: string) => Promise<ChannelMessage>;
|
|
1053
|
+
create: (channelId: string, data: CreateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1054
|
+
update: (channelId: string, messageId: string, data: UpdateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1055
|
+
delete: (channelId: string, messageId: string) => Promise<void>;
|
|
1056
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1057
|
+
removeReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1058
|
+
markAsRead: (channelId: string, messageId: string) => Promise<void>;
|
|
1059
|
+
};
|
|
1060
|
+
};
|
|
1061
|
+
|
|
951
1062
|
declare function sdk<T>(builder: (client: Client) => T): (client: Client) => T;
|
|
952
1063
|
|
|
953
1064
|
declare const health: (client: Client) => {
|
|
@@ -1091,6 +1202,26 @@ declare class TonightPass {
|
|
|
1091
1202
|
getAll: (query?: pathcat.Query<"/careers/offices">) => Promise<CareersOffice[]>;
|
|
1092
1203
|
};
|
|
1093
1204
|
};
|
|
1205
|
+
readonly channels: {
|
|
1206
|
+
getAll: () => Promise<Channel[]>;
|
|
1207
|
+
get: (channelId: string) => Promise<Channel>;
|
|
1208
|
+
create: (data: CreateChannelDto) => Promise<Channel>;
|
|
1209
|
+
update: (channelId: string, data: UpdateChannelDto) => Promise<Channel>;
|
|
1210
|
+
delete: (channelId: string) => Promise<void>;
|
|
1211
|
+
addMember: (channelId: string, userId: string) => Promise<void>;
|
|
1212
|
+
removeMember: (channelId: string, userId: string) => Promise<void>;
|
|
1213
|
+
getMembers: (channelId: string) => Promise<ChannelMember[]>;
|
|
1214
|
+
messages: {
|
|
1215
|
+
getAll: (channelId: string, options?: ArrayOptions<ChannelMessage>) => Promise<ArrayResult<ChannelMessage>>;
|
|
1216
|
+
get: (channelId: string, messageId: string) => Promise<ChannelMessage>;
|
|
1217
|
+
create: (channelId: string, data: CreateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1218
|
+
update: (channelId: string, messageId: string, data: UpdateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1219
|
+
delete: (channelId: string, messageId: string) => Promise<void>;
|
|
1220
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1221
|
+
removeReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1222
|
+
markAsRead: (channelId: string, messageId: string) => Promise<void>;
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1094
1225
|
readonly health: {
|
|
1095
1226
|
getAll: () => Promise<Health<"database" | "app" | "api">>;
|
|
1096
1227
|
database: () => Promise<Health<"database">>;
|
|
@@ -1196,4 +1327,4 @@ declare class TonightPass {
|
|
|
1196
1327
|
declare const isBrowser: boolean;
|
|
1197
1328
|
declare function buildFileFormData(key: string, files: File | File[] | FileList): FormData;
|
|
1198
1329
|
|
|
1199
|
-
export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type AuthEndpoints, type Base, type BaseProfile, type BaseProfileMetadata, type Body, type CareerEndpoints, type CareersCategory, type CareersEmploymentType, type CareersJob, type CareersOffice, Client, type ClientOptions, CreateLocationDto, CreateOrganizationDto, CreateOrganizationEventDto, type CreateOrganizationEventInput, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, type CreateOrganizationEventTicketInput, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, CreateUserIdentityDto, Currency, DEFAULT_API_URL, type DeepPartial, type Distance, type Endpoint, type Endpoints, ErrorType, type ErroredAPIResponse, type ExcludeBase, type GeoPoint, GeoPointDto, type GeoSearchAggregation, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationEndpoints, type Order, type OrderEndpoints, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventOrderEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationSocialLink, OrganizationSocialType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, type PromisedResponse, type PublicUser, type QueryParams, REGEX, RecoveryDto, RecoveryResetDto, type RecoveryResponse, type Response, type ResponseFor, SignInUserDto, type StringifiedQuery, type StringifiedQueryValue, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateLocationDto, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserBooking, type UserBookingEndpoints, type UserBookingTicket, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, UserFileType, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserNotification, type UserNotificationBase, type UserNotificationEndpoints, type UserNotificationFollow, UserNotificationType, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, type WebhookEndpoints, auth, buildFileFormData, careers, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
|
|
1330
|
+
export { type APIRequestOptions, type APIResponse, type ArrayFilterOptions, type ArrayOptions, type ArrayPaginationOptions, type ArrayResult, type ArraySortOptions, type Attachment, AttachmentType, type AuthEndpoints, type Base, type BaseProfile, type BaseProfileMetadata, type Body, type CareerEndpoints, type CareersCategory, type CareersEmploymentType, type CareersJob, type CareersOffice, type Channel, type ChannelEndpoints, type ChannelMember, type ChannelMessage, type ChannelMessageEndpoints, ChannelType, Client, type ClientOptions, CreateAttachmentDto, CreateChannelDto, CreateChannelMessageDto, CreateLocationDto, CreateOrganizationDto, CreateOrganizationEventDto, type CreateOrganizationEventInput, CreateOrganizationEventOrderDto, CreateOrganizationEventStyleDto, CreateOrganizationEventTicketDto, type CreateOrganizationEventTicketInput, CreateOrganizationIdentityDto, CreateOrganizationMemberDto, CreateUserDto, CreateUserIdentityDto, Currency, DEFAULT_API_URL, type DeepPartial, type Distance, type Endpoint, type Endpoints, ErrorType, type ErroredAPIResponse, type ExcludeBase, type GeoPoint, GeoPointDto, type GeoSearchAggregation, type Health, type HealthEndpoints, Language, type Location$1 as Location, type NotificationEndpoints, type Order, type OrderEndpoints, type Organization, type OrganizationBilling, type OrganizationBillingAccount, type OrganizationEndpoints, type OrganizationEvent, type OrganizationEventEndpoints, type OrganizationEventOrderEndpoints, type OrganizationEventStyle, type OrganizationEventStyleEndpoints, OrganizationEventStyleType, type OrganizationEventTicket, OrganizationEventTicketCategory, type OrganizationEventTicketEndpoints, OrganizationEventTicketType, OrganizationEventType, OrganizationEventVisibilityType, type OrganizationIdentity, type OrganizationMember, OrganizationMemberRole, OrganizationMemberStatus, type OrganizationMembersEndpoints, type OrganizationProfile, type OrganizationProfileMetadata, type OrganizationSocialLink, OrganizationSocialType, type PathsFor, type Profile, type ProfileEndpoints, type ProfileMetadata, ProfileType, type PromisedAPIResponse, type PromisedResponse, type PublicUser, type QueryParams, REGEX, RecoveryDto, RecoveryResetDto, type RecoveryResponse, type Response, type ResponseFor, SignInUserDto, type StringifiedQuery, type StringifiedQueryValue, type SuccessfulAPIResponse, TonightPass, TonightPassAPIError, UpdateChannelDto, UpdateChannelMessageDto, UpdateLocationDto, UpdateOrganizationDto, UpdateOrganizationEventDto, UpdateOrganizationEventStyleDto, UpdateOrganizationEventTicketDto, UpdateOrganizationIdentityDto, UpdateOrganizationMemberDto, UpdateUserDto, type User, type UserBooking, type UserBookingEndpoints, type UserBookingTicket, type UserConnection, type UserConnectionClient, type UserConnectionDevice, type UserConnectionOS, type UserEndpoints, UserFileType, type UserIdentifier, type UserIdentity, UserIdentityGender, type UserNotification, type UserNotificationBase, type UserNotificationEndpoints, type UserNotificationFollow, UserNotificationType, type UserPreferences, type UserProfile, type UserProfileMetadata, UserRole, type UserToken, UserTokenType, type WebhookEndpoints, auth, buildFileFormData, careers, channels, health, isBrowser, notifications, orders, organizations, profiles, request, sdk, users };
|