glitch-javascript-sdk 1.7.5 → 1.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/index.d.ts CHANGED
@@ -3010,15 +3010,46 @@ declare class Titles {
3010
3010
  static retentionAnalysis<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3011
3011
  static distinctDimensions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3012
3012
  /**
3013
- * List sessions for a specific title, with optional filters and pagination.
3014
- * Returns a paginated list of sessions with start/end times, session_length, user info, etc.
3015
- */
3013
+ * List sessions for a specific title, with optional filters and pagination.
3014
+ * Returns a paginated list of sessions with start/end times, session_length, user info, etc.
3015
+ */
3016
3016
  static listSessions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3017
3017
  /**
3018
3018
  * Get aggregated average session length data (daily/weekly/monthly) for a title.
3019
3019
  * Optionally filter by platform/device_type/OS/version and group by one dimension.
3020
3020
  */
3021
3021
  static sessionsAverage<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3022
+ static sessionsHistogram<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3023
+ /**
3024
+ * Upload a CSV/Excel file containing daily UTM analytics for a specific title.
3025
+ *
3026
+ * @param title_id The UUID of the title
3027
+ * @param file The CSV or Excel file
3028
+ * @param data Optional form fields (if needed)
3029
+ * @param params Optional query parameters
3030
+ * @returns AxiosPromise
3031
+ */
3032
+ static importUtmAnalytics<T>(title_id: string, file: File | Blob, data?: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
3033
+ /**
3034
+ * Retrieve the UTM analytics data for a title (paginated, filterable, sortable).
3035
+ *
3036
+ * GET /titles/{title_id}/utm
3037
+ *
3038
+ * @param title_id The UUID of the title
3039
+ * @param params Optional query params: start_date, end_date, source, device_type, sort_by, etc.
3040
+ * @returns AxiosPromise
3041
+ */
3042
+ static getUtmAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3043
+ /**
3044
+ * Analyze UTM data with optional group_by (source, campaign, medium, device_type, etc.)
3045
+ *
3046
+ * GET /titles/{title_id}/utm/analysis
3047
+ *
3048
+ * @param title_id The UUID of the title
3049
+ * @param params e.g. ?group_by=source&start_date=YYYY-MM-DD
3050
+ * @returns AxiosPromise
3051
+ */
3052
+ static analyzeUtmAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3022
3053
  }
3023
3054
 
3024
3055
  declare class Campaigns {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Titles.ts CHANGED
@@ -366,9 +366,9 @@ class Titles {
366
366
  }
367
367
 
368
368
  /**
369
- * List sessions for a specific title, with optional filters and pagination.
370
- * Returns a paginated list of sessions with start/end times, session_length, user info, etc.
371
- */
369
+ * List sessions for a specific title, with optional filters and pagination.
370
+ * Returns a paginated list of sessions with start/end times, session_length, user info, etc.
371
+ */
372
372
  public static listSessions<T>(
373
373
  title_id: string,
374
374
  params?: Record<string, any>
@@ -397,6 +397,80 @@ class Titles {
397
397
  );
398
398
  }
399
399
 
400
+ public static sessionsHistogram<T>(
401
+ title_id: string,
402
+ params?: Record<string, any>
403
+ ): AxiosPromise<Response<T>> {
404
+ return Requests.processRoute(
405
+ TitlesRoute.routes.sessionsHistogram,
406
+ {},
407
+ { title_id },
408
+ params
409
+ );
410
+ }
411
+
412
+ /**
413
+ * Upload a CSV/Excel file containing daily UTM analytics for a specific title.
414
+ *
415
+ * @param title_id The UUID of the title
416
+ * @param file The CSV or Excel file
417
+ * @param data Optional form fields (if needed)
418
+ * @param params Optional query parameters
419
+ * @returns AxiosPromise
420
+ */
421
+ public static importUtmAnalytics<T>(
422
+ title_id: string,
423
+ file: File | Blob,
424
+ data?: Record<string, any>,
425
+ params?: Record<string, any>
426
+ ): AxiosPromise<Response<T>> {
427
+ const url = TitlesRoute.routes.importUtmAnalytics.url.replace("{title_id}", title_id);
428
+ return Requests.uploadFile<T>(url, "file", file, data, params);
429
+ }
430
+
431
+ /**
432
+ * Retrieve the UTM analytics data for a title (paginated, filterable, sortable).
433
+ *
434
+ * GET /titles/{title_id}/utm
435
+ *
436
+ * @param title_id The UUID of the title
437
+ * @param params Optional query params: start_date, end_date, source, device_type, sort_by, etc.
438
+ * @returns AxiosPromise
439
+ */
440
+ public static getUtmAnalytics<T>(
441
+ title_id: string,
442
+ params?: Record<string, any>
443
+ ): AxiosPromise<Response<T>> {
444
+ return Requests.processRoute(
445
+ TitlesRoute.routes.getUtmAnalytics,
446
+ {},
447
+ { title_id },
448
+ params
449
+ );
450
+ }
451
+
452
+ /**
453
+ * Analyze UTM data with optional group_by (source, campaign, medium, device_type, etc.)
454
+ *
455
+ * GET /titles/{title_id}/utm/analysis
456
+ *
457
+ * @param title_id The UUID of the title
458
+ * @param params e.g. ?group_by=source&start_date=YYYY-MM-DD
459
+ * @returns AxiosPromise
460
+ */
461
+ public static analyzeUtmAnalytics<T>(
462
+ title_id: string,
463
+ params?: Record<string, any>
464
+ ): AxiosPromise<Response<T>> {
465
+ return Requests.processRoute(
466
+ TitlesRoute.routes.analyzeUtmAnalytics,
467
+ {},
468
+ { title_id },
469
+ params
470
+ );
471
+ }
472
+
473
+
400
474
  }
401
475
 
402
476
  export default Titles;
@@ -40,6 +40,37 @@ class TitlesRoute {
40
40
  url: '/titles/{title_id}/installs/sessions/average',
41
41
  method: HTTP_METHODS.GET
42
42
  },
43
+ sessionsHistogram: {
44
+ url: '/titles/{title_id}/sessions/histogram',
45
+ method: HTTP_METHODS.GET
46
+ },
47
+ /**
48
+ * 1) Import a CSV/Excel file containing daily UTM analytics data for a Title
49
+ * POST /titles/{title_id}/utm/import
50
+ */
51
+ importUtmAnalytics: {
52
+ url: "/titles/{title_id}/utm/import",
53
+ method: HTTP_METHODS.POST,
54
+ },
55
+
56
+ /**
57
+ * 2) Retrieve paginated/filterable UTM analytics data for a Title
58
+ * GET /titles/{title_id}/utm
59
+ */
60
+ getUtmAnalytics: {
61
+ url: "/titles/{title_id}/utm",
62
+ method: HTTP_METHODS.GET,
63
+ },
64
+
65
+ /**
66
+ * 3) Analyze UTM data with optional group_by / dimension-based aggregates
67
+ * GET /titles/{title_id}/utm/analysis
68
+ */
69
+ analyzeUtmAnalytics: {
70
+ url: "/titles/{title_id}/utm/analysis",
71
+ method: HTTP_METHODS.GET,
72
+ },
73
+
43
74
  };
44
75
 
45
76
  }