@natsuneko-laboratory/catalyst-sdk 0.6.0 → 0.7.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.
- package/dist/index.d.mts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +34 -2
- package/dist/index.mjs +34 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -194,10 +194,33 @@ interface CatalystReactions {
|
|
|
194
194
|
reactions: Record<string, CatalystReaction>;
|
|
195
195
|
}
|
|
196
196
|
interface CatalystCustomReaction {
|
|
197
|
+
id: string;
|
|
197
198
|
name: string;
|
|
198
199
|
symbol: string;
|
|
199
200
|
url: string;
|
|
200
201
|
}
|
|
202
|
+
type CatalystCustomReactionStatus = "active" | "moderated" | "hidden" | "disabled";
|
|
203
|
+
type SupporterTier = "none" | "tier_0" | "tier_1" | "tier_2" | "tier_3" | "tier_4" | "tier_5";
|
|
204
|
+
interface CatalystUserCustomReaction {
|
|
205
|
+
id: string;
|
|
206
|
+
shortcode: string;
|
|
207
|
+
displayName: string;
|
|
208
|
+
imageUrl: string;
|
|
209
|
+
mimeType: string;
|
|
210
|
+
sortOrder: number;
|
|
211
|
+
status: CatalystCustomReactionStatus;
|
|
212
|
+
createdAt: string;
|
|
213
|
+
}
|
|
214
|
+
interface CatalystCustomReactionList {
|
|
215
|
+
plan: SupporterTier;
|
|
216
|
+
limit: number;
|
|
217
|
+
used: number;
|
|
218
|
+
items: CatalystUserCustomReaction[];
|
|
219
|
+
}
|
|
220
|
+
interface UpdateCustomReactionRequest {
|
|
221
|
+
displayName?: string;
|
|
222
|
+
sortOrder?: number;
|
|
223
|
+
}
|
|
201
224
|
|
|
202
225
|
interface CatalystRelationships {
|
|
203
226
|
isMyself: boolean;
|
|
@@ -466,6 +489,10 @@ declare class CatalystClient {
|
|
|
466
489
|
listAlbums(username: string, includeSmartAlbums?: boolean): Promise<CatalystSmartAlbums>;
|
|
467
490
|
searchAlbums(q: string, includeSmartAlbums?: boolean): Promise<CatalystSmartAlbums>;
|
|
468
491
|
customReactions(): Promise<CatalystCustomReaction[]>;
|
|
492
|
+
customUserReactions(): Promise<CatalystCustomReactionList>;
|
|
493
|
+
createCustomReaction(data: FormData): Promise<CatalystUserCustomReaction>;
|
|
494
|
+
updateCustomReaction(id: string, data: UpdateCustomReactionRequest): Promise<void>;
|
|
495
|
+
deleteCustomReaction(id: string): Promise<void>;
|
|
469
496
|
block(data: CatalystRelationshipRequest): Promise<void>;
|
|
470
497
|
unblock(data: CatalystRelationshipRequest): Promise<void>;
|
|
471
498
|
relationships(id: string): Promise<CatalystRelationships>;
|
|
@@ -685,11 +712,18 @@ declare class MediaClient {
|
|
|
685
712
|
upload(): Promise<MediaUploadUrls>;
|
|
686
713
|
}
|
|
687
714
|
|
|
715
|
+
interface NotificationAdditionalContext {
|
|
716
|
+
type: "custom-reaction";
|
|
717
|
+
url: string;
|
|
718
|
+
format: string;
|
|
719
|
+
}
|
|
688
720
|
interface NotificationGroup {
|
|
689
721
|
id: string;
|
|
690
722
|
body: string;
|
|
691
723
|
occurredBy: EgeriaUser;
|
|
692
724
|
isRead: boolean;
|
|
725
|
+
createdAt: string;
|
|
726
|
+
additionalContexts?: NotificationAdditionalContext | null;
|
|
693
727
|
}
|
|
694
728
|
interface Notification {
|
|
695
729
|
id: string;
|
|
@@ -823,6 +857,10 @@ declare const CatalystEndpoint: {
|
|
|
823
857
|
readonly listAlbums: (username: string, includeSmartAlbums?: boolean) => Endpoint;
|
|
824
858
|
readonly searchAlbum: (q: string, includeSmartAlbums?: boolean) => Endpoint;
|
|
825
859
|
readonly customReactions: () => Endpoint;
|
|
860
|
+
readonly customUserReactions: () => Endpoint;
|
|
861
|
+
readonly createCustomReaction: (data: FormData) => Endpoint;
|
|
862
|
+
readonly updateCustomReaction: (id: string, data: UpdateCustomReactionRequest) => Endpoint;
|
|
863
|
+
readonly deleteCustomReaction: (id: string) => Endpoint;
|
|
826
864
|
readonly block: (data: CatalystRelationshipRequest) => Endpoint;
|
|
827
865
|
readonly unblock: (data: CatalystRelationshipRequest) => Endpoint;
|
|
828
866
|
readonly relationships: (id: string) => Endpoint;
|
|
@@ -993,4 +1031,4 @@ declare class LoggingInterceptor implements RequestInterceptor {
|
|
|
993
1031
|
retry(request: Request, error: unknown): Promise<boolean>;
|
|
994
1032
|
}
|
|
995
1033
|
|
|
996
|
-
export { ApiError, AuthInterceptor, type CatalystAlbum, type CatalystAlbumDisplayMode, type CatalystAnnouncement, CatalystClient, type CatalystContest, type CatalystContestAddCollaboratorRequest, type CatalystContestAward, type CatalystContestCollaborator, type CatalystContestPolls, type CatalystContestRank, type CatalystContestRemoveCollaboratorRequest, type CatalystCreateAlbumRequest, type CatalystCreateContestRequest, type CatalystCreateFleetMedia, type CatalystCreateFleetRequest, type CatalystCreateFleetSticker, type CatalystCreateFleetText, type CatalystCreateSmartAlbumRequest, type CatalystCreateStatusRequest, type CatalystCustomReaction, type CatalystEditAlbumRequest, type CatalystEditContestRequest, type CatalystEditSmartAlbumRequest, type CatalystEditStatusRequest, CatalystEndpoint, CatalystError, type CatalystFleet, type CatalystFleetMedia, type CatalystFleetRing, type CatalystFleetSticker, type CatalystFleetText, type CatalystFleetViewer, type CatalystInsertToAlbumRequest, type CatalystMediaWithMetadata, type CatalystPrivacySettings, type CatalystPrivacySettingsRequest, type CatalystReaction, type CatalystReactions, type CatalystRelationshipRequest, type CatalystRelationships, type CatalystRemoveFromAlbumRequest, type CatalystSetContestAwardRequest, type CatalystSmartAlbum, type CatalystSmartAlbums, type CatalystStatus, type CatalystStatusPrivacy, type CatalystStatusWrapper, type CatalystStatuses, CatalystTS, type CatalystTSOptions, type CatalystUnsetContestAwardRequest, type CatalystUserVoteRights, EgeriaClient, EgeriaEndpoint, type EgeriaUpdateProfileRequest, type EgeriaUser, type EgeriaUserProfile, type EgeriaUserWrapper, type EgeriaUsers, type Endpoint, HttpClient, type HttpMethod, ISSUER_CATALYST_SYSTEM_MESSAGE, ISSUER_CATALYST_USER_MESSAGE, ISSUER_EGERIA_SYSTEM_MESSAGE, type Identity, LoggingInterceptor, type Media, MediaClient, type MediaDeleteRequest, type MediaDownloadRequest, MediaEndpoint, type MediaMetadata, type MediaUploadUrls, type Notification, type NotificationGroup, type NotificationUnreadCount, type Notifications, OAuth, OAuthError, PKCE, PUBLIC_API_ENDPOINT, PUBLIC_AUTHORIZE_ENDPOINT, PUBLIC_GRAPHQL_ENDPOINT, type ProfileTag, type ProfileTagSuggestion, type ProfileTagUser, type ReportRequest, type RequestInterceptor, SteambirdClient, SteambirdEndpoint, type Token, type UpdateProfileTagsRequest, UserAgentInterceptor };
|
|
1034
|
+
export { ApiError, AuthInterceptor, type CatalystAlbum, type CatalystAlbumDisplayMode, type CatalystAnnouncement, CatalystClient, type CatalystContest, type CatalystContestAddCollaboratorRequest, type CatalystContestAward, type CatalystContestCollaborator, type CatalystContestPolls, type CatalystContestRank, type CatalystContestRemoveCollaboratorRequest, type CatalystCreateAlbumRequest, type CatalystCreateContestRequest, type CatalystCreateFleetMedia, type CatalystCreateFleetRequest, type CatalystCreateFleetSticker, type CatalystCreateFleetText, type CatalystCreateSmartAlbumRequest, type CatalystCreateStatusRequest, type CatalystCustomReaction, type CatalystCustomReactionList, type CatalystCustomReactionStatus, type CatalystEditAlbumRequest, type CatalystEditContestRequest, type CatalystEditSmartAlbumRequest, type CatalystEditStatusRequest, CatalystEndpoint, CatalystError, type CatalystFleet, type CatalystFleetMedia, type CatalystFleetRing, type CatalystFleetSticker, type CatalystFleetText, type CatalystFleetViewer, type CatalystInsertToAlbumRequest, type CatalystMediaWithMetadata, type CatalystPrivacySettings, type CatalystPrivacySettingsRequest, type CatalystReaction, type CatalystReactions, type CatalystRelationshipRequest, type CatalystRelationships, type CatalystRemoveFromAlbumRequest, type CatalystSetContestAwardRequest, type CatalystSmartAlbum, type CatalystSmartAlbums, type CatalystStatus, type CatalystStatusPrivacy, type CatalystStatusWrapper, type CatalystStatuses, CatalystTS, type CatalystTSOptions, type CatalystUnsetContestAwardRequest, type CatalystUserCustomReaction, type CatalystUserVoteRights, EgeriaClient, EgeriaEndpoint, type EgeriaUpdateProfileRequest, type EgeriaUser, type EgeriaUserProfile, type EgeriaUserWrapper, type EgeriaUsers, type Endpoint, HttpClient, type HttpMethod, ISSUER_CATALYST_SYSTEM_MESSAGE, ISSUER_CATALYST_USER_MESSAGE, ISSUER_EGERIA_SYSTEM_MESSAGE, type Identity, LoggingInterceptor, type Media, MediaClient, type MediaDeleteRequest, type MediaDownloadRequest, MediaEndpoint, type MediaMetadata, type MediaUploadUrls, type Notification, type NotificationAdditionalContext, type NotificationGroup, type NotificationUnreadCount, type Notifications, OAuth, OAuthError, PKCE, PUBLIC_API_ENDPOINT, PUBLIC_AUTHORIZE_ENDPOINT, PUBLIC_GRAPHQL_ENDPOINT, type ProfileTag, type ProfileTagSuggestion, type ProfileTagUser, type ReportRequest, type RequestInterceptor, SteambirdClient, SteambirdEndpoint, type SupporterTier, type Token, type UpdateCustomReactionRequest, type UpdateProfileTagsRequest, UserAgentInterceptor };
|
package/dist/index.d.ts
CHANGED
|
@@ -194,10 +194,33 @@ interface CatalystReactions {
|
|
|
194
194
|
reactions: Record<string, CatalystReaction>;
|
|
195
195
|
}
|
|
196
196
|
interface CatalystCustomReaction {
|
|
197
|
+
id: string;
|
|
197
198
|
name: string;
|
|
198
199
|
symbol: string;
|
|
199
200
|
url: string;
|
|
200
201
|
}
|
|
202
|
+
type CatalystCustomReactionStatus = "active" | "moderated" | "hidden" | "disabled";
|
|
203
|
+
type SupporterTier = "none" | "tier_0" | "tier_1" | "tier_2" | "tier_3" | "tier_4" | "tier_5";
|
|
204
|
+
interface CatalystUserCustomReaction {
|
|
205
|
+
id: string;
|
|
206
|
+
shortcode: string;
|
|
207
|
+
displayName: string;
|
|
208
|
+
imageUrl: string;
|
|
209
|
+
mimeType: string;
|
|
210
|
+
sortOrder: number;
|
|
211
|
+
status: CatalystCustomReactionStatus;
|
|
212
|
+
createdAt: string;
|
|
213
|
+
}
|
|
214
|
+
interface CatalystCustomReactionList {
|
|
215
|
+
plan: SupporterTier;
|
|
216
|
+
limit: number;
|
|
217
|
+
used: number;
|
|
218
|
+
items: CatalystUserCustomReaction[];
|
|
219
|
+
}
|
|
220
|
+
interface UpdateCustomReactionRequest {
|
|
221
|
+
displayName?: string;
|
|
222
|
+
sortOrder?: number;
|
|
223
|
+
}
|
|
201
224
|
|
|
202
225
|
interface CatalystRelationships {
|
|
203
226
|
isMyself: boolean;
|
|
@@ -466,6 +489,10 @@ declare class CatalystClient {
|
|
|
466
489
|
listAlbums(username: string, includeSmartAlbums?: boolean): Promise<CatalystSmartAlbums>;
|
|
467
490
|
searchAlbums(q: string, includeSmartAlbums?: boolean): Promise<CatalystSmartAlbums>;
|
|
468
491
|
customReactions(): Promise<CatalystCustomReaction[]>;
|
|
492
|
+
customUserReactions(): Promise<CatalystCustomReactionList>;
|
|
493
|
+
createCustomReaction(data: FormData): Promise<CatalystUserCustomReaction>;
|
|
494
|
+
updateCustomReaction(id: string, data: UpdateCustomReactionRequest): Promise<void>;
|
|
495
|
+
deleteCustomReaction(id: string): Promise<void>;
|
|
469
496
|
block(data: CatalystRelationshipRequest): Promise<void>;
|
|
470
497
|
unblock(data: CatalystRelationshipRequest): Promise<void>;
|
|
471
498
|
relationships(id: string): Promise<CatalystRelationships>;
|
|
@@ -685,11 +712,18 @@ declare class MediaClient {
|
|
|
685
712
|
upload(): Promise<MediaUploadUrls>;
|
|
686
713
|
}
|
|
687
714
|
|
|
715
|
+
interface NotificationAdditionalContext {
|
|
716
|
+
type: "custom-reaction";
|
|
717
|
+
url: string;
|
|
718
|
+
format: string;
|
|
719
|
+
}
|
|
688
720
|
interface NotificationGroup {
|
|
689
721
|
id: string;
|
|
690
722
|
body: string;
|
|
691
723
|
occurredBy: EgeriaUser;
|
|
692
724
|
isRead: boolean;
|
|
725
|
+
createdAt: string;
|
|
726
|
+
additionalContexts?: NotificationAdditionalContext | null;
|
|
693
727
|
}
|
|
694
728
|
interface Notification {
|
|
695
729
|
id: string;
|
|
@@ -823,6 +857,10 @@ declare const CatalystEndpoint: {
|
|
|
823
857
|
readonly listAlbums: (username: string, includeSmartAlbums?: boolean) => Endpoint;
|
|
824
858
|
readonly searchAlbum: (q: string, includeSmartAlbums?: boolean) => Endpoint;
|
|
825
859
|
readonly customReactions: () => Endpoint;
|
|
860
|
+
readonly customUserReactions: () => Endpoint;
|
|
861
|
+
readonly createCustomReaction: (data: FormData) => Endpoint;
|
|
862
|
+
readonly updateCustomReaction: (id: string, data: UpdateCustomReactionRequest) => Endpoint;
|
|
863
|
+
readonly deleteCustomReaction: (id: string) => Endpoint;
|
|
826
864
|
readonly block: (data: CatalystRelationshipRequest) => Endpoint;
|
|
827
865
|
readonly unblock: (data: CatalystRelationshipRequest) => Endpoint;
|
|
828
866
|
readonly relationships: (id: string) => Endpoint;
|
|
@@ -993,4 +1031,4 @@ declare class LoggingInterceptor implements RequestInterceptor {
|
|
|
993
1031
|
retry(request: Request, error: unknown): Promise<boolean>;
|
|
994
1032
|
}
|
|
995
1033
|
|
|
996
|
-
export { ApiError, AuthInterceptor, type CatalystAlbum, type CatalystAlbumDisplayMode, type CatalystAnnouncement, CatalystClient, type CatalystContest, type CatalystContestAddCollaboratorRequest, type CatalystContestAward, type CatalystContestCollaborator, type CatalystContestPolls, type CatalystContestRank, type CatalystContestRemoveCollaboratorRequest, type CatalystCreateAlbumRequest, type CatalystCreateContestRequest, type CatalystCreateFleetMedia, type CatalystCreateFleetRequest, type CatalystCreateFleetSticker, type CatalystCreateFleetText, type CatalystCreateSmartAlbumRequest, type CatalystCreateStatusRequest, type CatalystCustomReaction, type CatalystEditAlbumRequest, type CatalystEditContestRequest, type CatalystEditSmartAlbumRequest, type CatalystEditStatusRequest, CatalystEndpoint, CatalystError, type CatalystFleet, type CatalystFleetMedia, type CatalystFleetRing, type CatalystFleetSticker, type CatalystFleetText, type CatalystFleetViewer, type CatalystInsertToAlbumRequest, type CatalystMediaWithMetadata, type CatalystPrivacySettings, type CatalystPrivacySettingsRequest, type CatalystReaction, type CatalystReactions, type CatalystRelationshipRequest, type CatalystRelationships, type CatalystRemoveFromAlbumRequest, type CatalystSetContestAwardRequest, type CatalystSmartAlbum, type CatalystSmartAlbums, type CatalystStatus, type CatalystStatusPrivacy, type CatalystStatusWrapper, type CatalystStatuses, CatalystTS, type CatalystTSOptions, type CatalystUnsetContestAwardRequest, type CatalystUserVoteRights, EgeriaClient, EgeriaEndpoint, type EgeriaUpdateProfileRequest, type EgeriaUser, type EgeriaUserProfile, type EgeriaUserWrapper, type EgeriaUsers, type Endpoint, HttpClient, type HttpMethod, ISSUER_CATALYST_SYSTEM_MESSAGE, ISSUER_CATALYST_USER_MESSAGE, ISSUER_EGERIA_SYSTEM_MESSAGE, type Identity, LoggingInterceptor, type Media, MediaClient, type MediaDeleteRequest, type MediaDownloadRequest, MediaEndpoint, type MediaMetadata, type MediaUploadUrls, type Notification, type NotificationGroup, type NotificationUnreadCount, type Notifications, OAuth, OAuthError, PKCE, PUBLIC_API_ENDPOINT, PUBLIC_AUTHORIZE_ENDPOINT, PUBLIC_GRAPHQL_ENDPOINT, type ProfileTag, type ProfileTagSuggestion, type ProfileTagUser, type ReportRequest, type RequestInterceptor, SteambirdClient, SteambirdEndpoint, type Token, type UpdateProfileTagsRequest, UserAgentInterceptor };
|
|
1034
|
+
export { ApiError, AuthInterceptor, type CatalystAlbum, type CatalystAlbumDisplayMode, type CatalystAnnouncement, CatalystClient, type CatalystContest, type CatalystContestAddCollaboratorRequest, type CatalystContestAward, type CatalystContestCollaborator, type CatalystContestPolls, type CatalystContestRank, type CatalystContestRemoveCollaboratorRequest, type CatalystCreateAlbumRequest, type CatalystCreateContestRequest, type CatalystCreateFleetMedia, type CatalystCreateFleetRequest, type CatalystCreateFleetSticker, type CatalystCreateFleetText, type CatalystCreateSmartAlbumRequest, type CatalystCreateStatusRequest, type CatalystCustomReaction, type CatalystCustomReactionList, type CatalystCustomReactionStatus, type CatalystEditAlbumRequest, type CatalystEditContestRequest, type CatalystEditSmartAlbumRequest, type CatalystEditStatusRequest, CatalystEndpoint, CatalystError, type CatalystFleet, type CatalystFleetMedia, type CatalystFleetRing, type CatalystFleetSticker, type CatalystFleetText, type CatalystFleetViewer, type CatalystInsertToAlbumRequest, type CatalystMediaWithMetadata, type CatalystPrivacySettings, type CatalystPrivacySettingsRequest, type CatalystReaction, type CatalystReactions, type CatalystRelationshipRequest, type CatalystRelationships, type CatalystRemoveFromAlbumRequest, type CatalystSetContestAwardRequest, type CatalystSmartAlbum, type CatalystSmartAlbums, type CatalystStatus, type CatalystStatusPrivacy, type CatalystStatusWrapper, type CatalystStatuses, CatalystTS, type CatalystTSOptions, type CatalystUnsetContestAwardRequest, type CatalystUserCustomReaction, type CatalystUserVoteRights, EgeriaClient, EgeriaEndpoint, type EgeriaUpdateProfileRequest, type EgeriaUser, type EgeriaUserProfile, type EgeriaUserWrapper, type EgeriaUsers, type Endpoint, HttpClient, type HttpMethod, ISSUER_CATALYST_SYSTEM_MESSAGE, ISSUER_CATALYST_USER_MESSAGE, ISSUER_EGERIA_SYSTEM_MESSAGE, type Identity, LoggingInterceptor, type Media, MediaClient, type MediaDeleteRequest, type MediaDownloadRequest, MediaEndpoint, type MediaMetadata, type MediaUploadUrls, type Notification, type NotificationAdditionalContext, type NotificationGroup, type NotificationUnreadCount, type Notifications, OAuth, OAuthError, PKCE, PUBLIC_API_ENDPOINT, PUBLIC_AUTHORIZE_ENDPOINT, PUBLIC_GRAPHQL_ENDPOINT, type ProfileTag, type ProfileTagSuggestion, type ProfileTagUser, type ReportRequest, type RequestInterceptor, SteambirdClient, SteambirdEndpoint, type SupporterTier, type Token, type UpdateCustomReactionRequest, type UpdateProfileTagsRequest, UserAgentInterceptor };
|
package/dist/index.js
CHANGED
|
@@ -96,8 +96,12 @@ var HttpClient = class {
|
|
|
96
96
|
const headers = new Headers(endpoint.headers);
|
|
97
97
|
let body;
|
|
98
98
|
if (endpoint.body != null) {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
if (endpoint.body instanceof FormData) {
|
|
100
|
+
body = endpoint.body;
|
|
101
|
+
} else {
|
|
102
|
+
body = JSON.stringify(endpoint.body);
|
|
103
|
+
headers.set("Content-Type", "application/json");
|
|
104
|
+
}
|
|
101
105
|
}
|
|
102
106
|
return new Request(url.toString(), {
|
|
103
107
|
method: endpoint.method,
|
|
@@ -213,6 +217,22 @@ var CatalystEndpoint = {
|
|
|
213
217
|
customReactions() {
|
|
214
218
|
return { path: "/catalyst/v1/reactions", method: "GET" };
|
|
215
219
|
},
|
|
220
|
+
customUserReactions() {
|
|
221
|
+
return { path: "/catalyst/v1/custom-reactions", method: "GET" };
|
|
222
|
+
},
|
|
223
|
+
createCustomReaction(data) {
|
|
224
|
+
return { path: "/catalyst/v1/custom-reactions", method: "POST", body: data };
|
|
225
|
+
},
|
|
226
|
+
updateCustomReaction(id, data) {
|
|
227
|
+
return {
|
|
228
|
+
path: `/catalyst/v1/custom-reactions/${id}`,
|
|
229
|
+
method: "PATCH",
|
|
230
|
+
body: data
|
|
231
|
+
};
|
|
232
|
+
},
|
|
233
|
+
deleteCustomReaction(id) {
|
|
234
|
+
return { path: `/catalyst/v1/custom-reactions/${id}`, method: "DELETE" };
|
|
235
|
+
},
|
|
216
236
|
block(data) {
|
|
217
237
|
return {
|
|
218
238
|
path: "/catalyst/v1/blocks",
|
|
@@ -717,6 +737,18 @@ var CatalystClient = class {
|
|
|
717
737
|
customReactions() {
|
|
718
738
|
return this.http.request(CatalystEndpoint.customReactions());
|
|
719
739
|
}
|
|
740
|
+
customUserReactions() {
|
|
741
|
+
return this.http.request(CatalystEndpoint.customUserReactions());
|
|
742
|
+
}
|
|
743
|
+
createCustomReaction(data) {
|
|
744
|
+
return this.http.request(CatalystEndpoint.createCustomReaction(data));
|
|
745
|
+
}
|
|
746
|
+
updateCustomReaction(id, data) {
|
|
747
|
+
return this.http.requestVoid(CatalystEndpoint.updateCustomReaction(id, data));
|
|
748
|
+
}
|
|
749
|
+
deleteCustomReaction(id) {
|
|
750
|
+
return this.http.requestVoid(CatalystEndpoint.deleteCustomReaction(id));
|
|
751
|
+
}
|
|
720
752
|
// Relationships
|
|
721
753
|
block(data) {
|
|
722
754
|
return this.http.requestVoid(CatalystEndpoint.block(data));
|
package/dist/index.mjs
CHANGED
|
@@ -47,8 +47,12 @@ var HttpClient = class {
|
|
|
47
47
|
const headers = new Headers(endpoint.headers);
|
|
48
48
|
let body;
|
|
49
49
|
if (endpoint.body != null) {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
if (endpoint.body instanceof FormData) {
|
|
51
|
+
body = endpoint.body;
|
|
52
|
+
} else {
|
|
53
|
+
body = JSON.stringify(endpoint.body);
|
|
54
|
+
headers.set("Content-Type", "application/json");
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
return new Request(url.toString(), {
|
|
54
58
|
method: endpoint.method,
|
|
@@ -164,6 +168,22 @@ var CatalystEndpoint = {
|
|
|
164
168
|
customReactions() {
|
|
165
169
|
return { path: "/catalyst/v1/reactions", method: "GET" };
|
|
166
170
|
},
|
|
171
|
+
customUserReactions() {
|
|
172
|
+
return { path: "/catalyst/v1/custom-reactions", method: "GET" };
|
|
173
|
+
},
|
|
174
|
+
createCustomReaction(data) {
|
|
175
|
+
return { path: "/catalyst/v1/custom-reactions", method: "POST", body: data };
|
|
176
|
+
},
|
|
177
|
+
updateCustomReaction(id, data) {
|
|
178
|
+
return {
|
|
179
|
+
path: `/catalyst/v1/custom-reactions/${id}`,
|
|
180
|
+
method: "PATCH",
|
|
181
|
+
body: data
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
deleteCustomReaction(id) {
|
|
185
|
+
return { path: `/catalyst/v1/custom-reactions/${id}`, method: "DELETE" };
|
|
186
|
+
},
|
|
167
187
|
block(data) {
|
|
168
188
|
return {
|
|
169
189
|
path: "/catalyst/v1/blocks",
|
|
@@ -668,6 +688,18 @@ var CatalystClient = class {
|
|
|
668
688
|
customReactions() {
|
|
669
689
|
return this.http.request(CatalystEndpoint.customReactions());
|
|
670
690
|
}
|
|
691
|
+
customUserReactions() {
|
|
692
|
+
return this.http.request(CatalystEndpoint.customUserReactions());
|
|
693
|
+
}
|
|
694
|
+
createCustomReaction(data) {
|
|
695
|
+
return this.http.request(CatalystEndpoint.createCustomReaction(data));
|
|
696
|
+
}
|
|
697
|
+
updateCustomReaction(id, data) {
|
|
698
|
+
return this.http.requestVoid(CatalystEndpoint.updateCustomReaction(id, data));
|
|
699
|
+
}
|
|
700
|
+
deleteCustomReaction(id) {
|
|
701
|
+
return this.http.requestVoid(CatalystEndpoint.deleteCustomReaction(id));
|
|
702
|
+
}
|
|
671
703
|
// Relationships
|
|
672
704
|
block(data) {
|
|
673
705
|
return this.http.requestVoid(CatalystEndpoint.block(data));
|