glitch-javascript-sdk 2.1.2 → 2.1.4
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 +222 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Media.d.ts +80 -0
- package/dist/esm/api/Scheduler.d.ts +16 -0
- package/dist/esm/api/SocialPosts.d.ts +68 -0
- package/dist/esm/index.js +222 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +164 -0
- package/package.json +1 -1
- package/src/api/Media.ts +161 -0
- package/src/api/Scheduler.ts +22 -0
- package/src/api/SocialPosts.ts +96 -0
- package/src/routes/MediaRoute.ts +2 -0
- package/src/routes/SchedulerRoute.ts +3 -0
- package/src/routes/SocialPostsRoute.ts +11 -0
package/dist/cjs/index.js
CHANGED
|
@@ -24120,6 +24120,16 @@ var SocialPostsRoute = /** @class */ (function () {
|
|
|
24120
24120
|
reports: { url: '/socialposts/{post_id}/reports', method: HTTP_METHODS.GET },
|
|
24121
24121
|
updatePostImpressions: { url: '/socialposts/{post_id}/impressions', method: HTTP_METHODS.PUT },
|
|
24122
24122
|
shortLinkReports: { url: '/socialposts/shortlinks/reports', method: HTTP_METHODS.GET },
|
|
24123
|
+
// New Comment Routes
|
|
24124
|
+
listComments: { url: '/socialposts/{post_id}/comments', method: HTTP_METHODS.GET },
|
|
24125
|
+
syncComments: { url: '/socialposts/{post_id}/sync-comments', method: HTTP_METHODS.POST },
|
|
24126
|
+
listPendingResponses: { url: '/socialposts/comments/pending-responses', method: HTTP_METHODS.GET },
|
|
24127
|
+
viewComment: { url: '/socialposts/comments/{comment_id}', method: HTTP_METHODS.GET },
|
|
24128
|
+
replyToComment: { url: '/socialposts/comments/{comment_id}/reply', method: HTTP_METHODS.POST },
|
|
24129
|
+
moderateComment: { url: '/socialposts/comments/{comment_id}/moderate', method: HTTP_METHODS.PUT },
|
|
24130
|
+
markCommentForResponse: { url: '/socialposts/comments/{comment_id}/mark-for-response', method: HTTP_METHODS.PUT },
|
|
24131
|
+
getCommentThread: { url: '/socialposts/comments/{comment_id}/thread', method: HTTP_METHODS.GET },
|
|
24132
|
+
updateCommentMetrics: { url: '/socialposts/comments/{comment_id}/update-metrics', method: HTTP_METHODS.PUT },
|
|
24123
24133
|
};
|
|
24124
24134
|
return SocialPostsRoute;
|
|
24125
24135
|
}());
|
|
@@ -24289,6 +24299,92 @@ var SocialPosts = /** @class */ (function () {
|
|
|
24289
24299
|
SocialPosts.shortLinkReports = function (params) {
|
|
24290
24300
|
return Requests.processRoute(SocialPostsRoute.routes.shortLinkReports, undefined, undefined, params);
|
|
24291
24301
|
};
|
|
24302
|
+
/**
|
|
24303
|
+
* List comments for a social media post.
|
|
24304
|
+
*
|
|
24305
|
+
* @param post_id The ID of the social media post.
|
|
24306
|
+
* @param params Optional query parameters for filtering and sorting.
|
|
24307
|
+
* @returns A promise
|
|
24308
|
+
*/
|
|
24309
|
+
SocialPosts.listComments = function (post_id, params) {
|
|
24310
|
+
return Requests.processRoute(SocialPostsRoute.routes.listComments, undefined, { post_id: post_id }, params);
|
|
24311
|
+
};
|
|
24312
|
+
/**
|
|
24313
|
+
* Sync comments from the social media platform for a specific post.
|
|
24314
|
+
*
|
|
24315
|
+
* @param post_id The ID of the social media post.
|
|
24316
|
+
* @param params Optional query parameters (e.g., limit).
|
|
24317
|
+
* @returns A promise
|
|
24318
|
+
*/
|
|
24319
|
+
SocialPosts.syncComments = function (post_id, params) {
|
|
24320
|
+
return Requests.processRoute(SocialPostsRoute.routes.syncComments, undefined, { post_id: post_id }, params);
|
|
24321
|
+
};
|
|
24322
|
+
/**
|
|
24323
|
+
* Get a list of all comments that are pending a response.
|
|
24324
|
+
*
|
|
24325
|
+
* @param params Optional query parameters for filtering.
|
|
24326
|
+
* @returns A promise
|
|
24327
|
+
*/
|
|
24328
|
+
SocialPosts.listPendingResponses = function (params) {
|
|
24329
|
+
return Requests.processRoute(SocialPostsRoute.routes.listPendingResponses, undefined, undefined, params);
|
|
24330
|
+
};
|
|
24331
|
+
/**
|
|
24332
|
+
* Retrieve a single comment by its ID.
|
|
24333
|
+
*
|
|
24334
|
+
* @param comment_id The ID of the comment.
|
|
24335
|
+
* @param params Optional query parameters (e.g., include_thread).
|
|
24336
|
+
* @returns A promise
|
|
24337
|
+
*/
|
|
24338
|
+
SocialPosts.viewComment = function (comment_id, params) {
|
|
24339
|
+
return Requests.processRoute(SocialPostsRoute.routes.viewComment, undefined, { comment_id: comment_id }, params);
|
|
24340
|
+
};
|
|
24341
|
+
/**
|
|
24342
|
+
* Post a reply to a comment.
|
|
24343
|
+
*
|
|
24344
|
+
* @param comment_id The ID of the comment to reply to.
|
|
24345
|
+
* @param data The content of the reply.
|
|
24346
|
+
* @returns A promise
|
|
24347
|
+
*/
|
|
24348
|
+
SocialPosts.replyToComment = function (comment_id, data) {
|
|
24349
|
+
return Requests.processRoute(SocialPostsRoute.routes.replyToComment, data, { comment_id: comment_id });
|
|
24350
|
+
};
|
|
24351
|
+
/**
|
|
24352
|
+
* Moderate a comment (approve, reject, spam, hide, show).
|
|
24353
|
+
*
|
|
24354
|
+
* @param comment_id The ID of the comment to moderate.
|
|
24355
|
+
* @param data The moderation action and optional reason.
|
|
24356
|
+
* @returns A promise
|
|
24357
|
+
*/
|
|
24358
|
+
SocialPosts.moderateComment = function (comment_id, data) {
|
|
24359
|
+
return Requests.processRoute(SocialPostsRoute.routes.moderateComment, data, { comment_id: comment_id });
|
|
24360
|
+
};
|
|
24361
|
+
/**
|
|
24362
|
+
* Mark a comment as needing a response.
|
|
24363
|
+
*
|
|
24364
|
+
* @param comment_id The ID of the comment.
|
|
24365
|
+
* @returns A promise
|
|
24366
|
+
*/
|
|
24367
|
+
SocialPosts.markCommentForResponse = function (comment_id) {
|
|
24368
|
+
return Requests.processRoute(SocialPostsRoute.routes.markCommentForResponse, undefined, { comment_id: comment_id });
|
|
24369
|
+
};
|
|
24370
|
+
/**
|
|
24371
|
+
* Get the full thread for a given comment.
|
|
24372
|
+
*
|
|
24373
|
+
* @param comment_id The ID of a comment within the thread.
|
|
24374
|
+
* @returns A promise
|
|
24375
|
+
*/
|
|
24376
|
+
SocialPosts.getCommentThread = function (comment_id) {
|
|
24377
|
+
return Requests.processRoute(SocialPostsRoute.routes.getCommentThread, undefined, { comment_id: comment_id });
|
|
24378
|
+
};
|
|
24379
|
+
/**
|
|
24380
|
+
* Trigger a manual update of a comment's metrics from its platform.
|
|
24381
|
+
*
|
|
24382
|
+
* @param comment_id The ID of the comment to update.
|
|
24383
|
+
* @returns A promise
|
|
24384
|
+
*/
|
|
24385
|
+
SocialPosts.updateCommentMetrics = function (comment_id) {
|
|
24386
|
+
return Requests.processRoute(SocialPostsRoute.routes.updateCommentMetrics, undefined, { comment_id: comment_id });
|
|
24387
|
+
};
|
|
24292
24388
|
return SocialPosts;
|
|
24293
24389
|
}());
|
|
24294
24390
|
|
|
@@ -26642,6 +26738,8 @@ var MediaRoute = /** @class */ (function () {
|
|
|
26642
26738
|
MediaRoute.routes = {
|
|
26643
26739
|
upload: { url: '/media', method: HTTP_METHODS.POST },
|
|
26644
26740
|
getMedia: { url: '/media/{media_id}', method: HTTP_METHODS.GET },
|
|
26741
|
+
cropSteamCapsule: { url: '/media/crop-steam-capsule', method: HTTP_METHODS.POST },
|
|
26742
|
+
analyzeSteamCapsule: { url: '/media/analyze-steam-capsule', method: HTTP_METHODS.POST },
|
|
26645
26743
|
};
|
|
26646
26744
|
return MediaRoute;
|
|
26647
26745
|
}());
|
|
@@ -26687,6 +26785,108 @@ var Media = /** @class */ (function () {
|
|
|
26687
26785
|
Media.get = function (media_id, params) {
|
|
26688
26786
|
return Requests.processRoute(MediaRoute.routes.getMedia, {}, { media_id: media_id }, params);
|
|
26689
26787
|
};
|
|
26788
|
+
/**
|
|
26789
|
+
* Crop and resize an image to Steam capsule dimensions.
|
|
26790
|
+
*
|
|
26791
|
+
* @param request The crop request parameters.
|
|
26792
|
+
* @param params Additional query parameters.
|
|
26793
|
+
*
|
|
26794
|
+
* @returns promise
|
|
26795
|
+
*/
|
|
26796
|
+
Media.cropSteamCapsule = function (request, params) {
|
|
26797
|
+
return Requests.processRoute(MediaRoute.routes.cropSteamCapsule, request, {}, params);
|
|
26798
|
+
};
|
|
26799
|
+
/**
|
|
26800
|
+
* Analyze a Steam capsule image using AI.
|
|
26801
|
+
*
|
|
26802
|
+
* @param request The analysis request parameters.
|
|
26803
|
+
* @param params Additional query parameters.
|
|
26804
|
+
*
|
|
26805
|
+
* @returns promise
|
|
26806
|
+
*/
|
|
26807
|
+
Media.analyzeSteamCapsule = function (request, params) {
|
|
26808
|
+
return Requests.processRoute(MediaRoute.routes.analyzeSteamCapsule, request, {}, params);
|
|
26809
|
+
};
|
|
26810
|
+
/**
|
|
26811
|
+
* Get Steam capsule dimensions for a specific type.
|
|
26812
|
+
*
|
|
26813
|
+
* @param capsuleType The type of Steam capsule.
|
|
26814
|
+
*
|
|
26815
|
+
* @returns The dimensions object or null if invalid type.
|
|
26816
|
+
*/
|
|
26817
|
+
Media.getSteamCapsuleDimensions = function (capsuleType) {
|
|
26818
|
+
var dimensions = {
|
|
26819
|
+
'header': { width: 920, height: 430 },
|
|
26820
|
+
'small': { width: 462, height: 174 },
|
|
26821
|
+
'main': { width: 1232, height: 706 },
|
|
26822
|
+
'vertical': { width: 748, height: 896 },
|
|
26823
|
+
'library': { width: 600, height: 900 },
|
|
26824
|
+
'library_header': { width: 920, height: 430 },
|
|
26825
|
+
'library_hero': { width: 3840, height: 1240 },
|
|
26826
|
+
'page_background': { width: 1438, height: 810 }
|
|
26827
|
+
};
|
|
26828
|
+
return dimensions[capsuleType] || null;
|
|
26829
|
+
};
|
|
26830
|
+
/**
|
|
26831
|
+
* Get Steam capsule type information and requirements.
|
|
26832
|
+
*
|
|
26833
|
+
* @param capsuleType The type of Steam capsule.
|
|
26834
|
+
*
|
|
26835
|
+
* @returns Information about the capsule type.
|
|
26836
|
+
*/
|
|
26837
|
+
Media.getSteamCapsuleInfo = function (capsuleType) {
|
|
26838
|
+
var info = {
|
|
26839
|
+
'header': {
|
|
26840
|
+
name: 'Header Capsule',
|
|
26841
|
+
purpose: 'Appears at the top of store page, in recommended sections, grid view in libraries',
|
|
26842
|
+
textRequirement: 'Logo must be clearly legible',
|
|
26843
|
+
designFocus: 'Focus on branding of your product'
|
|
26844
|
+
},
|
|
26845
|
+
'small': {
|
|
26846
|
+
name: 'Small Capsule',
|
|
26847
|
+
purpose: 'Used for all lists throughout Steam: search results, top-sellers, new releases',
|
|
26848
|
+
textRequirement: 'Logo should nearly fill the small capsule for readability',
|
|
26849
|
+
designFocus: 'Focus on making logo clearly legible at smallest size'
|
|
26850
|
+
},
|
|
26851
|
+
'main': {
|
|
26852
|
+
name: 'Main Capsule',
|
|
26853
|
+
purpose: 'Appears at top of front page in featured and recommended carousel',
|
|
26854
|
+
textRequirement: 'Logo should be prominent and readable',
|
|
26855
|
+
designFocus: 'Designed to market the product with key art and logo'
|
|
26856
|
+
},
|
|
26857
|
+
'vertical': {
|
|
26858
|
+
name: 'Vertical Capsule',
|
|
26859
|
+
purpose: 'Can appear at top of front page during seasonal sales',
|
|
26860
|
+
textRequirement: 'Logo should be clearly visible',
|
|
26861
|
+
designFocus: 'Vertical asset designed to market your game'
|
|
26862
|
+
},
|
|
26863
|
+
'library': {
|
|
26864
|
+
name: 'Library Capsule',
|
|
26865
|
+
purpose: 'Used in library overview and collection views',
|
|
26866
|
+
textRequirement: 'Game name/logo should be easily legible against background',
|
|
26867
|
+
designFocus: 'Graphically-centric to give user sense of experience'
|
|
26868
|
+
},
|
|
26869
|
+
'library_header': {
|
|
26870
|
+
name: 'Library Header',
|
|
26871
|
+
purpose: 'Appears in various places in Steam Client Library',
|
|
26872
|
+
textRequirement: 'Logo must be clearly legible',
|
|
26873
|
+
designFocus: 'Focus on branding, similar to Library Capsule'
|
|
26874
|
+
},
|
|
26875
|
+
'library_hero': {
|
|
26876
|
+
name: 'Library Hero',
|
|
26877
|
+
purpose: 'Appears at top of user\'s library details page',
|
|
26878
|
+
textRequirement: 'Should NOT contain any text or logos',
|
|
26879
|
+
designFocus: 'Visually rich, easily recognizable key art'
|
|
26880
|
+
},
|
|
26881
|
+
'page_background': {
|
|
26882
|
+
name: 'Page Background',
|
|
26883
|
+
purpose: 'Background image for store page',
|
|
26884
|
+
textRequirement: 'Minimal or no text',
|
|
26885
|
+
designFocus: 'Should be ambient, not compete with page content'
|
|
26886
|
+
}
|
|
26887
|
+
};
|
|
26888
|
+
return info[capsuleType] || null;
|
|
26889
|
+
};
|
|
26690
26890
|
return Media;
|
|
26691
26891
|
}());
|
|
26692
26892
|
|
|
@@ -26799,6 +26999,8 @@ var SchedulerRoute = /** @class */ (function () {
|
|
|
26799
26999
|
getDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.GET },
|
|
26800
27000
|
updateDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.PUT },
|
|
26801
27001
|
deleteDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.DELETE },
|
|
27002
|
+
getSchedulerPostsWithComments: { url: '/schedulers/{scheduler_id}/posts-with-comments', method: HTTP_METHODS.GET },
|
|
27003
|
+
syncAllSchedulerComments: { url: '/schedulers/{scheduler_id}/sync-all-comments', method: HTTP_METHODS.POST },
|
|
26802
27004
|
};
|
|
26803
27005
|
return SchedulerRoute;
|
|
26804
27006
|
}());
|
|
@@ -27432,6 +27634,26 @@ var Scheduler = /** @class */ (function () {
|
|
|
27432
27634
|
Scheduler.generateRedditContent = function (scheduler_id, data, params) {
|
|
27433
27635
|
return Requests.processRoute(SchedulerRoute.routes.generateRedditContent, data, { scheduler_id: scheduler_id }, params);
|
|
27434
27636
|
};
|
|
27637
|
+
/**
|
|
27638
|
+
* Get all posts and comments for a scheduler.
|
|
27639
|
+
*
|
|
27640
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27641
|
+
* @param params Optional query parameters for filtering and sorting.
|
|
27642
|
+
* @returns promise
|
|
27643
|
+
*/
|
|
27644
|
+
Scheduler.getSchedulerPostsWithComments = function (scheduler_id, params) {
|
|
27645
|
+
return Requests.processRoute(SchedulerRoute.routes.getSchedulerPostsWithComments, {}, { scheduler_id: scheduler_id }, params);
|
|
27646
|
+
};
|
|
27647
|
+
/**
|
|
27648
|
+
* Sync all comments for all posts in a scheduler.
|
|
27649
|
+
*
|
|
27650
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
27651
|
+
* @param params Optional query parameters (e.g., limit_per_post).
|
|
27652
|
+
* @returns promise
|
|
27653
|
+
*/
|
|
27654
|
+
Scheduler.syncAllSchedulerComments = function (scheduler_id, params) {
|
|
27655
|
+
return Requests.processRoute(SchedulerRoute.routes.syncAllSchedulerComments, {}, { scheduler_id: scheduler_id }, params);
|
|
27656
|
+
};
|
|
27435
27657
|
return Scheduler;
|
|
27436
27658
|
}());
|
|
27437
27659
|
|