apexify.js 4.8.2 → 4.8.3
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/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/ai/ApexAI.ts +4 -4
- package/lib/ai/ApexModules.ts +8 -8
- package/lib/ai/modals/electronHub/chatmodels.ts +1 -1
- package/lib/ai/modals/electronHub/imageModels.ts +2 -2
- package/lib/ai/modals/electronHub/speechModels.ts +1 -1
- package/lib/ai/utils.ts +3 -3
- package/lib/canvas/ApexPainter.ts +1 -1
- package/lib/canvas/utils/Background/bg.ts +1 -1
- package/lib/canvas/utils/Charts/charts.ts +1 -1
- package/lib/canvas/utils/Custom/customLines.ts +2 -2
- package/lib/canvas/utils/General/general functions.ts +1 -1
- package/lib/canvas/utils/Image/imageProperties.ts +1 -1
- package/lib/canvas/utils/Texts/textProperties.ts +1 -1
- package/lib/canvas/utils/utils.ts +8 -8
- package/lib/index.ts +5 -5
- package/lib/utils.ts +3 -3
- package/package.json +5 -5
- package/dist/cjs/ai/ApexAI.d.ts +0 -144
- package/dist/cjs/ai/ApexAI.js +0 -486
- package/dist/cjs/ai/ApexModules.d.ts +0 -52
- package/dist/cjs/ai/ApexModules.js +0 -811
- package/dist/cjs/ai/functions/readFiles.d.ts +0 -1
- package/dist/cjs/ai/functions/readFiles.js +0 -56
- package/dist/cjs/ai/functions/tokenizer.d.ts +0 -9
- package/dist/cjs/ai/functions/tokenizer.js +0 -60
- package/dist/cjs/ai/functions/validOptions.d.ts +0 -21
- package/dist/cjs/ai/functions/validOptions.js +0 -93
- package/dist/cjs/ai/modals/electronHub/chatmodels.d.ts +0 -6
- package/dist/cjs/ai/modals/electronHub/chatmodels.js +0 -44
- package/dist/cjs/ai/modals/electronHub/imageModels.d.ts +0 -11
- package/dist/cjs/ai/modals/electronHub/imageModels.js +0 -85
- package/dist/cjs/ai/modals/electronHub/songModels.d.ts +0 -1
- package/dist/cjs/ai/modals/electronHub/songModels.js +0 -1
- package/dist/cjs/ai/modals/electronHub/speechModels.d.ts +0 -6
- package/dist/cjs/ai/modals/electronHub/speechModels.js +0 -56
- package/dist/cjs/ai/modals/electronHub/videoModels.d.ts +0 -5
- package/dist/cjs/ai/modals/electronHub/videoModels.js +0 -56
- package/dist/cjs/ai/modals/groq/chatgroq.d.ts +0 -8
- package/dist/cjs/ai/modals/groq/chatgroq.js +0 -57
- package/dist/cjs/ai/modals/groq/imageAnalyzer.d.ts +0 -7
- package/dist/cjs/ai/modals/groq/imageAnalyzer.js +0 -75
- package/dist/cjs/ai/modals/groq/whisper.d.ts +0 -4
- package/dist/cjs/ai/modals/groq/whisper.js +0 -101
- package/dist/cjs/ai/modals/hercai/chatModels.d.ts +0 -6
- package/dist/cjs/ai/modals/hercai/chatModels.js +0 -19
- package/dist/cjs/ai/utils.d.ts +0 -4
- package/dist/cjs/ai/utils.js +0 -4
- package/dist/cjs/canvas/ApexPainter.d.ts +0 -144
- package/dist/cjs/canvas/ApexPainter.js +0 -900
- package/dist/cjs/canvas/utils/Background/bg.d.ts +0 -30
- package/dist/cjs/canvas/utils/Background/bg.js +0 -151
- package/dist/cjs/canvas/utils/Charts/charts.d.ts +0 -7
- package/dist/cjs/canvas/utils/Charts/charts.js +0 -455
- package/dist/cjs/canvas/utils/Custom/customLines.d.ts +0 -2
- package/dist/cjs/canvas/utils/Custom/customLines.js +0 -105
- package/dist/cjs/canvas/utils/General/conversion.d.ts +0 -5
- package/dist/cjs/canvas/utils/General/conversion.js +0 -26
- package/dist/cjs/canvas/utils/General/general functions.d.ts +0 -38
- package/dist/cjs/canvas/utils/General/general functions.js +0 -590
- package/dist/cjs/canvas/utils/Image/imageProperties.d.ts +0 -114
- package/dist/cjs/canvas/utils/Image/imageProperties.js +0 -590
- package/dist/cjs/canvas/utils/Texts/textProperties.d.ts +0 -16
- package/dist/cjs/canvas/utils/Texts/textProperties.js +0 -154
- package/dist/cjs/canvas/utils/types.d.ts +0 -621
- package/dist/cjs/canvas/utils/types.js +0 -5
- package/dist/cjs/canvas/utils/utils.d.ts +0 -18
- package/dist/cjs/canvas/utils/utils.js +0 -17
- package/dist/cjs/index.d.ts +0 -28
- package/dist/cjs/index.js +0 -67
- package/dist/cjs/utils.d.ts +0 -4
- package/dist/cjs/utils.js +0 -4
- package/dist/esm/ai/ApexAI.d.ts +0 -144
- package/dist/esm/ai/ApexAI.js +0 -486
- package/dist/esm/ai/ApexModules.d.ts +0 -52
- package/dist/esm/ai/ApexModules.js +0 -811
- package/dist/esm/ai/functions/readFiles.d.ts +0 -1
- package/dist/esm/ai/functions/readFiles.js +0 -56
- package/dist/esm/ai/functions/tokenizer.d.ts +0 -9
- package/dist/esm/ai/functions/tokenizer.js +0 -60
- package/dist/esm/ai/functions/validOptions.d.ts +0 -21
- package/dist/esm/ai/functions/validOptions.js +0 -93
- package/dist/esm/ai/modals/electronHub/chatmodels.d.ts +0 -6
- package/dist/esm/ai/modals/electronHub/chatmodels.js +0 -44
- package/dist/esm/ai/modals/electronHub/imageModels.d.ts +0 -11
- package/dist/esm/ai/modals/electronHub/imageModels.js +0 -85
- package/dist/esm/ai/modals/electronHub/songModels.d.ts +0 -1
- package/dist/esm/ai/modals/electronHub/songModels.js +0 -1
- package/dist/esm/ai/modals/electronHub/speechModels.d.ts +0 -6
- package/dist/esm/ai/modals/electronHub/speechModels.js +0 -56
- package/dist/esm/ai/modals/electronHub/videoModels.d.ts +0 -5
- package/dist/esm/ai/modals/electronHub/videoModels.js +0 -56
- package/dist/esm/ai/modals/groq/chatgroq.d.ts +0 -8
- package/dist/esm/ai/modals/groq/chatgroq.js +0 -57
- package/dist/esm/ai/modals/groq/imageAnalyzer.d.ts +0 -7
- package/dist/esm/ai/modals/groq/imageAnalyzer.js +0 -75
- package/dist/esm/ai/modals/groq/whisper.d.ts +0 -4
- package/dist/esm/ai/modals/groq/whisper.js +0 -101
- package/dist/esm/ai/modals/hercai/chatModels.d.ts +0 -6
- package/dist/esm/ai/modals/hercai/chatModels.js +0 -19
- package/dist/esm/ai/utils.d.ts +0 -4
- package/dist/esm/ai/utils.js +0 -4
- package/dist/esm/canvas/ApexPainter.d.ts +0 -144
- package/dist/esm/canvas/ApexPainter.js +0 -900
- package/dist/esm/canvas/utils/Background/bg.d.ts +0 -30
- package/dist/esm/canvas/utils/Background/bg.js +0 -151
- package/dist/esm/canvas/utils/Charts/charts.d.ts +0 -7
- package/dist/esm/canvas/utils/Charts/charts.js +0 -455
- package/dist/esm/canvas/utils/Custom/customLines.d.ts +0 -2
- package/dist/esm/canvas/utils/Custom/customLines.js +0 -105
- package/dist/esm/canvas/utils/General/conversion.d.ts +0 -5
- package/dist/esm/canvas/utils/General/conversion.js +0 -26
- package/dist/esm/canvas/utils/General/general functions.d.ts +0 -38
- package/dist/esm/canvas/utils/General/general functions.js +0 -590
- package/dist/esm/canvas/utils/Image/imageProperties.d.ts +0 -114
- package/dist/esm/canvas/utils/Image/imageProperties.js +0 -590
- package/dist/esm/canvas/utils/Texts/textProperties.d.ts +0 -16
- package/dist/esm/canvas/utils/Texts/textProperties.js +0 -154
- package/dist/esm/canvas/utils/types.d.ts +0 -621
- package/dist/esm/canvas/utils/types.js +0 -5
- package/dist/esm/canvas/utils/utils.d.ts +0 -18
- package/dist/esm/canvas/utils/utils.js +0 -17
- package/dist/esm/index.d.ts +0 -28
- package/dist/esm/index.js +0 -67
- package/dist/esm/utils.d.ts +0 -4
- package/dist/esm/utils.js +0 -4
- package/lib/ai/modals/electronHub/songModels.ts +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { createGradient } from "../Image/imageProperties.js";
|
|
2
|
-
export function customLines(ctx, options) {
|
|
3
|
-
let previousEndCoordinates = null;
|
|
4
|
-
let currentStyle = null;
|
|
5
|
-
let inSingleLineSequence = false;
|
|
6
|
-
for (let i = 0; i < options.length; i++) {
|
|
7
|
-
const customOption = options[i];
|
|
8
|
-
const { startCoordinates, endCoordinates, lineStyle } = customOption;
|
|
9
|
-
const isSingleLine = lineStyle?.singleLine;
|
|
10
|
-
if (isSingleLine && !inSingleLineSequence) {
|
|
11
|
-
currentStyle = lineStyle;
|
|
12
|
-
inSingleLineSequence = true;
|
|
13
|
-
ctx.beginPath();
|
|
14
|
-
ctx.moveTo(startCoordinates.x, startCoordinates.y);
|
|
15
|
-
}
|
|
16
|
-
if (!isSingleLine && inSingleLineSequence) {
|
|
17
|
-
ctx.stroke();
|
|
18
|
-
applyStroke(ctx, currentStyle, startCoordinates, endCoordinates);
|
|
19
|
-
inSingleLineSequence = false;
|
|
20
|
-
currentStyle = null;
|
|
21
|
-
}
|
|
22
|
-
const start = inSingleLineSequence && previousEndCoordinates
|
|
23
|
-
? previousEndCoordinates
|
|
24
|
-
: startCoordinates;
|
|
25
|
-
if (!inSingleLineSequence) {
|
|
26
|
-
ctx.beginPath();
|
|
27
|
-
ctx.moveTo(start.x, start.y);
|
|
28
|
-
}
|
|
29
|
-
ctx.lineTo(endCoordinates.x, endCoordinates.y);
|
|
30
|
-
const appliedStyle = inSingleLineSequence ? currentStyle : lineStyle;
|
|
31
|
-
ctx.lineWidth = appliedStyle?.width || 1;
|
|
32
|
-
if (appliedStyle?.gradient) {
|
|
33
|
-
ctx.strokeStyle = createGradient(ctx, appliedStyle.gradient, start.x, start.y, endCoordinates.x, endCoordinates.y);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
ctx.strokeStyle = appliedStyle?.color || 'black';
|
|
37
|
-
}
|
|
38
|
-
ctx.lineJoin = appliedStyle?.lineJoin || 'miter';
|
|
39
|
-
ctx.lineCap = appliedStyle?.lineCap || 'butt';
|
|
40
|
-
if (appliedStyle?.lineDash) {
|
|
41
|
-
ctx.setLineDash(appliedStyle.lineDash.dashArray || []);
|
|
42
|
-
ctx.lineDashOffset = appliedStyle.lineDash.offset || 0;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
ctx.setLineDash([]);
|
|
46
|
-
}
|
|
47
|
-
if (typeof appliedStyle?.lineRadius === 'number' && appliedStyle.lineRadius > 0) {
|
|
48
|
-
const radius = appliedStyle.lineRadius;
|
|
49
|
-
const dx = endCoordinates.x - start.x;
|
|
50
|
-
const dy = endCoordinates.y - start.y;
|
|
51
|
-
const angle = Math.atan2(dy, dx);
|
|
52
|
-
ctx.lineCap = "round";
|
|
53
|
-
ctx.stroke();
|
|
54
|
-
ctx.beginPath();
|
|
55
|
-
ctx.arc(start.x, start.y, radius, angle + Math.PI / 2, angle - Math.PI / 2, true);
|
|
56
|
-
ctx.arc(endCoordinates.x, endCoordinates.y, radius, angle - Math.PI / 2, angle + Math.PI / 2, false);
|
|
57
|
-
ctx.fill();
|
|
58
|
-
}
|
|
59
|
-
else if (appliedStyle?.lineRadius === 'circular') {
|
|
60
|
-
const dx = endCoordinates.x - start.x;
|
|
61
|
-
const dy = endCoordinates.y - start.y;
|
|
62
|
-
const length = Math.sqrt(dx * dx + dy * dy);
|
|
63
|
-
ctx.beginPath();
|
|
64
|
-
ctx.arcTo(start.x, start.y, endCoordinates.x, endCoordinates.y, length / 2);
|
|
65
|
-
ctx.arcTo(endCoordinates.x, endCoordinates.y, start.x, start.y, length / 2);
|
|
66
|
-
ctx.closePath();
|
|
67
|
-
ctx.stroke();
|
|
68
|
-
}
|
|
69
|
-
if (!inSingleLineSequence || i === options.length - 1) {
|
|
70
|
-
ctx.stroke();
|
|
71
|
-
applyStroke(ctx, appliedStyle, startCoordinates, endCoordinates);
|
|
72
|
-
}
|
|
73
|
-
previousEndCoordinates = endCoordinates;
|
|
74
|
-
if (!isSingleLine) {
|
|
75
|
-
currentStyle = null;
|
|
76
|
-
inSingleLineSequence = false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function applyStroke(ctx, style, start, end) {
|
|
81
|
-
if (style.stroke) {
|
|
82
|
-
const { color, width, gradient, lineRadius, lineCap } = style.stroke;
|
|
83
|
-
const prevStrokeStyle = ctx.strokeStyle;
|
|
84
|
-
const prevLineWidth = ctx.lineWidth;
|
|
85
|
-
const prevLineCap = ctx.lineCap;
|
|
86
|
-
if (gradient) {
|
|
87
|
-
ctx.strokeStyle = createGradient(ctx, gradient, start.x, start.y, end.x, end.y);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
ctx.strokeStyle = color || prevStrokeStyle;
|
|
91
|
-
}
|
|
92
|
-
ctx.lineWidth = width || prevLineWidth;
|
|
93
|
-
ctx.lineCap = lineCap || prevLineCap;
|
|
94
|
-
ctx.stroke();
|
|
95
|
-
if (typeof lineRadius === 'number' && lineRadius > 0) {
|
|
96
|
-
ctx.beginPath();
|
|
97
|
-
ctx.arc(start.x, start.y, lineRadius, 0, Math.PI * 2);
|
|
98
|
-
ctx.arc(end.x, end.y, lineRadius, 0, Math.PI * 2);
|
|
99
|
-
ctx.fill();
|
|
100
|
-
}
|
|
101
|
-
ctx.strokeStyle = prevStrokeStyle;
|
|
102
|
-
ctx.lineWidth = prevLineWidth;
|
|
103
|
-
ctx.lineCap = prevLineCap;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function url(buffer: Buffer): Promise<string>;
|
|
2
|
-
export declare function dataURL(buffer: any): string;
|
|
3
|
-
export declare function blob(buffer: any): Blob;
|
|
4
|
-
export declare function base64(buffer: any): string;
|
|
5
|
-
export declare function arrayBuffer(buffer: any): ArrayBuffer;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ImgurClient } from "imgur";
|
|
2
|
-
export async function url(buffer) {
|
|
3
|
-
const client = new ImgurClient({
|
|
4
|
-
clientId: "cd66e7c46e15b4e",
|
|
5
|
-
clientSecret: "14a6adf67597a7b2db5e535a09c24843470fc70b",
|
|
6
|
-
accessToken: "ad06eacb7c7228d8f482d2db20f490d649f58e52",
|
|
7
|
-
refreshToken: "57fd64eeca315fcd25584fbbde91950bf17a7f5e"
|
|
8
|
-
});
|
|
9
|
-
const response = await client.upload({
|
|
10
|
-
image: base64(buffer),
|
|
11
|
-
type: 'base64',
|
|
12
|
-
});
|
|
13
|
-
return response.data.link;
|
|
14
|
-
}
|
|
15
|
-
export function dataURL(buffer) {
|
|
16
|
-
return `data:image/png;base64,${Buffer.from(buffer).toString('base64')}`;
|
|
17
|
-
}
|
|
18
|
-
export function blob(buffer) {
|
|
19
|
-
return new Blob([buffer], { type: 'image/png' });
|
|
20
|
-
}
|
|
21
|
-
export function base64(buffer) {
|
|
22
|
-
return Buffer.from(buffer).toString('base64');
|
|
23
|
-
}
|
|
24
|
-
export function arrayBuffer(buffer) {
|
|
25
|
-
return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
|
|
26
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
2
|
-
import { cropOptions, ResizeOptions } from '../types.js';
|
|
3
|
-
export declare function loadImages(imagePath: string): Promise<sharp.Sharp>;
|
|
4
|
-
/**
|
|
5
|
-
* Resizes an image using Sharp with additional options for quality, kernel, and withoutEnlargement.
|
|
6
|
-
* @param resizeOptions - The options for resizing.
|
|
7
|
-
* @returns A Promise that resolves with the resized image as a Buffer.
|
|
8
|
-
*/
|
|
9
|
-
export declare function resizingImg(resizeOptions: ResizeOptions): Promise<Buffer>;
|
|
10
|
-
export declare function converter(imagePath: string, newExtension: string): Promise<Buffer<ArrayBufferLike>>;
|
|
11
|
-
export declare function applyColorFilters(imagePath: string, gradientOptions?: any, opacity?: number): Promise<any>;
|
|
12
|
-
export declare function imgEffects(imagePath: string, filters: any[]): Promise<Buffer<ArrayBufferLike>>;
|
|
13
|
-
/**
|
|
14
|
-
* Crops the inner portion of the image based on the bounding box of the provided coordinates.
|
|
15
|
-
* Optionally applies a clipping mask with a specified radius.
|
|
16
|
-
*/
|
|
17
|
-
export declare function cropInner(options: cropOptions): Promise<Buffer>;
|
|
18
|
-
/**
|
|
19
|
-
* Crops the outer portion of the image by removing the area defined by the provided polygon.
|
|
20
|
-
* The polygon is defined by the coordinates (with optional bezier smoothing using tension).
|
|
21
|
-
*/
|
|
22
|
-
export declare function cropOuter(options: cropOptions): Promise<Buffer>;
|
|
23
|
-
/**
|
|
24
|
-
* Detects dominant colors from an image.
|
|
25
|
-
*
|
|
26
|
-
* @param imagePath - Local path or URL of the image.
|
|
27
|
-
* @returns A sorted array of dominant colors with their frequency.
|
|
28
|
-
*/
|
|
29
|
-
export declare function detectColors(imagePath: string): Promise<{
|
|
30
|
-
color: string;
|
|
31
|
-
frequency: string;
|
|
32
|
-
}[]>;
|
|
33
|
-
export declare function removeColor(inputImagePath: string, colorToRemove: {
|
|
34
|
-
red: number;
|
|
35
|
-
green: number;
|
|
36
|
-
blue: number;
|
|
37
|
-
}): Promise<Buffer | undefined>;
|
|
38
|
-
export declare function bgRemoval(imgURL: string, API_KEY: string): Promise<Buffer | undefined>;
|