glitch-javascript-sdk 2.0.4 → 2.0.5

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 CHANGED
@@ -19079,6 +19079,60 @@ var Auth = /** @class */ (function () {
19079
19079
  return Auth;
19080
19080
  }());
19081
19081
 
19082
+ var AccessKeysRoute = /** @class */ (function () {
19083
+ function AccessKeysRoute() {
19084
+ }
19085
+ AccessKeysRoute.routes = {
19086
+ list: { url: '/titles/{title_id}/keys', method: HTTP_METHODS.GET },
19087
+ store: { url: '/titles/{title_id}/keys', method: HTTP_METHODS.POST },
19088
+ delete: { url: '/keys/{key_id}', method: HTTP_METHODS.DELETE },
19089
+ };
19090
+ return AccessKeysRoute;
19091
+ }());
19092
+
19093
+ var AccessKeys = /** @class */ (function () {
19094
+ function AccessKeys() {
19095
+ }
19096
+ /**
19097
+ * List all access keys for a given title.
19098
+ *
19099
+ * @see https://api.glitch.fun/api/documentation#/Access%20Keys/get_titles__title_id__keys
19100
+ *
19101
+ * @param title_id The UUID of the title.
19102
+ * @param params Optional query parameters for pagination.
19103
+ * @returns promise
19104
+ */
19105
+ AccessKeys.list = function (title_id, params) {
19106
+ return Requests.processRoute(AccessKeysRoute.routes.list, undefined, { title_id: title_id }, params);
19107
+ };
19108
+ /**
19109
+ * Bulk create access keys from a string of codes.
19110
+ *
19111
+ * @see https://api.glitch.fun/api/documentation#/Access%20Keys/post_titles__title_id__keys
19112
+ *
19113
+ * @param title_id The UUID of the title.
19114
+ * @param data The platform and codes to upload.
19115
+ * @param data.platform The platform for the keys (e.g., 'steam').
19116
+ * @param data.codes A string of codes separated by newlines, commas, or spaces.
19117
+ * @returns Promise
19118
+ */
19119
+ AccessKeys.store = function (title_id, data, params) {
19120
+ return Requests.processRoute(AccessKeysRoute.routes.store, data, { title_id: title_id }, params);
19121
+ };
19122
+ /**
19123
+ * Deletes an unassigned access key.
19124
+ *
19125
+ * @see https://api.glitch.fun/api/documentation#/Access%20Keys/delete_keys__key_id_
19126
+ *
19127
+ * @param key_id The UUID of the access key to delete.
19128
+ * @returns promise
19129
+ */
19130
+ AccessKeys.delete = function (key_id, params) {
19131
+ return Requests.processRoute(AccessKeysRoute.routes.delete, {}, { key_id: key_id }, params);
19132
+ };
19133
+ return AccessKeys;
19134
+ }());
19135
+
19082
19136
  var CompetitionRoutes = /** @class */ (function () {
19083
19137
  function CompetitionRoutes() {
19084
19138
  }
@@ -24275,6 +24329,7 @@ var TitlesRoute = /** @class */ (function () {
24275
24329
  url: '/titles/{title_id}/chat/messages/{message_id}',
24276
24330
  method: HTTP_METHODS.PUT
24277
24331
  },
24332
+ importKeys: { url: '/titles/{title_id}/import-keys', method: HTTP_METHODS.POST },
24278
24333
  // ─────────────────────────────────────────────────────────────────
24279
24334
  // Purchase/Revenue Endpoints
24280
24335
  // ─────────────────────────────────────────────────────────────────
@@ -24757,6 +24812,22 @@ var Titles = /** @class */ (function () {
24757
24812
  Titles.itemAndPurchaseTypeStats = function (title_id, params) {
24758
24813
  return Requests.processRoute(TitlesRoute.routes.purchasesItemTypeStats, {}, { title_id: title_id }, params);
24759
24814
  };
24815
+ /**
24816
+ * Bulk import access keys for a title from a CSV or Excel file.
24817
+ * The file must contain 'platform' and 'code' columns.
24818
+ *
24819
+ * @see https://api.glitch.fun/api/documentation#/Titles/importTitleKeys
24820
+ *
24821
+ * @param title_id The UUID of the title.
24822
+ * @param file The CSV or Excel file to upload.
24823
+ * @param data Optional additional form data.
24824
+ * @param params Optional query parameters.
24825
+ * @returns AxiosPromise
24826
+ */
24827
+ Titles.importKeys = function (title_id, file, data, params) {
24828
+ var url = TitlesRoute.routes.importKeys.url.replace("{title_id}", title_id);
24829
+ return Requests.uploadFile(url, "file", file, data, params);
24830
+ };
24760
24831
  return Titles;
24761
24832
  }());
24762
24833
 
@@ -24829,6 +24900,7 @@ var CampaignsRoute = /** @class */ (function () {
24829
24900
  getSourcedCreators: { url: '/campaigns/{campaign_id}/sourcing/creators', method: HTTP_METHODS.GET },
24830
24901
  getSourcedCreator: { url: '/campaigns/{campaign_id}/sourcing/creators/{sourced_creator_id}', method: HTTP_METHODS.GET },
24831
24902
  updateSourcedCreator: { url: '/campaigns/{campaign_id}/sourcing/creators/{sourced_creator_id}', method: HTTP_METHODS.PUT },
24903
+ assignKeyToInfluencer: { url: '/campaigns/{campaign_id}/influencers/{user_id}/assign-key', method: HTTP_METHODS.POST },
24832
24904
  };
24833
24905
  return CampaignsRoute;
24834
24906
  }());
@@ -25560,6 +25632,21 @@ var Campaigns = /** @class */ (function () {
25560
25632
  Campaigns.updateSourcedCreator = function (campaign_id, sourced_creator_id, data) {
25561
25633
  return Requests.processRoute(CampaignsRoute.routes.updateSourcedCreator, data, { campaign_id: campaign_id, sourced_creator_id: sourced_creator_id });
25562
25634
  };
25635
+ /**
25636
+ * Assigns an available access key to an influencer for a specific campaign.
25637
+ * This will find the next available key for the given platform and assign it.
25638
+ *
25639
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/assignKey
25640
+ *
25641
+ * @param campaign_id The ID of the campaign.
25642
+ * @param user_id The ID of the user (influencer).
25643
+ * @param data The platform for which to assign a key.
25644
+ * @param data.platform The platform of the key to assign (e.g., 'steam').
25645
+ * @returns promise
25646
+ */
25647
+ Campaigns.assignKeyToInfluencer = function (campaign_id, user_id, data, params) {
25648
+ return Requests.processRoute(CampaignsRoute.routes.assignKeyToInfluencer, data, { campaign_id: campaign_id, user_id: user_id }, params);
25649
+ };
25563
25650
  return Campaigns;
25564
25651
  }());
25565
25652
 
@@ -28566,6 +28653,7 @@ var Glitch = /** @class */ (function () {
28566
28653
  };
28567
28654
  Glitch.api = {
28568
28655
  Ads: Ads,
28656
+ AccessKeys: AccessKeys,
28569
28657
  Auth: Auth,
28570
28658
  Campaigns: Campaigns,
28571
28659
  Competitions: Competitions,