tonightpass 0.0.135 → 0.0.137
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 +135 -3
- package/dist/index.d.ts +135 -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";
|
|
@@ -22,13 +22,17 @@ declare const REGEX: {
|
|
|
22
22
|
IMAGE_URL: RegExp;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
declare class AddParticipantDto {
|
|
26
|
+
username: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
type Endpoint<M extends Options["method"], Path extends string, Res, Body = undefined> = {
|
|
26
30
|
method: M;
|
|
27
31
|
path: Path;
|
|
28
32
|
res: Res;
|
|
29
33
|
body: Body;
|
|
30
34
|
};
|
|
31
|
-
type Endpoints = AuthEndpoints | CareerEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
|
|
35
|
+
type Endpoints = AuthEndpoints | CareerEndpoints | ChannelEndpoints | ChannelMessageEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
|
|
32
36
|
|
|
33
37
|
declare enum UserNotificationType {
|
|
34
38
|
Follow = "follow"
|
|
@@ -241,6 +245,62 @@ type CareerEndpoints = Endpoint<"GET", "/careers/categories", CareersCategory[],
|
|
|
241
245
|
cityNameLike?: string;
|
|
242
246
|
}>;
|
|
243
247
|
|
|
248
|
+
declare enum AttachmentType {
|
|
249
|
+
Image = "image",
|
|
250
|
+
Video = "video",
|
|
251
|
+
Audio = "audio",
|
|
252
|
+
Document = "document",
|
|
253
|
+
File = "file"
|
|
254
|
+
}
|
|
255
|
+
type Attachment = {
|
|
256
|
+
type: AttachmentType;
|
|
257
|
+
url: string;
|
|
258
|
+
filename?: string;
|
|
259
|
+
size?: number;
|
|
260
|
+
mimeType?: string;
|
|
261
|
+
};
|
|
262
|
+
type ChannelMessage = Base & {
|
|
263
|
+
channel: Channel;
|
|
264
|
+
sender: ChannelParticipant;
|
|
265
|
+
content: string;
|
|
266
|
+
attachments: Attachment[];
|
|
267
|
+
sent: boolean;
|
|
268
|
+
delivered: boolean;
|
|
269
|
+
read: boolean;
|
|
270
|
+
readBy?: {
|
|
271
|
+
participant: ChannelParticipant;
|
|
272
|
+
readAt: Date;
|
|
273
|
+
}[];
|
|
274
|
+
edited: boolean;
|
|
275
|
+
editedAt?: Date;
|
|
276
|
+
replyTo?: ChannelMessage;
|
|
277
|
+
reactions?: {
|
|
278
|
+
emoji: string;
|
|
279
|
+
participants: ChannelParticipant[];
|
|
280
|
+
}[];
|
|
281
|
+
};
|
|
282
|
+
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, AddReactionDto> | Endpoint<"DELETE", "/channels/:channelId/messages/:messageId/reactions/:emoji", void, undefined> | Endpoint<"POST", "/channels/:channelId/messages/:messageId/read", void, null>;
|
|
283
|
+
|
|
284
|
+
declare enum ChannelType {
|
|
285
|
+
Private = "private",
|
|
286
|
+
Group = "group"
|
|
287
|
+
}
|
|
288
|
+
type ChannelParticipant = Profile;
|
|
289
|
+
type Channel = Base & {
|
|
290
|
+
type: ChannelType;
|
|
291
|
+
participants: ChannelParticipant[];
|
|
292
|
+
name?: string;
|
|
293
|
+
lastMessageAt?: Date;
|
|
294
|
+
unreadCount?: number;
|
|
295
|
+
};
|
|
296
|
+
type ChannelMember = {
|
|
297
|
+
participant: ChannelParticipant;
|
|
298
|
+
joinedAt: Date;
|
|
299
|
+
role?: "admin" | "member";
|
|
300
|
+
lastReadAt?: Date;
|
|
301
|
+
};
|
|
302
|
+
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/participants", void, AddParticipantDto> | Endpoint<"DELETE", "/channels/:channelId/participants/:username", void, undefined> | Endpoint<"GET", "/channels/:channelId/members", ChannelMember[]>;
|
|
303
|
+
|
|
244
304
|
declare enum ErrorType {
|
|
245
305
|
AuthEmailAlreadyExists = "auth.email-already-exists",
|
|
246
306
|
AuthUsernameAlreadyExists = "auth.username-already-exists",
|
|
@@ -664,6 +724,37 @@ type ArrayResult<T> = {
|
|
|
664
724
|
limit: number;
|
|
665
725
|
};
|
|
666
726
|
|
|
727
|
+
declare class CreateChannelDto {
|
|
728
|
+
type: ChannelType;
|
|
729
|
+
participantUsernames: string[];
|
|
730
|
+
name?: string;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare class UpdateChannelDto {
|
|
734
|
+
name?: string;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
declare class AddReactionDto {
|
|
738
|
+
emoji: string;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
declare class CreateAttachmentDto {
|
|
742
|
+
type: AttachmentType;
|
|
743
|
+
url: string;
|
|
744
|
+
filename?: string;
|
|
745
|
+
mimeType?: string;
|
|
746
|
+
}
|
|
747
|
+
declare class CreateChannelMessageDto {
|
|
748
|
+
content: string;
|
|
749
|
+
attachments?: CreateAttachmentDto[];
|
|
750
|
+
replyToId?: string;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
declare class UpdateChannelMessageDto {
|
|
754
|
+
content?: string;
|
|
755
|
+
attachments?: CreateAttachmentDto[];
|
|
756
|
+
}
|
|
757
|
+
|
|
667
758
|
declare class GeoPointDto implements GeoPoint {
|
|
668
759
|
type: "Point";
|
|
669
760
|
coordinates: [number, number];
|
|
@@ -948,6 +1039,27 @@ declare const careers: (client: Client) => {
|
|
|
948
1039
|
};
|
|
949
1040
|
};
|
|
950
1041
|
|
|
1042
|
+
declare const channels: (client: Client) => {
|
|
1043
|
+
getAll: () => Promise<Channel[]>;
|
|
1044
|
+
get: (channelId: string) => Promise<Channel>;
|
|
1045
|
+
create: (data: CreateChannelDto) => Promise<Channel>;
|
|
1046
|
+
update: (channelId: string, data: UpdateChannelDto) => Promise<Channel>;
|
|
1047
|
+
delete: (channelId: string) => Promise<void>;
|
|
1048
|
+
addParticipant: (channelId: string, username: string) => Promise<void>;
|
|
1049
|
+
removeParticipant: (channelId: string, username: string) => Promise<void>;
|
|
1050
|
+
getMembers: (channelId: string) => Promise<ChannelMember[]>;
|
|
1051
|
+
messages: {
|
|
1052
|
+
getAll: (channelId: string, options?: ArrayOptions<ChannelMessage>) => Promise<ArrayResult<ChannelMessage>>;
|
|
1053
|
+
get: (channelId: string, messageId: string) => Promise<ChannelMessage>;
|
|
1054
|
+
create: (channelId: string, data: CreateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1055
|
+
update: (channelId: string, messageId: string, data: UpdateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1056
|
+
delete: (channelId: string, messageId: string) => Promise<void>;
|
|
1057
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1058
|
+
removeReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1059
|
+
markAsRead: (channelId: string, messageId: string) => Promise<void>;
|
|
1060
|
+
};
|
|
1061
|
+
};
|
|
1062
|
+
|
|
951
1063
|
declare function sdk<T>(builder: (client: Client) => T): (client: Client) => T;
|
|
952
1064
|
|
|
953
1065
|
declare const health: (client: Client) => {
|
|
@@ -1091,6 +1203,26 @@ declare class TonightPass {
|
|
|
1091
1203
|
getAll: (query?: pathcat.Query<"/careers/offices">) => Promise<CareersOffice[]>;
|
|
1092
1204
|
};
|
|
1093
1205
|
};
|
|
1206
|
+
readonly channels: {
|
|
1207
|
+
getAll: () => Promise<Channel[]>;
|
|
1208
|
+
get: (channelId: string) => Promise<Channel>;
|
|
1209
|
+
create: (data: CreateChannelDto) => Promise<Channel>;
|
|
1210
|
+
update: (channelId: string, data: UpdateChannelDto) => Promise<Channel>;
|
|
1211
|
+
delete: (channelId: string) => Promise<void>;
|
|
1212
|
+
addParticipant: (channelId: string, username: string) => Promise<void>;
|
|
1213
|
+
removeParticipant: (channelId: string, username: string) => Promise<void>;
|
|
1214
|
+
getMembers: (channelId: string) => Promise<ChannelMember[]>;
|
|
1215
|
+
messages: {
|
|
1216
|
+
getAll: (channelId: string, options?: ArrayOptions<ChannelMessage>) => Promise<ArrayResult<ChannelMessage>>;
|
|
1217
|
+
get: (channelId: string, messageId: string) => Promise<ChannelMessage>;
|
|
1218
|
+
create: (channelId: string, data: CreateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1219
|
+
update: (channelId: string, messageId: string, data: UpdateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1220
|
+
delete: (channelId: string, messageId: string) => Promise<void>;
|
|
1221
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1222
|
+
removeReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1223
|
+
markAsRead: (channelId: string, messageId: string) => Promise<void>;
|
|
1224
|
+
};
|
|
1225
|
+
};
|
|
1094
1226
|
readonly health: {
|
|
1095
1227
|
getAll: () => Promise<Health<"database" | "app" | "api">>;
|
|
1096
1228
|
database: () => Promise<Health<"database">>;
|
|
@@ -1196,4 +1328,4 @@ declare class TonightPass {
|
|
|
1196
1328
|
declare const isBrowser: boolean;
|
|
1197
1329
|
declare function buildFileFormData(key: string, files: File | File[] | FileList): FormData;
|
|
1198
1330
|
|
|
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 };
|
|
1331
|
+
export { type APIRequestOptions, type APIResponse, AddParticipantDto, AddReactionDto, 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, type ChannelParticipant, 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";
|
|
@@ -22,13 +22,17 @@ declare const REGEX: {
|
|
|
22
22
|
IMAGE_URL: RegExp;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
declare class AddParticipantDto {
|
|
26
|
+
username: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
type Endpoint<M extends Options["method"], Path extends string, Res, Body = undefined> = {
|
|
26
30
|
method: M;
|
|
27
31
|
path: Path;
|
|
28
32
|
res: Res;
|
|
29
33
|
body: Body;
|
|
30
34
|
};
|
|
31
|
-
type Endpoints = AuthEndpoints | CareerEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
|
|
35
|
+
type Endpoints = AuthEndpoints | CareerEndpoints | ChannelEndpoints | ChannelMessageEndpoints | HealthEndpoints | OrderEndpoints | OrganizationEndpoints | ProfileEndpoints | UserEndpoints | WebhookEndpoints | NotificationEndpoints;
|
|
32
36
|
|
|
33
37
|
declare enum UserNotificationType {
|
|
34
38
|
Follow = "follow"
|
|
@@ -241,6 +245,62 @@ type CareerEndpoints = Endpoint<"GET", "/careers/categories", CareersCategory[],
|
|
|
241
245
|
cityNameLike?: string;
|
|
242
246
|
}>;
|
|
243
247
|
|
|
248
|
+
declare enum AttachmentType {
|
|
249
|
+
Image = "image",
|
|
250
|
+
Video = "video",
|
|
251
|
+
Audio = "audio",
|
|
252
|
+
Document = "document",
|
|
253
|
+
File = "file"
|
|
254
|
+
}
|
|
255
|
+
type Attachment = {
|
|
256
|
+
type: AttachmentType;
|
|
257
|
+
url: string;
|
|
258
|
+
filename?: string;
|
|
259
|
+
size?: number;
|
|
260
|
+
mimeType?: string;
|
|
261
|
+
};
|
|
262
|
+
type ChannelMessage = Base & {
|
|
263
|
+
channel: Channel;
|
|
264
|
+
sender: ChannelParticipant;
|
|
265
|
+
content: string;
|
|
266
|
+
attachments: Attachment[];
|
|
267
|
+
sent: boolean;
|
|
268
|
+
delivered: boolean;
|
|
269
|
+
read: boolean;
|
|
270
|
+
readBy?: {
|
|
271
|
+
participant: ChannelParticipant;
|
|
272
|
+
readAt: Date;
|
|
273
|
+
}[];
|
|
274
|
+
edited: boolean;
|
|
275
|
+
editedAt?: Date;
|
|
276
|
+
replyTo?: ChannelMessage;
|
|
277
|
+
reactions?: {
|
|
278
|
+
emoji: string;
|
|
279
|
+
participants: ChannelParticipant[];
|
|
280
|
+
}[];
|
|
281
|
+
};
|
|
282
|
+
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, AddReactionDto> | Endpoint<"DELETE", "/channels/:channelId/messages/:messageId/reactions/:emoji", void, undefined> | Endpoint<"POST", "/channels/:channelId/messages/:messageId/read", void, null>;
|
|
283
|
+
|
|
284
|
+
declare enum ChannelType {
|
|
285
|
+
Private = "private",
|
|
286
|
+
Group = "group"
|
|
287
|
+
}
|
|
288
|
+
type ChannelParticipant = Profile;
|
|
289
|
+
type Channel = Base & {
|
|
290
|
+
type: ChannelType;
|
|
291
|
+
participants: ChannelParticipant[];
|
|
292
|
+
name?: string;
|
|
293
|
+
lastMessageAt?: Date;
|
|
294
|
+
unreadCount?: number;
|
|
295
|
+
};
|
|
296
|
+
type ChannelMember = {
|
|
297
|
+
participant: ChannelParticipant;
|
|
298
|
+
joinedAt: Date;
|
|
299
|
+
role?: "admin" | "member";
|
|
300
|
+
lastReadAt?: Date;
|
|
301
|
+
};
|
|
302
|
+
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/participants", void, AddParticipantDto> | Endpoint<"DELETE", "/channels/:channelId/participants/:username", void, undefined> | Endpoint<"GET", "/channels/:channelId/members", ChannelMember[]>;
|
|
303
|
+
|
|
244
304
|
declare enum ErrorType {
|
|
245
305
|
AuthEmailAlreadyExists = "auth.email-already-exists",
|
|
246
306
|
AuthUsernameAlreadyExists = "auth.username-already-exists",
|
|
@@ -664,6 +724,37 @@ type ArrayResult<T> = {
|
|
|
664
724
|
limit: number;
|
|
665
725
|
};
|
|
666
726
|
|
|
727
|
+
declare class CreateChannelDto {
|
|
728
|
+
type: ChannelType;
|
|
729
|
+
participantUsernames: string[];
|
|
730
|
+
name?: string;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare class UpdateChannelDto {
|
|
734
|
+
name?: string;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
declare class AddReactionDto {
|
|
738
|
+
emoji: string;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
declare class CreateAttachmentDto {
|
|
742
|
+
type: AttachmentType;
|
|
743
|
+
url: string;
|
|
744
|
+
filename?: string;
|
|
745
|
+
mimeType?: string;
|
|
746
|
+
}
|
|
747
|
+
declare class CreateChannelMessageDto {
|
|
748
|
+
content: string;
|
|
749
|
+
attachments?: CreateAttachmentDto[];
|
|
750
|
+
replyToId?: string;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
declare class UpdateChannelMessageDto {
|
|
754
|
+
content?: string;
|
|
755
|
+
attachments?: CreateAttachmentDto[];
|
|
756
|
+
}
|
|
757
|
+
|
|
667
758
|
declare class GeoPointDto implements GeoPoint {
|
|
668
759
|
type: "Point";
|
|
669
760
|
coordinates: [number, number];
|
|
@@ -948,6 +1039,27 @@ declare const careers: (client: Client) => {
|
|
|
948
1039
|
};
|
|
949
1040
|
};
|
|
950
1041
|
|
|
1042
|
+
declare const channels: (client: Client) => {
|
|
1043
|
+
getAll: () => Promise<Channel[]>;
|
|
1044
|
+
get: (channelId: string) => Promise<Channel>;
|
|
1045
|
+
create: (data: CreateChannelDto) => Promise<Channel>;
|
|
1046
|
+
update: (channelId: string, data: UpdateChannelDto) => Promise<Channel>;
|
|
1047
|
+
delete: (channelId: string) => Promise<void>;
|
|
1048
|
+
addParticipant: (channelId: string, username: string) => Promise<void>;
|
|
1049
|
+
removeParticipant: (channelId: string, username: string) => Promise<void>;
|
|
1050
|
+
getMembers: (channelId: string) => Promise<ChannelMember[]>;
|
|
1051
|
+
messages: {
|
|
1052
|
+
getAll: (channelId: string, options?: ArrayOptions<ChannelMessage>) => Promise<ArrayResult<ChannelMessage>>;
|
|
1053
|
+
get: (channelId: string, messageId: string) => Promise<ChannelMessage>;
|
|
1054
|
+
create: (channelId: string, data: CreateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1055
|
+
update: (channelId: string, messageId: string, data: UpdateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1056
|
+
delete: (channelId: string, messageId: string) => Promise<void>;
|
|
1057
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1058
|
+
removeReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1059
|
+
markAsRead: (channelId: string, messageId: string) => Promise<void>;
|
|
1060
|
+
};
|
|
1061
|
+
};
|
|
1062
|
+
|
|
951
1063
|
declare function sdk<T>(builder: (client: Client) => T): (client: Client) => T;
|
|
952
1064
|
|
|
953
1065
|
declare const health: (client: Client) => {
|
|
@@ -1091,6 +1203,26 @@ declare class TonightPass {
|
|
|
1091
1203
|
getAll: (query?: pathcat.Query<"/careers/offices">) => Promise<CareersOffice[]>;
|
|
1092
1204
|
};
|
|
1093
1205
|
};
|
|
1206
|
+
readonly channels: {
|
|
1207
|
+
getAll: () => Promise<Channel[]>;
|
|
1208
|
+
get: (channelId: string) => Promise<Channel>;
|
|
1209
|
+
create: (data: CreateChannelDto) => Promise<Channel>;
|
|
1210
|
+
update: (channelId: string, data: UpdateChannelDto) => Promise<Channel>;
|
|
1211
|
+
delete: (channelId: string) => Promise<void>;
|
|
1212
|
+
addParticipant: (channelId: string, username: string) => Promise<void>;
|
|
1213
|
+
removeParticipant: (channelId: string, username: string) => Promise<void>;
|
|
1214
|
+
getMembers: (channelId: string) => Promise<ChannelMember[]>;
|
|
1215
|
+
messages: {
|
|
1216
|
+
getAll: (channelId: string, options?: ArrayOptions<ChannelMessage>) => Promise<ArrayResult<ChannelMessage>>;
|
|
1217
|
+
get: (channelId: string, messageId: string) => Promise<ChannelMessage>;
|
|
1218
|
+
create: (channelId: string, data: CreateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1219
|
+
update: (channelId: string, messageId: string, data: UpdateChannelMessageDto) => Promise<ChannelMessage>;
|
|
1220
|
+
delete: (channelId: string, messageId: string) => Promise<void>;
|
|
1221
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1222
|
+
removeReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
1223
|
+
markAsRead: (channelId: string, messageId: string) => Promise<void>;
|
|
1224
|
+
};
|
|
1225
|
+
};
|
|
1094
1226
|
readonly health: {
|
|
1095
1227
|
getAll: () => Promise<Health<"database" | "app" | "api">>;
|
|
1096
1228
|
database: () => Promise<Health<"database">>;
|
|
@@ -1196,4 +1328,4 @@ declare class TonightPass {
|
|
|
1196
1328
|
declare const isBrowser: boolean;
|
|
1197
1329
|
declare function buildFileFormData(key: string, files: File | File[] | FileList): FormData;
|
|
1198
1330
|
|
|
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 };
|
|
1331
|
+
export { type APIRequestOptions, type APIResponse, AddParticipantDto, AddReactionDto, 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, type ChannelParticipant, 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 };
|