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.
package/dist/cjs/index.js CHANGED
@@ -22167,6 +22167,167 @@ var Campaigns = /** @class */ (function () {
22167
22167
  return Campaigns;
22168
22168
  }());
22169
22169
 
22170
+ var SubscriptionsRoute = /** @class */ (function () {
22171
+ function SubscriptionsRoute() {
22172
+ }
22173
+ SubscriptionsRoute.routes = {
22174
+ createCreatorSubscription: { url: '/subscriptions/creators/subscribe', method: HTTP_METHODS.POST },
22175
+ getCreatorSubscription: { url: '/subscriptions/creators/{stripe_subscription_id}', method: HTTP_METHODS.GET },
22176
+ cancelCreatorSubscription: { url: '/subscriptions/creators/{stripe_subscription_id}', method: HTTP_METHODS.DELETE },
22177
+ listCreatorSubscriptions: { url: '/subscriptions/creators', method: HTTP_METHODS.GET },
22178
+ createCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/subscribe/{community_id}', method: HTTP_METHODS.POST },
22179
+ getCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/{community_id}/{stripe_subscription_id}', method: HTTP_METHODS.GET },
22180
+ cancelCommunityInfluencerSubscription: { url: '/subscriptions/communities/influencers/{community_id}/{stripe_subscription_id}', method: HTTP_METHODS.DELETE },
22181
+ listCommunityInfluencerSubscriptions: { url: '/subscriptions/communities/influencers/{community_id}', method: HTTP_METHODS.GET },
22182
+ };
22183
+ return SubscriptionsRoute;
22184
+ }());
22185
+
22186
+ var Subscriptions = /** @class */ (function () {
22187
+ function Subscriptions() {
22188
+ }
22189
+ /**
22190
+ * Get a creator subscription for the creator program.
22191
+ *
22192
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscription
22193
+ *
22194
+ * @returns promise
22195
+ */
22196
+ Subscriptions.getCreatorSubscription = function (stripe_subscription_id, params) {
22197
+ return Requests.processRoute(SubscriptionsRoute.routes.getCreatorSubscription, undefined, { stripe_subscription_id: stripe_subscription_id }, params);
22198
+ };
22199
+ /**
22200
+ * Get a s subscription plan that a community has to talk with influencers
22201
+ *
22202
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscription
22203
+ *
22204
+ * @returns promise
22205
+ */
22206
+ Subscriptions.getCommunityInfluencerSubscription = function (community_id, stripe_subscription_id, params) {
22207
+ return Requests.processRoute(SubscriptionsRoute.routes.getCommunityInfluencerSubscription, undefined, { community_id: community_id, stripe_subscription_id: stripe_subscription_id }, params);
22208
+ };
22209
+ /**
22210
+ * List all the subscription plans that a creator has.
22211
+ *
22212
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCreatorSubscriptions
22213
+ *
22214
+ * @returns promise
22215
+ */
22216
+ Subscriptions.listCreatorSubscriptions = function (params) {
22217
+ return Requests.processRoute(SubscriptionsRoute.routes.listCreatorSubscriptions, undefined, undefined, params);
22218
+ };
22219
+ /**
22220
+ * List all the subscription plans that a community has.
22221
+ *
22222
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/getCommunityInfluencerSubscriptions
22223
+ *
22224
+ * @returns promise
22225
+ */
22226
+ Subscriptions.listCommunityInfluencerSubscriptions = function (community_id, params) {
22227
+ return Requests.processRoute(SubscriptionsRoute.routes.listCommunityInfluencerSubscriptions, undefined, { community_id: community_id }, params);
22228
+ };
22229
+ /**
22230
+ * Create a new subscription of a content creator
22231
+ *
22232
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCreatorSubscription
22233
+ *
22234
+ * @returns A promise
22235
+ */
22236
+ Subscriptions.createCreatorSubscription = function (data, params) {
22237
+ return Requests.processRoute(SubscriptionsRoute.routes.createCreatorSubscription, data, {}, params);
22238
+ };
22239
+ /**
22240
+ * Create a new subscription of a community engaging in influencer marketing
22241
+ *
22242
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/createCommunityInfluencerSubscription
22243
+ *
22244
+ * @returns A promise
22245
+ */
22246
+ Subscriptions.createCommunityInfluencerSubscription = function (community_id, data, params) {
22247
+ return Requests.processRoute(SubscriptionsRoute.routes.createCommunityInfluencerSubscription, data, { community_id: community_id }, params);
22248
+ };
22249
+ /**
22250
+ * Cancels a creator subscription
22251
+ *
22252
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCreatorSubscription
22253
+ *
22254
+ * @returns A promise
22255
+ */
22256
+ Subscriptions.cancelCreatorSubscription = function (stripe_subscription_id, data, params) {
22257
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelCreatorSubscription, data, { stripe_subscription_id: stripe_subscription_id }, params);
22258
+ };
22259
+ /**
22260
+ * Cancels a community subscription
22261
+ *
22262
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelCommunityInfluencerSubscription
22263
+ *
22264
+ * @returns A promise
22265
+ */
22266
+ Subscriptions.cancelCommunityInfluencerSubscription = function (community_id, stripe_subscription_id, data, params) {
22267
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelCreatorSubscription, data, { community_id: community_id, stripe_subscription_id: stripe_subscription_id }, params);
22268
+ };
22269
+ return Subscriptions;
22270
+ }());
22271
+
22272
+ var MessagesRoute = /** @class */ (function () {
22273
+ function MessagesRoute() {
22274
+ }
22275
+ MessagesRoute.routes = {
22276
+ listMessageThreads: { url: '/messages', method: HTTP_METHODS.GET },
22277
+ sendMessage: { url: '/message', method: HTTP_METHODS.POST },
22278
+ deleteMessage: { url: '/message/{message_id}', method: HTTP_METHODS.DELETE },
22279
+ createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
22280
+ };
22281
+ return MessagesRoute;
22282
+ }());
22283
+
22284
+ var Messages = /** @class */ (function () {
22285
+ function Messages() {
22286
+ }
22287
+ /**
22288
+ * Get all the message threads that a user has particpated in.
22289
+ *
22290
+ * @see https://api.glitch.fun/api/documentation#/Messages/getConversations
22291
+ *
22292
+ * @returns promise
22293
+ */
22294
+ Messages.listMessageThreads = function (params) {
22295
+ return Requests.processRoute(MessagesRoute.routes.listMessageThreads, undefined, undefined, params);
22296
+ };
22297
+ /**
22298
+ * Send a new message that will be added to a thread
22299
+ *
22300
+ * @see https://api.glitch.fun/api/documentation#/Messages/storeMessage
22301
+ *
22302
+ * @returns A promise
22303
+ */
22304
+ Messages.sendMessage = function (data, params) {
22305
+ return Requests.processRoute(MessagesRoute.routes.sendMessage, data, {}, params);
22306
+ };
22307
+ /**
22308
+ * Deletes a message.
22309
+ *
22310
+ * @see https://api.glitch.fun/api/documentation#/Messages/destroyMessage
22311
+ *
22312
+ * @returns A promise
22313
+ */
22314
+ Messages.deleteMessage = function (message_id, data, params) {
22315
+ return Requests.processRoute(MessagesRoute.routes.deleteMessage, data, { message_id: message_id }, params);
22316
+ };
22317
+ /**
22318
+ * A message thread is a thread between multiple users. Pass the user ids in the thread and it will either
22319
+ * get the current thread or create a new thread.
22320
+ *
22321
+ * @see https://api.glitch.fun/api/documentation#/Messages/conversations
22322
+ *
22323
+ * @returns A promise
22324
+ */
22325
+ Messages.createOrGetThread = function (data, params) {
22326
+ return Requests.processRoute(MessagesRoute.routes.createOrGetThread, data, {}, params);
22327
+ };
22328
+ return Messages;
22329
+ }());
22330
+
22170
22331
  var Parser = /** @class */ (function () {
22171
22332
  function Parser() {
22172
22333
  }
@@ -22572,6 +22733,7 @@ var Glitch = /** @class */ (function () {
22572
22733
  Events: Events,
22573
22734
  Teams: Teams,
22574
22735
  Posts: Posts,
22736
+ Messages: Messages,
22575
22737
  Templates: Templates,
22576
22738
  Waitlists: Waitlists,
22577
22739
  Utility: Utility,
@@ -22579,6 +22741,7 @@ var Glitch = /** @class */ (function () {
22579
22741
  Titles: Titles,
22580
22742
  Social: Social,
22581
22743
  SocialPosts: SocialPosts,
22744
+ Subscriptions: Subscriptions,
22582
22745
  TipPackages: TipPackages,
22583
22746
  TipEmojis: TipEmojis,
22584
22747
  TipPackagePurchases: TipPackagePurchases