glitch-javascript-sdk 0.7.5 → 0.7.7

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.
@@ -0,0 +1,7 @@
1
+ import Route from "./interface";
2
+ declare class MessagesRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default MessagesRoute;
@@ -0,0 +1,7 @@
1
+ import Route from "./interface";
2
+ declare class SubscriptionsRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default SubscriptionsRoute;
package/dist/index.d.ts CHANGED
@@ -1233,15 +1233,15 @@ declare class Events {
1233
1233
  */
1234
1234
  static syncAsLive<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1235
1235
  /**
1236
- * Updates the main image for the event using a File object.
1237
- *
1238
- * @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
1239
- *
1240
- * @param file The file object to upload.
1241
- * @param data Any additional data to pass along to the upload.
1242
- *
1243
- * @returns promise
1244
- */
1236
+ * Updates the main image for the event using a File object.
1237
+ *
1238
+ * @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
1239
+ *
1240
+ * @param file The file object to upload.
1241
+ * @param data Any additional data to pass along to the upload.
1242
+ *
1243
+ * @returns promise
1244
+ */
1245
1245
  static uploadMainImageFile<T>(event_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1246
1246
  /**
1247
1247
  * Updates the main image for the event using a Blob.
@@ -1255,7 +1255,7 @@ declare class Events {
1255
1255
  */
1256
1256
  static uploadMainImageBlob<T>(event_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1257
1257
  /**
1258
- * Updates the banner image for the team using a File object.
1258
+ * Updates the banner image for the event using a File object.
1259
1259
  *
1260
1260
  * @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
1261
1261
  *
@@ -1266,7 +1266,7 @@ declare class Events {
1266
1266
  */
1267
1267
  static uploadBannerImageFile<T>(event_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
1268
1268
  /**
1269
- * Updates the banner image for the team using a Blob.
1269
+ * Updates the banner image for the event using a Blob.
1270
1270
  *
1271
1271
  * @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
1272
1272
  *
@@ -2169,6 +2169,70 @@ declare class Titles {
2169
2169
  * @returns Promise
2170
2170
  */
2171
2171
  static reject<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2172
+ /**
2173
+ * Add a user as an administrator to a title
2174
+ *
2175
+ * @see https://api.glitch.fun/api/documentation#/Titles/addTitleAdministrator
2176
+ *
2177
+ * @param data The data to be passed when creating a title.
2178
+ *
2179
+ * @returns Promise
2180
+ */
2181
+ static addAdministrator<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2182
+ /**
2183
+ * Remove a user as an administrator toa tile
2184
+ *
2185
+ * @see https://api.glitch.fun/api/documentation#/Titles/removeTitleAdministrator
2186
+ *
2187
+ * @param data The data to be passed when creating a title.
2188
+ *
2189
+ * @returns Promise
2190
+ */
2191
+ static removeAdministrator<T>(title_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2192
+ /**
2193
+ * Updates the main image for the title using a File object.
2194
+ *
2195
+ * @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
2196
+ *
2197
+ * @param file The file object to upload.
2198
+ * @param data Any additional data to pass along to the upload.
2199
+ *
2200
+ * @returns promise
2201
+ */
2202
+ static uploadMainImageFile<T>(title_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2203
+ /**
2204
+ * Updates the main image for the title using a Blob.
2205
+ *
2206
+ * @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
2207
+ *
2208
+ * @param blob The blob to upload.
2209
+ * @param data Any additional data to pass along to the upload
2210
+ *
2211
+ * @returns promise
2212
+ */
2213
+ static uploadMainImageBlob<T>(title_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2214
+ /**
2215
+ * Updates the banner image for the title using a File object.
2216
+ *
2217
+ * @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
2218
+ *
2219
+ * @param file The file object to upload.
2220
+ * @param data Any additional data to pass along to the upload.
2221
+ *
2222
+ * @returns promise
2223
+ */
2224
+ static uploadBannerImageFile<T>(title_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2225
+ /**
2226
+ * Updates the banner image for the title using a Blob.
2227
+ *
2228
+ * @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
2229
+ *
2230
+ * @param blob The blob to upload.
2231
+ * @param data Any additional data to pass along to the upload
2232
+ *
2233
+ * @returns promise
2234
+ */
2235
+ static uploadBannerImageBlob<T>(title_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2172
2236
  }
2173
2237
 
2174
2238
  declare class Campaigns {
@@ -2328,6 +2392,109 @@ declare class Campaigns {
2328
2392
  static listInfluencerCampaignLinks<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2329
2393
  }
2330
2394
 
2395
+ declare class Subscriptions {
2396
+ /**
2397
+ * Get a creator subscription for the creator program.
2398
+ *
2399
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscription
2400
+ *
2401
+ * @returns promise
2402
+ */
2403
+ static getCreatorSubscription<T>(stripe_subscription_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2404
+ /**
2405
+ * Get a s subscription plan that a community has to talk with influencers
2406
+ *
2407
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscription
2408
+ *
2409
+ * @returns promise
2410
+ */
2411
+ static getCommunityInfluencerSubscription<T>(community_id: string, stripe_subscription_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2412
+ /**
2413
+ * List all the subscription plans that a creator has.
2414
+ *
2415
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscriptions
2416
+ *
2417
+ * @returns promise
2418
+ */
2419
+ static listCreatorSubscriptions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2420
+ /**
2421
+ * List all the subscription plans that a community has.
2422
+ *
2423
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscriptions
2424
+ *
2425
+ * @returns promise
2426
+ */
2427
+ static listCommunityInfluencerSubscriptions<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2428
+ /**
2429
+ * Create a new subscription of a content creator
2430
+ *
2431
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCreatorSubscription
2432
+ *
2433
+ * @returns A promise
2434
+ */
2435
+ static createCreatorSubscription<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2436
+ /**
2437
+ * Create a new subscription of a community engaging in influencer marketing
2438
+ *
2439
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCommunityInfluencerSubscription
2440
+ *
2441
+ * @returns A promise
2442
+ */
2443
+ static createCommunityInfluencerSubscription<T>(community_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2444
+ /**
2445
+ * Cancels a creator subscription
2446
+ *
2447
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCreatorSubscription
2448
+ *
2449
+ * @returns A promise
2450
+ */
2451
+ static cancelCreatorSubscription<T>(stripe_subscription_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2452
+ /**
2453
+ * Cancels a community subscription
2454
+ *
2455
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCommunityInfluencerSubscription
2456
+ *
2457
+ * @returns A promise
2458
+ */
2459
+ static cancelCommunityInfluencerSubscription<T>(community_id: string, stripe_subscription_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2460
+ }
2461
+
2462
+ declare class Messages {
2463
+ /**
2464
+ * Get all the message threads that a user has particpated in.
2465
+ *
2466
+ * @see https://api.glitch.fun/api/documentation#/Messages/getConversations
2467
+ *
2468
+ * @returns promise
2469
+ */
2470
+ static listMessageThreads<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2471
+ /**
2472
+ * Send a new message that will be added to a thread
2473
+ *
2474
+ * @see https://api.glitch.fun/api/documentation#/Messages/storeMessage
2475
+ *
2476
+ * @returns A promise
2477
+ */
2478
+ static sendMessage<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2479
+ /**
2480
+ * Deletes a message.
2481
+ *
2482
+ * @see https://api.glitch.fun/api/documentation#/Messages/destroyMessage
2483
+ *
2484
+ * @returns A promise
2485
+ */
2486
+ static deleteMessage<T>(message_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2487
+ /**
2488
+ * A message thread is a thread between multiple users. Pass the user ids in the thread and it will either
2489
+ * get the current thread or create a new thread.
2490
+ *
2491
+ * @see https://api.glitch.fun/api/documentation#/Messages/conversations
2492
+ *
2493
+ * @returns A promise
2494
+ */
2495
+ static createOrGetThread<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
2496
+ }
2497
+
2331
2498
  interface Route {
2332
2499
  url: string;
2333
2500
  method: string;
@@ -2634,6 +2801,7 @@ declare class Glitch {
2634
2801
  Events: typeof Events;
2635
2802
  Teams: typeof Teams;
2636
2803
  Posts: typeof Posts;
2804
+ Messages: typeof Messages;
2637
2805
  Templates: typeof Templates;
2638
2806
  Waitlists: typeof Waitlists;
2639
2807
  Utility: typeof Utility;
@@ -2641,6 +2809,7 @@ declare class Glitch {
2641
2809
  Titles: typeof Titles;
2642
2810
  Social: typeof Social;
2643
2811
  SocialPosts: typeof SocialPosts;
2812
+ Subscriptions: typeof Subscriptions;
2644
2813
  TipPackages: typeof TipPackages;
2645
2814
  TipEmojis: typeof TipEmojis;
2646
2815
  TipPackagePurchases: typeof TipPackagePurchases;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Events.ts CHANGED
@@ -193,7 +193,7 @@ class Events {
193
193
  return Requests.processRoute(EventsRoutes.routes.syncAsLive, data, { event_id: event_id }, params);
194
194
  }
195
195
 
196
- /**
196
+ /**
197
197
  * Updates the main image for the event using a File object.
198
198
  *
199
199
  * @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
@@ -228,7 +228,7 @@ class Events {
228
228
  }
229
229
 
230
230
  /**
231
- * Updates the banner image for the team using a File object.
231
+ * Updates the banner image for the event using a File object.
232
232
  *
233
233
  * @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
234
234
  *
@@ -245,7 +245,7 @@ class Events {
245
245
  }
246
246
 
247
247
  /**
248
- * Updates the banner image for the team using a Blob.
248
+ * Updates the banner image for the event using a Blob.
249
249
  *
250
250
  * @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
251
251
  *
@@ -0,0 +1,57 @@
1
+ import MessagesRoute from "../routes/MessagesRoute";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ class Messages {
7
+
8
+ /**
9
+ * Get all the message threads that a user has particpated in.
10
+ *
11
+ * @see https://api.glitch.fun/api/documentation#/Messages/getConversations
12
+ *
13
+ * @returns promise
14
+ */
15
+ public static listMessageThreads<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
16
+ return Requests.processRoute(MessagesRoute.routes.listMessageThreads, undefined, undefined, params);
17
+ }
18
+
19
+ /**
20
+ * Send a new message that will be added to a thread
21
+ *
22
+ * @see https://api.glitch.fun/api/documentation#/Messages/storeMessage
23
+ *
24
+ * @returns A promise
25
+ */
26
+ public static sendMessage<T>(data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
27
+ return Requests.processRoute(MessagesRoute.routes.sendMessage, data, {}, params);
28
+ }
29
+
30
+ /**
31
+ * Deletes a message.
32
+ *
33
+ * @see https://api.glitch.fun/api/documentation#/Messages/destroyMessage
34
+ *
35
+ * @returns A promise
36
+ */
37
+ public static deleteMessage<T>(message_id: string, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
38
+ return Requests.processRoute(MessagesRoute.routes.deleteMessage, data, {message_id : message_id}, params);
39
+ }
40
+
41
+ /**
42
+ * A message thread is a thread between multiple users. Pass the user ids in the thread and it will either
43
+ * get the current thread or create a new thread.
44
+ *
45
+ * @see https://api.glitch.fun/api/documentation#/Messages/conversations
46
+ *
47
+ * @returns A promise
48
+ */
49
+ public static createOrGetThread<T>(data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
50
+ return Requests.processRoute(MessagesRoute.routes.createOrGetThread, data, {}, params);
51
+ }
52
+
53
+
54
+
55
+ }
56
+
57
+ export default Messages;
@@ -0,0 +1,99 @@
1
+ import SubscriptionsRoute from "../routes/SubscriptionsRoute";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ class Subscriptions {
7
+
8
+ /**
9
+ * Get a creator subscription for the creator program.
10
+ *
11
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscription
12
+ *
13
+ * @returns promise
14
+ */
15
+ public static getCreatorSubscription<T>(stripe_subscription_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
16
+ return Requests.processRoute(SubscriptionsRoute.routes.getCreatorSubscription, undefined, {stripe_subscription_id : stripe_subscription_id}, params);
17
+ }
18
+
19
+ /**
20
+ * Get a s subscription plan that a community has to talk with influencers
21
+ *
22
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscription
23
+ *
24
+ * @returns promise
25
+ */
26
+ public static getCommunityInfluencerSubscription<T>(community_id : string, stripe_subscription_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
27
+ return Requests.processRoute(SubscriptionsRoute.routes.getCommunityInfluencerSubscription, undefined, {community_id : community_id, stripe_subscription_id : stripe_subscription_id}, params);
28
+ }
29
+
30
+ /**
31
+ * List all the subscription plans that a creator has.
32
+ *
33
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscriptions
34
+ *
35
+ * @returns promise
36
+ */
37
+ public static listCreatorSubscriptions<T>( params?: Record<string, any>): AxiosPromise<Response<T>> {
38
+ return Requests.processRoute(SubscriptionsRoute.routes.listCreatorSubscriptions, undefined, undefined, params);
39
+ }
40
+
41
+ /**
42
+ * List all the subscription plans that a community has.
43
+ *
44
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscriptions
45
+ *
46
+ * @returns promise
47
+ */
48
+ public static listCommunityInfluencerSubscriptions<T>(community_id : string, params?: Record<string, any>): AxiosPromise<Response<T>> {
49
+ return Requests.processRoute(SubscriptionsRoute.routes.listCommunityInfluencerSubscriptions, undefined, {community_id : community_id}, params);
50
+ }
51
+
52
+ /**
53
+ * Create a new subscription of a content creator
54
+ *
55
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCreatorSubscription
56
+ *
57
+ * @returns A promise
58
+ */
59
+ public static createCreatorSubscription<T>(data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
60
+ return Requests.processRoute(SubscriptionsRoute.routes.createCreatorSubscription, data, {}, params);
61
+ }
62
+
63
+ /**
64
+ * Create a new subscription of a community engaging in influencer marketing
65
+ *
66
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCommunityInfluencerSubscription
67
+ *
68
+ * @returns A promise
69
+ */
70
+ public static createCommunityInfluencerSubscription<T>(community_id : string, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
71
+ return Requests.processRoute(SubscriptionsRoute.routes.createCommunityInfluencerSubscription, data, {community_id: community_id}, params);
72
+ }
73
+
74
+ /**
75
+ * Cancels a creator subscription
76
+ *
77
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCreatorSubscription
78
+ *
79
+ * @returns A promise
80
+ */
81
+ public static cancelCreatorSubscription<T>(stripe_subscription_id: string, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
82
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelCreatorSubscription, data, {stripe_subscription_id : stripe_subscription_id}, params);
83
+ }
84
+
85
+ /**
86
+ * Cancels a community subscription
87
+ *
88
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCommunityInfluencerSubscription
89
+ *
90
+ * @returns A promise
91
+ */
92
+ public static cancelCommunityInfluencerSubscription<T>(community_id : string, stripe_subscription_id: string, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
93
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelCreatorSubscription, data, {community_id: community_id, stripe_subscription_id : stripe_subscription_id}, params);
94
+ }
95
+
96
+
97
+ }
98
+
99
+ export default Subscriptions;
package/src/api/Titles.ts CHANGED
@@ -100,6 +100,102 @@ class Titles {
100
100
  return Requests.processRoute(TitlesRoute.routes.reject, data, { title_id: title_id }, params);
101
101
  }
102
102
 
103
+ /**
104
+ * Add a user as an administrator to a title
105
+ *
106
+ * @see https://api.glitch.fun/api/documentation#/Titles/addTitleAdministrator
107
+ *
108
+ * @param data The data to be passed when creating a title.
109
+ *
110
+ * @returns Promise
111
+ */
112
+ public static addAdministrator<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
113
+
114
+ return Requests.processRoute(TitlesRoute.routes.addAdministrator, data, { title_id: title_id }, params);
115
+ }
116
+
117
+ /**
118
+ * Remove a user as an administrator toa tile
119
+ *
120
+ * @see https://api.glitch.fun/api/documentation#/Titles/removeTitleAdministrator
121
+ *
122
+ * @param data The data to be passed when creating a title.
123
+ *
124
+ * @returns Promise
125
+ */
126
+ public static removeAdministrator<T>(title_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
127
+
128
+ return Requests.processRoute(TitlesRoute.routes.removeAdministrator, data, { title_id: title_id, user_id: user_id }, params);
129
+ }
130
+
131
+ /**
132
+ * Updates the main image for the title using a File object.
133
+ *
134
+ * @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
135
+ *
136
+ * @param file The file object to upload.
137
+ * @param data Any additional data to pass along to the upload.
138
+ *
139
+ * @returns promise
140
+ */
141
+ public static uploadMainImageFile<T>(title_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
142
+
143
+ let url = TitlesRoute.routes.uploadMainImage.url.replace('{title_id}', title_id);
144
+
145
+ return Requests.uploadFile(url, 'image', file, data);
146
+ }
147
+
148
+ /**
149
+ * Updates the main image for the title using a Blob.
150
+ *
151
+ * @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
152
+ *
153
+ * @param blob The blob to upload.
154
+ * @param data Any additional data to pass along to the upload
155
+ *
156
+ * @returns promise
157
+ */
158
+ public static uploadMainImageBlob<T>(title_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
159
+
160
+ let url = TitlesRoute.routes.uploadMainImage.url.replace('{title_id}', title_id);
161
+
162
+ return Requests.uploadBlob(url, 'image', blob, data);
163
+ }
164
+
165
+ /**
166
+ * Updates the banner image for the title using a File object.
167
+ *
168
+ * @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
169
+ *
170
+ * @param file The file object to upload.
171
+ * @param data Any additional data to pass along to the upload.
172
+ *
173
+ * @returns promise
174
+ */
175
+ public static uploadBannerImageFile<T>(title_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
176
+
177
+ let url = TitlesRoute.routes.uploadBannerImage.url.replace('{title_id}', title_id);
178
+
179
+ return Requests.uploadFile(url, 'image', file, data);
180
+ }
181
+
182
+ /**
183
+ * Updates the banner image for the title using a Blob.
184
+ *
185
+ * @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
186
+ *
187
+ * @param blob The blob to upload.
188
+ * @param data Any additional data to pass along to the upload
189
+ *
190
+ * @returns promise
191
+ */
192
+ public static uploadBannerImageBlob<T>(title_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
193
+
194
+ let url = TitlesRoute.routes.uploadBannerImage.url.replace('{title_id}', title_id);
195
+
196
+ return Requests.uploadBlob(url, 'image', blob, data);
197
+ }
198
+
103
199
  }
104
200
 
105
201
  export default Titles;
package/src/api/index.ts CHANGED
@@ -16,6 +16,8 @@ import TipPackagePurchases from "./TipPackagePurchases";
16
16
  import SocialPosts from "./SocialPosts";
17
17
  import Titles from "./Titles";
18
18
  import Campaigns from "./Campaigns";
19
+ import Subscriptions from "./Subscriptions";
20
+ import Messages from "./Messages";
19
21
 
20
22
  export {Auth};
21
23
  export {Competitions};
@@ -34,4 +36,6 @@ export {TipPackages};
34
36
  export {TipPackagePurchases};
35
37
  export {SocialPosts};
36
38
  export {Titles};
37
- export {Campaigns};
39
+ export {Campaigns};
40
+ export {Subscriptions};
41
+ export {Messages};
package/src/index.ts CHANGED
@@ -20,6 +20,8 @@ import { TipPackagePurchases } from "./api";
20
20
  import { SocialPosts } from "./api";
21
21
  import {Titles} from "./api";
22
22
  import {Campaigns} from "./api";
23
+ import {Subscriptions} from "./api";
24
+ import {Messages} from "./api";
23
25
 
24
26
 
25
27
 
@@ -61,6 +63,7 @@ class Glitch {
61
63
  Events: Events,
62
64
  Teams: Teams,
63
65
  Posts: Posts,
66
+ Messages : Messages,
64
67
  Templates : Templates,
65
68
  Waitlists: Waitlists,
66
69
  Utility : Utility,
@@ -68,6 +71,7 @@ class Glitch {
68
71
  Titles : Titles,
69
72
  Social : Social,
70
73
  SocialPosts : SocialPosts,
74
+ Subscriptions : Subscriptions,
71
75
  TipPackages : TipPackages,
72
76
  TipEmojis : TipEmojis ,
73
77
  TipPackagePurchases: TipPackagePurchases
@@ -0,0 +1,15 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class MessagesRoute {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ listMessageThreads: { url: '/messages', method: HTTP_METHODS.GET },
8
+ sendMessage: { url: '/message', method: HTTP_METHODS.POST },
9
+ deleteMessage: { url: '/message/{message_id}', method: HTTP_METHODS.DELETE },
10
+ createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
11
+ };
12
+
13
+ }
14
+
15
+ export default MessagesRoute;
@@ -0,0 +1,20 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class SubscriptionsRoute {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ createCreatorSubscription: { url: '/subscriptions/creators/subscribe', method: HTTP_METHODS.POST },
8
+ getCreatorSubscription: { url: '/subscriptions/creators/{stripe_subscription_id}', method: HTTP_METHODS.GET },
9
+ cancelCreatorSubscription: { url: '/subscriptions/creators/{stripe_subscription_id}', method: HTTP_METHODS.DELETE },
10
+ listCreatorSubscriptions: { url: '/subscriptions/creators', method: HTTP_METHODS.GET },
11
+
12
+ createCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/subscribe/{community_id}', method: HTTP_METHODS.POST },
13
+ getCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/{community_id}/{stripe_subscription_id}', method: HTTP_METHODS.GET },
14
+ cancelCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/{community_id}/{stripe_subscription_id}', method: HTTP_METHODS.DELETE },
15
+ listCommunityInfluencerSubscriptions: { url: '/subscriptions/communities/influencers/{community_id}', method: HTTP_METHODS.GET },
16
+ };
17
+
18
+ }
19
+
20
+ export default SubscriptionsRoute;
@@ -10,7 +10,11 @@ class TitlesRoute {
10
10
  update :{ url: '/titles/{title_id}', method: HTTP_METHODS.PUT },
11
11
  delete : { url: '/titles/{title_id}', method: HTTP_METHODS.DELETE },
12
12
  approve : { url: '/titles/{title_id}/approve', method: HTTP_METHODS.POST },
13
- reject : { url: '//titles/{title_id}/reject', method: HTTP_METHODS.POST },
13
+ reject : { url: '/titles/{title_id}/reject', method: HTTP_METHODS.POST },
14
+ uploadMainImage : {url : '/titles/{title_id}/uploadMainImage', method: HTTP_METHODS.POST},
15
+ uploadBannerImage : {url : '/titles/{title_id}/uploadBannerImage', method: HTTP_METHODS.POST},
16
+ addAdministrator : { url: '/titles/{title_id}/addAdministrator', method: HTTP_METHODS.POST },
17
+ removeAdministrator : { url: '/titles/{title_id}/removeAdministrator/{user_id}', method: HTTP_METHODS.DELETE },
14
18
  };
15
19
 
16
20
  }