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/cjs/index.js
CHANGED
|
@@ -22167,6 +22167,242 @@ 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: '/messages', method: HTTP_METHODS.POST },
|
|
22278
|
+
deleteMessage: { url: '/messages/{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
|
+
|
|
22331
|
+
var FeedbackRoute = /** @class */ (function () {
|
|
22332
|
+
function FeedbackRoute() {
|
|
22333
|
+
}
|
|
22334
|
+
FeedbackRoute.routes = {
|
|
22335
|
+
listFeedback: { url: '/feedback', method: HTTP_METHODS.GET },
|
|
22336
|
+
sendFeedback: { url: '/feedback', method: HTTP_METHODS.POST },
|
|
22337
|
+
viewFeedback: { url: '/feedback/{feedback_id}', method: HTTP_METHODS.GET },
|
|
22338
|
+
};
|
|
22339
|
+
return FeedbackRoute;
|
|
22340
|
+
}());
|
|
22341
|
+
|
|
22342
|
+
var Feedback = /** @class */ (function () {
|
|
22343
|
+
function Feedback() {
|
|
22344
|
+
}
|
|
22345
|
+
/**
|
|
22346
|
+
* List all the feedback that been left by users.
|
|
22347
|
+
*
|
|
22348
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/listFeedback
|
|
22349
|
+
*
|
|
22350
|
+
* @returns promise
|
|
22351
|
+
*/
|
|
22352
|
+
Feedback.listFeedback = function (params) {
|
|
22353
|
+
return Requests.processRoute(FeedbackRoute.routes.listFeedback, undefined, undefined, params);
|
|
22354
|
+
};
|
|
22355
|
+
/**
|
|
22356
|
+
* View a particular item of feedback.
|
|
22357
|
+
*
|
|
22358
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/getFeedbackById
|
|
22359
|
+
*
|
|
22360
|
+
* @returns promise
|
|
22361
|
+
*/
|
|
22362
|
+
Feedback.viewFeedback = function (feedback_id, params) {
|
|
22363
|
+
return Requests.processRoute(FeedbackRoute.routes.viewFeedback, undefined, { feedback_id: feedback_id }, params);
|
|
22364
|
+
};
|
|
22365
|
+
/**
|
|
22366
|
+
* Submit feedback.
|
|
22367
|
+
*
|
|
22368
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
22369
|
+
*
|
|
22370
|
+
* @returns A promise
|
|
22371
|
+
*/
|
|
22372
|
+
Feedback.sendFeedback = function (data, params) {
|
|
22373
|
+
return Requests.processRoute(FeedbackRoute.routes.sendFeedback, data, {}, params);
|
|
22374
|
+
};
|
|
22375
|
+
/**
|
|
22376
|
+
* Submit feedback with the log file as a file.
|
|
22377
|
+
*
|
|
22378
|
+
* @see https://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
22379
|
+
*
|
|
22380
|
+
* @param file The file object to upload.
|
|
22381
|
+
* @param data Any additional data to pass along to the upload.
|
|
22382
|
+
*
|
|
22383
|
+
* @returns promise
|
|
22384
|
+
*/
|
|
22385
|
+
Feedback.sendFeedbackWithFile = function (file, data, params) {
|
|
22386
|
+
var url = FeedbackRoute.routes.sendFeedback.url;
|
|
22387
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
22388
|
+
};
|
|
22389
|
+
/**
|
|
22390
|
+
* Submit feedback with the log file as a blob.
|
|
22391
|
+
*
|
|
22392
|
+
* @see hhttps://api.glitch.fun/api/documentation#/Feedback/a64fe3d6f90ed1af5bbd5311a795c134
|
|
22393
|
+
*
|
|
22394
|
+
* @param blob The blob to upload.
|
|
22395
|
+
* @param data Any additional data to pass along to the upload
|
|
22396
|
+
*
|
|
22397
|
+
* @returns promise
|
|
22398
|
+
*/
|
|
22399
|
+
Feedback.sendFeedbackWithBlob = function (blob, data, params) {
|
|
22400
|
+
var url = FeedbackRoute.routes.sendFeedback.url;
|
|
22401
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
22402
|
+
};
|
|
22403
|
+
return Feedback;
|
|
22404
|
+
}());
|
|
22405
|
+
|
|
22170
22406
|
var Parser = /** @class */ (function () {
|
|
22171
22407
|
function Parser() {
|
|
22172
22408
|
}
|
|
@@ -22570,8 +22806,10 @@ var Glitch = /** @class */ (function () {
|
|
|
22570
22806
|
Communities: Communities,
|
|
22571
22807
|
Users: Users,
|
|
22572
22808
|
Events: Events,
|
|
22809
|
+
Feedback: Feedback,
|
|
22573
22810
|
Teams: Teams,
|
|
22574
22811
|
Posts: Posts,
|
|
22812
|
+
Messages: Messages,
|
|
22575
22813
|
Templates: Templates,
|
|
22576
22814
|
Waitlists: Waitlists,
|
|
22577
22815
|
Utility: Utility,
|
|
@@ -22579,6 +22817,7 @@ var Glitch = /** @class */ (function () {
|
|
|
22579
22817
|
Titles: Titles,
|
|
22580
22818
|
Social: Social,
|
|
22581
22819
|
SocialPosts: SocialPosts,
|
|
22820
|
+
Subscriptions: Subscriptions,
|
|
22582
22821
|
TipPackages: TipPackages,
|
|
22583
22822
|
TipEmojis: TipEmojis,
|
|
22584
22823
|
TipPackagePurchases: TipPackagePurchases
|