@easyling/sanity-connector 0.0.1 → 0.0.2-rc.1
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/.tsbuildinfo +1 -1
- package/package.json +18 -12
- package/dist/actions/bulkTranslate.d.ts +0 -7
- package/dist/actions/bulkTranslate.d.ts.map +0 -1
- package/dist/actions/bulkTranslate.js +0 -543
- package/dist/actions/bulkTranslate.js.map +0 -1
- package/dist/actions/manageDNTFields.d.ts +0 -12
- package/dist/actions/manageDNTFields.d.ts.map +0 -1
- package/dist/actions/manageDNTFields.js +0 -100
- package/dist/actions/manageDNTFields.js.map +0 -1
- package/dist/actions/translateDocument.d.ts +0 -7
- package/dist/actions/translateDocument.d.ts.map +0 -1
- package/dist/actions/translateDocument.js +0 -256
- package/dist/actions/translateDocument.js.map +0 -1
- package/dist/components/RadioWithDefault.d.ts +0 -17
- package/dist/components/RadioWithDefault.d.ts.map +0 -1
- package/dist/components/RadioWithDefault.js +0 -29
- package/dist/components/RadioWithDefault.js.map +0 -1
- package/dist/components/auth/AuthNavbar.d.ts +0 -18
- package/dist/components/auth/AuthNavbar.d.ts.map +0 -1
- package/dist/components/auth/AuthNavbar.js +0 -15
- package/dist/components/auth/AuthNavbar.js.map +0 -1
- package/dist/components/auth/AuthStatus.d.ts +0 -27
- package/dist/components/auth/AuthStatus.d.ts.map +0 -1
- package/dist/components/auth/AuthStatus.js +0 -82
- package/dist/components/auth/AuthStatus.js.map +0 -1
- package/dist/components/auth/AuthStatusWrapper.d.ts +0 -15
- package/dist/components/auth/AuthStatusWrapper.d.ts.map +0 -1
- package/dist/components/auth/AuthStatusWrapper.js +0 -39
- package/dist/components/auth/AuthStatusWrapper.js.map +0 -1
- package/dist/components/auth/MigrationPrompt.d.ts +0 -20
- package/dist/components/auth/MigrationPrompt.d.ts.map +0 -1
- package/dist/components/auth/MigrationPrompt.js +0 -16
- package/dist/components/auth/MigrationPrompt.js.map +0 -1
- package/dist/components/auth/MigrationPromptWrapper.d.ts +0 -14
- package/dist/components/auth/MigrationPromptWrapper.d.ts.map +0 -1
- package/dist/components/auth/MigrationPromptWrapper.js +0 -16
- package/dist/components/auth/MigrationPromptWrapper.js.map +0 -1
- package/dist/components/auth/OAuthCallback.d.ts +0 -20
- package/dist/components/auth/OAuthCallback.d.ts.map +0 -1
- package/dist/components/auth/OAuthCallback.js +0 -12
- package/dist/components/auth/OAuthCallback.js.map +0 -1
- package/dist/components/auth/index.d.ts +0 -15
- package/dist/components/auth/index.d.ts.map +0 -1
- package/dist/components/auth/index.js +0 -12
- package/dist/components/auth/index.js.map +0 -1
- package/dist/components/config/LocaleConfigTool.d.ts +0 -17
- package/dist/components/config/LocaleConfigTool.d.ts.map +0 -1
- package/dist/components/config/LocaleConfigTool.js +0 -186
- package/dist/components/config/LocaleConfigTool.js.map +0 -1
- package/dist/components/config/LocaleConfigToolWrapper.d.ts +0 -13
- package/dist/components/config/LocaleConfigToolWrapper.d.ts.map +0 -1
- package/dist/components/config/LocaleConfigToolWrapper.js +0 -26
- package/dist/components/config/LocaleConfigToolWrapper.js.map +0 -1
- package/dist/components/config/OAuthConfig.d.ts +0 -26
- package/dist/components/config/OAuthConfig.d.ts.map +0 -1
- package/dist/components/config/OAuthConfig.js +0 -152
- package/dist/components/config/OAuthConfig.js.map +0 -1
- package/dist/components/config/OAuthConfigWrapper.d.ts +0 -13
- package/dist/components/config/OAuthConfigWrapper.d.ts.map +0 -1
- package/dist/components/config/OAuthConfigWrapper.js +0 -41
- package/dist/components/config/OAuthConfigWrapper.js.map +0 -1
- package/dist/components/config/PasswordInput.d.ts +0 -14
- package/dist/components/config/PasswordInput.d.ts.map +0 -1
- package/dist/components/config/PasswordInput.js +0 -23
- package/dist/components/config/PasswordInput.js.map +0 -1
- package/dist/components/config/index.d.ts +0 -9
- package/dist/components/config/index.d.ts.map +0 -1
- package/dist/components/config/index.js +0 -8
- package/dist/components/config/index.js.map +0 -1
- package/dist/components/config/localeConfigToolDefinition.d.ts +0 -13
- package/dist/components/config/localeConfigToolDefinition.d.ts.map +0 -1
- package/dist/components/config/localeConfigToolDefinition.js +0 -19
- package/dist/components/config/localeConfigToolDefinition.js.map +0 -1
- package/dist/components/config/oauthConfigToolDefinition.d.ts +0 -13
- package/dist/components/config/oauthConfigToolDefinition.d.ts.map +0 -1
- package/dist/components/config/oauthConfigToolDefinition.js +0 -19
- package/dist/components/config/oauthConfigToolDefinition.js.map +0 -1
- package/dist/components/dialogs/ConfirmationDialog.d.ts +0 -21
- package/dist/components/dialogs/ConfirmationDialog.d.ts.map +0 -1
- package/dist/components/dialogs/ConfirmationDialog.js +0 -28
- package/dist/components/dialogs/ConfirmationDialog.js.map +0 -1
- package/dist/components/dialogs/ErrorDialog.d.ts +0 -21
- package/dist/components/dialogs/ErrorDialog.d.ts.map +0 -1
- package/dist/components/dialogs/ErrorDialog.js +0 -28
- package/dist/components/dialogs/ErrorDialog.js.map +0 -1
- package/dist/components/dialogs/LocaleSelectionDialog.d.ts +0 -41
- package/dist/components/dialogs/LocaleSelectionDialog.d.ts.map +0 -1
- package/dist/components/dialogs/LocaleSelectionDialog.js +0 -117
- package/dist/components/dialogs/LocaleSelectionDialog.js.map +0 -1
- package/dist/components/dialogs/SuccessDialog.d.ts +0 -19
- package/dist/components/dialogs/SuccessDialog.d.ts.map +0 -1
- package/dist/components/dialogs/SuccessDialog.js +0 -37
- package/dist/components/dialogs/SuccessDialog.js.map +0 -1
- package/dist/components/dialogs/index.d.ts +0 -12
- package/dist/components/dialogs/index.d.ts.map +0 -1
- package/dist/components/dialogs/index.js +0 -8
- package/dist/components/dialogs/index.js.map +0 -1
- package/dist/components/dnt/DNTFieldBadge.d.ts +0 -16
- package/dist/components/dnt/DNTFieldBadge.d.ts.map +0 -1
- package/dist/components/dnt/DNTFieldBadge.js +0 -56
- package/dist/components/dnt/DNTFieldBadge.js.map +0 -1
- package/dist/components/dnt/DNTFieldComponent.d.ts +0 -17
- package/dist/components/dnt/DNTFieldComponent.d.ts.map +0 -1
- package/dist/components/dnt/DNTFieldComponent.js +0 -21
- package/dist/components/dnt/DNTFieldComponent.js.map +0 -1
- package/dist/components/dnt/DNTFieldInput.d.ts +0 -14
- package/dist/components/dnt/DNTFieldInput.d.ts.map +0 -1
- package/dist/components/dnt/DNTFieldInput.js +0 -76
- package/dist/components/dnt/DNTFieldInput.js.map +0 -1
- package/dist/components/dnt/index.d.ts +0 -7
- package/dist/components/dnt/index.d.ts.map +0 -1
- package/dist/components/dnt/index.js +0 -7
- package/dist/components/dnt/index.js.map +0 -1
- package/dist/config/index.d.ts +0 -6
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -6
- package/dist/config/index.js.map +0 -1
- package/dist/config/pluginConfig.d.ts +0 -163
- package/dist/config/pluginConfig.d.ts.map +0 -1
- package/dist/config/pluginConfig.js +0 -548
- package/dist/config/pluginConfig.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -12
- package/dist/index.js.map +0 -1
- package/dist/plugin.d.ts +0 -3
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plugin.js +0 -137
- package/dist/plugin.js.map +0 -1
- package/dist/services/authStateManager.d.ts +0 -94
- package/dist/services/authStateManager.d.ts.map +0 -1
- package/dist/services/authStateManager.js +0 -208
- package/dist/services/authStateManager.js.map +0 -1
- package/dist/services/contentExtractor.d.ts +0 -95
- package/dist/services/contentExtractor.d.ts.map +0 -1
- package/dist/services/contentExtractor.js +0 -516
- package/dist/services/contentExtractor.js.map +0 -1
- package/dist/services/dialogService.d.ts +0 -96
- package/dist/services/dialogService.d.ts.map +0 -1
- package/dist/services/dialogService.js +0 -244
- package/dist/services/dialogService.js.map +0 -1
- package/dist/services/dntServiceManager.d.ts +0 -44
- package/dist/services/dntServiceManager.d.ts.map +0 -1
- package/dist/services/dntServiceManager.js +0 -74
- package/dist/services/dntServiceManager.js.map +0 -1
- package/dist/services/dntStorageAdapter.d.ts +0 -73
- package/dist/services/dntStorageAdapter.d.ts.map +0 -1
- package/dist/services/dntStorageAdapter.js +0 -192
- package/dist/services/dntStorageAdapter.js.map +0 -1
- package/dist/services/documentCreationService.d.ts +0 -139
- package/dist/services/documentCreationService.d.ts.map +0 -1
- package/dist/services/documentCreationService.js +0 -938
- package/dist/services/documentCreationService.js.map +0 -1
- package/dist/services/localeService.d.ts +0 -160
- package/dist/services/localeService.d.ts.map +0 -1
- package/dist/services/localeService.js +0 -300
- package/dist/services/localeService.js.map +0 -1
- package/dist/services/localeStorageAdapter.d.ts +0 -42
- package/dist/services/localeStorageAdapter.d.ts.map +0 -1
- package/dist/services/localeStorageAdapter.js +0 -107
- package/dist/services/localeStorageAdapter.js.map +0 -1
- package/dist/services/oauthConfigStorage.d.ts +0 -46
- package/dist/services/oauthConfigStorage.d.ts.map +0 -1
- package/dist/services/oauthConfigStorage.js +0 -122
- package/dist/services/oauthConfigStorage.js.map +0 -1
- package/dist/services/oauthService.d.ts +0 -48
- package/dist/services/oauthService.d.ts.map +0 -1
- package/dist/services/oauthService.js +0 -71
- package/dist/services/oauthService.js.map +0 -1
- package/dist/services/oauthServiceManager.d.ts +0 -189
- package/dist/services/oauthServiceManager.d.ts.map +0 -1
- package/dist/services/oauthServiceManager.js +0 -380
- package/dist/services/oauthServiceManager.js.map +0 -1
- package/dist/services/tokenStorage.d.ts +0 -54
- package/dist/services/tokenStorage.d.ts.map +0 -1
- package/dist/services/tokenStorage.js +0 -140
- package/dist/services/tokenStorage.js.map +0 -1
- package/dist/services/translationService.d.ts +0 -374
- package/dist/services/translationService.d.ts.map +0 -1
- package/dist/services/translationService.js +0 -687
- package/dist/services/translationService.js.map +0 -1
- package/dist/services/unifiedConfigStorage.d.ts +0 -124
- package/dist/services/unifiedConfigStorage.d.ts.map +0 -1
- package/dist/services/unifiedConfigStorage.js +0 -304
- package/dist/services/unifiedConfigStorage.js.map +0 -1
- package/dist/test-utils.d.ts +0 -9
- package/dist/test-utils.d.ts.map +0 -1
- package/dist/test-utils.js +0 -13
- package/dist/test-utils.js.map +0 -1
- package/dist/types/dialog.d.ts +0 -107
- package/dist/types/dialog.d.ts.map +0 -1
- package/dist/types/dialog.js +0 -6
- package/dist/types/dialog.js.map +0 -1
- package/dist/types/dnt.d.ts +0 -84
- package/dist/types/dnt.d.ts.map +0 -1
- package/dist/types/dnt.js +0 -5
- package/dist/types/dnt.js.map +0 -1
- package/dist/types/index.d.ts +0 -12
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +0 -1
- package/dist/types/locale.d.ts +0 -116
- package/dist/types/locale.d.ts.map +0 -1
- package/dist/types/locale.js +0 -189
- package/dist/types/locale.js.map +0 -1
- package/dist/types/oauth.d.ts +0 -90
- package/dist/types/oauth.d.ts.map +0 -1
- package/dist/types/oauth.js +0 -62
- package/dist/types/oauth.js.map +0 -1
- package/dist/types/pluginConfig.d.ts +0 -45
- package/dist/types/pluginConfig.d.ts.map +0 -1
- package/dist/types/pluginConfig.js +0 -6
- package/dist/types/pluginConfig.js.map +0 -1
- package/dist/types/translation.d.ts +0 -122
- package/dist/types/translation.d.ts.map +0 -1
- package/dist/types/translation.js +0 -6
- package/dist/types/translation.js.map +0 -1
- package/dist/utils/htmlFormatter.d.ts +0 -66
- package/dist/utils/htmlFormatter.d.ts.map +0 -1
- package/dist/utils/htmlFormatter.js +0 -191
- package/dist/utils/htmlFormatter.js.map +0 -1
- package/dist/utils/index.d.ts +0 -15
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -16
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -105
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -229
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/oauthErrorFeedback.d.ts +0 -76
- package/dist/utils/oauthErrorFeedback.d.ts.map +0 -1
- package/dist/utils/oauthErrorFeedback.js +0 -134
- package/dist/utils/oauthErrorFeedback.js.map +0 -1
- package/dist/utils/oauthLogger.d.ts +0 -176
- package/dist/utils/oauthLogger.d.ts.map +0 -1
- package/dist/utils/oauthLogger.js +0 -282
- package/dist/utils/oauthLogger.js.map +0 -1
- package/dist/utils/validator.d.ts +0 -67
- package/dist/utils/validator.d.ts.map +0 -1
- package/dist/utils/validator.js +0 -390
- package/dist/utils/validator.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pluginConfig.js","sourceRoot":"","sources":["../../src/types/pluginConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced translation request/response type definitions
|
|
3
|
-
* Requirements: 5.1, 5.2, 5.3
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Enhanced translation request with locale support
|
|
7
|
-
*/
|
|
8
|
-
export interface EnhancedTranslationRequest {
|
|
9
|
-
/** Unique identifier for the document */
|
|
10
|
-
documentId: string;
|
|
11
|
-
/** Sanity document type */
|
|
12
|
-
documentType: string;
|
|
13
|
-
/** HTML content to translate */
|
|
14
|
-
htmlContent: string;
|
|
15
|
-
/** Array of target locale codes */
|
|
16
|
-
targetLocales: string[];
|
|
17
|
-
/** Optional source locale code */
|
|
18
|
-
sourceLocale?: string;
|
|
19
|
-
/** Request metadata */
|
|
20
|
-
metadata: {
|
|
21
|
-
/** Document title */
|
|
22
|
-
title: string;
|
|
23
|
-
/** Request timestamp */
|
|
24
|
-
timestamp: string;
|
|
25
|
-
/** Plugin version */
|
|
26
|
-
pluginVersion: string;
|
|
27
|
-
/** Unique request identifier */
|
|
28
|
-
requestId: string;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Enhanced translation response with multi-locale support
|
|
33
|
-
*/
|
|
34
|
-
export interface EnhancedTranslationResponse {
|
|
35
|
-
/** Whether the overall request was successful */
|
|
36
|
-
success: boolean;
|
|
37
|
-
/** Unique request identifier */
|
|
38
|
-
requestId: string;
|
|
39
|
-
/** Source locale code */
|
|
40
|
-
sourceLocale?: string;
|
|
41
|
-
/** Translations for each requested locale */
|
|
42
|
-
translations: {
|
|
43
|
-
[localeCode: string]: {
|
|
44
|
-
/** Translated content */
|
|
45
|
-
content: string;
|
|
46
|
-
/** Translation status */
|
|
47
|
-
status: 'completed' | 'failed' | 'pending';
|
|
48
|
-
/** Error message if translation failed */
|
|
49
|
-
error?: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
/** Overall error message if request failed */
|
|
53
|
-
error?: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Translation progress information
|
|
57
|
-
*/
|
|
58
|
-
export interface TranslationProgress {
|
|
59
|
-
/** Total number of translations requested */
|
|
60
|
-
total: number;
|
|
61
|
-
/** Number of completed translations */
|
|
62
|
-
completed: number;
|
|
63
|
-
/** Number of failed translations */
|
|
64
|
-
failed: number;
|
|
65
|
-
/** Number of pending translations */
|
|
66
|
-
pending: number;
|
|
67
|
-
/** Current translation being processed */
|
|
68
|
-
current?: {
|
|
69
|
-
documentId: string;
|
|
70
|
-
locale: string;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Bulk translation request with locale selection
|
|
75
|
-
*/
|
|
76
|
-
export interface BulkTranslationRequest {
|
|
77
|
-
/** Array of document IDs to translate */
|
|
78
|
-
documentIds: string[];
|
|
79
|
-
/** Array of target locale codes */
|
|
80
|
-
targetLocales: string[];
|
|
81
|
-
/** Optional source locale code */
|
|
82
|
-
sourceLocale?: string;
|
|
83
|
-
/** Request metadata */
|
|
84
|
-
metadata: {
|
|
85
|
-
/** Request timestamp */
|
|
86
|
-
timestamp: string;
|
|
87
|
-
/** Plugin version */
|
|
88
|
-
pluginVersion: string;
|
|
89
|
-
/** Unique request identifier */
|
|
90
|
-
requestId: string;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Bulk translation summary with locale breakdown
|
|
95
|
-
*/
|
|
96
|
-
export interface EnhancedBulkTranslationSummary {
|
|
97
|
-
/** Total number of documents processed */
|
|
98
|
-
totalDocuments: number;
|
|
99
|
-
/** Total number of locale translations requested */
|
|
100
|
-
totalTranslations: number;
|
|
101
|
-
/** Number of successful translations */
|
|
102
|
-
successfulTranslations: number;
|
|
103
|
-
/** Number of failed translations */
|
|
104
|
-
failedTranslations: number;
|
|
105
|
-
/** Breakdown by locale */
|
|
106
|
-
localeBreakdown: {
|
|
107
|
-
[localeCode: string]: {
|
|
108
|
-
/** Number of successful translations for this locale */
|
|
109
|
-
successful: number;
|
|
110
|
-
/** Number of failed translations for this locale */
|
|
111
|
-
failed: number;
|
|
112
|
-
/** Error messages for failed translations */
|
|
113
|
-
errors: string[];
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
/** Individual translation requests */
|
|
117
|
-
requests: EnhancedTranslationRequest[];
|
|
118
|
-
/** Individual translation responses */
|
|
119
|
-
responses: EnhancedTranslationResponse[];
|
|
120
|
-
}
|
|
121
|
-
export type { TranslationRequestPayload, TranslationResponse, TranslatableField } from '../services/translationService';
|
|
122
|
-
//# sourceMappingURL=translation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../src/types/translation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uBAAuB;IACvB,QAAQ,EAAE;QACR,qBAAqB;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,wBAAw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B,qBAAqB;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,gCAAgC;QAChC,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wCAAwC;IACxC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,oCAAoC;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B;IAC1B,eAAe,EAAE;QACf,CAAC,UAAU,EAAE,MAAM,GAAG;YACpB,wDAAwD;YACxD,UAAU,EAAE,MAAM,CAAC;YACnB,oDAAoD;YACpD,MAAM,EAAE,MAAM,CAAC;YACf,6CAA6C;YAC7C,MAAM,EAAE,MAAM,EAAE,CAAC;SAClB,CAAC;KACH,CAAC;IACF,sCAAsC;IACtC,QAAQ,EAAE,0BAA0B,EAAE,CAAC;IACvC,uCAAuC;IACvC,SAAS,EAAE,2BAA2B,EAAE,CAAC;CAC1C;AAGD,YAAY,EACV,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,gCAAgC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../src/types/translation.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTML formatting utilities for content processing
|
|
3
|
-
* Requirements: 3.3, 3.4 - Proper HTML formatting and special character escaping
|
|
4
|
-
*/
|
|
5
|
-
export interface HtmlFormattingOptions {
|
|
6
|
-
preserveWhitespace?: boolean;
|
|
7
|
-
escapeSpecialChars?: boolean;
|
|
8
|
-
minifyOutput?: boolean;
|
|
9
|
-
addLineBreaks?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare class HtmlFormatter {
|
|
12
|
-
/**
|
|
13
|
-
* Escape HTML special characters for JSON transmission
|
|
14
|
-
* Requirement 3.4: Properly escape special characters for JSON transmission
|
|
15
|
-
*/
|
|
16
|
-
static escapeHtml(text: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Unescape HTML entities back to regular characters
|
|
19
|
-
*/
|
|
20
|
-
static unescapeHtml(html: string): string;
|
|
21
|
-
/**
|
|
22
|
-
* Format HTML content with proper structure and indentation
|
|
23
|
-
* Requirement 3.2: Preserve text structure including paragraphs, lists, and formatting
|
|
24
|
-
*/
|
|
25
|
-
static formatHtml(html: string, options?: HtmlFormattingOptions): string;
|
|
26
|
-
/**
|
|
27
|
-
* Clean HTML content by removing unwanted tags and attributes
|
|
28
|
-
*/
|
|
29
|
-
static cleanHtml(html: string, allowedTags?: string[]): string;
|
|
30
|
-
/**
|
|
31
|
-
* Wrap content in appropriate HTML structure
|
|
32
|
-
* Requirement 3.3: Include HTML content in structured format
|
|
33
|
-
*/
|
|
34
|
-
static wrapContent(content: string, wrapper?: string, className?: string): string;
|
|
35
|
-
/**
|
|
36
|
-
* Extract text content from HTML, removing all tags
|
|
37
|
-
*/
|
|
38
|
-
static stripHtml(html: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Validate HTML structure and check for common issues
|
|
41
|
-
*/
|
|
42
|
-
static validateHtml(html: string): {
|
|
43
|
-
isValid: boolean;
|
|
44
|
-
errors: string[];
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Convert line breaks to HTML paragraphs
|
|
48
|
-
*/
|
|
49
|
-
static lineBreaksToParagraphs(text: string): string;
|
|
50
|
-
/**
|
|
51
|
-
* Truncate HTML content while preserving structure
|
|
52
|
-
*/
|
|
53
|
-
static truncateHtml(html: string, maxLength: number, suffix?: string): string;
|
|
54
|
-
}
|
|
55
|
-
export declare const htmlFormatter: {
|
|
56
|
-
escapeHtml: typeof HtmlFormatter.escapeHtml;
|
|
57
|
-
unescapeHtml: typeof HtmlFormatter.unescapeHtml;
|
|
58
|
-
formatHtml: typeof HtmlFormatter.formatHtml;
|
|
59
|
-
cleanHtml: typeof HtmlFormatter.cleanHtml;
|
|
60
|
-
wrapContent: typeof HtmlFormatter.wrapContent;
|
|
61
|
-
stripHtml: typeof HtmlFormatter.stripHtml;
|
|
62
|
-
validateHtml: typeof HtmlFormatter.validateHtml;
|
|
63
|
-
lineBreaksToParagraphs: typeof HtmlFormatter.lineBreaksToParagraphs;
|
|
64
|
-
truncateHtml: typeof HtmlFormatter.truncateHtml;
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=htmlFormatter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"htmlFormatter.d.ts","sourceRoot":"","sources":["../../src/utils/htmlFormatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,qBAAa,aAAa;IACxB;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAkBvC;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAkBzC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM;IA6C5E;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,MAAM,EAAO,GAAG,MAAM;IAkBlE;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IASxF;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAYtC;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE;IA6BzE;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAYnD;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAAc,GAAG,MAAM;CAoBrF;AAGD,eAAO,MAAM,aAAa;;;;;;;;;;CAUzB,CAAC"}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTML formatting utilities for content processing
|
|
3
|
-
* Requirements: 3.3, 3.4 - Proper HTML formatting and special character escaping
|
|
4
|
-
*/
|
|
5
|
-
export class HtmlFormatter {
|
|
6
|
-
/**
|
|
7
|
-
* Escape HTML special characters for JSON transmission
|
|
8
|
-
* Requirement 3.4: Properly escape special characters for JSON transmission
|
|
9
|
-
*/
|
|
10
|
-
static escapeHtml(text) {
|
|
11
|
-
if (typeof text !== 'string') {
|
|
12
|
-
return '';
|
|
13
|
-
}
|
|
14
|
-
const htmlEscapeMap = {
|
|
15
|
-
'&': '&',
|
|
16
|
-
'<': '<',
|
|
17
|
-
'>': '>',
|
|
18
|
-
'"': '"',
|
|
19
|
-
"'": ''',
|
|
20
|
-
'/': '/',
|
|
21
|
-
'`': '`'
|
|
22
|
-
};
|
|
23
|
-
return text.replace(/[&<>"'`/]/g, (match) => htmlEscapeMap[match] || match);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Unescape HTML entities back to regular characters
|
|
27
|
-
*/
|
|
28
|
-
static unescapeHtml(html) {
|
|
29
|
-
if (typeof html !== 'string') {
|
|
30
|
-
return '';
|
|
31
|
-
}
|
|
32
|
-
const htmlUnescapeMap = {
|
|
33
|
-
'&': '&',
|
|
34
|
-
'<': '<',
|
|
35
|
-
'>': '>',
|
|
36
|
-
'"': '"',
|
|
37
|
-
''': "'",
|
|
38
|
-
'/': '/',
|
|
39
|
-
'`': '`'
|
|
40
|
-
};
|
|
41
|
-
return html.replace(/&(?:amp|lt|gt|quot|#x27|#x2F|#x60);/g, (match) => htmlUnescapeMap[match] || match);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Format HTML content with proper structure and indentation
|
|
45
|
-
* Requirement 3.2: Preserve text structure including paragraphs, lists, and formatting
|
|
46
|
-
*/
|
|
47
|
-
static formatHtml(html, options = {}) {
|
|
48
|
-
if (typeof html !== 'string') {
|
|
49
|
-
return '';
|
|
50
|
-
}
|
|
51
|
-
const { preserveWhitespace = true, escapeSpecialChars = false, minifyOutput = false, addLineBreaks = true } = options;
|
|
52
|
-
let formatted = html;
|
|
53
|
-
// Escape special characters if requested
|
|
54
|
-
if (escapeSpecialChars) {
|
|
55
|
-
formatted = this.escapeHtml(formatted);
|
|
56
|
-
}
|
|
57
|
-
// Handle whitespace preservation
|
|
58
|
-
if (!preserveWhitespace) {
|
|
59
|
-
formatted = formatted.replace(/\s+/g, ' ').trim();
|
|
60
|
-
}
|
|
61
|
-
// Add line breaks for better readability
|
|
62
|
-
if (addLineBreaks && !minifyOutput) {
|
|
63
|
-
formatted = formatted
|
|
64
|
-
.replace(/(<\/(?:p|div|h[1-6]|li|blockquote)>)/g, '$1\n')
|
|
65
|
-
.replace(/(<(?:p|div|h[1-6]|li|blockquote)[^>]*>)/g, '\n$1')
|
|
66
|
-
.replace(/(<br\s*\/?>)/g, '$1\n')
|
|
67
|
-
.replace(/\n\s*\n/g, '\n')
|
|
68
|
-
.trim();
|
|
69
|
-
}
|
|
70
|
-
// Minify output if requested
|
|
71
|
-
if (minifyOutput) {
|
|
72
|
-
formatted = formatted
|
|
73
|
-
.replace(/>\s+</g, '><')
|
|
74
|
-
.replace(/\s+/g, ' ')
|
|
75
|
-
.trim();
|
|
76
|
-
}
|
|
77
|
-
return formatted;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Clean HTML content by removing unwanted tags and attributes
|
|
81
|
-
*/
|
|
82
|
-
static cleanHtml(html, allowedTags = []) {
|
|
83
|
-
if (typeof html !== 'string') {
|
|
84
|
-
return '';
|
|
85
|
-
}
|
|
86
|
-
const defaultAllowedTags = [
|
|
87
|
-
'p', 'div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
|
88
|
-
'strong', 'em', 'u', 'code', 'pre', 'blockquote',
|
|
89
|
-
'ul', 'ol', 'li', 'a', 'img', 'figure', 'figcaption',
|
|
90
|
-
'time', 'br'
|
|
91
|
-
];
|
|
92
|
-
const tagsToAllow = allowedTags.length > 0 ? allowedTags : defaultAllowedTags;
|
|
93
|
-
const tagPattern = new RegExp(`<(?!\/?(?:${tagsToAllow.join('|')})(?:\s|>))[^>]+>`, 'gi');
|
|
94
|
-
return html.replace(tagPattern, '');
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Wrap content in appropriate HTML structure
|
|
98
|
-
* Requirement 3.3: Include HTML content in structured format
|
|
99
|
-
*/
|
|
100
|
-
static wrapContent(content, wrapper = 'div', className) {
|
|
101
|
-
if (typeof content !== 'string') {
|
|
102
|
-
return '';
|
|
103
|
-
}
|
|
104
|
-
const classAttr = className ? ` class="${this.escapeHtml(className)}"` : '';
|
|
105
|
-
return `<${wrapper}${classAttr}>${content}</${wrapper}>`;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Extract text content from HTML, removing all tags
|
|
109
|
-
*/
|
|
110
|
-
static stripHtml(html) {
|
|
111
|
-
if (typeof html !== 'string') {
|
|
112
|
-
return '';
|
|
113
|
-
}
|
|
114
|
-
return html
|
|
115
|
-
.replace(/<[^>]*>/g, '')
|
|
116
|
-
.replace(/&[^;]+;/g, ' ')
|
|
117
|
-
.replace(/\s+/g, ' ')
|
|
118
|
-
.trim();
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Validate HTML structure and check for common issues
|
|
122
|
-
*/
|
|
123
|
-
static validateHtml(html) {
|
|
124
|
-
const errors = [];
|
|
125
|
-
if (typeof html !== 'string') {
|
|
126
|
-
errors.push('HTML content must be a string');
|
|
127
|
-
return { isValid: false, errors };
|
|
128
|
-
}
|
|
129
|
-
// For basic validation, we'll just check for obviously malformed tags
|
|
130
|
-
// More sophisticated validation would require a proper HTML parser
|
|
131
|
-
// Check for obviously malformed tags
|
|
132
|
-
if (html.includes('<>') || html.includes('</>')) {
|
|
133
|
-
errors.push('Malformed HTML tags detected');
|
|
134
|
-
}
|
|
135
|
-
// Check for unclosed angle brackets
|
|
136
|
-
const openBrackets = (html.match(/</g) || []).length;
|
|
137
|
-
const closeBrackets = (html.match(/>/g) || []).length;
|
|
138
|
-
if (openBrackets !== closeBrackets) {
|
|
139
|
-
errors.push('Mismatched angle brackets detected');
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
isValid: errors.length === 0,
|
|
143
|
-
errors
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Convert line breaks to HTML paragraphs
|
|
148
|
-
*/
|
|
149
|
-
static lineBreaksToParagraphs(text) {
|
|
150
|
-
if (typeof text !== 'string') {
|
|
151
|
-
return '';
|
|
152
|
-
}
|
|
153
|
-
return text
|
|
154
|
-
.split(/\n\s*\n/)
|
|
155
|
-
.filter(paragraph => paragraph.trim())
|
|
156
|
-
.map(paragraph => `<p>${this.escapeHtml(paragraph.trim())}</p>`)
|
|
157
|
-
.join('\n');
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Truncate HTML content while preserving structure
|
|
161
|
-
*/
|
|
162
|
-
static truncateHtml(html, maxLength, suffix = '...') {
|
|
163
|
-
if (typeof html !== 'string' || html.length <= maxLength) {
|
|
164
|
-
return html;
|
|
165
|
-
}
|
|
166
|
-
const textContent = this.stripHtml(html);
|
|
167
|
-
if (textContent.length <= maxLength) {
|
|
168
|
-
return html;
|
|
169
|
-
}
|
|
170
|
-
// Simple truncation that tries to preserve structure
|
|
171
|
-
const truncated = html.substring(0, maxLength);
|
|
172
|
-
const lastCompleteTag = truncated.lastIndexOf('>');
|
|
173
|
-
if (lastCompleteTag > 0) {
|
|
174
|
-
return truncated.substring(0, lastCompleteTag + 1) + suffix;
|
|
175
|
-
}
|
|
176
|
-
return truncated + suffix;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
// Export convenience functions for backward compatibility
|
|
180
|
-
export const htmlFormatter = {
|
|
181
|
-
escapeHtml: HtmlFormatter.escapeHtml,
|
|
182
|
-
unescapeHtml: HtmlFormatter.unescapeHtml,
|
|
183
|
-
formatHtml: HtmlFormatter.formatHtml,
|
|
184
|
-
cleanHtml: HtmlFormatter.cleanHtml,
|
|
185
|
-
wrapContent: HtmlFormatter.wrapContent,
|
|
186
|
-
stripHtml: HtmlFormatter.stripHtml,
|
|
187
|
-
validateHtml: HtmlFormatter.validateHtml,
|
|
188
|
-
lineBreaksToParagraphs: HtmlFormatter.lineBreaksToParagraphs,
|
|
189
|
-
truncateHtml: HtmlFormatter.truncateHtml
|
|
190
|
-
};
|
|
191
|
-
//# sourceMappingURL=htmlFormatter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"htmlFormatter.js","sourceRoot":"","sources":["../../src/utils/htmlFormatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,OAAO,aAAa;IACxB;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,IAAY;QAC5B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,aAAa,GAA2B;YAC5C,GAAG,EAAE,OAAO;YACZ,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ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AED,qDAAqD;QACrD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QAC/C,MAAM,eAAe,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAEnD,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;QAC9D,CAAC;QAED,OAAO,SAAS,GAAG,MAAM,CAAC;IAC5B,CAAC;CACF;AAED,0DAA0D;AAC1D,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,UAAU,EAAE,aAAa,CAAC,UAAU;IACpC,YAAY,EAAE,aAAa,CAAC,YAAY;IACxC,UAAU,EAAE,aAAa,CAAC,UAAU;IACpC,SAAS,EAAE,aAAa,CAAC,SAAS;IAClC,WAAW,EAAE,aAAa,CAAC,WAAW;IACtC,SAAS,EAAE,aAAa,CAAC,SAAS;IAClC,YAAY,EAAE,aAAa,CAAC,YAAY;IACxC,sBAAsB,EAAE,aAAa,CAAC,sBAAsB;IAC5D,YAAY,EAAE,aAAa,CAAC,YAAY;CACzC,CAAC"}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for the Sanity Translation Plugin
|
|
3
|
-
* Requirements: 3.3, 3.4, 4.3
|
|
4
|
-
*/
|
|
5
|
-
export * from './htmlFormatter';
|
|
6
|
-
export * from './logger';
|
|
7
|
-
export * from './validator';
|
|
8
|
-
export * from './oauthLogger';
|
|
9
|
-
export * from './oauthErrorFeedback';
|
|
10
|
-
export { HtmlFormatter } from './htmlFormatter';
|
|
11
|
-
export { Logger, LogLevel, defaultLogger } from './logger';
|
|
12
|
-
export { Validator } from './validator';
|
|
13
|
-
export { OAuthLogger, createOAuthLogger } from './oauthLogger';
|
|
14
|
-
export { OAuthErrorFeedback, createOAuthErrorFeedback } from './oauthErrorFeedback';
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/utils/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for the Sanity Translation Plugin
|
|
3
|
-
* Requirements: 3.3, 3.4, 4.3
|
|
4
|
-
*/
|
|
5
|
-
export * from './htmlFormatter';
|
|
6
|
-
export * from './logger';
|
|
7
|
-
export * from './validator';
|
|
8
|
-
export * from './oauthLogger';
|
|
9
|
-
export * from './oauthErrorFeedback';
|
|
10
|
-
// Re-export main utility classes for convenience
|
|
11
|
-
export { HtmlFormatter } from './htmlFormatter';
|
|
12
|
-
export { Logger, LogLevel, defaultLogger } from './logger';
|
|
13
|
-
export { Validator } from './validator';
|
|
14
|
-
export { OAuthLogger, createOAuthLogger } from './oauthLogger';
|
|
15
|
-
export { OAuthErrorFeedback, createOAuthErrorFeedback } from './oauthErrorFeedback';
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AAErC,iDAAiD;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logging utilities with structured output
|
|
3
|
-
* Requirements: 4.3 - Clear error messages and structured logging
|
|
4
|
-
*/
|
|
5
|
-
export declare enum LogLevel {
|
|
6
|
-
DEBUG = 0,
|
|
7
|
-
INFO = 1,
|
|
8
|
-
WARN = 2,
|
|
9
|
-
ERROR = 3
|
|
10
|
-
}
|
|
11
|
-
export interface LogEntry {
|
|
12
|
-
timestamp: string;
|
|
13
|
-
level: LogLevel;
|
|
14
|
-
message: string;
|
|
15
|
-
context?: Record<string, any>;
|
|
16
|
-
error?: Error;
|
|
17
|
-
}
|
|
18
|
-
export interface LoggerConfig {
|
|
19
|
-
level: LogLevel;
|
|
20
|
-
enableConsole: boolean;
|
|
21
|
-
enableStructuredOutput: boolean;
|
|
22
|
-
prefix?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare class Logger {
|
|
25
|
-
private config;
|
|
26
|
-
constructor(config?: Partial<LoggerConfig>);
|
|
27
|
-
/**
|
|
28
|
-
* Log debug message
|
|
29
|
-
*/
|
|
30
|
-
debug(message: string, context?: Record<string, any>): void;
|
|
31
|
-
/**
|
|
32
|
-
* Log info message
|
|
33
|
-
*/
|
|
34
|
-
info(message: string, context?: Record<string, any>): void;
|
|
35
|
-
/**
|
|
36
|
-
* Log warning message
|
|
37
|
-
*/
|
|
38
|
-
warn(message: string, context?: Record<string, any>): void;
|
|
39
|
-
/**
|
|
40
|
-
* Log error message
|
|
41
|
-
* Requirement 4.3: Display clear error messages
|
|
42
|
-
*/
|
|
43
|
-
error(message: string, error?: Error, context?: Record<string, any>): void;
|
|
44
|
-
/**
|
|
45
|
-
* Log translation request with structured format
|
|
46
|
-
* Requirements: 1.3, 2.4 - Log request body to console for verification
|
|
47
|
-
*/
|
|
48
|
-
logTranslationRequest(documentId: string, endpoint: string, payload: any): void;
|
|
49
|
-
/**
|
|
50
|
-
* Log bulk translation summary
|
|
51
|
-
* Requirement 2.5: Display summary of processed documents
|
|
52
|
-
*/
|
|
53
|
-
logBulkTranslationSummary(summary: {
|
|
54
|
-
totalDocuments: number;
|
|
55
|
-
processedDocuments: number;
|
|
56
|
-
failedDocuments: number;
|
|
57
|
-
duration?: number;
|
|
58
|
-
}): void;
|
|
59
|
-
/**
|
|
60
|
-
* Log document processing progress
|
|
61
|
-
*/
|
|
62
|
-
logProgress(current: number, total: number, documentId?: string): void;
|
|
63
|
-
/**
|
|
64
|
-
* Log validation errors
|
|
65
|
-
* Requirement 4.3: Clear error messages for validation failures
|
|
66
|
-
*/
|
|
67
|
-
logValidationError(type: string, errors: string[], context?: Record<string, any>): void;
|
|
68
|
-
/**
|
|
69
|
-
* Log performance metrics
|
|
70
|
-
*/
|
|
71
|
-
logPerformance(operation: string, duration: number, context?: Record<string, any>): void;
|
|
72
|
-
/**
|
|
73
|
-
* Core logging method
|
|
74
|
-
*/
|
|
75
|
-
private log;
|
|
76
|
-
/**
|
|
77
|
-
* Output log entry to console with appropriate formatting
|
|
78
|
-
*/
|
|
79
|
-
private outputToConsole;
|
|
80
|
-
/**
|
|
81
|
-
* Serialize error object for logging
|
|
82
|
-
*/
|
|
83
|
-
private serializeError;
|
|
84
|
-
/**
|
|
85
|
-
* Update logger configuration
|
|
86
|
-
*/
|
|
87
|
-
updateConfig(config: Partial<LoggerConfig>): void;
|
|
88
|
-
/**
|
|
89
|
-
* Get current configuration
|
|
90
|
-
*/
|
|
91
|
-
getConfig(): LoggerConfig;
|
|
92
|
-
}
|
|
93
|
-
export declare const defaultLogger: Logger;
|
|
94
|
-
export declare const logger: {
|
|
95
|
-
debug: (message: string, context?: Record<string, any>) => void;
|
|
96
|
-
info: (message: string, context?: Record<string, any>) => void;
|
|
97
|
-
warn: (message: string, context?: Record<string, any>) => void;
|
|
98
|
-
error: (message: string, error?: Error, context?: Record<string, any>) => void;
|
|
99
|
-
logTranslationRequest: (documentId: string, endpoint: string, payload: any) => void;
|
|
100
|
-
logBulkTranslationSummary: (summary: any) => void;
|
|
101
|
-
logProgress: (current: number, total: number, documentId?: string) => void;
|
|
102
|
-
logValidationError: (type: string, errors: string[], context?: Record<string, any>) => void;
|
|
103
|
-
logPerformance: (operation: string, duration: number, context?: Record<string, any>) => void;
|
|
104
|
-
};
|
|
105
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,CAAC;I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