@chanomhub/sdk 1.2.7 → 1.2.8

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
@@ -31,7 +31,7 @@
31
31
  * ```
32
32
  */
33
33
  import { type GraphQLFetcher } from './client';
34
- import { type ArticleRepository, type FavoritesRepository, type UsersRepository, type SearchRepository, type AuthRepository, type DownloadsRepository, type SubscriptionsRepository } from './repositories';
34
+ import { type ArticleRepository, type FavoritesRepository, type UsersRepository, type SearchRepository, type AuthRepository, type DownloadsRepository, type SubscriptionsRepository, type ModsRepository } from './repositories';
35
35
  import { type ChanomhubConfig } from './config';
36
36
  export * from './types';
37
37
  export * from './config';
@@ -53,6 +53,8 @@ export interface ChanomhubClient {
53
53
  downloads: DownloadsRepository;
54
54
  /** Subscriptions operations */
55
55
  subscriptions: SubscriptionsRepository;
56
+ /** Mods operations */
57
+ mods: ModsRepository;
56
58
  /** Raw GraphQL fetcher for custom queries */
57
59
  graphql: GraphQLFetcher;
58
60
  /** SDK configuration */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAyC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,EAQH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhE,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AA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AACzB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE3F,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC5B,yBAAyB;IACzB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,2BAA2B;IAC3B,SAAS,EAAE,mBAAmB,CAAC;IAC/B,8BAA8B;IAC9B,KAAK,EAAE,eAAe,CAAC;IACvB,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,qEAAqE;IACrE,IAAI,EAAE,cAAc,CAAC;IACrB,sCAAsC;IACtC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,+BAA+B;IAC/B,aAAa,EAAE,uBAAuB,CAAC;IACvC,sBAAsB;IACtB,IAAI,EAAE,cAAc,CAAC;IACrB,6CAA6C;IAC7C,OAAO,EAAE,cAAc,CAAC;IACxB,wBAAwB;IACxB,MAAM,EAAE,eAAe,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,eAAe,CA6B5F;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,GACtC,eAAe,CAMjB;AAGD,eAAe,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -96,6 +96,7 @@ function createChanomhubClient(config = {}) {
96
96
  const auth = (0, repositories_1.createAuthRepository)(rest, fullConfig);
97
97
  const downloads = (0, repositories_1.createDownloadsRepository)(rest, fullConfig);
98
98
  const subscriptions = (0, repositories_1.createSubscriptionsRepository)(rest, fullConfig);
99
+ const mods = (0, repositories_1.createModsRepository)(rest, fullConfig);
99
100
  return {
100
101
  articles,
101
102
  favorites,
@@ -104,6 +105,7 @@ function createChanomhubClient(config = {}) {
104
105
  auth,
105
106
  downloads,
106
107
  subscriptions,
108
+ mods,
107
109
  graphql,
108
110
  config: fullConfig,
109
111
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;;;;;;;;;;;;;;;AAuEH,sDA2BC;AAUD,8DASC;AAnHD,qCAAsF;AACtF,iDAewB;AACxB,qCAAgE;AAEhE,kBAAkB;AAClB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,kDAA2F;AAAlF,2GAAA,eAAe,OAAA;AAAE,0GAAA,cAAc,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAwB3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,qBAAqB,CAAC,SAAmC,EAAE;IACvE,MAAM,UAAU,GAAoB;QAChC,GAAG,uBAAc;QACjB,GAAG,MAAM;KACZ,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,IAAA,yBAAgB,EAAC,UAAU,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAA,sCAAuB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,IAAA,wCAAyB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,IAAA,oCAAqB,EAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAA,qCAAsB,EAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,IAAA,mCAAoB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,IAAA,wCAAyB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,IAAA,4CAA6B,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAEtE,OAAO;QACH,QAAQ;QACR,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,qCAAsB,EAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,IAAA,mCAAoB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,IAAA,wCAAyB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,IAAA,4CAA6B,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,IAAA,mCAAoB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAEpD,OAAO;QACH,QAAQ;QACR,SAAS;QACT,KAAK;QACL,MAAM;QACN,IAAI;QACJ,SAAS;QACT,aAAa;QACb,IAAI;QACJ,OAAO;QACP,MAAM,EAAE,UAAU;KACrB,CAAC;AACN,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,yBAAyB,CACrC,KAAa,EACb,SAAmC,EAAE;IAErC,OAAO,qBAAqB,CAAC;QACzB,GAAG,MAAM;QACT,KAAK;QACL,mBAAmB,EAAE,CAAC,EAAE,2CAA2C;KACtE,CAAC,CAAC;AACP,CAAC;AAED,iBAAiB;AACjB,kBAAe,qBAAqB,CAAC"}
@@ -8,4 +8,5 @@ export { createSearchRepository, type SearchRepository, type SearchOptions, } fr
8
8
  export { createAuthRepository, type AuthRepository } from './authRepository';
9
9
  export { createDownloadsRepository, type DownloadsRepository } from './downloadsRepository';
10
10
  export { createSubscriptionsRepository, type SubscriptionsRepository, } from './subscriptionsRepository';
11
+ export { createModsRepository, type ModsRepository } from './modsRepository';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../repositories/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EACH,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACH,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EACH,6BAA6B,EAC7B,KAAK,uBAAuB,GAC/B,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../repositories/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EACH,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACH,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EACH,6BAA6B,EAC7B,KAAK,uBAAuB,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * Chanomhub SDK - Repositories Index
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createSubscriptionsRepository = exports.createDownloadsRepository = exports.createAuthRepository = exports.createSearchRepository = exports.createUsersRepository = exports.createFavoritesRepository = exports.createArticleRepository = void 0;
6
+ exports.createModsRepository = exports.createSubscriptionsRepository = exports.createDownloadsRepository = exports.createAuthRepository = exports.createSearchRepository = exports.createUsersRepository = exports.createFavoritesRepository = exports.createArticleRepository = void 0;
7
7
  var articleRepository_1 = require("./articleRepository");
8
8
  Object.defineProperty(exports, "createArticleRepository", { enumerable: true, get: function () { return articleRepository_1.createArticleRepository; } });
9
9
  var favoritesRepository_1 = require("./favoritesRepository");
@@ -18,4 +18,6 @@ var downloadsRepository_1 = require("./downloadsRepository");
18
18
  Object.defineProperty(exports, "createDownloadsRepository", { enumerable: true, get: function () { return downloadsRepository_1.createDownloadsRepository; } });
19
19
  var subscriptionsRepository_1 = require("./subscriptionsRepository");
20
20
  Object.defineProperty(exports, "createSubscriptionsRepository", { enumerable: true, get: function () { return subscriptionsRepository_1.createSubscriptionsRepository; } });
21
+ var modsRepository_1 = require("./modsRepository");
22
+ Object.defineProperty(exports, "createModsRepository", { enumerable: true, get: function () { return modsRepository_1.createModsRepository; } });
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../repositories/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yDAAsF;AAA7E,4HAAA,uBAAuB,OAAA;AAChC,6DAI+B;AAH3B,gIAAA,yBAAyB,OAAA;AAI7B,qDAAgF;AAAvE,wHAAA,qBAAqB,OAAA;AAC9B,uDAI4B;AAHxB,0HAAA,sBAAsB,OAAA;AAI1B,mDAA6E;AAApE,sHAAA,oBAAoB,OAAA;AAC7B,6DAA4F;AAAnF,gIAAA,yBAAyB,OAAA;AAClC,qEAGmC;AAF/B,wIAAA,6BAA6B,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../repositories/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yDAAsF;AAA7E,4HAAA,uBAAuB,OAAA;AAChC,6DAI+B;AAH3B,gIAAA,yBAAyB,OAAA;AAI7B,qDAAgF;AAAvE,wHAAA,qBAAqB,OAAA;AAC9B,uDAI4B;AAHxB,0HAAA,sBAAsB,OAAA;AAI1B,mDAA6E;AAApE,sHAAA,oBAAoB,OAAA;AAC7B,6DAA4F;AAAnF,gIAAA,yBAAyB,OAAA;AAClC,qEAGmC;AAF/B,wIAAA,6BAA6B,OAAA;AAGjC,mDAA6E;AAApE,sHAAA,oBAAoB,OAAA"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Chanomhub SDK - Mods Repository
3
+ */
4
+ import type { RestFetcher } from '../client';
5
+ import type { ChanomhubConfig } from '../config';
6
+ import type { Mod } from '../types/common';
7
+ import type { CreateModDTO } from '../types/mod';
8
+ export interface ModsRepository {
9
+ /**
10
+ * Create a new mod for an article
11
+ * @param slug - Article slug
12
+ * @param data - Mod data
13
+ * @returns Created mod
14
+ */
15
+ create(slug: string, data: CreateModDTO): Promise<Mod>;
16
+ }
17
+ /**
18
+ * Creates a mods repository with the given REST client
19
+ */
20
+ export declare function createModsRepository(fetcher: RestFetcher, config: ChanomhubConfig): ModsRepository;
21
+ //# sourceMappingURL=modsRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modsRepository.d.ts","sourceRoot":"","sources":["../../repositories/modsRepository.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,MAAM,WAAW,cAAc;IAC3B;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAC1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,eAAe,GACxB,cAAc,CA8BhB"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /**
3
+ * Chanomhub SDK - Mods Repository
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createModsRepository = createModsRepository;
7
+ const errors_1 = require("../errors");
8
+ /**
9
+ * Creates a mods repository with the given REST client
10
+ */
11
+ function createModsRepository(fetcher, config) {
12
+ function requireAuth() {
13
+ if (!config.token) {
14
+ throw new errors_1.AuthenticationError('Authentication required for mods management. Use createAuthenticatedClient() or provide a token.');
15
+ }
16
+ }
17
+ async function create(slug, data) {
18
+ requireAuth();
19
+ const { data: response, error } = await fetcher(`/api/mods/article/${slug}`, {
20
+ method: 'POST',
21
+ body: data,
22
+ });
23
+ if (error || !response) {
24
+ throw new Error(error || 'Failed to create mod');
25
+ }
26
+ return response.mod;
27
+ }
28
+ return {
29
+ create,
30
+ };
31
+ }
32
+ //# sourceMappingURL=modsRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modsRepository.js","sourceRoot":"","sources":["../../repositories/modsRepository.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAqBH,oDAiCC;AAhDD,sCAAgD;AAYhD;;GAEG;AACH,SAAgB,oBAAoB,CAChC,OAAoB,EACpB,MAAuB;IAEvB,SAAS,WAAW;QAChB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,4BAAmB,CACzB,kGAAkG,CACrG,CAAC;QACN,CAAC;IACL,CAAC;IAED,KAAK,UAAU,MAAM,CAAC,IAAY,EAAE,IAAkB;QAClD,WAAW,EAAE,CAAC;QAEd,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,OAAO,CAC3C,qBAAqB,IAAI,EAAE,EAC3B;YACI,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAA0C;SACnD,CACJ,CAAC;QAEF,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,KAAK,IAAI,sBAAsB,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,QAAQ,CAAC,GAAG,CAAC;IACxB,CAAC;IAED,OAAO;QACH,MAAM;KACT,CAAC;AACN,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Chanomhub SDK - Mods Repository
3
+ */
4
+ import type { RestFetcher } from '../client';
5
+ import type { ChanomhubConfig } from '../config';
6
+ import type { Mod } from '../types/common';
7
+ import type { CreateModDTO } from '../types/mod';
8
+ export interface ModsRepository {
9
+ /**
10
+ * Create a new mod
11
+ * @param data - Mod data
12
+ * @returns Created mod
13
+ */
14
+ create(data: CreateModDTO): Promise<Mod>;
15
+ }
16
+ /**
17
+ * Creates a mods repository with the given REST client
18
+ */
19
+ export declare function createModsRepository(fetcher: RestFetcher, config: ChanomhubConfig): ModsRepository;
20
+ //# sourceMappingURL=modsRepository.temp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modsRepository.temp.d.ts","sourceRoot":"","sources":["../../repositories/modsRepository.temp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,MAAM,WAAW,cAAc;IAC3B;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,eAAe,GACxB,cAAc,CAuChB"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * Chanomhub SDK - Mods Repository
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createModsRepository = createModsRepository;
7
+ const errors_1 = require("../errors");
8
+ /**
9
+ * Creates a mods repository with the given REST client
10
+ */
11
+ function createModsRepository(fetcher, config) {
12
+ function requireAuth() {
13
+ if (!config.token) {
14
+ throw new errors_1.AuthenticationError('Authentication required for mods management. Use createAuthenticatedClient() or provide a token.');
15
+ }
16
+ }
17
+ async function create(data) {
18
+ requireAuth();
19
+ // The endpoint is /api/mods/article/:slug but the DTO has articleId.
20
+ // Wait, the frontend code used: /api/mods/article/${slug}
21
+ // But the DTO in frontend has articleId: number.
22
+ // The Articles API usually takes slug or ID.
23
+ // Let's check how we can get slug if we only have ID, OR if there is an endpoint that takes ID.
24
+ // If the SDK structure follows the existing pattern, maybe we should ask for slug in create() arguments?
25
+ // The frontend `AddModDialog` has `slug` available.
26
+ // So `create(slug: string, data: CreateModDTO)` would be better.
27
+ // But let's look at `data`.
28
+ // Actually, looking at existing repositories, `create` usually takes just DTO.
29
+ // But if the route depends on slug, we need it.
30
+ // Let's assume we change signature to `create(slug: string, data: CreateModDTO)`.
31
+ throw new Error("Method not implemented correctly yet - checking path requirements");
32
+ }
33
+ return {
34
+ create: async (data) => {
35
+ // We need slug to call /api/mods/article/:slug
36
+ // If CreateModDTO doesn't have slug, we are in trouble unless we change the API or the DTO.
37
+ // The frontend passes `slug` to `AddModDialog`.
38
+ // So I should probably include `slug` in `CreateModDTO` or as an argument.
39
+ // Let's modify the interface to accept slug.
40
+ throw new Error("Invalid usage. See updated implementation below.");
41
+ }
42
+ };
43
+ }
44
+ //# sourceMappingURL=modsRepository.temp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modsRepository.temp.js","sourceRoot":"","sources":["../../repositories/modsRepository.temp.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAoBH,oDA0CC;AAxDD,sCAAgD;AAWhD;;GAEG;AACH,SAAgB,oBAAoB,CAChC,OAAoB,EACpB,MAAuB;IAEvB,SAAS,WAAW;QAChB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,4BAAmB,CACzB,kGAAkG,CACrG,CAAC;QACN,CAAC;IACL,CAAC;IAED,KAAK,UAAU,MAAM,CAAC,IAAkB;QACpC,WAAW,EAAE,CAAC;QAEd,qEAAqE;QACrE,0DAA0D;QAC1D,iDAAiD;QACjD,8CAA8C;QAC9C,gGAAgG;QAChG,yGAAyG;QACzG,oDAAoD;QACpD,iEAAiE;QACjE,4BAA4B;QAE5B,+EAA+E;QAC/E,gDAAgD;QAChD,kFAAkF;QAElF,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACzF,CAAC;IAED,OAAO;QACH,MAAM,EAAE,KAAK,EAAE,IAAkB,EAAE,EAAE;YACjC,+CAA+C;YAC/C,4FAA4F;YAC5F,gDAAgD;YAChD,2EAA2E;YAC3E,6CAA6C;YAC7C,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACxE,CAAC;KACJ,CAAC;AACN,CAAC"}
@@ -8,4 +8,5 @@ export type { SocialMediaLink } from './user';
8
8
  export * from './auth';
9
9
  export * from './download';
10
10
  export * from './subscription';
11
+ export * from './mod';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,OAAO,CAAC"}
@@ -23,4 +23,5 @@ __exportStar(require("./user"), exports);
23
23
  __exportStar(require("./auth"), exports);
24
24
  __exportStar(require("./download"), exports);
25
25
  __exportStar(require("./subscription"), exports);
26
+ __exportStar(require("./mod"), exports);
26
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AAEvB,yCAAuB;AACvB,6CAA2B;AAC3B,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AAEvB,yCAAuB;AACvB,6CAA2B;AAC3B,iDAA+B;AAC/B,wCAAsB"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Chanomhub SDK - Mod Types
3
+ */
4
+ import type { Mod } from './common';
5
+ /** DTO for creating a new mod */
6
+ export interface CreateModDTO {
7
+ name: string;
8
+ version: string;
9
+ articleId: number;
10
+ articleVersion: number;
11
+ type: string;
12
+ description: string;
13
+ downloadLink?: string;
14
+ creditTo?: string;
15
+ categories?: string[];
16
+ tags?: string[];
17
+ images?: any;
18
+ }
19
+ /** DTO for updating a mod */
20
+ export interface UpdateModDTO {
21
+ name?: string;
22
+ version?: string;
23
+ type?: string;
24
+ description?: string;
25
+ downloadLink?: string;
26
+ creditTo?: string;
27
+ categories?: string[];
28
+ tags?: string[];
29
+ }
30
+ export { Mod };
31
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../types/mod.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,iCAAiC;AACjC,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,6BAA6B;AAC7B,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,OAAO,EAAE,GAAG,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Chanomhub SDK - Mod Types
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=mod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../types/mod.ts"],"names":[],"mappings":";AAAA;;GAEG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chanomhub/sdk",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "ChanomHub SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",