@graph-knowledge/api 0.3.2 → 0.9.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.
- package/package.json +1 -1
- package/src/index.d.ts +3 -2
- package/src/lib/clients/firebase-auth-client.d.ts +7 -0
- package/src/lib/clients/firebase-auth-client.js +20 -2
- package/src/lib/clients/firebase-firestore-client.js +83 -29
- package/src/lib/constants/element-defaults.js +1 -0
- package/src/lib/graph-knowledge-api.d.ts +21 -2
- package/src/lib/graph-knowledge-api.js +35 -5
- package/src/lib/interfaces/auth-client.interface.d.ts +10 -0
- package/src/lib/interfaces/custom-shape-operations.interface.d.ts +82 -0
- package/src/lib/interfaces/custom-shape-operations.interface.js +2 -0
- package/src/lib/interfaces/node-operations.interface.d.ts +29 -1
- package/src/lib/interfaces/template-operations.interface.d.ts +22 -1
- package/src/lib/operations/batch-operations.d.ts +3 -15
- package/src/lib/operations/batch-operations.js +8 -80
- package/src/lib/operations/custom-shape-operations.d.ts +27 -0
- package/src/lib/operations/custom-shape-operations.js +175 -0
- package/src/lib/operations/document-operations.js +9 -2
- package/src/lib/operations/element-operations.d.ts +3 -22
- package/src/lib/operations/element-operations.js +6 -119
- package/src/lib/operations/node-operations.d.ts +9 -3
- package/src/lib/operations/node-operations.js +18 -5
- package/src/lib/operations/template-operations.d.ts +3 -1
- package/src/lib/operations/template-operations.js +50 -7
- package/src/lib/testing/mock-auth-client.d.ts +2 -0
- package/src/lib/testing/mock-auth-client.js +7 -0
- package/src/lib/types/api-types.d.ts +113 -2
- package/src/lib/types/element-input-types.d.ts +67 -11
- package/src/lib/utils/element-builder.d.ts +63 -0
- package/src/lib/utils/element-builder.js +258 -0
- package/src/lib/utils/rotation.d.ts +4 -0
- package/src/lib/utils/rotation.js +13 -0
- package/src/lib/validators/custom-shape-definition-validator.d.ts +17 -0
- package/src/lib/validators/custom-shape-definition-validator.js +135 -0
- package/src/lib/validators/element-type-validators/base-element-validator.d.ts +4 -0
- package/src/lib/validators/element-type-validators/base-element-validator.js +30 -0
- package/src/lib/validators/element-type-validators/basic-shape-validators.js +2 -0
- package/src/lib/validators/element-type-validators/bezier-curve-validator.d.ts +12 -0
- package/src/lib/validators/element-type-validators/bezier-curve-validator.js +47 -0
- package/src/lib/validators/element-type-validators/block-arrow-validator.js +2 -0
- package/src/lib/validators/element-type-validators/line-validator.d.ts +1 -0
- package/src/lib/validators/element-type-validators/line-validator.js +12 -5
- package/src/lib/validators/element-type-validators/rectangle-validator.js +2 -0
- package/src/lib/validators/element-validator-registry.js +2 -0
- package/src/lib/validators/template-validator.d.ts +7 -1
- package/src/lib/validators/template-validator.js +21 -0
|
@@ -26,6 +26,27 @@ class TemplateValidator {
|
|
|
26
26
|
}
|
|
27
27
|
this.validateCanvasDimensions(input.canvasWidth, input.canvasHeight);
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Validates input for template update.
|
|
31
|
+
* @param input The update input to validate
|
|
32
|
+
* @throws ValidationError if validation fails
|
|
33
|
+
*/
|
|
34
|
+
validateUpdate(input) {
|
|
35
|
+
if (input.title !== undefined) {
|
|
36
|
+
if (typeof input.title !== "string") {
|
|
37
|
+
throw new api_errors_1.ValidationError("title must be a string", "title");
|
|
38
|
+
}
|
|
39
|
+
if (input.title.trim().length === 0) {
|
|
40
|
+
throw new api_errors_1.ValidationError("title cannot be empty", "title");
|
|
41
|
+
}
|
|
42
|
+
if (input.title.length > 200) {
|
|
43
|
+
throw new api_errors_1.ValidationError("title must be 200 characters or less", "title");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (input.content !== undefined && typeof input.content !== "string") {
|
|
47
|
+
throw new api_errors_1.ValidationError("content must be a string", "content");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
29
50
|
/**
|
|
30
51
|
* Validates canvas dimensions.
|
|
31
52
|
*/
|