glitch-javascript-sdk 2.4.5 → 2.4.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 +138 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/SocialPosts.d.ts +46 -0
- package/dist/esm/api/Titles.d.ts +46 -0
- package/dist/esm/index.js +138 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +92 -0
- package/package.json +1 -1
- package/src/api/SocialPosts.ts +61 -0
- package/src/api/Titles.ts +74 -0
- package/src/routes/SocialPostsRoute.ts +7 -0
- package/src/routes/TitlesRoute.ts +15 -0
package/dist/index.d.ts
CHANGED
|
@@ -3640,6 +3640,52 @@ declare class SocialPosts {
|
|
|
3640
3640
|
* Get ad creative performance matrix.
|
|
3641
3641
|
*/
|
|
3642
3642
|
static creativePerformance<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3643
|
+
/**
|
|
3644
|
+
* List social media conversations.
|
|
3645
|
+
*
|
|
3646
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/listSocialConversations
|
|
3647
|
+
*
|
|
3648
|
+
* @param params Query parameters (scheduler_id, platform, page, per_page).
|
|
3649
|
+
* @returns promise
|
|
3650
|
+
*/
|
|
3651
|
+
static listConversations<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3652
|
+
/**
|
|
3653
|
+
* Sync conversations from external platform.
|
|
3654
|
+
*
|
|
3655
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/syncSocialConversations
|
|
3656
|
+
*
|
|
3657
|
+
* @param data Body parameters (platform, scheduler_id).
|
|
3658
|
+
* @returns promise
|
|
3659
|
+
*/
|
|
3660
|
+
static syncConversations<T>(data: object): AxiosPromise<Response<T>>;
|
|
3661
|
+
/**
|
|
3662
|
+
* Get a specific conversation.
|
|
3663
|
+
*
|
|
3664
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/getSocialConversation
|
|
3665
|
+
*
|
|
3666
|
+
* @param conversation_id The ID of the conversation.
|
|
3667
|
+
* @returns promise
|
|
3668
|
+
*/
|
|
3669
|
+
static getConversation<T>(conversation_id: string): AxiosPromise<Response<T>>;
|
|
3670
|
+
/**
|
|
3671
|
+
* List messages in a conversation.
|
|
3672
|
+
*
|
|
3673
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/listSocialMessages
|
|
3674
|
+
*
|
|
3675
|
+
* @param conversation_id The ID of the conversation.
|
|
3676
|
+
* @param params Query parameters (sync, page, per_page).
|
|
3677
|
+
* @returns promise
|
|
3678
|
+
*/
|
|
3679
|
+
static getConversationMessages<T>(conversation_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3680
|
+
/**
|
|
3681
|
+
* Send a Direct Message.
|
|
3682
|
+
*
|
|
3683
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/sendSocialMessage
|
|
3684
|
+
*
|
|
3685
|
+
* @param data Body parameters (message, conversation_id, recipient_id, platform, scheduler_id, media_ids).
|
|
3686
|
+
* @returns promise
|
|
3687
|
+
*/
|
|
3688
|
+
static sendSocialMessage<T>(data: object): AxiosPromise<Response<T>>;
|
|
3643
3689
|
}
|
|
3644
3690
|
|
|
3645
3691
|
declare class Titles {
|
|
@@ -4071,6 +4117,52 @@ declare class Titles {
|
|
|
4071
4117
|
group_by: 'platform' | 'status' | 'event_type';
|
|
4072
4118
|
unique_clicks?: boolean;
|
|
4073
4119
|
}): AxiosPromise<Response<T>>;
|
|
4120
|
+
/**
|
|
4121
|
+
* Get a geographical distribution report for installs.
|
|
4122
|
+
* @param params e.g., { group_by: 'country_code', start_date: '2025-01-01' }
|
|
4123
|
+
*/
|
|
4124
|
+
static geoReport<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4125
|
+
/**
|
|
4126
|
+
* List and filter raw game events (telemetry).
|
|
4127
|
+
*/
|
|
4128
|
+
static listEvents<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4129
|
+
/**
|
|
4130
|
+
* Record a single in-game action.
|
|
4131
|
+
*/
|
|
4132
|
+
static createEvent<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
4133
|
+
/**
|
|
4134
|
+
* Record multiple events in one request (Batching).
|
|
4135
|
+
* @param data { events: Array<{game_install_id, step_key, action_key, metadata?}> }
|
|
4136
|
+
*/
|
|
4137
|
+
static bulkCreateEvents<T>(title_id: string, data: {
|
|
4138
|
+
events: object[];
|
|
4139
|
+
}): AxiosPromise<Response<T>>;
|
|
4140
|
+
/**
|
|
4141
|
+
* Get a summary of actions per step.
|
|
4142
|
+
*/
|
|
4143
|
+
static eventSummary<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4144
|
+
/**
|
|
4145
|
+
* Get all unique step and action keys used in this title.
|
|
4146
|
+
*/
|
|
4147
|
+
static eventDistinctKeys<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
4148
|
+
/**
|
|
4149
|
+
* List all saved behavioral funnel definitions.
|
|
4150
|
+
*/
|
|
4151
|
+
static listBehavioralFunnels<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
4152
|
+
/**
|
|
4153
|
+
* Create and save a new behavioral funnel definition.
|
|
4154
|
+
* @param data { name: string, description?: string, steps: string[] }
|
|
4155
|
+
*/
|
|
4156
|
+
static createBehavioralFunnel<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
4157
|
+
/**
|
|
4158
|
+
* Generate the drop-off report for a specific behavioral funnel.
|
|
4159
|
+
* @param params { start_date?: string, end_date?: string }
|
|
4160
|
+
*/
|
|
4161
|
+
static behavioralFunnelReport<T>(title_id: string, funnel_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4162
|
+
/**
|
|
4163
|
+
* Delete a saved behavioral funnel definition.
|
|
4164
|
+
*/
|
|
4165
|
+
static deleteBehavioralFunnel<T>(title_id: string, funnel_id: string): AxiosPromise<Response<T>>;
|
|
4074
4166
|
}
|
|
4075
4167
|
|
|
4076
4168
|
declare class Campaigns {
|
package/package.json
CHANGED
package/src/api/SocialPosts.ts
CHANGED
|
@@ -369,6 +369,67 @@ class SocialPosts {
|
|
|
369
369
|
public static creativePerformance<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
370
370
|
return Requests.processRoute(SocialPostsRoute.routes.creativePerformance, {}, {}, params);
|
|
371
371
|
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* List social media conversations.
|
|
375
|
+
*
|
|
376
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/listSocialConversations
|
|
377
|
+
*
|
|
378
|
+
* @param params Query parameters (scheduler_id, platform, page, per_page).
|
|
379
|
+
* @returns promise
|
|
380
|
+
*/
|
|
381
|
+
public static listConversations<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
382
|
+
return Requests.processRoute(SocialPostsRoute.routes.listConversations, undefined, undefined, params);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Sync conversations from external platform.
|
|
387
|
+
*
|
|
388
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/syncSocialConversations
|
|
389
|
+
*
|
|
390
|
+
* @param data Body parameters (platform, scheduler_id).
|
|
391
|
+
* @returns promise
|
|
392
|
+
*/
|
|
393
|
+
public static syncConversations<T>(data: object): AxiosPromise<Response<T>> {
|
|
394
|
+
return Requests.processRoute(SocialPostsRoute.routes.syncConversations, data);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Get a specific conversation.
|
|
399
|
+
*
|
|
400
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/getSocialConversation
|
|
401
|
+
*
|
|
402
|
+
* @param conversation_id The ID of the conversation.
|
|
403
|
+
* @returns promise
|
|
404
|
+
*/
|
|
405
|
+
public static getConversation<T>(conversation_id: string): AxiosPromise<Response<T>> {
|
|
406
|
+
return Requests.processRoute(SocialPostsRoute.routes.getConversation, undefined, { conversation_id });
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* List messages in a conversation.
|
|
411
|
+
*
|
|
412
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/listSocialMessages
|
|
413
|
+
*
|
|
414
|
+
* @param conversation_id The ID of the conversation.
|
|
415
|
+
* @param params Query parameters (sync, page, per_page).
|
|
416
|
+
* @returns promise
|
|
417
|
+
*/
|
|
418
|
+
public static getConversationMessages<T>(conversation_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
419
|
+
return Requests.processRoute(SocialPostsRoute.routes.getConversationMessages, undefined, { conversation_id }, params);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Send a Direct Message.
|
|
424
|
+
*
|
|
425
|
+
* @see https://api.glitch.fun/api/documentation#/Social%20Messaging/sendSocialMessage
|
|
426
|
+
*
|
|
427
|
+
* @param data Body parameters (message, conversation_id, recipient_id, platform, scheduler_id, media_ids).
|
|
428
|
+
* @returns promise
|
|
429
|
+
*/
|
|
430
|
+
public static sendSocialMessage<T>(data: object): AxiosPromise<Response<T>> {
|
|
431
|
+
return Requests.processRoute(SocialPostsRoute.routes.sendSocialMessage, data);
|
|
432
|
+
}
|
|
372
433
|
}
|
|
373
434
|
|
|
374
435
|
export default SocialPosts;
|
package/src/api/Titles.ts
CHANGED
|
@@ -858,6 +858,80 @@ class Titles {
|
|
|
858
858
|
params
|
|
859
859
|
);
|
|
860
860
|
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Get a geographical distribution report for installs.
|
|
864
|
+
* @param params e.g., { group_by: 'country_code', start_date: '2025-01-01' }
|
|
865
|
+
*/
|
|
866
|
+
public static geoReport<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
867
|
+
return Requests.processRoute(TitlesRoute.routes.geoReport, {}, { title_id }, params);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* List and filter raw game events (telemetry).
|
|
872
|
+
*/
|
|
873
|
+
public static listEvents<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
874
|
+
return Requests.processRoute(TitlesRoute.routes.listEvents, {}, { title_id }, params);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Record a single in-game action.
|
|
879
|
+
*/
|
|
880
|
+
public static createEvent<T>(title_id: string, data: object): AxiosPromise<Response<T>> {
|
|
881
|
+
return Requests.processRoute(TitlesRoute.routes.createEvent, data, { title_id });
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Record multiple events in one request (Batching).
|
|
886
|
+
* @param data { events: Array<{game_install_id, step_key, action_key, metadata?}> }
|
|
887
|
+
*/
|
|
888
|
+
public static bulkCreateEvents<T>(title_id: string, data: { events: object[] }): AxiosPromise<Response<T>> {
|
|
889
|
+
return Requests.processRoute(TitlesRoute.routes.bulkCreateEvents, data, { title_id });
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Get a summary of actions per step.
|
|
894
|
+
*/
|
|
895
|
+
public static eventSummary<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
896
|
+
return Requests.processRoute(TitlesRoute.routes.eventSummary, {}, { title_id }, params);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Get all unique step and action keys used in this title.
|
|
901
|
+
*/
|
|
902
|
+
public static eventDistinctKeys<T>(title_id: string): AxiosPromise<Response<T>> {
|
|
903
|
+
return Requests.processRoute(TitlesRoute.routes.eventDistinctKeys, {}, { title_id });
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* List all saved behavioral funnel definitions.
|
|
908
|
+
*/
|
|
909
|
+
public static listBehavioralFunnels<T>(title_id: string): AxiosPromise<Response<T>> {
|
|
910
|
+
return Requests.processRoute(TitlesRoute.routes.listBehavioralFunnels, {}, { title_id });
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Create and save a new behavioral funnel definition.
|
|
915
|
+
* @param data { name: string, description?: string, steps: string[] }
|
|
916
|
+
*/
|
|
917
|
+
public static createBehavioralFunnel<T>(title_id: string, data: object): AxiosPromise<Response<T>> {
|
|
918
|
+
return Requests.processRoute(TitlesRoute.routes.createBehavioralFunnel, data, { title_id });
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Generate the drop-off report for a specific behavioral funnel.
|
|
923
|
+
* @param params { start_date?: string, end_date?: string }
|
|
924
|
+
*/
|
|
925
|
+
public static behavioralFunnelReport<T>(title_id: string, funnel_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
926
|
+
return Requests.processRoute(TitlesRoute.routes.behavioralFunnelReport, {}, { title_id, funnel_id }, params);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Delete a saved behavioral funnel definition.
|
|
931
|
+
*/
|
|
932
|
+
public static deleteBehavioralFunnel<T>(title_id: string, funnel_id: string): AxiosPromise<Response<T>> {
|
|
933
|
+
return Requests.processRoute(TitlesRoute.routes.deleteBehavioralFunnel, {}, { title_id, funnel_id });
|
|
934
|
+
}
|
|
861
935
|
}
|
|
862
936
|
|
|
863
937
|
export default Titles;
|
|
@@ -41,6 +41,13 @@ class SocialPostsRoute {
|
|
|
41
41
|
|
|
42
42
|
creativePerformance: { url: '/socialposts/creative-performance', method: HTTP_METHODS.GET },
|
|
43
43
|
|
|
44
|
+
// Social Messaging (DM) Routes
|
|
45
|
+
listConversations: { url: '/social/conversations', method: HTTP_METHODS.GET },
|
|
46
|
+
syncConversations: { url: '/social/conversations/sync', method: HTTP_METHODS.POST },
|
|
47
|
+
getConversation: { url: '/social/conversations/{conversation_id}', method: HTTP_METHODS.GET },
|
|
48
|
+
getConversationMessages: { url: '/social/conversations/{conversation_id}/messages', method: HTTP_METHODS.GET },
|
|
49
|
+
sendSocialMessage: { url: '/social/messages', method: HTTP_METHODS.POST },
|
|
50
|
+
|
|
44
51
|
};
|
|
45
52
|
|
|
46
53
|
}
|
|
@@ -165,6 +165,21 @@ class TitlesRoute {
|
|
|
165
165
|
|
|
166
166
|
cohorts: { url: '/titles/{title_id}/installs/cohorts', method: HTTP_METHODS.GET },
|
|
167
167
|
|
|
168
|
+
geoReport: { url: '/titles/{title_id}/installs/geo-report', method: HTTP_METHODS.GET },
|
|
169
|
+
|
|
170
|
+
// Game Events (Behavioral Telemetry)
|
|
171
|
+
listEvents: { url: '/titles/{title_id}/events', method: HTTP_METHODS.GET },
|
|
172
|
+
createEvent: { url: '/titles/{title_id}/events', method: HTTP_METHODS.POST },
|
|
173
|
+
bulkCreateEvents: { url: '/titles/{title_id}/events/bulk', method: HTTP_METHODS.POST },
|
|
174
|
+
eventSummary: { url: '/titles/{title_id}/events/summary', method: HTTP_METHODS.GET },
|
|
175
|
+
eventDistinctKeys: { url: '/titles/{title_id}/events/distinct-keys', method: HTTP_METHODS.GET },
|
|
176
|
+
|
|
177
|
+
// Behavioral Funnels
|
|
178
|
+
listBehavioralFunnels: { url: '/titles/{title_id}/behavioral-funnels', method: HTTP_METHODS.GET },
|
|
179
|
+
createBehavioralFunnel: { url: '/titles/{title_id}/behavioral-funnels', method: HTTP_METHODS.POST },
|
|
180
|
+
behavioralFunnelReport: { url: '/titles/{title_id}/behavioral-funnels/{funnel_id}/report', method: HTTP_METHODS.GET },
|
|
181
|
+
deleteBehavioralFunnel: { url: '/titles/{title_id}/behavioral-funnels/{funnel_id}', method: HTTP_METHODS.DELETE },
|
|
182
|
+
|
|
168
183
|
};
|
|
169
184
|
|
|
170
185
|
}
|