glitch-javascript-sdk 0.7.6 → 0.7.8
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/cjs/index.js +239 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Feedback.d.ts +51 -0
- package/dist/esm/api/Messages.d.ts +38 -0
- package/dist/esm/api/Subscriptions.d.ts +69 -0
- package/dist/esm/api/index.d.ts +6 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +239 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/FeedbackRoute.d.ts +7 -0
- package/dist/esm/routes/MessagesRoute.d.ts +7 -0
- package/dist/esm/routes/SubscriptionsRoute.d.ts +7 -0
- package/dist/index.d.ts +155 -0
- package/package.json +1 -1
- package/src/api/Feedback.ts +80 -0
- package/src/api/Messages.ts +57 -0
- package/src/api/Subscriptions.ts +99 -0
- package/src/api/index.ts +7 -1
- package/src/index.ts +6 -0
- package/src/routes/FeedbackRoute.ts +14 -0
- package/src/routes/MessagesRoute.ts +15 -0
- package/src/routes/SubscriptionsRoute.ts +20 -0
package/dist/index.d.ts
CHANGED
|
@@ -2392,6 +2392,158 @@ declare class Campaigns {
|
|
|
2392
2392
|
static listInfluencerCampaignLinks<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2393
2393
|
}
|
|
2394
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
|
+
|
|
2498
|
+
declare class Feedback {
|
|
2499
|
+
/**
|
|
2500
|
+
* List all the feedback that been left by users.
|
|
2501
|
+
*
|
|
2502
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/listFeedback
|
|
2503
|
+
*
|
|
2504
|
+
* @returns promise
|
|
2505
|
+
*/
|
|
2506
|
+
static listFeedback<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2507
|
+
/**
|
|
2508
|
+
* View a particular item of feedback.
|
|
2509
|
+
*
|
|
2510
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/getFeedbackById
|
|
2511
|
+
*
|
|
2512
|
+
* @returns promise
|
|
2513
|
+
*/
|
|
2514
|
+
static viewFeedback<T>(feedback_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2515
|
+
/**
|
|
2516
|
+
* Submit feedback.
|
|
2517
|
+
*
|
|
2518
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
2519
|
+
*
|
|
2520
|
+
* @returns A promise
|
|
2521
|
+
*/
|
|
2522
|
+
static sendFeedback<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2523
|
+
/**
|
|
2524
|
+
* Submit feedback with the log file as a file.
|
|
2525
|
+
*
|
|
2526
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
2527
|
+
*
|
|
2528
|
+
* @param file The file object to upload.
|
|
2529
|
+
* @param data Any additional data to pass along to the upload.
|
|
2530
|
+
*
|
|
2531
|
+
* @returns promise
|
|
2532
|
+
*/
|
|
2533
|
+
static sendFeedbackWithFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2534
|
+
/**
|
|
2535
|
+
* Submit feedback with the log file as a blob.
|
|
2536
|
+
*
|
|
2537
|
+
* @see hhttps://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
2538
|
+
*
|
|
2539
|
+
* @param blob The blob to upload.
|
|
2540
|
+
* @param data Any additional data to pass along to the upload
|
|
2541
|
+
*
|
|
2542
|
+
* @returns promise
|
|
2543
|
+
*/
|
|
2544
|
+
static sendFeedbackWithBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2395
2547
|
interface Route {
|
|
2396
2548
|
url: string;
|
|
2397
2549
|
method: string;
|
|
@@ -2696,8 +2848,10 @@ declare class Glitch {
|
|
|
2696
2848
|
Communities: typeof Communities;
|
|
2697
2849
|
Users: typeof Users;
|
|
2698
2850
|
Events: typeof Events;
|
|
2851
|
+
Feedback: typeof Feedback;
|
|
2699
2852
|
Teams: typeof Teams;
|
|
2700
2853
|
Posts: typeof Posts;
|
|
2854
|
+
Messages: typeof Messages;
|
|
2701
2855
|
Templates: typeof Templates;
|
|
2702
2856
|
Waitlists: typeof Waitlists;
|
|
2703
2857
|
Utility: typeof Utility;
|
|
@@ -2705,6 +2859,7 @@ declare class Glitch {
|
|
|
2705
2859
|
Titles: typeof Titles;
|
|
2706
2860
|
Social: typeof Social;
|
|
2707
2861
|
SocialPosts: typeof SocialPosts;
|
|
2862
|
+
Subscriptions: typeof Subscriptions;
|
|
2708
2863
|
TipPackages: typeof TipPackages;
|
|
2709
2864
|
TipEmojis: typeof TipEmojis;
|
|
2710
2865
|
TipPackagePurchases: typeof TipPackagePurchases;
|
package/package.json
CHANGED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import FeedbackRoute from "../routes/FeedbackRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class Feedback {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* List all the feedback that been left by users.
|
|
10
|
+
*
|
|
11
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/listFeedback
|
|
12
|
+
*
|
|
13
|
+
* @returns promise
|
|
14
|
+
*/
|
|
15
|
+
public static listFeedback<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(FeedbackRoute.routes.listFeedback, undefined, undefined, params);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* View a particular item of feedback.
|
|
21
|
+
*
|
|
22
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/getFeedbackById
|
|
23
|
+
*
|
|
24
|
+
* @returns promise
|
|
25
|
+
*/
|
|
26
|
+
public static viewFeedback<T>(feedback_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
27
|
+
return Requests.processRoute(FeedbackRoute.routes.viewFeedback, undefined, { feedback_id: feedback_id }, params);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Submit feedback.
|
|
32
|
+
*
|
|
33
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
34
|
+
*
|
|
35
|
+
* @returns A promise
|
|
36
|
+
*/
|
|
37
|
+
public static sendFeedback<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
38
|
+
return Requests.processRoute(FeedbackRoute.routes.sendFeedback, data, {}, params);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Submit feedback with the log file as a file.
|
|
45
|
+
*
|
|
46
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
47
|
+
*
|
|
48
|
+
* @param file The file object to upload.
|
|
49
|
+
* @param data Any additional data to pass along to the upload.
|
|
50
|
+
*
|
|
51
|
+
* @returns promise
|
|
52
|
+
*/
|
|
53
|
+
public static sendFeedbackWithFile<T>(file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
54
|
+
|
|
55
|
+
let url = FeedbackRoute.routes.sendFeedback.url;
|
|
56
|
+
|
|
57
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Submit feedback with the log file as a blob.
|
|
62
|
+
*
|
|
63
|
+
* @see hhttps://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
64
|
+
*
|
|
65
|
+
* @param blob The blob to upload.
|
|
66
|
+
* @param data Any additional data to pass along to the upload
|
|
67
|
+
*
|
|
68
|
+
* @returns promise
|
|
69
|
+
*/
|
|
70
|
+
public static sendFeedbackWithBlob<T>(blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
71
|
+
|
|
72
|
+
let url = FeedbackRoute.routes.sendFeedback.url;
|
|
73
|
+
|
|
74
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export default Feedback;
|
|
@@ -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/index.ts
CHANGED
|
@@ -16,6 +16,9 @@ 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";
|
|
21
|
+
import Feedback from "./Feedback";
|
|
19
22
|
|
|
20
23
|
export {Auth};
|
|
21
24
|
export {Competitions};
|
|
@@ -34,4 +37,7 @@ export {TipPackages};
|
|
|
34
37
|
export {TipPackagePurchases};
|
|
35
38
|
export {SocialPosts};
|
|
36
39
|
export {Titles};
|
|
37
|
-
export {Campaigns};
|
|
40
|
+
export {Campaigns};
|
|
41
|
+
export {Subscriptions};
|
|
42
|
+
export {Messages};
|
|
43
|
+
export {Feedback};
|
package/src/index.ts
CHANGED
|
@@ -20,6 +20,9 @@ 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";
|
|
25
|
+
import {Feedback} from "./api";
|
|
23
26
|
|
|
24
27
|
|
|
25
28
|
|
|
@@ -59,8 +62,10 @@ class Glitch {
|
|
|
59
62
|
Communities : Communities,
|
|
60
63
|
Users: Users,
|
|
61
64
|
Events: Events,
|
|
65
|
+
Feedback : Feedback,
|
|
62
66
|
Teams: Teams,
|
|
63
67
|
Posts: Posts,
|
|
68
|
+
Messages : Messages,
|
|
64
69
|
Templates : Templates,
|
|
65
70
|
Waitlists: Waitlists,
|
|
66
71
|
Utility : Utility,
|
|
@@ -68,6 +73,7 @@ class Glitch {
|
|
|
68
73
|
Titles : Titles,
|
|
69
74
|
Social : Social,
|
|
70
75
|
SocialPosts : SocialPosts,
|
|
76
|
+
Subscriptions : Subscriptions,
|
|
71
77
|
TipPackages : TipPackages,
|
|
72
78
|
TipEmojis : TipEmojis ,
|
|
73
79
|
TipPackagePurchases: TipPackagePurchases
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class FeedbackRoute {
|
|
5
|
+
|
|
6
|
+
public static routes: { [key: string]: Route } = {
|
|
7
|
+
listFeedback: { url: '/feedback', method: HTTP_METHODS.GET },
|
|
8
|
+
sendFeedback: { url: '/feedback', method: HTTP_METHODS.POST },
|
|
9
|
+
viewFeedback: { url: '/feedback/{feedback_id}', method: HTTP_METHODS.GET },
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default FeedbackRoute;
|
|
@@ -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: '/messages', method: HTTP_METHODS.POST },
|
|
9
|
+
deleteMessage: { url: '/messages/{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;
|