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.
- package/dist/cjs/index.js +259 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +11 -11
- package/dist/esm/api/Messages.d.ts +38 -0
- package/dist/esm/api/Subscriptions.d.ts +69 -0
- package/dist/esm/api/Titles.d.ts +64 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +259 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/MessagesRoute.d.ts +7 -0
- package/dist/esm/routes/SubscriptionsRoute.d.ts +7 -0
- package/dist/index.d.ts +180 -11
- package/package.json +1 -1
- package/src/api/Events.ts +3 -3
- package/src/api/Messages.ts +57 -0
- package/src/api/Subscriptions.ts +99 -0
- package/src/api/Titles.ts +96 -0
- package/src/api/index.ts +5 -1
- package/src/index.ts +4 -0
- package/src/routes/MessagesRoute.ts +15 -0
- package/src/routes/SubscriptionsRoute.ts +20 -0
- package/src/routes/TitlesRoute.ts +5 -1
package/dist/cjs/index.js
CHANGED
|
@@ -20491,15 +20491,15 @@ var Events = /** @class */ (function () {
|
|
|
20491
20491
|
return Requests.processRoute(EventsRoutes.routes.syncAsLive, data, { event_id: event_id }, params);
|
|
20492
20492
|
};
|
|
20493
20493
|
/**
|
|
20494
|
-
|
|
20495
|
-
|
|
20496
|
-
|
|
20497
|
-
|
|
20498
|
-
|
|
20499
|
-
|
|
20500
|
-
|
|
20501
|
-
|
|
20502
|
-
|
|
20494
|
+
* Updates the main image for the event using a File object.
|
|
20495
|
+
*
|
|
20496
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
|
|
20497
|
+
*
|
|
20498
|
+
* @param file The file object to upload.
|
|
20499
|
+
* @param data Any additional data to pass along to the upload.
|
|
20500
|
+
*
|
|
20501
|
+
* @returns promise
|
|
20502
|
+
*/
|
|
20503
20503
|
Events.uploadMainImageFile = function (event_id, file, data, params) {
|
|
20504
20504
|
var url = EventsRoutes.routes.uploadMainImage.url.replace('{event_id}', event_id);
|
|
20505
20505
|
return Requests.uploadFile(url, 'image', file, data);
|
|
@@ -20519,7 +20519,7 @@ var Events = /** @class */ (function () {
|
|
|
20519
20519
|
return Requests.uploadBlob(url, 'image', blob, data);
|
|
20520
20520
|
};
|
|
20521
20521
|
/**
|
|
20522
|
-
* Updates the banner image for the
|
|
20522
|
+
* Updates the banner image for the event using a File object.
|
|
20523
20523
|
*
|
|
20524
20524
|
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
20525
20525
|
*
|
|
@@ -20533,7 +20533,7 @@ var Events = /** @class */ (function () {
|
|
|
20533
20533
|
return Requests.uploadFile(url, 'image', file, data);
|
|
20534
20534
|
};
|
|
20535
20535
|
/**
|
|
20536
|
-
* Updates the banner image for the
|
|
20536
|
+
* Updates the banner image for the event using a Blob.
|
|
20537
20537
|
*
|
|
20538
20538
|
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
20539
20539
|
*
|
|
@@ -21774,7 +21774,11 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
21774
21774
|
update: { url: '/titles/{title_id}', method: HTTP_METHODS.PUT },
|
|
21775
21775
|
delete: { url: '/titles/{title_id}', method: HTTP_METHODS.DELETE },
|
|
21776
21776
|
approve: { url: '/titles/{title_id}/approve', method: HTTP_METHODS.POST },
|
|
21777
|
-
reject: { url: '
|
|
21777
|
+
reject: { url: '/titles/{title_id}/reject', method: HTTP_METHODS.POST },
|
|
21778
|
+
uploadMainImage: { url: '/titles/{title_id}/uploadMainImage', method: HTTP_METHODS.POST },
|
|
21779
|
+
uploadBannerImage: { url: '/titles/{title_id}/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
21780
|
+
addAdministrator: { url: '/titles/{title_id}/addAdministrator', method: HTTP_METHODS.POST },
|
|
21781
|
+
removeAdministrator: { url: '/titles/{title_id}/removeAdministrator/{user_id}', method: HTTP_METHODS.DELETE },
|
|
21778
21782
|
};
|
|
21779
21783
|
return TitlesRoute;
|
|
21780
21784
|
}());
|
|
@@ -21864,6 +21868,86 @@ var Titles = /** @class */ (function () {
|
|
|
21864
21868
|
Titles.reject = function (title_id, data, params) {
|
|
21865
21869
|
return Requests.processRoute(TitlesRoute.routes.reject, data, { title_id: title_id }, params);
|
|
21866
21870
|
};
|
|
21871
|
+
/**
|
|
21872
|
+
* Add a user as an administrator to a title
|
|
21873
|
+
*
|
|
21874
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/addTitleAdministrator
|
|
21875
|
+
*
|
|
21876
|
+
* @param data The data to be passed when creating a title.
|
|
21877
|
+
*
|
|
21878
|
+
* @returns Promise
|
|
21879
|
+
*/
|
|
21880
|
+
Titles.addAdministrator = function (title_id, data, params) {
|
|
21881
|
+
return Requests.processRoute(TitlesRoute.routes.addAdministrator, data, { title_id: title_id }, params);
|
|
21882
|
+
};
|
|
21883
|
+
/**
|
|
21884
|
+
* Remove a user as an administrator toa tile
|
|
21885
|
+
*
|
|
21886
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/removeTitleAdministrator
|
|
21887
|
+
*
|
|
21888
|
+
* @param data The data to be passed when creating a title.
|
|
21889
|
+
*
|
|
21890
|
+
* @returns Promise
|
|
21891
|
+
*/
|
|
21892
|
+
Titles.removeAdministrator = function (title_id, user_id, data, params) {
|
|
21893
|
+
return Requests.processRoute(TitlesRoute.routes.removeAdministrator, data, { title_id: title_id, user_id: user_id }, params);
|
|
21894
|
+
};
|
|
21895
|
+
/**
|
|
21896
|
+
* Updates the main image for the title using a File object.
|
|
21897
|
+
*
|
|
21898
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
|
|
21899
|
+
*
|
|
21900
|
+
* @param file The file object to upload.
|
|
21901
|
+
* @param data Any additional data to pass along to the upload.
|
|
21902
|
+
*
|
|
21903
|
+
* @returns promise
|
|
21904
|
+
*/
|
|
21905
|
+
Titles.uploadMainImageFile = function (title_id, file, data, params) {
|
|
21906
|
+
var url = TitlesRoute.routes.uploadMainImage.url.replace('{title_id}', title_id);
|
|
21907
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
21908
|
+
};
|
|
21909
|
+
/**
|
|
21910
|
+
* Updates the main image for the title using a Blob.
|
|
21911
|
+
*
|
|
21912
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
|
|
21913
|
+
*
|
|
21914
|
+
* @param blob The blob to upload.
|
|
21915
|
+
* @param data Any additional data to pass along to the upload
|
|
21916
|
+
*
|
|
21917
|
+
* @returns promise
|
|
21918
|
+
*/
|
|
21919
|
+
Titles.uploadMainImageBlob = function (title_id, blob, data, params) {
|
|
21920
|
+
var url = TitlesRoute.routes.uploadMainImage.url.replace('{title_id}', title_id);
|
|
21921
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
21922
|
+
};
|
|
21923
|
+
/**
|
|
21924
|
+
* Updates the banner image for the title using a File object.
|
|
21925
|
+
*
|
|
21926
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
|
|
21927
|
+
*
|
|
21928
|
+
* @param file The file object to upload.
|
|
21929
|
+
* @param data Any additional data to pass along to the upload.
|
|
21930
|
+
*
|
|
21931
|
+
* @returns promise
|
|
21932
|
+
*/
|
|
21933
|
+
Titles.uploadBannerImageFile = function (title_id, file, data, params) {
|
|
21934
|
+
var url = TitlesRoute.routes.uploadBannerImage.url.replace('{title_id}', title_id);
|
|
21935
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
21936
|
+
};
|
|
21937
|
+
/**
|
|
21938
|
+
* Updates the banner image for the title using a Blob.
|
|
21939
|
+
*
|
|
21940
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
|
|
21941
|
+
*
|
|
21942
|
+
* @param blob The blob to upload.
|
|
21943
|
+
* @param data Any additional data to pass along to the upload
|
|
21944
|
+
*
|
|
21945
|
+
* @returns promise
|
|
21946
|
+
*/
|
|
21947
|
+
Titles.uploadBannerImageBlob = function (title_id, blob, data, params) {
|
|
21948
|
+
var url = TitlesRoute.routes.uploadBannerImage.url.replace('{title_id}', title_id);
|
|
21949
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
21950
|
+
};
|
|
21867
21951
|
return Titles;
|
|
21868
21952
|
}());
|
|
21869
21953
|
|
|
@@ -22083,6 +22167,167 @@ var Campaigns = /** @class */ (function () {
|
|
|
22083
22167
|
return Campaigns;
|
|
22084
22168
|
}());
|
|
22085
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
|
+
|
|
22086
22331
|
var Parser = /** @class */ (function () {
|
|
22087
22332
|
function Parser() {
|
|
22088
22333
|
}
|
|
@@ -22488,6 +22733,7 @@ var Glitch = /** @class */ (function () {
|
|
|
22488
22733
|
Events: Events,
|
|
22489
22734
|
Teams: Teams,
|
|
22490
22735
|
Posts: Posts,
|
|
22736
|
+
Messages: Messages,
|
|
22491
22737
|
Templates: Templates,
|
|
22492
22738
|
Waitlists: Waitlists,
|
|
22493
22739
|
Utility: Utility,
|
|
@@ -22495,6 +22741,7 @@ var Glitch = /** @class */ (function () {
|
|
|
22495
22741
|
Titles: Titles,
|
|
22496
22742
|
Social: Social,
|
|
22497
22743
|
SocialPosts: SocialPosts,
|
|
22744
|
+
Subscriptions: Subscriptions,
|
|
22498
22745
|
TipPackages: TipPackages,
|
|
22499
22746
|
TipEmojis: TipEmojis,
|
|
22500
22747
|
TipPackagePurchases: TipPackagePurchases
|