@abyss-project/main 4.0.0 → 5.0.0

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.
@@ -1,4 +1,4 @@
1
- import { IGetByTokenTokenHistoryAdminParams, IGetByTokenTokenHistoryAdminResponse, IGetTokenHistoryAdminParams, IGetTokenHistoryAdminResponse, IPaginateTokenHistoryAdminQuery, IPaginateTokenHistoryAdminResponse } from '../types';
2
- export declare const getTokenHistoryAdmin: (params: IGetTokenHistoryAdminParams) => Promise<IGetTokenHistoryAdminResponse>;
3
- export declare const getByTokenTokenHistoryAdmin: (params: IGetByTokenTokenHistoryAdminParams) => Promise<IGetByTokenTokenHistoryAdminResponse>;
1
+ import { IGetByTokenTokenHistoryAdminBody, IGetByTokenTokenHistoryAdminResponse, IGetTokenHistoryAdminBody, IGetTokenHistoryAdminResponse, IPaginateTokenHistoryAdminQuery, IPaginateTokenHistoryAdminResponse } from '../types';
2
+ export declare const getTokenHistoryAdmin: (params: IGetTokenHistoryAdminBody) => Promise<IGetTokenHistoryAdminResponse>;
3
+ export declare const getByTokenTokenHistoryAdmin: (params: IGetByTokenTokenHistoryAdminBody) => Promise<IGetByTokenTokenHistoryAdminResponse>;
4
4
  export declare const paginateTokenHistoryAdmin: (query: IPaginateTokenHistoryAdminQuery) => Promise<IPaginateTokenHistoryAdminResponse>;
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateTokenHistoryAdmin = exports.getByTokenTokenHistoryAdmin = exports.getTokenHistoryAdmin = void 0;
4
4
  const __1 = require("..");
5
5
  const getTokenHistoryAdmin = async (params) => {
6
- return (await __1.AbyssCore.axios.get(`token-history/admin/${params.tokenHistoryId}`)).data;
6
+ return (await __1.AbyssCore.axios.post(`token-history/admin/lookup`, params)).data;
7
7
  };
8
8
  exports.getTokenHistoryAdmin = getTokenHistoryAdmin;
9
9
  const getByTokenTokenHistoryAdmin = async (params) => {
10
- return (await __1.AbyssCore.axios.get(`token-history/admin/token/${params.token}`)).data;
10
+ return (await __1.AbyssCore.axios.post(`token-history/admin/token/verify`, params)).data;
11
11
  };
12
12
  exports.getByTokenTokenHistoryAdmin = getByTokenTokenHistoryAdmin;
