glitch-javascript-sdk 2.0.3 → 2.0.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 +139 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/ShortLinks.d.ts +20 -0
- package/dist/esm/api/Titles.d.ts +45 -0
- package/dist/esm/index.js +139 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +65 -0
- package/package.json +1 -1
- package/src/api/ShortLinks.ts +52 -0
- package/src/api/Titles.ts +146 -0
- package/src/routes/ShortLinksRoute.ts +5 -0
- package/src/routes/TitlesRoute.ts +43 -0
|
@@ -17,5 +17,25 @@ declare class ShortLinks {
|
|
|
17
17
|
* Update a short link
|
|
18
18
|
*/
|
|
19
19
|
static update<T>(id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get click-summary report
|
|
22
|
+
* - Example usage: ShortLinks.clickSummary({ short_link_id: 'uuid-here' })
|
|
23
|
+
*/
|
|
24
|
+
static clickSummary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
25
|
+
/**
|
|
26
|
+
* Get geo & device breakdown report
|
|
27
|
+
* - Example usage: ShortLinks.geoDeviceBreakdown({ short_link_id: 'uuid-here' })
|
|
28
|
+
*/
|
|
29
|
+
static geoDeviceBreakdown<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
30
|
+
/**
|
|
31
|
+
* Get time-series report
|
|
32
|
+
* - Example usage: ShortLinks.timeSeries({ short_link_id: 'uuid-here', group_by: 'day' })
|
|
33
|
+
*/
|
|
34
|
+
static timeSeries<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
35
|
+
/**
|
|
36
|
+
* Get referrer & UTM report
|
|
37
|
+
* - Example usage: ShortLinks.referrerReport({ short_link_id: 'uuid-here' })
|
|
38
|
+
*/
|
|
39
|
+
static referrerReport<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
20
40
|
}
|
|
21
41
|
export default ShortLinks;
|
package/dist/esm/api/Titles.d.ts
CHANGED
|
@@ -289,5 +289,50 @@ declare class Titles {
|
|
|
289
289
|
* Update a specific chat message.
|
|
290
290
|
*/
|
|
291
291
|
static chatUpdateMessage<T>(title_id: string, message_id: string, data: object): AxiosPromise<Response<T>>;
|
|
292
|
+
/**
|
|
293
|
+
* List all purchase events for a specific title.
|
|
294
|
+
* Matches GET /titles/{title_id}/purchases
|
|
295
|
+
*/
|
|
296
|
+
static listPurchases<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
297
|
+
/**
|
|
298
|
+
* Retrieve a single purchase record by ID.
|
|
299
|
+
* Matches GET /titles/{title_id}/purchases/{purchase_id}
|
|
300
|
+
*/
|
|
301
|
+
static viewPurchase<T>(title_id: string, purchase_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
302
|
+
/**
|
|
303
|
+
* Create a new purchase record.
|
|
304
|
+
* Matches POST /titles/{title_id}/purchases
|
|
305
|
+
*/
|
|
306
|
+
static createPurchase<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
307
|
+
/**
|
|
308
|
+
* Get a summary of total revenue, grouped by day or purchase_type.
|
|
309
|
+
* Matches GET /titles/{title_id}/purchases/summary
|
|
310
|
+
*/
|
|
311
|
+
static purchaseSummary<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
312
|
+
/**
|
|
313
|
+
* Revenue by time (daily, weekly, or monthly).
|
|
314
|
+
* Matches GET /titles/{title_id}/purchases/reports/time
|
|
315
|
+
*/
|
|
316
|
+
static purchaseRevenueByTime<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
317
|
+
/**
|
|
318
|
+
* 30-day LTV (Lifetime Value) per install.
|
|
319
|
+
* Matches GET /titles/{title_id}/purchases/reports/ltv30
|
|
320
|
+
*/
|
|
321
|
+
static purchaseLtv30<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
322
|
+
/**
|
|
323
|
+
* Show breakdown of revenue per currency, with optional USD conversion.
|
|
324
|
+
* Matches GET /titles/{title_id}/purchases/reports/currency
|
|
325
|
+
*/
|
|
326
|
+
static purchaseCurrencyBreakdown<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
327
|
+
/**
|
|
328
|
+
* Distribution of installs by total revenue, plus a histogram array.
|
|
329
|
+
* Matches GET /titles/{title_id}/purchases/reports/install-distribution
|
|
330
|
+
*/
|
|
331
|
+
static installRevenueDistribution<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
332
|
+
/**
|
|
333
|
+
* Stats by item SKU, purchase type, and repeat purchase analysis.
|
|
334
|
+
* Matches GET /titles/{title_id}/purchases/reports/item-type-stats
|
|
335
|
+
*/
|
|
336
|
+
static itemAndPurchaseTypeStats<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
292
337
|
}
|
|
293
338
|
export default Titles;
|
package/dist/esm/index.js
CHANGED
|
@@ -11091,6 +11091,46 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
11091
11091
|
url: '/titles/{title_id}/chat/messages/{message_id}',
|
|
11092
11092
|
method: HTTP_METHODS.PUT
|
|
11093
11093
|
},
|
|
11094
|
+
// ─────────────────────────────────────────────────────────────────
|
|
11095
|
+
// Purchase/Revenue Endpoints
|
|
11096
|
+
// ─────────────────────────────────────────────────────────────────
|
|
11097
|
+
purchasesList: {
|
|
11098
|
+
url: "/titles/{title_id}/purchases",
|
|
11099
|
+
method: HTTP_METHODS.GET,
|
|
11100
|
+
},
|
|
11101
|
+
purchasesShow: {
|
|
11102
|
+
url: "/titles/{title_id}/purchases/{purchase_id}",
|
|
11103
|
+
method: HTTP_METHODS.GET,
|
|
11104
|
+
},
|
|
11105
|
+
purchasesCreate: {
|
|
11106
|
+
url: "/titles/{title_id}/purchases",
|
|
11107
|
+
method: HTTP_METHODS.POST,
|
|
11108
|
+
},
|
|
11109
|
+
purchasesSummary: {
|
|
11110
|
+
url: "/titles/{title_id}/purchases/summary",
|
|
11111
|
+
method: HTTP_METHODS.GET,
|
|
11112
|
+
},
|
|
11113
|
+
// Advanced analytics sub-routes
|
|
11114
|
+
purchasesTimeReport: {
|
|
11115
|
+
url: "/titles/{title_id}/purchases/reports/time",
|
|
11116
|
+
method: HTTP_METHODS.GET,
|
|
11117
|
+
},
|
|
11118
|
+
purchasesLtv30Report: {
|
|
11119
|
+
url: "/titles/{title_id}/purchases/reports/ltv30",
|
|
11120
|
+
method: HTTP_METHODS.GET,
|
|
11121
|
+
},
|
|
11122
|
+
purchasesCurrencyBreakdown: {
|
|
11123
|
+
url: "/titles/{title_id}/purchases/reports/currency",
|
|
11124
|
+
method: HTTP_METHODS.GET,
|
|
11125
|
+
},
|
|
11126
|
+
purchasesInstallDistribution: {
|
|
11127
|
+
url: "/titles/{title_id}/purchases/reports/install-distribution",
|
|
11128
|
+
method: HTTP_METHODS.GET,
|
|
11129
|
+
},
|
|
11130
|
+
purchasesItemTypeStats: {
|
|
11131
|
+
url: "/titles/{title_id}/purchases/reports/item-type-stats",
|
|
11132
|
+
method: HTTP_METHODS.GET,
|
|
11133
|
+
},
|
|
11094
11134
|
};
|
|
11095
11135
|
return TitlesRoute;
|
|
11096
11136
|
}());
|
|
@@ -11470,6 +11510,69 @@ var Titles = /** @class */ (function () {
|
|
|
11470
11510
|
Titles.chatUpdateMessage = function (title_id, message_id, data) {
|
|
11471
11511
|
return Requests.processRoute(TitlesRoute.routes.chatUpdateMessage, data, { title_id: title_id, message_id: message_id });
|
|
11472
11512
|
};
|
|
11513
|
+
/**
|
|
11514
|
+
* List all purchase events for a specific title.
|
|
11515
|
+
* Matches GET /titles/{title_id}/purchases
|
|
11516
|
+
*/
|
|
11517
|
+
Titles.listPurchases = function (title_id, params) {
|
|
11518
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesList, {}, { title_id: title_id }, params);
|
|
11519
|
+
};
|
|
11520
|
+
/**
|
|
11521
|
+
* Retrieve a single purchase record by ID.
|
|
11522
|
+
* Matches GET /titles/{title_id}/purchases/{purchase_id}
|
|
11523
|
+
*/
|
|
11524
|
+
Titles.viewPurchase = function (title_id, purchase_id, params) {
|
|
11525
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesShow, {}, { title_id: title_id, purchase_id: purchase_id }, params);
|
|
11526
|
+
};
|
|
11527
|
+
/**
|
|
11528
|
+
* Create a new purchase record.
|
|
11529
|
+
* Matches POST /titles/{title_id}/purchases
|
|
11530
|
+
*/
|
|
11531
|
+
Titles.createPurchase = function (title_id, data, params) {
|
|
11532
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesCreate, data, { title_id: title_id }, params);
|
|
11533
|
+
};
|
|
11534
|
+
/**
|
|
11535
|
+
* Get a summary of total revenue, grouped by day or purchase_type.
|
|
11536
|
+
* Matches GET /titles/{title_id}/purchases/summary
|
|
11537
|
+
*/
|
|
11538
|
+
Titles.purchaseSummary = function (title_id, params) {
|
|
11539
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesSummary, {}, { title_id: title_id }, params);
|
|
11540
|
+
};
|
|
11541
|
+
/**
|
|
11542
|
+
* Revenue by time (daily, weekly, or monthly).
|
|
11543
|
+
* Matches GET /titles/{title_id}/purchases/reports/time
|
|
11544
|
+
*/
|
|
11545
|
+
Titles.purchaseRevenueByTime = function (title_id, params) {
|
|
11546
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesTimeReport, {}, { title_id: title_id }, params);
|
|
11547
|
+
};
|
|
11548
|
+
/**
|
|
11549
|
+
* 30-day LTV (Lifetime Value) per install.
|
|
11550
|
+
* Matches GET /titles/{title_id}/purchases/reports/ltv30
|
|
11551
|
+
*/
|
|
11552
|
+
Titles.purchaseLtv30 = function (title_id, params) {
|
|
11553
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesLtv30Report, {}, { title_id: title_id }, params);
|
|
11554
|
+
};
|
|
11555
|
+
/**
|
|
11556
|
+
* Show breakdown of revenue per currency, with optional USD conversion.
|
|
11557
|
+
* Matches GET /titles/{title_id}/purchases/reports/currency
|
|
11558
|
+
*/
|
|
11559
|
+
Titles.purchaseCurrencyBreakdown = function (title_id, params) {
|
|
11560
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesCurrencyBreakdown, {}, { title_id: title_id }, params);
|
|
11561
|
+
};
|
|
11562
|
+
/**
|
|
11563
|
+
* Distribution of installs by total revenue, plus a histogram array.
|
|
11564
|
+
* Matches GET /titles/{title_id}/purchases/reports/install-distribution
|
|
11565
|
+
*/
|
|
11566
|
+
Titles.installRevenueDistribution = function (title_id, params) {
|
|
11567
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesInstallDistribution, {}, { title_id: title_id }, params);
|
|
11568
|
+
};
|
|
11569
|
+
/**
|
|
11570
|
+
* Stats by item SKU, purchase type, and repeat purchase analysis.
|
|
11571
|
+
* Matches GET /titles/{title_id}/purchases/reports/item-type-stats
|
|
11572
|
+
*/
|
|
11573
|
+
Titles.itemAndPurchaseTypeStats = function (title_id, params) {
|
|
11574
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesItemTypeStats, {}, { title_id: title_id }, params);
|
|
11575
|
+
};
|
|
11473
11576
|
return Titles;
|
|
11474
11577
|
}());
|
|
11475
11578
|
|
|
@@ -14462,6 +14565,10 @@ var ShortLinksRoute = /** @class */ (function () {
|
|
|
14462
14565
|
updateShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.PUT },
|
|
14463
14566
|
// Delete can be added if supported
|
|
14464
14567
|
// deleteShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.DELETE }
|
|
14568
|
+
clickSummary: { url: '/shortlinks/reports/click-summary', method: HTTP_METHODS.GET },
|
|
14569
|
+
geoDeviceBreakdown: { url: '/shortlinks/reports/geo-device', method: HTTP_METHODS.GET },
|
|
14570
|
+
timeSeries: { url: '/shortlinks/reports/time-series', method: HTTP_METHODS.GET },
|
|
14571
|
+
referrerReport: { url: '/shortlinks/reports/referrer', method: HTTP_METHODS.GET },
|
|
14465
14572
|
};
|
|
14466
14573
|
return ShortLinksRoute;
|
|
14467
14574
|
}());
|
|
@@ -14493,6 +14600,38 @@ var ShortLinks = /** @class */ (function () {
|
|
|
14493
14600
|
ShortLinks.update = function (id, data, params) {
|
|
14494
14601
|
return Requests.processRoute(ShortLinksRoute.routes.updateShortLink, data, { id: id }, params);
|
|
14495
14602
|
};
|
|
14603
|
+
// Uncomment when delete is supported
|
|
14604
|
+
// public static delete<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
14605
|
+
// return Requests.processRoute(ShortLinksRoute.routes.deleteShortLink, {}, { id }, params);
|
|
14606
|
+
// }
|
|
14607
|
+
/**
|
|
14608
|
+
* Get click-summary report
|
|
14609
|
+
* - Example usage: ShortLinks.clickSummary({ short_link_id: 'uuid-here' })
|
|
14610
|
+
*/
|
|
14611
|
+
ShortLinks.clickSummary = function (params) {
|
|
14612
|
+
return Requests.processRoute(ShortLinksRoute.routes.clickSummary, undefined, undefined, params);
|
|
14613
|
+
};
|
|
14614
|
+
/**
|
|
14615
|
+
* Get geo & device breakdown report
|
|
14616
|
+
* - Example usage: ShortLinks.geoDeviceBreakdown({ short_link_id: 'uuid-here' })
|
|
14617
|
+
*/
|
|
14618
|
+
ShortLinks.geoDeviceBreakdown = function (params) {
|
|
14619
|
+
return Requests.processRoute(ShortLinksRoute.routes.geoDeviceBreakdown, undefined, undefined, params);
|
|
14620
|
+
};
|
|
14621
|
+
/**
|
|
14622
|
+
* Get time-series report
|
|
14623
|
+
* - Example usage: ShortLinks.timeSeries({ short_link_id: 'uuid-here', group_by: 'day' })
|
|
14624
|
+
*/
|
|
14625
|
+
ShortLinks.timeSeries = function (params) {
|
|
14626
|
+
return Requests.processRoute(ShortLinksRoute.routes.timeSeries, undefined, undefined, params);
|
|
14627
|
+
};
|
|
14628
|
+
/**
|
|
14629
|
+
* Get referrer & UTM report
|
|
14630
|
+
* - Example usage: ShortLinks.referrerReport({ short_link_id: 'uuid-here' })
|
|
14631
|
+
*/
|
|
14632
|
+
ShortLinks.referrerReport = function (params) {
|
|
14633
|
+
return Requests.processRoute(ShortLinksRoute.routes.referrerReport, undefined, undefined, params);
|
|
14634
|
+
};
|
|
14496
14635
|
return ShortLinks;
|
|
14497
14636
|
}());
|
|
14498
14637
|
|