glitch-javascript-sdk 0.7.6 → 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,38 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Messages {
4
+ /**
5
+ * Get all the message threads that a user has particpated in.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Messages/getConversations
8
+ *
9
+ * @returns promise
10
+ */
11
+ static listMessageThreads<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Send a new message that will be added to a thread
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Messages/storeMessage
16
+ *
17
+ * @returns A promise
18
+ */
19
+ static sendMessage<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
20
+ /**
21
+ * Deletes a message.
22
+ *
23
+ * @see https://api.glitch.fun/api/documentation#/Messages/destroyMessage
24
+ *
25
+ * @returns A promise
26
+ */
27
+ static deleteMessage<T>(message_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
28
+ /**
29
+ * A message thread is a thread between multiple users. Pass the user ids in the thread and it will either
30
+ * get the current thread or create a new thread.
31
+ *
32
+ * @see https://api.glitch.fun/api/documentation#/Messages/conversations
33
+ *
34
+ * @returns A promise
35
+ */
36
+ static createOrGetThread<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
37
+ }
38
+ export default Messages;
@@ -0,0 +1,69 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Subscriptions {
4
+ /**
5
+ * Get a creator subscription for the creator program.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscription
8
+ *
9
+ * @returns promise
10
+ */
11
+ static getCreatorSubscription<T>(stripe_subscription_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Get a s subscription plan that a community has to talk with influencers
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscription
16
+ *
17
+ * @returns promise
18
+ */
19
+ static getCommunityInfluencerSubscription<T>(community_id: string, stripe_subscription_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
20
+ /**
21
+ * List all the subscription plans that a creator has.
22
+ *
23
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscriptions
24
+ *
25
+ * @returns promise
26
+ */
27
+ static listCreatorSubscriptions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
28
+ /**
29
+ * List all the subscription plans that a community has.
30
+ *
31
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscriptions
32
+ *
33
+ * @returns promise
34
+ */
35
+ static listCommunityInfluencerSubscriptions<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
36
+ /**
37
+ * Create a new subscription of a content creator
38
+ *
39
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCreatorSubscription
40
+ *
41
+ * @returns A promise
42
+ */
43
+ static createCreatorSubscription<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
44
+ /**
45
+ * Create a new subscription of a community engaging in influencer marketing
46
+ *
47
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCommunityInfluencerSubscription
48
+ *
49
+ * @returns A promise
50
+ */
51
+ static createCommunityInfluencerSubscription<T>(community_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Cancels a creator subscription
54
+ *
55
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCreatorSubscription
56
+ *
57
+ * @returns A promise
58
+ */
59
+ static cancelCreatorSubscription<T>(stripe_subscription_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
60
+ /**
61
+ * Cancels a community subscription
62
+ *
63
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCommunityInfluencerSubscription
64
+ *
65
+ * @returns A promise
66
+ */
67
+ static cancelCommunityInfluencerSubscription<T>(community_id: string, stripe_subscription_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
68
+ }
69
+ export default Subscriptions;
@@ -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
  export { Auth };
20
22
  export { Competitions };
21
23
  export { Communities };
@@ -34,3 +36,5 @@ export { TipPackagePurchases };
34
36
  export { SocialPosts };
35
37
  export { Titles };
36
38
  export { Campaigns };
39
+ export { Subscriptions };
40
+ export { Messages };
@@ -16,6 +16,8 @@ import { TipPackagePurchases } from "./api";
16
16
  import { SocialPosts } from "./api";
17
17
  import { Titles } from "./api";
18
18
  import { Campaigns } from "./api";
19
+ import { Subscriptions } from "./api";
20
+ import { Messages } from "./api";
19
21
  import Requests from "./util/Requests";
20
22
  import Parser from "./util/Parser";
21
23
  import Session from "./util/Session";
@@ -43,6 +45,7 @@ declare class Glitch {
43
45
  Events: typeof Events;
44
46
  Teams: typeof Teams;
45
47
  Posts: typeof Posts;
48
+ Messages: typeof Messages;
46
49
  Templates: typeof Templates;
47
50
  Waitlists: typeof Waitlists;
48
51
  Utility: typeof Utility;
@@ -50,6 +53,7 @@ declare class Glitch {
50
53
  Titles: typeof Titles;
51
54
  Social: typeof Social;
52
55
  SocialPosts: typeof SocialPosts;
56
+ Subscriptions: typeof Subscriptions;
53
57
  TipPackages: typeof TipPackages;
54
58
  TipEmojis: typeof TipEmojis;
55
59
  TipPackagePurchases: typeof TipPackagePurchases;
package/dist/esm/index.js CHANGED
@@ -8983,6 +8983,167 @@ var Campaigns = /** @class */ (function () {
8983
8983
  return Campaigns;
8984
8984
  }());
8985
8985
 
8986
+ var SubscriptionsRoute = /** @class */ (function () {
8987
+ function SubscriptionsRoute() {
8988
+ }
8989
+ SubscriptionsRoute.routes = {
8990
+ createCreatorSubscription: { url: '/subscriptions/creators/subscribe', method: HTTP_METHODS.POST },
8991
+ getCreatorSubscription: { url: '/subscriptions/creators/{stripe_subscription_id}', method: HTTP_METHODS.GET },
8992
+ cancelCreatorSubscription: { url: '/subscriptions/creators/{stripe_subscription_id}', method: HTTP_METHODS.DELETE },
8993
+ listCreatorSubscriptions: { url: '/subscriptions/creators', method: HTTP_METHODS.GET },
8994
+ createCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/subscribe/{community_id}', method: HTTP_METHODS.POST },
8995
+ getCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/{community_id}/{stripe_subscription_id}', method: HTTP_METHODS.GET },
8996
+ cancelCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/{community_id}/{stripe_subscription_id}', method: HTTP_METHODS.DELETE },
8997
+ listCommunityInfluencerSubscriptions: { url: '/subscriptions/communities/influencers/{community_id}', method: HTTP_METHODS.GET },
8998
+ };
8999
+ return SubscriptionsRoute;
9000
+ }());
9001
+
9002
+ var Subscriptions = /** @class */ (function () {
9003
+ function Subscriptions() {
9004
+ }
9005
+ /**
9006
+ * Get a creator subscription for the creator program.
9007
+ *
9008
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscription
9009
+ *
9010
+ * @returns promise
9011
+ */
9012
+ Subscriptions.getCreatorSubscription = function (stripe_subscription_id, params) {
9013
+ return Requests.processRoute(SubscriptionsRoute.routes.getCreatorSubscription, undefined, { stripe_subscription_id: stripe_subscription_id }, params);
9014
+ };
9015
+ /**
9016
+ * Get a s subscription plan that a community has to talk with influencers
9017
+ *
9018
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscription
9019
+ *
9020
+ * @returns promise
9021
+ */
9022
+ Subscriptions.getCommunityInfluencerSubscription = function (community_id, stripe_subscription_id, params) {
9023
+ return Requests.processRoute(SubscriptionsRoute.routes.getCommunityInfluencerSubscription, undefined, { community_id: community_id, stripe_subscription_id: stripe_subscription_id }, params);
9024
+ };
9025
+ /**
9026
+ * List all the subscription plans that a creator has.
9027
+ *
9028
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscriptions
9029
+ *
9030
+ * @returns promise
9031
+ */
9032
+ Subscriptions.listCreatorSubscriptions = function (params) {
9033
+ return Requests.processRoute(SubscriptionsRoute.routes.listCreatorSubscriptions, undefined, undefined, params);
9034
+ };
9035
+ /**
9036
+ * List all the subscription plans that a community has.
9037
+ *
9038
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscriptions
9039
+ *
9040
+ * @returns promise
9041
+ */
9042
+ Subscriptions.listCommunityInfluencerSubscriptions = function (community_id, params) {
9043
+ return Requests.processRoute(SubscriptionsRoute.routes.listCommunityInfluencerSubscriptions, undefined, { community_id: community_id }, params);
9044
+ };
9045
+ /**
9046
+ * Create a new subscription of a content creator
9047
+ *
9048
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCreatorSubscription
9049
+ *
9050
+ * @returns A promise
9051
+ */
9052
+ Subscriptions.createCreatorSubscription = function (data, params) {
9053
+ return Requests.processRoute(SubscriptionsRoute.routes.createCreatorSubscription, data, {}, params);
9054
+ };
9055
+ /**
9056
+ * Create a new subscription of a community engaging in influencer marketing
9057
+ *
9058
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCommunityInfluencerSubscription
9059
+ *
9060
+ * @returns A promise
9061
+ */
9062
+ Subscriptions.createCommunityInfluencerSubscription = function (community_id, data, params) {
9063
+ return Requests.processRoute(SubscriptionsRoute.routes.createCommunityInfluencerSubscription, data, { community_id: community_id }, params);
9064
+ };
9065
+ /**
9066
+ * Cancels a creator subscription
9067
+ *
9068
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCreatorSubscription
9069
+ *
9070
+ * @returns A promise
9071
+ */
9072
+ Subscriptions.cancelCreatorSubscription = function (stripe_subscription_id, data, params) {
9073
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelCreatorSubscription, data, { stripe_subscription_id: stripe_subscription_id }, params);
9074
+ };
9075
+ /**
9076
+ * Cancels a community subscription
9077
+ *
9078
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCommunityInfluencerSubscription
9079
+ *
9080
+ * @returns A promise
9081
+ */
9082
+ Subscriptions.cancelCommunityInfluencerSubscription = function (community_id, stripe_subscription_id, data, params) {
9083
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelCreatorSubscription, data, { community_id: community_id, stripe_subscription_id: stripe_subscription_id }, params);
9084
+ };
9085
+ return Subscriptions;
9086
+ }());
9087
+
9088
+ var MessagesRoute = /** @class */ (function () {
9089
+ function MessagesRoute() {
9090
+ }
9091
+ MessagesRoute.routes = {
9092
+ listMessageThreads: { url: '/messages', method: HTTP_METHODS.GET },
9093
+ sendMessage: { url: '/message', method: HTTP_METHODS.POST },
9094
+ deleteMessage: { url: '/message/{message_id}', method: HTTP_METHODS.DELETE },
9095
+ createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
9096
+ };
9097
+ return MessagesRoute;
9098
+ }());
9099
+
9100
+ var Messages = /** @class */ (function () {
9101
+ function Messages() {
9102
+ }
9103
+ /**
9104
+ * Get all the message threads that a user has particpated in.
9105
+ *
9106
+ * @see https://api.glitch.fun/api/documentation#/Messages/getConversations
9107
+ *
9108
+ * @returns promise
9109
+ */
9110
+ Messages.listMessageThreads = function (params) {
9111
+ return Requests.processRoute(MessagesRoute.routes.listMessageThreads, undefined, undefined, params);
9112
+ };
9113
+ /**
9114
+ * Send a new message that will be added to a thread
9115
+ *
9116
+ * @see https://api.glitch.fun/api/documentation#/Messages/storeMessage
9117
+ *
9118
+ * @returns A promise
9119
+ */
9120
+ Messages.sendMessage = function (data, params) {
9121
+ return Requests.processRoute(MessagesRoute.routes.sendMessage, data, {}, params);
9122
+ };
9123
+ /**
9124
+ * Deletes a message.
9125
+ *
9126
+ * @see https://api.glitch.fun/api/documentation#/Messages/destroyMessage
9127
+ *
9128
+ * @returns A promise
9129
+ */
9130
+ Messages.deleteMessage = function (message_id, data, params) {
9131
+ return Requests.processRoute(MessagesRoute.routes.deleteMessage, data, { message_id: message_id }, params);
9132
+ };
9133
+ /**
9134
+ * A message thread is a thread between multiple users. Pass the user ids in the thread and it will either
9135
+ * get the current thread or create a new thread.
9136
+ *
9137
+ * @see https://api.glitch.fun/api/documentation#/Messages/conversations
9138
+ *
9139
+ * @returns A promise
9140
+ */
9141
+ Messages.createOrGetThread = function (data, params) {
9142
+ return Requests.processRoute(MessagesRoute.routes.createOrGetThread, data, {}, params);
9143
+ };
9144
+ return Messages;
9145
+ }());
9146
+
8986
9147
  var Parser = /** @class */ (function () {
8987
9148
  function Parser() {
8988
9149
  }
@@ -9388,6 +9549,7 @@ var Glitch = /** @class */ (function () {
9388
9549
  Events: Events,
9389
9550
  Teams: Teams,
9390
9551
  Posts: Posts,
9552
+ Messages: Messages,
9391
9553
  Templates: Templates,
9392
9554
  Waitlists: Waitlists,
9393
9555
  Utility: Utility,
@@ -9395,6 +9557,7 @@ var Glitch = /** @class */ (function () {
9395
9557
  Titles: Titles,
9396
9558
  Social: Social,
9397
9559
  SocialPosts: SocialPosts,
9560
+ Subscriptions: Subscriptions,
9398
9561
  TipPackages: TipPackages,
9399
9562
  TipEmojis: TipEmojis,
9400
9563
  TipPackagePurchases: TipPackagePurchases