@majkapp/plugin-kit 1.0.12 → 1.0.14
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/plugin-kit.d.ts.map +1 -1
- package/dist/plugin-kit.js +6 -7
- package/package.json +1 -1
package/dist/plugin-kit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-kit.d.ts","sourceRoot":"","sources":["../src/plugin-kit.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAGb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EAIb,eAAe,EACf,gBAAgB,EACjB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-kit.d.ts","sourceRoot":"","sources":["../src/plugin-kit.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAGb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EAIb,eAAe,EACf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAqtBjB;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,EAAE,SAAS,MAAM;IAC9C,mDAAmD;IACnD,MAAM,CAAC,KAAK,EAAE,mBAAmB,EAAE,IAAI,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE7G,0CAA0C;IAC1C,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE5B,yBAAyB;IACz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EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,aAAa,CAAC,EAAE,CAAC,CA4WnB"}
|
package/dist/plugin-kit.js
CHANGED
|
@@ -49,10 +49,7 @@ function validateDescription(desc, name) {
|
|
|
49
49
|
if (!trimmed.endsWith('.')) {
|
|
50
50
|
throw new PluginBuildError(`Description for "${name}" must end with a period`, `Add a period at the end: "${desc}."`);
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
if (sentences.length < 2 || sentences.length > 3) {
|
|
54
|
-
throw new PluginBuildError(`Description for "${name}" must be 2-3 sentences, found ${sentences.length} sentences`, `Rewrite the description to have 2-3 clear sentences. Current: "${desc}"`, { sentences });
|
|
55
|
-
}
|
|
52
|
+
// Sentence count validation removed - descriptions can be any length
|
|
56
53
|
}
|
|
57
54
|
/**
|
|
58
55
|
* Validate entity data matches MAJK's EntityCapabilityHandler requirements
|
|
@@ -153,13 +150,15 @@ function validateEntity(entityType, entity) {
|
|
|
153
150
|
function pathToRegex(p) {
|
|
154
151
|
const keys = [];
|
|
155
152
|
console.log(`[pathToRegex] Input path: ${p}`);
|
|
156
|
-
|
|
153
|
+
// First, escape special regex characters EXCEPT the colon (for path params)
|
|
154
|
+
const escaped = p.replace(/([.+*?=^!${}()[\]|\\])/g, '\\$1');
|
|
155
|
+
console.log(`[pathToRegex] After escaping: ${escaped}`);
|
|
156
|
+
// Then, replace path parameters with capturing groups
|
|
157
|
+
const pattern = escaped.replace(/\/:([A-Za-z0-9_]+)/g, (_m, k) => {
|
|
157
158
|
keys.push(k);
|
|
158
159
|
console.log(`[pathToRegex] Found param: ${k}`);
|
|
159
160
|
return '/([^/]+)';
|
|
160
161
|
});
|
|
161
|
-
console.log(`[pathToRegex] After param replace: ${afterParamReplace}`);
|
|
162
|
-
const pattern = afterParamReplace.replace(/([.+*?=^!${}()[\]|/\\])/g, '\\$1');
|
|
163
162
|
console.log(`[pathToRegex] Final pattern: ${pattern}`);
|
|
164
163
|
console.log(`[pathToRegex] Keys: [${keys.join(', ')}]`);
|
|
165
164
|
const regex = new RegExp(`^${pattern}$`);
|