@abyss-project/spotlight 1.0.6 → 1.0.9
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/api/project.public.api.d.ts +2 -1
- package/dist/api/project.public.api.js +5 -1
- package/dist/constants/project.constant.d.ts +1 -0
- package/dist/constants/project.constant.js +2 -1
- package/dist/index.js +5 -3
- package/dist/types/interface/api/requests/project.public.request.d.ts +10 -0
- package/dist/types/interface/api/responses/project.public.response.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { IPaginatePublishedProjectPublicResponse, IPaginatePublishedProjectPublicQuery, IGetPublishedProjectPublicResponse, IGetPublishedProjectPublicParams, IGetPublishedBySlugProjectPublicResponse, IGetPublishedBySlugProjectPublicParams, IGetPopularProjectPublicResponse, IPaginatePostProjectPublicParams, IPaginatePostProjectPublicQuery, IPaginatePostProjectPublicResponse, IGeneratePresentationProjectPublicBody, IGeneratePresentationProjectPublicResponse } from '..';
|
|
1
|
+
import { IPaginatePublishedProjectPublicResponse, IPaginatePublishedProjectPublicQuery, IGetPublishedProjectPublicResponse, IGetPublishedProjectPublicParams, IGetPublishedBySlugProjectPublicResponse, IGetPublishedBySlugProjectPublicParams, IGetPopularProjectPublicResponse, IPaginatePostProjectPublicParams, IPaginatePostProjectPublicQuery, IPaginatePostProjectPublicResponse, IGeneratePresentationProjectPublicBody, IGeneratePresentationProjectPublicResponse, IGeneratePostProjectPublicResponse, IGeneratePostProjectPublicBody } from '..';
|
|
2
2
|
export declare const getPublishedProjectPublic: (params: IGetPublishedProjectPublicParams) => Promise<IGetPublishedProjectPublicResponse>;
|
|
3
3
|
export declare const paginatePostProjectPublic: (params: IPaginatePostProjectPublicParams, query: IPaginatePostProjectPublicQuery) => Promise<IPaginatePostProjectPublicResponse>;
|
|
4
4
|
export declare const getPublishedBySlugProjectPublic: (params: IGetPublishedBySlugProjectPublicParams) => Promise<IGetPublishedBySlugProjectPublicResponse>;
|
|
5
5
|
export declare const paginatePublishedProjectPublic: (query: IPaginatePublishedProjectPublicQuery) => Promise<IPaginatePublishedProjectPublicResponse>;
|
|
6
6
|
export declare const getPopularProjectPublic: () => Promise<IGetPopularProjectPublicResponse>;
|
|
7
7
|
export declare const generatePresentationProjectPublic: (body: IGeneratePresentationProjectPublicBody) => Promise<IGeneratePresentationProjectPublicResponse>;
|
|
8
|
+
export declare const generatePostProjectPublic: (body: IGeneratePostProjectPublicBody) => Promise<IGeneratePostProjectPublicResponse>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generatePresentationProjectPublic = exports.getPopularProjectPublic = exports.paginatePublishedProjectPublic = exports.getPublishedBySlugProjectPublic = exports.paginatePostProjectPublic = exports.getPublishedProjectPublic = void 0;
|
|
3
|
+
exports.generatePostProjectPublic = exports.generatePresentationProjectPublic = exports.getPopularProjectPublic = exports.paginatePublishedProjectPublic = exports.getPublishedBySlugProjectPublic = exports.paginatePostProjectPublic = exports.getPublishedProjectPublic = void 0;
|
|
4
4
|
const __1 = require("..");
|
|
5
5
|
const getPublishedProjectPublic = async (params) => {
|
|
6
6
|
return (await __1.AbyssSpotlightCore.axios.get(`project/public/published/${params.projectId}`)).data;
|
|
@@ -26,3 +26,7 @@ const generatePresentationProjectPublic = async (body) => {
|
|
|
26
26
|
return (await __1.AbyssSpotlightCore.axios.post(`project/public/generate-presentation`, body)).data;
|
|
27
27
|
};
|
|
28
28
|
exports.generatePresentationProjectPublic = generatePresentationProjectPublic;
|
|
29
|
+
const generatePostProjectPublic = async (body) => {
|
|
30
|
+
return (await __1.AbyssSpotlightCore.axios.post(`project/public/generate-post`, body)).data;
|
|
31
|
+
};
|
|
32
|
+
exports.generatePostProjectPublic = generatePostProjectPublic;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MINIMUM_DESCRIPTION_LENGTH_TO_GENERATE_PRESENTATION = exports.MAXIMUM_TAGS_LENGTH = exports.MAXIMUM_TAGS_PER_PROJECT = void 0;
|
|
3
|
+
exports.MAXIMUM_DESCRIPTION_LENGTH_TO_GENERATE_PRESENTATION = exports.MINIMUM_DESCRIPTION_LENGTH_TO_GENERATE_PRESENTATION = exports.MAXIMUM_TAGS_LENGTH = exports.MAXIMUM_TAGS_PER_PROJECT = void 0;
|
|
4
4
|
exports.MAXIMUM_TAGS_PER_PROJECT = 5;
|
|
5
5
|
exports.MAXIMUM_TAGS_LENGTH = 36;
|
|
6
6
|
exports.MINIMUM_DESCRIPTION_LENGTH_TO_GENERATE_PRESENTATION = 50;
|
|
7
|
+
exports.MAXIMUM_DESCRIPTION_LENGTH_TO_GENERATE_PRESENTATION = 500;
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
24
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
|
+
var _a;
|
|
27
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
29
|
exports.AbyssSpotlightCore = exports.ADMIN_TOKEN_HEADER = exports.API_KEY_HEADER = void 0;
|
|
29
30
|
const axios_1 = __importDefault(require("axios"));
|
|
@@ -47,9 +48,9 @@ class AbyssSpotlightCore {
|
|
|
47
48
|
retries: NUMBER_RETRY_API,
|
|
48
49
|
retryDelay: (retryCount) => retryCount * BASE_DELAY_BETWEEN_RETRY,
|
|
49
50
|
retryCondition: (error) => {
|
|
50
|
-
var
|
|
51
|
+
var _b;
|
|
51
52
|
return (0, axios_retry_1.isNetworkOrIdempotentRequestError)(error) ||
|
|
52
|
-
RETRY_CODES.includes(((
|
|
53
|
+
RETRY_CODES.includes(((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) || 502);
|
|
53
54
|
},
|
|
54
55
|
...axiosRetryConfig,
|
|
55
56
|
});
|
|
@@ -74,6 +75,7 @@ class AbyssSpotlightCore {
|
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
exports.AbyssSpotlightCore = AbyssSpotlightCore;
|
|
78
|
+
_a = AbyssSpotlightCore;
|
|
77
79
|
AbyssSpotlightCore.config = {
|
|
78
80
|
token: '',
|
|
79
81
|
apiKey: '',
|
|
@@ -82,4 +84,4 @@ AbyssSpotlightCore.config = {
|
|
|
82
84
|
adminToken: '',
|
|
83
85
|
baseURL: DEFAULT_BASE_URL,
|
|
84
86
|
};
|
|
85
|
-
AbyssSpotlightCore.axios = axios_1.default.create({ baseURL:
|
|
87
|
+
AbyssSpotlightCore.axios = axios_1.default.create({ baseURL: _a.config.baseURL });
|
|
@@ -21,5 +21,15 @@ export declare type IPaginatePublishedProjectPublicQuery = {
|
|
|
21
21
|
otherLanguage?: ProjectLanguage[];
|
|
22
22
|
} & QueryPaginate;
|
|
23
23
|
export interface IGeneratePresentationProjectPublicBody {
|
|
24
|
+
title: string;
|
|
24
25
|
description: string;
|
|
25
26
|
}
|
|
27
|
+
export interface IGeneratePostProjectPublicBody {
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
subject: string;
|
|
31
|
+
socialNetworks?: {
|
|
32
|
+
socialNetwork: string;
|
|
33
|
+
url: string;
|
|
34
|
+
}[];
|
|
35
|
+
}
|
|
@@ -39,3 +39,7 @@ export interface IGeneratePresentationProjectPublicData {
|
|
|
39
39
|
content: string;
|
|
40
40
|
}
|
|
41
41
|
export declare type IGeneratePresentationProjectPublicResponse = IResponse<IGeneratePresentationProjectPublicData>;
|
|
42
|
+
export interface IGeneratePostProjectPublicData {
|
|
43
|
+
content: string;
|
|
44
|
+
}
|
|
45
|
+
export declare type IGeneratePostProjectPublicResponse = IResponse<IGeneratePostProjectPublicData>;
|