Compare commits

15 Commits
dev ... master

Author SHA1 Message Date
8696b25e9b feat(index.d.ts): add Base64Package interface for encoding and decoding data
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-28 14:31:06 +00:00
102a93f20c feat(index.d.ts): add includeHeader option to create method
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-27 16:51:08 +00:00
99e7d940ee feat(index.d.ts): extend create method options to include rootElement parameter
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-27 16:32:38 +00:00
c4d4a2f6e0 feat(index.d.ts): update create method parameter type for XML string creation
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-27 14:36:04 +00:00
fe548c0537 feat(index.d.ts): add ExecPackage interface to global context
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-27 09:06:57 +00:00
b724100477 feat(index.d.ts): add ExecPackage interface for command execution with options
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-27 08:55:15 +00:00
40446e13bb feat(config.json): füge admin-Konfiguration mit Token-Management hinzu
All checks were successful
continuous-integration/drone/push Build is passing
2025-04-24 14:48:16 +00:00
303652101b feat(index.d.ts): erweitere Bildverarbeitungsoptionen um Resampling, Anker, und Dimensionseinsparungen
All checks were successful
continuous-integration/drone/push Build is passing
2025-04-24 10:04:10 +00:00
592ee4a42b feat(index.d.ts): add outputType option for image processing configuration
All checks were successful
continuous-integration/drone/push Build is passing
2025-04-23 17:07:51 +00:00
ca8d37815b feat(index.d.ts): add lossless option to image processing configuration
All checks were successful
continuous-integration/drone/push Build is passing
2025-04-23 16:49:52 +00:00
9beb4d3a43 feat(index.d.ts): add sameSite option to set cookie's SameSite attribute
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-26 13:18:14 +00:00
2b0edd2c9f sleep in hook and cors in config
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-23 14:01:15 +00:00
1b48015c98 context.cyrpto.md5
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-26 14:58:39 +00:00
c6abfc9f07 image filter with skipLargerDimension and skipLargerFilesize
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-23 09:52:27 +00:00
b0771bdfb5 📝 docs(index.d.ts): add server config object definition for better documentation
All checks were successful
continuous-integration/drone/push Build is passing
The server config object definition has been added to the global declaration file to provide clear documentation on the structure of the server configuration object. This will help developers understand the expected format of the server configuration object and its properties.
2024-02-23 10:56:56 +00:00
4 changed files with 227 additions and 9 deletions

102
index.d.ts vendored
View File

