@authenty/authapi-types 1.0.39 → 1.0.44

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
@@ -354,12 +354,23 @@ export declare namespace AuthApi {
354
354
  financial: Privilege;
355
355
  };
356
356
  type CronJob = {
357
- startAt: Date | null;
358
- latestRunErrorCount: number;
359
- latestCompletedAt: Date | null;
357
+ id: number;
358
+ name: string;
359
+ active: boolean;
360
+ schedule: string;
361
+ customTimeout_s?: number;
362
+ internalRun: boolean;
363
+ History: CronJobExecution[];
360
364
  };
361
- type CronjobsStatuses = {
362
- purchasesStatusUpdate: CronJob;
365
+ type CronStatus = 'SCHEDULED' | 'RUNNING' | 'BLOCKED' | 'ABORTED' | 'STALED' | 'ERRORED' | 'FINISHED';
366
+ type CronJobExecution = {
367
+ id: number;
368
+ cronId: number;
369
+ CronJob?: CronJob;
370
+ status: CronStatus;
371
+ metaData?: object;
372
+ startedAt: string;
373
+ finishedAt?: string;
363
374
  };
364
375
  type LogFilters = {
365
376
  page: number;
@@ -643,13 +654,14 @@ export declare namespace AuthApi {
643
654
  }
644
655
  }
645
656
  namespace cronJobs {
646
- namespace status {
647
- type GET = auxiliarTypes.CronjobsStatuses;
648
- }
649
- namespace run {
650
- type POST = {
651
- msg: string;
652
- };
657
+ type GET = auxiliarTypes.CronJob[];
658
+ namespace $conId {
659
+ type GET = auxiliarTypes.CronJob;
660
+ namespace run {
661
+ type POST = {
662
+ msg: string;
663
+ };
664
+ }
653
665
  }
654
666
  }
655
667
  namespace aux {
@@ -929,8 +941,8 @@ export declare namespace AuthApi {
929
941
  status: () => Promise<responses.ApiResponse<responses.logs.status.GET>>;
930
942
  };
931
943
  cronJobs: {
932
- status: () => Promise<responses.ApiResponse<auxiliarTypes.CronjobsStatuses>>;
933
- run: (name: string) => Promise<responses.ApiResponse<responses.cronJobs.run.POST>>;
944
+ status: () => Promise<responses.ApiResponse<responses.cronJobs.GET>>;
945
+ run: (id: number) => Promise<responses.ApiResponse<responses.cronJobs.$conId.run.POST>>;
934
946
  };
935
947
  reports: {
936
948
  users: () => Promise<responses.ApiResponse<responses.report.users.GET>>;
package/dist/index.js CHANGED
@@ -259,10 +259,10 @@ var AuthApi;
259
259
  },
260
260
  cronJobs: {
261
261
  status: async () => {
262
- return await this.request('GET', 'admin/cronjobs/status', {});
262
+ return await this.request('GET', 'admin/cronjobs', {});
263
263
  },
264
- run: async (name) => {
265
- return await this.request('POST', `admin/cronjobs/run/${name}`, {});
264
+ run: async (id) => {
265
+ return await this.request('POST', `admin/cronjobs/${id}/run`, {});
266
266
  }
267
267
  },
268
268
  reports: {
@@ -29,5 +29,5 @@ export declare const Privilege: typeof AuthApi.auxiliarTypes.Privilege;
29
29
  export type Privilege = AuthApi.auxiliarTypes.Privilege;
30
30
  export type PrivilegeTable = AuthApi.auxiliarTypes.PrivilegeTable;
31
31
  export type CronJob = AuthApi.auxiliarTypes.CronJob;
32
- export type CronjobsStatuses = AuthApi.auxiliarTypes.CronjobsStatuses;
32
+ export type CronStatus = AuthApi.auxiliarTypes.CronStatus;
33
33
  export type LogFilters = AuthApi.auxiliarTypes.LogFilters;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authenty/authapi-types",
3
- "version": "1.0.39",
3
+ "version": "1.0.44",
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
@@ -398,14 +398,27 @@ export namespace AuthApi {
398
398
  financial: Privilege;
399
399
  }
400
400
 
401
- export type CronJob = { //Também definido em ~/server/src/cronjobs.ts
402
- startAt: Date | null //null se não está rodando
403
- latestRunErrorCount: number //zero se não teve erro
404
- latestCompletedAt: Date | null
401
+ export type CronJob = {
402
+ id: number,
403
+ name: string,
404
+ active: boolean,
405
+ schedule: string,
406
+ customTimeout_s?: number,
407
+ internalRun: boolean,
408
+ // frequence: number
409
+ History: CronJobExecution[]
405
410
  }
406
411
 
407
- export type CronjobsStatuses = {
408
- purchasesStatusUpdate: CronJob
412
+ export type CronStatus = 'SCHEDULED'|'RUNNING'|'BLOCKED'|'ABORTED'|'STALED'|'ERRORED'|'FINISHED';
413
+
414
+ export type CronJobExecution = {
415
+ id: number,
416
+ cronId: number,
417
+ CronJob?: CronJob,
418
+ status: CronStatus,
419
+ metaData?: object,
420
+ startedAt: string,
421
+ finishedAt?: string
409
422
  }
410
423
 
411
424
  export type LogFilters = {
@@ -678,11 +691,14 @@ export namespace AuthApi {
678
691
  }
679
692
 
680
693
  export namespace cronJobs {
681
- export namespace status {
682
- export type GET = auxiliarTypes.CronjobsStatuses;
683
- }
684
- export namespace run {
685
- export type POST = { msg: string };
694
+
695
+ export type GET = auxiliarTypes.CronJob[];
696
+ export namespace $conId {
697
+
698
+ export type GET = auxiliarTypes.CronJob;
699
+ export namespace run {
700
+ export type POST = { msg: string };
701
+ }
686
702
  }
687
703
  }
688
704
 
@@ -1239,10 +1255,10 @@ export namespace AuthApi {
1239
1255
 
1240
1256
  cronJobs: {
1241
1257
  status: async () => {
1242
- return await this.request<responses.cronJobs.status.GET>('GET', 'admin/cronjobs/status', {});
1258
+ return await this.request<responses.cronJobs.GET>('GET', 'admin/cronjobs', {});
1243
1259
  },
1244
- run: async (name: string) => {
1245
- return await this.request<responses.cronJobs.run.POST>('POST', `admin/cronjobs/run/${name}`, {});
1260
+ run: async (id: number) => {
1261
+ return await this.request<responses.cronJobs.$conId.run.POST>('POST', `admin/cronjobs/${id}/run`, {});
1246
1262
  }
1247
1263
  },
1248
1264
 
@@ -35,7 +35,7 @@ export const Privilege = AuthApi.auxiliarTypes.Privilege;
35
35
  export type Privilege = AuthApi.auxiliarTypes.Privilege;
36
36
  export type PrivilegeTable = AuthApi.auxiliarTypes.PrivilegeTable;
37
37
  export type CronJob = AuthApi.auxiliarTypes.CronJob;
38
- export type CronjobsStatuses = AuthApi.auxiliarTypes.CronjobsStatuses;
38
+ export type CronStatus = AuthApi.auxiliarTypes.CronStatus;
39
39
  export type LogFilters = AuthApi.auxiliarTypes.LogFilters;
40
40
 
41
41