Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
8696b25e9b
|
|||
|
102a93f20c
|
|||
|
99e7d940ee
|
|||
|
c4d4a2f6e0
|
|||
|
fe548c0537
|
|||
|
b724100477
|
|||
|
40446e13bb
|
|||
|
303652101b
|
|||
|
592ee4a42b
|
|||
|
ca8d37815b
|
|||
|
9beb4d3a43
|
|||
|
2b0edd2c9f
|
|||
|
1b48015c98
|
|||
|
c6abfc9f07
|
|||
|
b0771bdfb5
|
102
index.d.ts
vendored
102
index.d.ts
vendored
@@ -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 {
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -58,6 +58,12 @@
|
||||
},
|
||||
"quality": {
|
||||
"type": "number"
|
||||
},
|
||||
"skipLargerDimension": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"skipLargerFilesize": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user