@@ -111,11 +111,25 @@ declare global {
/**
* get current project object
*
*
*/
project(): {
[key: string]: any
}
/**
* get server config object
*
*/
server(): {
api: {
port: number
}
security: {
allowAbsolutePaths: boolean
allowUpperPaths: boolean
}
}
}
interface DbPackage {
@@ -330,6 +344,13 @@ declare global {
* get Sentry trace id
*/
sentryTraceId(): string
/**
* sleep
*
* @param ms sleep time in milliseconds
*/
sleep(ms: number): void
}
interface ResponsePackage {
@@ -444,10 +465,26 @@ declare global {
sourceFile: string,
targetFile: string,
filters: {
fit?: boolean
fill?: boolean
width?: number
height?: number
fit?: boolean
fill?: boolean
resampling?: "nearestNeighbor"
| "hermite"
| "linear"
| "catmullRom"
| "lanczos"
| "box"
| "mitchellNetravili"
| "bSpline"
| "gaussian"
| "bartlett"
| "hann"
| "hamming"
| "blackman"
| "welch"
| "cosine"
anchor?: "center" | "topLeft" | "top" | "topRight" | "left" | "right" | "bottomLeft" | "bottom" | "bottomRight"
brightness?: number
saturation?: number
contrast?: number
@@ -457,6 +494,10 @@ declare global {
invert?: boolean
grayscale?: boolean
quality?: number
lossless?: boolean
skipLargerDimensions?: boolean
skipLargerFilesize?: boolean
outputType?: "jpg" | "jpeg" | "png" | "webp"
}[]
): void
}
@@ -465,10 +506,13 @@ declare global {
/**
* create xml string
*
* @param data object or array
* @param data object or array (map with string keys as nodes (-KEY will be attribute in parent node))
* @param options options
*/
create(data: any, options?: {}): string
create(data: {[key: string]: any}, options?: {
rootElement?: string
includeHeader?: boolean
}): string
/**
* parse xml string to json
@@ -503,6 +547,7 @@ declare global {
domain?: string
secure?: boolean
httpOnly?: boolean
sameSite?: "strict" | "lax" | "none"
}
): void
}
@@ -618,6 +663,15 @@ declare global {
* @returns hex hash
*/
sha256(data: string): string
/**
* get hex of md5 hash
*
* @param sata string
*
* @returns hex hash
*/
md5(data: string): string
}
interface JsonPackage {
@@ -634,6 +688,41 @@ declare global {
stringify(json: any): string
}
interface ExecPackage {
command(cmd: string, options?: {
args?: string[]
stdin?: string
dir?: string
env?: string[]
timeout?: number
returnObject?: boolean
combineOutput?: boolean
}): string
command<T extends {
args?: string[]
stdin?: string
dir?: string
env?: string[]
timeout?: number
returnObject?: boolean
combineOutput?: boolean
}>(cmd: string, options: T):
T['returnObject'] extends true
? T['combineOutput'] extends true
? { output: string; exitCode: number }
: { stdout: string; stderr: string; exitCode: number }
: string
}
interface Base64Package {
encode(data: string|Int8Array): string
decode(data: string): string
decode(data: string, options: {returnBytes: true}): Int8Array
decode(data: string, options: {returnBytes: false}): string
decode(data: string, options: {returnBytes?: boolean}): string | Int8Array
}
export interface HookContext
extends GetHookData,
GetHookGetOnlyData,
@@ -657,7 +746,7 @@ declare global {
}
api(): {
[key: string]: any
[key: string]: any
}
project(): {
@@ -686,6 +775,7 @@ declare global {
pdf: PdfPackage
crypto: CryptoPackage
json: JsonPackage
exec: ExecPackage
}
export interface HookException {

View File

@@ -125,6 +125,53 @@
}
}
]
},
"cors": {
"type": "object",
"description": "cors configuration",
"additionalProperties": false,
"properties": {
"merge": {
"type": "boolean",
"description": "merge with global and project cors configuration"
},
"allowOrigins": {
"type": "array",
"description": "list of allowed origins",
"items": {
"type": "string"
}
},
"allowMethods": {
"type": "array",
"description": "list of allowed methods",
"items": {
"type": "string"
}
},
"allowHeaders": {
"type": "array",
"description": "list of allowed headers",
"items": {
"type": "string"
}
},
"allowCredentials": {
"type": "boolean",
"description": "allow credentials"
},
"exposeHeaders": {
"type": "array",
"description": "list of exposed headers",
"items": {
"type": "string"
}
},
"maxAge": {
"type": "integer",
"description": "max age in seconds"
}
}
}
},
"required": ["name", "permissions"]

View File

@@ -25,7 +25,9 @@
"imageUrl": {
"description": "project's teaser image url shown in admin ui",
"oneOf": [
{ "type": "string" },
{
"type": "string"
},
{
"$ref": "definitions.json#/definitions/evalObject"
}
@@ -77,7 +79,80 @@
}
]
}
},
"cors": {
"type": "object",
"description": "cors configuration",
"additionalProperties": false,
"properties": {
"merge": {
"type": "boolean",
"description": "merge with global cors configuration"
},
"allowOrigins": {
"type": "array",
"description": "list of allowed origins",
"items": {
"type": "string"
}
},
"allowMethods": {
"type": "array",
"description": "list of allowed methods",
"items": {
"type": "string"
}
},
"allowHeaders": {
"type": "array",
"description": "list of allowed headers",
"items": {
"type": "string"
}
},
"allowCredentials": {
"type": "boolean",
"description": "allow credentials"
},
"exposeHeaders": {
"type": "array",
"description": "list of exposed headers",
"items": {
"type": "string"
}
},
"maxAge": {
"type": "integer",
"description": "max age in seconds"
}
}
},
"admin": {
"type": "object",
"description": "admin configuration",
"additionalProperties": false,
"properties": {
"tokens": {
"type": "array",
"description": "list of admin tokens",
"items": {
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "admin token"
},
"allowReload": {
"type": "boolean",
"description": "allow reload"
}
}
}
}
}
}
},
"required": ["namespace"]
}
"required": [
"namespace"
]
}

View File

@@ -58,6 +58,12 @@
},
"quality": {
"type": "number"
},
"skipLargerDimension": {
"type": "boolean"
},
"skipLargerFilesize": {
"type": "boolean"
}
}
}