13
13
  const paginateTokenHistoryAdmin = async (query) => {
@@ -1 +1 @@
1
- {"version":3,"file":"token-history.admin.api.js","sourceRoot":"","sources":["../../src/api/token-history.admin.api.ts"],"names":[],"mappings":";;;AAAA,0BAA+B;AAUxB,MAAM,oBAAoB,GAAG,KAAK,EACvC,MAAmC,EACK,EAAE;IAC1C,OAAO,CACL,MAAM,aAAS,CAAC,KAAK,CAAC,GAAG,CACvB,uBAAuB,MAAM,CAAC,cAAc,EAAE,CAC/C,CACF,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AARW,QAAA,oBAAoB,wBAQ/B;AAEK,MAAM,2BAA2B,GAAG,KAAK,EAC9C,MAA0C,EACK,EAAE;IACjD,OAAO,CACL,MAAM,aAAS,CAAC,KAAK,CAAC,GAAG,CACvB,6BAA6B,MAAM,CAAC,KAAK,EAAE,CAC5C,CACF,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AARW,QAAA,2BAA2B,+BAQtC;AAEK,MAAM,yBAAyB,GAAG,KAAK,EAC5C,KAAsC,EACO,EAAE;IAC/C,OAAO,CACL,MAAM,aAAS,CAAC,KAAK,CAAC,GAAG,CAAqC,8BAA8B,EAAE;QAC5F,MAAM,EAAE,KAAK;KACd,CAAC,CACH,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AARW,QAAA,yBAAyB,6BAQpC"}
1
+ {"version":3,"file":"token-history.admin.api.js","sourceRoot":"","sources":["../../src/api/token-history.admin.api.ts"],"names":[],"mappings":";;;AAAA,0BAA+B;AAcxB,MAAM,oBAAoB,GAAG,KAAK,EACvC,MAAiC,EACO,EAAE;IAC1C,OAAO,CACL,MAAM,aAAS,CAAC,KAAK,CAAC,IAAI,CAAgC,4BAA4B,EAAE,MAAM,CAAC,CAChG,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B;AAEK,MAAM,2BAA2B,GAAG,KAAK,EAC9C,MAAwC,EACO,EAAE;IACjD,OAAO,CACL,MAAM,aAAS,CAAC,KAAK,CAAC,IAAI,CACxB,kCAAkC,EAClC,MAAM,CACP,CACF,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AATW,QAAA,2BAA2B,+BAStC;AAEK,MAAM,yBAAyB,GAAG,KAAK,EAC5C,KAAsC,EACO,EAAE;IAC/C,OAAO,CACL,MAAM,aAAS,CAAC,KAAK,CAAC,GAAG,CAAqC,8BAA8B,EAAE;QAC5F,MAAM,EAAE,KAAK;KACd,CAAC,CACH,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AARW,QAAA,yBAAyB,6BAQpC"}
@@ -1,11 +1,11 @@
1
1
  import { QueryPaginate } from '..';
2
2
  import { TokenType } from '../../../enum';
3
- export interface IGetTokenHistoryAdminParams {
3
+ export interface IGetTokenHistoryAdminBody {
4
4
  tokenHistoryId: string;
5
5
  }
6
6
  export type IPaginateTokenHistoryAdminQuery = {
7
7
  type?: TokenType[];
8
8
  } & QueryPaginate;
9
- export interface IGetByTokenTokenHistoryAdminParams {
9
+ export interface IGetByTokenTokenHistoryAdminBody {
10
10
  token: string;
11
11
  }
@@ -1,12 +1,22 @@
1
- import { BasePaginate, IResponse, ITokenHistory } from '../..';
1
+ import { BasePaginate, IResponse } from '../..';
2
+ import { AbyssService } from '../../../enum';
3
+ import { ExternalIdentityBindingTokenPayload, PublicEmailVerificationTokenPayload, ResetPasswordTokenPayload, UserInvitationTokenPayload } from '../../../session';
4
+ export interface ISafeTokenHistoryAdminListItem {
5
+ createdAt: string;
6
+ }
7
+ export type IPaginateTokenHistoryAdminResponse = IResponse<BasePaginate<ISafeTokenHistoryAdminListItem>>;
8
+ export type ISafeTokenHistoryDecodedToken = (Omit<ResetPasswordTokenPayload, 'tokenHistoryId'> | Omit<UserInvitationTokenPayload, 'tokenHistoryId'> | Omit<PublicEmailVerificationTokenPayload, 'tokenHistoryId'> | Omit<ExternalIdentityBindingTokenPayload, 'tokenHistoryId'>) & {
9
+ emitter: AbyssService;
10
+ iat: number;
11
+ exp: number;
12
+ };
2
13
  export interface IGetTokenHistoryAdminData {
3
- tokenHistory: ITokenHistory;
4
- decodedToken: unknown | null;
14
+ decodedToken: ISafeTokenHistoryDecodedToken | null;
5
15
  }
6
16
  export type IGetTokenHistoryAdminResponse = IResponse<IGetTokenHistoryAdminData>;
7
- export type IPaginateTokenHistoryAdminResponse = IResponse<BasePaginate<ITokenHistory>>;
8
17
  export interface IGetByTokenTokenHistoryAdminData {
9
- tokenHistory: ITokenHistory;
10
- decodedToken: unknown | null;
18
+ decodedToken: {
19
+ email?: string;
20
+ } | null;
11
21
  }
12
22
  export type IGetByTokenTokenHistoryAdminResponse = IResponse<IGetByTokenTokenHistoryAdminData>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/main",
3
- "version": "4.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "Core package to interact with Abyss-Project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",