glitch-javascript-sdk 2.5.1 → 2.5.2

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.
@@ -0,0 +1,57 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class DiscordMarketplace {
4
+ /**
5
+ * Search for Discord servers available for sponsorship.
6
+ */
7
+ static listListings<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
8
+ /**
9
+ * List a Discord server in the marketplace (Owner).
10
+ */
11
+ static createListing<T>(data: object): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Get details for a specific server listing.
14
+ */
15
+ static viewListing<T>(id: string): AxiosPromise<Response<T>>;
16
+ /**
17
+ * Update listing settings like price or auto-approve (Owner).
18
+ */
19
+ static updateListing<T>(id: string, data: object): AxiosPromise<Response<T>>;
20
+ /**
21
+ * Remove a server from the marketplace (Owner).
22
+ */
23
+ static deleteListing<T>(id: string): AxiosPromise<Response<T>>;
24
+ /**
25
+ * List sponsored post orders. Use params { mode: 'buyer' | 'seller' }.
26
+ */
27
+ static listOrders<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
28
+ /**
29
+ * Submit a post to a Discord server for sponsorship (Game Developer).
30
+ */
31
+ static createOrder<T>(data: object): AxiosPromise<Response<T>>;
32
+ /**
33
+ * Get details for a specific order.
34
+ */
35
+ static viewOrder<T>(id: string): AxiosPromise<Response<T>>;
36
+ /**
37
+ * Approve and publish a sponsored post (Owner).
38
+ */
39
+ static approveOrder<T>(id: string): AxiosPromise<Response<T>>;
40
+ /**
41
+ * Reject a sponsored post (Owner).
42
+ */
43
+ static rejectOrder<T>(id: string, data: {
44
+ reason: string;
45
+ }): AxiosPromise<Response<T>>;
46
+ /**
47
+ * Request changes to the post content (Owner).
48
+ */
49
+ static requestChanges<T>(id: string, data: {
50
+ reason: string;
51
+ }): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Resubmit a post after making requested changes (Game Developer).
54
+ */
55
+ static resubmitOrder<T>(id: string): AxiosPromise<Response<T>>;
56
+ }
57
+ export default DiscordMarketplace;
@@ -94,5 +94,10 @@ declare class Raffles {
94
94
  * Get viral loop analytics (K-Factor, Cost Per Entry).
95
95
  */
96
96
  static analytics<T>(id: string): AxiosPromise<Response<T>>;
97
+ /**
98
+ * Update a raffle (Game Owner).
99
+ * Handles status transitions (e.g., moving from draft to active).
100
+ */
101
+ static update<T>(id: string, data: object): AxiosPromise<Response<T>>;
97
102
  }
98
103
  export default Raffles;
@@ -39,6 +39,7 @@ import AIUsage from "./AIUsage";
39
39
  import MarketingAgencies from "./MarketingAgencies";
40
40
  import TwitchReporting from "./TwitchReporting";
41
41
  import Raffles from "./Raffles";
42
+ import DiscordMarketplace from "./DiscordMarketplace";
42
43
  export { Ads };
43
44
  export { AccessKeys };
44
45
  export { Auth };
@@ -80,3 +81,4 @@ export { AIUsage };
80
81
  export { MarketingAgencies };
81
82
  export { TwitchReporting };
82
83
  export { Raffles };
84
+ export { DiscordMarketplace };
@@ -39,6 +39,7 @@ import { AIUsage } from "./api";
39
39
  import { MarketingAgencies } from "./api";
40
40
  import { TwitchReporting } from './api';
41
41
  import { Raffles } from './api';
42
+ import { DiscordMarketplace } from './api';
42
43
  import Requests from "./util/Requests";
43
44
  import Parser from "./util/Parser";
44
45
  import Session from "./util/Session";
@@ -99,6 +100,7 @@ declare class Glitch {
99
100
  MarketingAgencies: typeof MarketingAgencies;
100
101
  TwitchReporting: typeof TwitchReporting;
101
102
  Raffles: typeof Raffles;
103
+ DiscordMarketplace: typeof DiscordMarketplace;
102
104
  };
