@kong-ui-public/entities-plugins 9.265.0 → 9.265.1-pr.3728.a2f06df6f.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.
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A Kong plugin config field, as dumped by the Admin API. Deliberately typed
|
|
4
|
+
* loosely (not as the stricter `FormSchema`/`UnionFieldSchema` in
|
|
5
|
+
* `../../types/plugins/form-schema`): this compiler consumes live
|
|
6
|
+
* `JSON.parse()`'d Admin API output, which was never going to satisfy a
|
|
7
|
+
* hand-maintained literal-union type at the TS level anyway, and the DSL has
|
|
8
|
+
* more optional keys (e.g. `uuid`, `gt`, `starts_with`) than that type
|
|
9
|
+
* currently models.
|
|
10
|
+
*/
|
|
11
|
+
type LuaField = Record<string, any> & {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
type LuaNamedField = Record<string, LuaField | undefined>;
|
|
15
|
+
type LuaFormSchema = {
|
|
16
|
+
fields: LuaNamedField[];
|
|
17
|
+
};
|
|
18
|
+
export declare function compileField(field: LuaField): z.ZodTypeAny;
|
|
19
|
+
/** Compile a full plugin config schema (the Admin API's root schema shape) into a Zod object schema. */
|
|
20
|
+
export declare function luaSchemaToZod(schema: LuaFormSchema): z.ZodObject<any>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/lua-schema-to-zod/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;;;;GAQG;AACH,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAGtD,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAA;AACzD,KAAK,aAAa,GAAG;IAAE,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,CAAA;AA2OhD,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,CAAC,UAAU,CA6C1D;AAED,wGAAwG;AACxG,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAEtE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Best-effort translator from Kong's Lua pattern syntax (used in `match` /
|
|
3
|
+
* `match_all` / `match_none` / `match_any`) to a JS RegExp.
|
|
4
|
+
*
|
|
5
|
+
* Lua patterns are NOT PCRE/JS regex: no alternation (`|`), no `{n,m}` bounded
|
|
6
|
+
* repetition, `-` after an item is a *lazy* "0 or more" quantifier (unlike
|
|
7
|
+
* JS's greedy `*`), and character classes use `%d %a %s %w ...` instead of
|
|
8
|
+
* `\d \w \s`. A naive `new RegExp(pattern)` on a Lua pattern can silently
|
|
9
|
+
* validate the wrong thing, which is worse than not validating at all.
|
|
10
|
+
*
|
|
11
|
+
* This translator only handles constructs it can map with confidence and
|
|
12
|
+
* returns `null` for anything else (bare `-` quantifiers outside `[...]`,
|
|
13
|
+
* `%b`/`%f`, unknown `%x` escapes). Callers should skip the check client-side
|
|
14
|
+
* when `null` comes back, and rely on the server's real (Lua) validation.
|
|
15
|
+
*/
|
|
16
|
+
export declare function translateLuaPattern(pattern: string): RegExp | null;
|
|
17
|
+
//# sourceMappingURL=lua-pattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lua-pattern.d.ts","sourceRoot":"","sources":["../../../../src/utils/lua-schema-to-zod/lua-pattern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAuBH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkElE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-plugins",
|
|
3
|
-
"version": "9.265.0",
|
|
3
|
+
"version": "9.265.1-pr.3728.a2f06df6f.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-plugins.umd.js",
|
|
6
6
|
"module": "./dist/entities-plugins.es.js",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"vue": ">= 3.3.13 < 4",
|
|
56
56
|
"vue-router": "^4.6.4 || ^5.0.6",
|
|
57
57
|
"zod": ">= 4.1.3 < 5",
|
|
58
|
-
"@kong-ui-public/i18n": "^2.5.1",
|
|
59
58
|
"@kong-ui-public/entities-shared": "^3.63.0",
|
|
60
|
-
"@kong-ui-public/monaco-editor": "^0.24.13"
|
|
59
|
+
"@kong-ui-public/monaco-editor": "^0.24.13",
|
|
60
|
+
"@kong-ui-public/i18n": "^2.5.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"@playwright/test": {
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
"vue": "^3.5.35",
|
|
92
92
|
"vue-router": "^5.2.0",
|
|
93
93
|
"zod": "^4.4.3",
|
|
94
|
-
"@kong-ui-public/entities-shared": "^3.63.0",
|
|
95
94
|
"@kong-ui-public/entities-vaults": "^4.16.25",
|
|
96
95
|
"@kong-ui-public/i18n": "^2.5.1",
|
|
97
|
-
"@kong-ui-public/monaco-editor": "^0.24.13"
|
|
96
|
+
"@kong-ui-public/monaco-editor": "^0.24.13",
|
|
97
|
+
"@kong-ui-public/entities-shared": "^3.63.0"
|
|
98
98
|
},
|
|
99
99
|
"repository": {
|
|
100
100
|
"type": "git",
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
"@kong-ui-public/entities-consumer-groups": "^4.7.23",
|
|
118
118
|
"@kong-ui-public/entities-consumers": "^4.7.20",
|
|
119
119
|
"@kong-ui-public/entities-gateway-services": "^3.27.0",
|
|
120
|
-
"@kong-ui-public/entities-plugins-icon": "^1.7.2",
|
|
121
120
|
"@kong-ui-public/entities-plugins-metadata": "^1.15.1",
|
|
122
121
|
"@kong-ui-public/entities-redis-configurations": "^1.18.23",
|
|
122
|
+
"@kong-ui-public/entities-plugins-icon": "^1.7.2",
|
|
123
123
|
"@kong-ui-public/entities-routes": "^3.26.16",
|
|
124
|
-
"@kong-ui-public/
|
|
125
|
-
"@kong-ui-public/
|
|
124
|
+
"@kong-ui-public/forms": "^4.33.25",
|
|
125
|
+
"@kong-ui-public/entities-vaults": "^4.16.25"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|
|
128
128
|
"dev": "cross-env USE_SANDBOX=true vite",
|