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
package/dist/cjs/index.js
CHANGED
|
@@ -24275,6 +24275,46 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
24275
24275
|
url: '/titles/{title_id}/chat/messages/{message_id}',
|
|
24276
24276
|
method: HTTP_METHODS.PUT
|
|
24277
24277
|
},
|
|
24278
|
+
// ─────────────────────────────────────────────────────────────────
|
|
24279
|
+
// Purchase/Revenue Endpoints
|
|
24280
|
+
// ─────────────────────────────────────────────────────────────────
|
|
24281
|
+
purchasesList: {
|
|
24282
|
+
url: "/titles/{title_id}/purchases",
|
|
24283
|
+
method: HTTP_METHODS.GET,
|
|
24284
|
+
},
|
|
24285
|
+
purchasesShow: {
|
|
24286
|
+
url: "/titles/{title_id}/purchases/{purchase_id}",
|
|
24287
|
+
method: HTTP_METHODS.GET,
|
|
24288
|
+
},
|
|
24289
|
+
purchasesCreate: {
|
|
24290
|
+
url: "/titles/{title_id}/purchases",
|
|
24291
|
+
method: HTTP_METHODS.POST,
|
|
24292
|
+
},
|
|
24293
|
+
purchasesSummary: {
|
|
24294
|
+
url: "/titles/{title_id}/purchases/summary",
|
|
24295
|
+
method: HTTP_METHODS.GET,
|
|
24296
|
+
},
|
|
24297
|
+
// Advanced analytics sub-routes
|
|
24298
|
+
purchasesTimeReport: {
|
|
24299
|
+
url: "/titles/{title_id}/purchases/reports/time",
|
|
24300
|
+
method: HTTP_METHODS.GET,
|
|
24301
|
+
},
|
|
24302
|
+
purchasesLtv30Report: {
|
|
24303
|
+
url: "/titles/{title_id}/purchases/reports/ltv30",
|
|
24304
|
+
method: HTTP_METHODS.GET,
|
|
24305
|
+
},
|
|
24306
|
+
purchasesCurrencyBreakdown: {
|
|
24307
|
+
url: "/titles/{title_id}/purchases/reports/currency",
|
|
24308
|
+
method: HTTP_METHODS.GET,
|
|
24309
|
+
},
|
|
24310
|
+
purchasesInstallDistribution: {
|
|
24311
|
+
url: "/titles/{title_id}/purchases/reports/install-distribution",
|
|
24312
|
+
method: HTTP_METHODS.GET,
|
|
24313
|
+
},
|
|
24314
|
+
purchasesItemTypeStats: {
|
|
24315
|
+
url: "/titles/{title_id}/purchases/reports/item-type-stats",
|
|
24316
|
+
method: HTTP_METHODS.GET,
|
|
24317
|
+
},
|
|
24278
24318
|
};
|
|
24279
24319
|
return TitlesRoute;
|
|
24280
24320
|
}());
|
|
@@ -24654,6 +24694,69 @@ var Titles = /** @class */ (function () {
|
|
|
24654
24694
|
Titles.chatUpdateMessage = function (title_id, message_id, data) {
|
|
24655
24695
|
return Requests.processRoute(TitlesRoute.routes.chatUpdateMessage, data, { title_id: title_id, message_id: message_id });
|
|
24656
24696
|
};
|
|
24697
|
+
/**
|
|
24698
|
+
* List all purchase events for a specific title.
|
|
24699
|
+
* Matches GET /titles/{title_id}/purchases
|
|
24700
|
+
*/
|
|
24701
|
+
Titles.listPurchases = function (title_id, params) {
|
|
24702
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesList, {}, { title_id: title_id }, params);
|
|
24703
|
+
};
|
|
24704
|
+
/**
|
|
24705
|
+
* Retrieve a single purchase record by ID.
|
|
24706
|
+
* Matches GET /titles/{title_id}/purchases/{purchase_id}
|
|
24707
|
+
*/
|
|
24708
|
+
Titles.viewPurchase = function (title_id, purchase_id, params) {
|
|
24709
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesShow, {}, { title_id: title_id, purchase_id: purchase_id }, params);
|
|
24710
|
+
};
|
|
24711
|
+
/**
|
|
24712
|
+
* Create a new purchase record.
|
|
24713
|
+
* Matches POST /titles/{title_id}/purchases
|
|
24714
|
+
*/
|
|
24715
|
+
Titles.createPurchase = function (title_id, data, params) {
|
|
24716
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesCreate, data, { title_id: title_id }, params);
|
|
24717
|
+
};
|
|
24718
|
+
/**
|
|
24719
|
+
* Get a summary of total revenue, grouped by day or purchase_type.
|
|
24720
|
+
* Matches GET /titles/{title_id}/purchases/summary
|
|
24721
|
+
*/
|
|
24722
|
+
Titles.purchaseSummary = function (title_id, params) {
|
|
24723
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesSummary, {}, { title_id: title_id }, params);
|
|
24724
|
+
};
|
|
24725
|
+
/**
|
|
24726
|
+
* Revenue by time (daily, weekly, or monthly).
|
|
24727
|
+
* Matches GET /titles/{title_id}/purchases/reports/time
|
|
24728
|
+
*/
|
|
24729
|
+
Titles.purchaseRevenueByTime = function (title_id, params) {
|
|
24730
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesTimeReport, {}, { title_id: title_id }, params);
|
|
24731
|
+
};
|
|
24732
|
+
/**
|
|
24733
|
+
* 30-day LTV (Lifetime Value) per install.
|
|
24734
|
+
* Matches GET /titles/{title_id}/purchases/reports/ltv30
|
|
24735
|
+
*/
|
|
24736
|
+
Titles.purchaseLtv30 = function (title_id, params) {
|
|
24737
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesLtv30Report, {}, { title_id: title_id }, params);
|
|
24738
|
+
};
|
|
24739
|
+
/**
|
|
24740
|
+
* Show breakdown of revenue per currency, with optional USD conversion.
|
|
24741
|
+
* Matches GET /titles/{title_id}/purchases/reports/currency
|
|
24742
|
+
*/
|
|
24743
|
+
Titles.purchaseCurrencyBreakdown = function (title_id, params) {
|
|
24744
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesCurrencyBreakdown, {}, { title_id: title_id }, params);
|
|
24745
|
+
};
|
|
24746
|
+
/**
|
|
24747
|
+
* Distribution of installs by total revenue, plus a histogram array.
|
|
24748
|
+
* Matches GET /titles/{title_id}/purchases/reports/install-distribution
|
|
24749
|
+
*/
|
|
24750
|
+
Titles.installRevenueDistribution = function (title_id, params) {
|
|
24751
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesInstallDistribution, {}, { title_id: title_id }, params);
|
|
24752
|
+
};
|
|
24753
|
+
/**
|
|
24754
|
+
* Stats by item SKU, purchase type, and repeat purchase analysis.
|
|
24755
|
+
* Matches GET /titles/{title_id}/purchases/reports/item-type-stats
|
|
24756
|
+
*/
|
|
24757
|
+
Titles.itemAndPurchaseTypeStats = function (title_id, params) {
|
|
24758
|
+
return Requests.processRoute(TitlesRoute.routes.purchasesItemTypeStats, {}, { title_id: title_id }, params);
|
|
24759
|
+
};
|
|
24657
24760
|
return Titles;
|
|
24658
24761
|
}());
|
|
24659
24762
|
|
|
@@ -27646,6 +27749,10 @@ var ShortLinksRoute = /** @class */ (function () {
|
|
|
27646
27749
|
updateShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.PUT },
|
|
27647
27750
|
// Delete can be added if supported
|
|
27648
27751
|
// deleteShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.DELETE }
|
|
27752
|
+
clickSummary: { url: '/shortlinks/reports/click-summary', method: HTTP_METHODS.GET },
|
|
27753
|
+
geoDeviceBreakdown: { url: '/shortlinks/reports/geo-device', method: HTTP_METHODS.GET },
|
|
27754
|
+
timeSeries: { url: '/shortlinks/reports/time-series', method: HTTP_METHODS.GET },
|
|
27755
|
+
referrerReport: { url: '/shortlinks/reports/referrer', method: HTTP_METHODS.GET },
|
|
27649
27756
|
};
|
|
27650
27757
|
return ShortLinksRoute;
|
|
27651
27758
|
}());
|
|
@@ -27677,6 +27784,38 @@ var ShortLinks = /** @class */ (function () {
|
|
|
27677
27784
|
ShortLinks.update = function (id, data, params) {
|
|
27678
27785
|
return Requests.processRoute(ShortLinksRoute.routes.updateShortLink, data, { id: id }, params);
|
|
27679
27786
|
};
|
|
27787
|
+
// Uncomment when delete is supported
|
|
27788
|
+
// public static delete<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
27789
|
+
// return Requests.processRoute(ShortLinksRoute.routes.deleteShortLink, {}, { id }, params);
|
|
27790
|
+
// }
|
|
27791
|
+
/**
|
|
27792
|
+
* Get click-summary report
|
|
27793
|
+
* - Example usage: ShortLinks.clickSummary({ short_link_id: 'uuid-here' })
|
|
27794
|
+
*/
|
|
27795
|
+
ShortLinks.clickSummary = function (params) {
|
|
27796
|
+
return Requests.processRoute(ShortLinksRoute.routes.clickSummary, undefined, undefined, params);
|
|
27797
|
+
};
|
|
27798
|
+
/**
|
|
27799
|
+
* Get geo & device breakdown report
|
|
27800
|
+
* - Example usage: ShortLinks.geoDeviceBreakdown({ short_link_id: 'uuid-here' })
|
|
27801
|
+
*/
|
|
27802
|
+
ShortLinks.geoDeviceBreakdown = function (params) {
|
|
27803
|
+
return Requests.processRoute(ShortLinksRoute.routes.geoDeviceBreakdown, undefined, undefined, params);
|
|
27804
|
+
};
|
|
27805
|
+
/**
|
|
27806
|
+
* Get time-series report
|
|
27807
|
+
* - Example usage: ShortLinks.timeSeries({ short_link_id: 'uuid-here', group_by: 'day' })
|
|
27808
|
+
*/
|
|
27809
|
+
ShortLinks.timeSeries = function (params) {
|
|
27810
|
+
return Requests.processRoute(ShortLinksRoute.routes.timeSeries, undefined, undefined, params);
|
|
27811
|
+
};
|
|
27812
|
+
/**
|
|
27813
|
+
* Get referrer & UTM report
|
|
27814
|
+
* - Example usage: ShortLinks.referrerReport({ short_link_id: 'uuid-here' })
|
|
27815
|
+
*/
|
|
27816
|
+
ShortLinks.referrerReport = function (params) {
|
|
27817
|
+
return Requests.processRoute(ShortLinksRoute.routes.referrerReport, undefined, undefined, params);
|
|
27818
|
+
};
|
|
27680
27819
|
return ShortLinks;
|
|
27681
27820
|
}());
|
|
27682
27821
|
|