103
105
  static util: {
104
106
  Requests: typeof Requests;
package/dist/esm/index.js CHANGED
@@ -16194,6 +16194,7 @@ var RafflesRoute = /** @class */ (function () {
16194
16194
  list: { url: '/raffles', method: HTTP_METHODS.GET },
16195
16195
  create: { url: '/raffles', method: HTTP_METHODS.POST },
16196
16196
  view: { url: '/raffles/{id}', method: HTTP_METHODS.GET },
16197
+ update: { url: '/raffles/{id}', method: HTTP_METHODS.PUT },
16197
16198
  enter: { url: '/raffles/{id}/enter', method: HTTP_METHODS.POST },
16198
16199
  me: { url: '/raffles/{id}/me', method: HTTP_METHODS.GET },
16199
16200
  performAction: { url: '/raffles/{id}/actions', method: HTTP_METHODS.POST },
@@ -16328,9 +16329,116 @@ var Raffles = /** @class */ (function () {
16328
16329
  Raffles.analytics = function (id) {
16329
16330
  return Requests.processRoute(RafflesRoute.routes.analytics, {}, { id: id });
16330
16331
  };
16332
+ /**
16333
+ * Update a raffle (Game Owner).
16334
+ * Handles status transitions (e.g., moving from draft to active).
16335
+ */
16336
+ Raffles.update = function (id, data) {
16337
+ return Requests.processRoute(RafflesRoute.routes.update, data, { id: id });
16338
+ };
16331
16339
  return Raffles;
16332
16340
  }());
16333
16341
 
16342
+ var DiscordMarketplaceRoute = /** @class */ (function () {
16343
+ function DiscordMarketplaceRoute() {
16344
+ }
16345
+ DiscordMarketplaceRoute.routes = {
16346
+ // Listings
16347
+ listListings: { url: '/discord-marketplace/listings', method: HTTP_METHODS.GET },
16348
+ createListing: { url: '/discord-marketplace/listings', method: HTTP_METHODS.POST },
16349
+ viewListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.GET },
16350
+ updateListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.PUT },
16351
+ deleteListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.DELETE },
16352
+ // Orders
16353
+ listOrders: { url: '/discord-marketplace/orders', method: HTTP_METHODS.GET },
16354
+ createOrder: { url: '/discord-marketplace/orders', method: HTTP_METHODS.POST },
16355
+ viewOrder: { url: '/discord-marketplace/orders/{id}', method: HTTP_METHODS.GET },
16356
+ approveOrder: { url: '/discord-marketplace/orders/{id}/approve', method: HTTP_METHODS.POST },
16357
+ rejectOrder: { url: '/discord-marketplace/orders/{id}/reject', method: HTTP_METHODS.POST },
16358
+ requestChanges: { url: '/discord-marketplace/orders/{id}/request-changes', method: HTTP_METHODS.POST },
16359
+ resubmitOrder: { url: '/discord-marketplace/orders/{id}/resubmit', method: HTTP_METHODS.POST },
16360
+ };
16361
+ return DiscordMarketplaceRoute;
16362
+ }());
16363
+
16364
+ var DiscordMarketplace = /** @class */ (function () {
16365
+ function DiscordMarketplace() {
16366
+ }
16367
+ /**
16368
+ * Search for Discord servers available for sponsorship.
16369
+ */
16370
+ DiscordMarketplace.listListings = function (params) {
16371
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.listListings, undefined, undefined, params);
16372
+ };
16373
+ /**
16374
+ * List a Discord server in the marketplace (Owner).
16375
+ */
16376
+ DiscordMarketplace.createListing = function (data) {
16377
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.createListing, data);
16378
+ };
16379
+ /**
16380
+ * Get details for a specific server listing.
16381
+ */
16382
+ DiscordMarketplace.viewListing = function (id) {
16383
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.viewListing, {}, { id: id });
16384
+ };
16385
+ /**
16386
+ * Update listing settings like price or auto-approve (Owner).
16387
+ */
16388
+ DiscordMarketplace.updateListing = function (id, data) {
16389
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.updateListing, data, { id: id });
16390
+ };
16391
+ /**
16392
+ * Remove a server from the marketplace (Owner).
16393
+ */
16394
+ DiscordMarketplace.deleteListing = function (id) {
16395
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.deleteListing, {}, { id: id });
16396
+ };
16397
+ /**
16398
+ * List sponsored post orders. Use params { mode: 'buyer' | 'seller' }.
16399
+ */
16400
+ DiscordMarketplace.listOrders = function (params) {
16401
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.listOrders, undefined, undefined, params);
16402
+ };
16403
+ /**
16404
+ * Submit a post to a Discord server for sponsorship (Game Developer).
16405
+ */
16406
+ DiscordMarketplace.createOrder = function (data) {
16407
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.createOrder, data);
16408
+ };
16409
+ /**
16410
+ * Get details for a specific order.
16411
+ */
16412
+ DiscordMarketplace.viewOrder = function (id) {
16413
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.viewOrder, {}, { id: id });
16414
+ };
16415
+ /**
16416
+ * Approve and publish a sponsored post (Owner).
16417
+ */
16418
+ DiscordMarketplace.approveOrder = function (id) {
16419
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.approveOrder, {}, { id: id });
16420
+ };
16421
+ /**
16422
+ * Reject a sponsored post (Owner).
16423
+ */
16424
+ DiscordMarketplace.rejectOrder = function (id, data) {
16425
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.rejectOrder, data, { id: id });
16426
+ };
16427
+ /**
16428
+ * Request changes to the post content (Owner).
16429
+ */
16430
+ DiscordMarketplace.requestChanges = function (id, data) {
16431
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.requestChanges, data, { id: id });
16432
+ };
16433
+ /**
16434
+ * Resubmit a post after making requested changes (Game Developer).
16435
+ */
16436
+ DiscordMarketplace.resubmitOrder = function (id) {
16437
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.resubmitOrder, {}, { id: id });
16438
+ };
16439
+ return DiscordMarketplace;
16440
+ }());
16441
+
16334
16442
  var Parser = /** @class */ (function () {
16335
16443
  function Parser() {
16336
16444
  }
@@ -16860,6 +16968,7 @@ var Glitch = /** @class */ (function () {
16860
16968
  MarketingAgencies: MarketingAgencies,
16861
16969
  TwitchReporting: TwitchReporting,
16862
16970
  Raffles: Raffles,
16971
+ DiscordMarketplace: DiscordMarketplace,
16863
16972
  };
16864
16973
  Glitch.util = {
16865
16974
  Requests: Requests,