@authenty/authapi-types 1.0.48 → 1.0.50

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
@@ -280,6 +280,18 @@ export declare namespace AuthApi {
280
280
  referer?: string;
281
281
  };
282
282
  };
283
+ type Article = {
284
+ id: number;
285
+ title: string;
286
+ areas_interesse: string;
287
+ autor: string;
288
+ descricao_autor: string;
289
+ content: string;
290
+ showInSite: boolean;
291
+ thumbnail_url: string | null;
292
+ createdAt: string;
293
+ deletedAt?: string | null;
294
+ };
283
295
  namespace PaymentSystem {
284
296
  type PG_Customer = {
285
297
  id: string;
@@ -352,6 +364,7 @@ export declare namespace AuthApi {
352
364
  adminMaster: Privilege;
353
365
  activityTrakking: Privilege;
354
366
  financial: Privilege;
367
+ articles: Privilege;
355
368
  };
356
369
  type CronJob = {
357
370
  id: number;
@@ -531,6 +544,22 @@ export declare namespace AuthApi {
531
544
  }
532
545
  }
533
546
  }
547
+ namespace article {
548
+ type POST = {
549
+ msg: string;
550
+ article?: objects.Article;
551
+ };
552
+ namespace $articleId {
553
+ type GET = objects.Article;
554
+ type PUT = objects.Article;
555
+ type DELETE = {
556
+ msg: string;
557
+ };
558
+ }
559
+ }
560
+ namespace articles {
561
+ type GET = objects.Article[];
562
+ }
534
563
  namespace bundle {
535
564
  type POST = {
536
565
  msg: string;
@@ -955,6 +984,13 @@ export declare namespace AuthApi {
955
984
  licenseStatus?: objects.PaymentSystem.PG_PurchaseLicenseStatus;
956
985
  }) => Promise<responses.ApiResponse<responses.admin.purchases.search.POST>>;
957
986
  };
987
+ articles: {
988
+ list: () => Promise<responses.ApiResponse<responses.articles.GET>>;
989
+ get: (articleId: number, includeDeleted: boolean) => Promise<responses.ApiResponse<objects.Article>>;
990
+ create: (articleData: objects.Article) => Promise<responses.ApiResponse<responses.article.POST>>;
991
+ update: (articleId: number, articleData: objects.Article) => Promise<responses.ApiResponse<objects.Article>>;
992
+ delete: (articleId: number) => Promise<responses.ApiResponse<responses.article.$articleId.DELETE>>;
993
+ };
958
994
  reports: {
959
995
  users: () => Promise<responses.ApiResponse<responses.report.users.GET>>;
960
996
  usersMonthlyUsage: (iniDate?: string, endDate?: string, userId?: number) => Promise<responses.ApiResponse<responses.report.users.usage.monthly.GET>>;
package/dist/index.js CHANGED
@@ -261,6 +261,23 @@ var AuthApi;
261
261
  return await this.request('POST', 'admin/purchases/search', filters);
262
262
  }
263
263
  },
264
+ articles: {
265
+ list: async () => {
266
+ return await this.request('GET', 'articles', {});
267
+ },
268
+ get: async (articleId, includeDeleted) => {
269
+ return await this.request('GET', `article/${articleId}`, { includeDeleted });
270
+ },
271
+ create: async (articleData) => {
272
+ return await this.request('POST', 'article', articleData);
273
+ },
274
+ update: async (articleId, articleData) => {
275
+ return await this.request('PUT', `article/${articleId}`, articleData);
276
+ },
277
+ delete: async (articleId) => {
278
+ return await this.request('DELETE', `article/${articleId}`, {});
279
+ }
280
+ },
264
281
  reports: {
265
282
  users: async () => {
266
283
  return await this.request('GET', 'report/users', {});
@@ -388,7 +405,7 @@ var AuthApi;
388
405
  const fetchOptions = {
389
406
  method,
390
407
  headers: {
391
- 'Content-Type': 'application/json',
408
+ ...(method !== 'DELETE' ? { 'Content-Type': 'application/json' } : {}),
392
409
  ...headers
393
410
  },
394
411
  credentials: 'include'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authenty/authapi-types",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "description": "Shared types for Authenty API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -302,6 +302,19 @@ export namespace AuthApi {
302
302
  };
303
303
  }
304
304
 
305
+ export type Article = {
306
+ id: number;
307
+ title: string;
308
+ areas_interesse: string;
309
+ autor: string;
310
+ descricao_autor: string;
311
+ content: string;
312
+ showInSite: boolean;
313
+ thumbnail_url: string | null;
314
+ createdAt: string;
315
+ deletedAt?: string | null;
316
+ }
317
+
305
318
  export namespace PaymentSystem {
306
319
 
307
320
  export type PG_Customer = {
@@ -396,6 +409,7 @@ export namespace AuthApi {
396
409
  adminMaster: Privilege;
397
410
  activityTrakking: Privilege;
398
411
  financial: Privilege;
412
+ articles: Privilege;
399
413
  }
400
414
 
401
415
  export type CronJob = {
@@ -574,6 +588,18 @@ export namespace AuthApi {
574
588
  }
575
589
  }
576
590
 
591
+ export namespace article {
592
+ export type POST = { msg: string, article?: objects.Article };
593
+ export namespace $articleId {
594
+ export type GET = objects.Article;
595
+ export type PUT = objects.Article;
596
+ export type DELETE = { msg: string };
597
+ }
598
+ }
599
+
600
+ export namespace articles {
601
+ export type GET = objects.Article[]
602
+ }
577
603
  export namespace bundle {
578
604
  export type POST = { msg: string, Bundle?: objects.Bundle };
579
605
  export namespace $bundleId {
@@ -982,7 +1008,7 @@ export namespace AuthApi {
982
1008
  const fetchOptions: RequestInit = {
983
1009
  method,
984
1010
  headers: {
985
- 'Content-Type': 'application/json',
1011
+ ...(method!=='DELETE' ? {'Content-Type': 'application/json'} : {}),
986
1012
  ...headers
987
1013
  },
988
1014
  credentials: 'include'
@@ -1268,6 +1294,25 @@ export namespace AuthApi {
1268
1294
  }
1269
1295
  },
1270
1296
 
1297
+ articles: {
1298
+
1299
+ list: async () => {
1300
+ return await this.request<responses.articles.GET>('GET', 'articles', {});
1301
+ },
1302
+ get: async (articleId:number, includeDeleted:boolean) => {
1303
+ return await this.request<responses.article.$articleId.GET>('GET', `article/${articleId}`, {includeDeleted});
1304
+ },
1305
+ create: async (articleData: objects.Article) => {
1306
+ return await this.request<responses.article.POST>('POST', 'article', articleData);
1307
+ },
1308
+ update: async (articleId: number, articleData: objects.Article) => {
1309
+ return await this.request<responses.article.$articleId.PUT>('PUT', `article/${articleId}`, articleData);
1310
+ },
1311
+ delete: async (articleId: number) => {
1312
+ return await this.request<responses.article.$articleId.DELETE>('DELETE', `article/${articleId}`,{});
1313
+ }
1314
+ },
1315
+
1271
1316
  reports: {
1272
1317
  users: async () => {
1273
1318
  return await this.request<responses.report.users.GET>('GET', 'report/users', {});