@easyling/sanity-connector 1.4.0 → 2.0.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/README.md +560 -90
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -0
- package/package.json +38 -54
- package/LICENSE +0 -21
- package/dist/.tsbuildinfo +0 -1
- package/dist-types/actions/bulkTranslate.d.ts +0 -6
- package/dist-types/actions/manageDNTFields.d.ts +0 -11
- package/dist-types/actions/translateDocument.d.ts +0 -6
- package/dist-types/components/RadioWithDefault.d.ts +0 -16
- package/dist-types/components/auth/AuthNavbar.d.ts +0 -17
- package/dist-types/components/auth/AuthStatus.d.ts +0 -26
- package/dist-types/components/auth/AuthStatusWrapper.d.ts +0 -14
- package/dist-types/components/auth/MigrationPrompt.d.ts +0 -19
- package/dist-types/components/auth/MigrationPromptWrapper.d.ts +0 -13
- package/dist-types/components/auth/OAuthCallback.d.ts +0 -19
- package/dist-types/components/auth/index.d.ts +0 -14
- package/dist-types/components/config/LocaleConfigTool.d.ts +0 -16
- package/dist-types/components/config/LocaleConfigToolWrapper.d.ts +0 -12
- package/dist-types/components/config/OAuthConfig.d.ts +0 -25
- package/dist-types/components/config/OAuthConfigWrapper.d.ts +0 -12
- package/dist-types/components/config/PasswordInput.d.ts +0 -13
- package/dist-types/components/config/index.d.ts +0 -8
- package/dist-types/components/config/localeConfigToolDefinition.d.ts +0 -12
- package/dist-types/components/config/oauthConfigToolDefinition.d.ts +0 -12
- package/dist-types/components/dialogs/ConfirmationDialog.d.ts +0 -20
- package/dist-types/components/dialogs/ErrorDialog.d.ts +0 -20
- package/dist-types/components/dialogs/LocaleSelectionDialog.d.ts +0 -62
- package/dist-types/components/dialogs/SuccessDialog.d.ts +0 -18
- package/dist-types/components/dialogs/index.d.ts +0 -11
- package/dist-types/components/dnt/DNTFieldBadge.d.ts +0 -15
- package/dist-types/components/dnt/DNTFieldComponent.d.ts +0 -16
- package/dist-types/components/dnt/DNTFieldInput.d.ts +0 -13
- package/dist-types/components/dnt/DebugDNTBadge.d.ts +0 -19
- package/dist-types/components/dnt/index.d.ts +0 -7
- package/dist-types/config/index.d.ts +0 -5
- package/dist-types/config/pluginConfig.d.ts +0 -162
- package/dist-types/index.d.ts +0 -11
- package/dist-types/plugin.d.ts +0 -12
- package/dist-types/services/authStateManager.d.ts +0 -93
- package/dist-types/services/collisionDetectionService.d.ts +0 -85
- package/dist-types/services/contentExtractor.d.ts +0 -161
- package/dist-types/services/dialogService.d.ts +0 -95
- package/dist-types/services/dntServiceManager.d.ts +0 -43
- package/dist-types/services/dntStorageAdapter.d.ts +0 -72
- package/dist-types/services/documentCreationService.d.ts +0 -262
- package/dist-types/services/localeService.d.ts +0 -159
- package/dist-types/services/localeStorageAdapter.d.ts +0 -41
- package/dist-types/services/oauthConfigStorage.d.ts +0 -45
- package/dist-types/services/oauthService.d.ts +0 -47
- package/dist-types/services/oauthServiceManager.d.ts +0 -195
- package/dist-types/services/tokenStorage.d.ts +0 -53
- package/dist-types/services/translationService.d.ts +0 -385
- package/dist-types/services/unifiedConfigStorage.d.ts +0 -158
- package/dist-types/test-utils.d.ts +0 -8
- package/dist-types/types/dialog.d.ts +0 -118
- package/dist-types/types/dnt.d.ts +0 -83
- package/dist-types/types/index.d.ts +0 -11
- package/dist-types/types/locale.d.ts +0 -115
- package/dist-types/types/oauth.d.ts +0 -89
- package/dist-types/types/pluginConfig.d.ts +0 -64
- package/dist-types/types/translation.d.ts +0 -121
- package/dist-types/utils/dntDefaults.d.ts +0 -101
- package/dist-types/utils/htmlFormatter.d.ts +0 -65
- package/dist-types/utils/index.d.ts +0 -16
- package/dist-types/utils/logger.d.ts +0 -104
- package/dist-types/utils/oauthErrorFeedback.d.ts +0 -75
- package/dist-types/utils/oauthLogger.d.ts +0 -175
- package/dist-types/utils/validator.d.ts +0 -66
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validation functions for document and payload structure
|
|
3
|
-
* Requirements: 3.4, 4.3 - Validate document structure and provide clear error messages
|
|
4
|
-
*/
|
|
5
|
-
import { DocumentContent, ExtendedDocumentContent } from '../services/contentExtractor';
|
|
6
|
-
import { TranslationRequestPayload } from '../services/translationService';
|
|
7
|
-
export interface ValidationResult {
|
|
8
|
-
isValid: boolean;
|
|
9
|
-
errors: string[];
|
|
10
|
-
warnings: string[];
|
|
11
|
-
}
|
|
12
|
-
export interface DocumentValidationOptions {
|
|
13
|
-
requireTitle?: boolean;
|
|
14
|
-
requireContent?: boolean;
|
|
15
|
-
allowEmptyFields?: boolean;
|
|
16
|
-
maxContentLength?: number;
|
|
17
|
-
}
|
|
18
|
-
export interface PayloadValidationOptions {
|
|
19
|
-
requireMetadata?: boolean;
|
|
20
|
-
maxPayloadSize?: number;
|
|
21
|
-
validateHtmlStructure?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export declare class Validator {
|
|
24
|
-
/**
|
|
25
|
-
* Validate Sanity document structure
|
|
26
|
-
* Requirement 3.4: Validate document structure
|
|
27
|
-
*/
|
|
28
|
-
static validateSanityDocument(document: any, options?: DocumentValidationOptions): ValidationResult;
|
|
29
|
-
/**
|
|
30
|
-
* Validate document content structure
|
|
31
|
-
* Requirement 3.4: Validate extracted content structure
|
|
32
|
-
*/
|
|
33
|
-
static validateDocumentContent(content: DocumentContent): ValidationResult;
|
|
34
|
-
/**
|
|
35
|
-
* Validate extended document content structure
|
|
36
|
-
*/
|
|
37
|
-
static validateExtendedDocumentContent(content: ExtendedDocumentContent): ValidationResult;
|
|
38
|
-
/**
|
|
39
|
-
* Validate translation request payload
|
|
40
|
-
* Requirement 3.4: Validate payload structure for JSON transmission
|
|
41
|
-
*/
|
|
42
|
-
static validateTranslationPayload(payload: TranslationRequestPayload, options?: PayloadValidationOptions): ValidationResult;
|
|
43
|
-
/**
|
|
44
|
-
* Validate HTML content structure
|
|
45
|
-
* Requirement 3.2: Validate HTML structure preservation
|
|
46
|
-
*/
|
|
47
|
-
static validateHtmlContent(html: string): ValidationResult;
|
|
48
|
-
/**
|
|
49
|
-
* Validate array of documents for bulk operations
|
|
50
|
-
* Requirement 2.1: Validate multiple documents for bulk processing
|
|
51
|
-
*/
|
|
52
|
-
static validateDocumentArray(documents: any[], options?: DocumentValidationOptions): ValidationResult;
|
|
53
|
-
/**
|
|
54
|
-
* Validate endpoint URL
|
|
55
|
-
*/
|
|
56
|
-
static validateEndpoint(endpoint: string): ValidationResult;
|
|
57
|
-
}
|
|
58
|
-
export declare const validator: {
|
|
59
|
-
validateSanityDocument: typeof Validator.validateSanityDocument;
|
|
60
|
-
validateDocumentContent: typeof Validator.validateDocumentContent;
|
|
61
|
-
validateExtendedDocumentContent: typeof Validator.validateExtendedDocumentContent;
|
|
62
|
-
validateTranslationPayload: typeof Validator.validateTranslationPayload;
|
|
63
|
-
validateHtmlContent: typeof Validator.validateHtmlContent;
|
|
64
|
-
validateDocumentArray: typeof Validator.validateDocumentArray;
|
|
65
|
-
validateEndpoint: typeof Validator.validateEndpoint;
|
|
66
|
-
};
|