@el-j/google-sheet-translations 2.2.0 → 3.0.0-beta.13

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.
Files changed (122) hide show
  1. package/README.md +44 -1
  2. package/dist/action-entrypoint.d.ts.map +1 -1
  3. package/dist/core/rowTransformer.d.ts +26 -0
  4. package/dist/core/rowTransformer.d.ts.map +1 -0
  5. package/dist/esm/index.js +9549 -2524
  6. package/dist/getMultipleSpreadSheetsData.d.ts.map +1 -1
  7. package/dist/getSpreadSheetData.d.ts +3 -3
  8. package/dist/getSpreadSheetData.d.ts.map +1 -1
  9. package/dist/index.d.ts +13 -8
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +9656 -2611
  12. package/dist/migration/migrateV3.d.ts +60 -0
  13. package/dist/migration/migrateV3.d.ts.map +1 -0
  14. package/dist/providers/assetContracts.d.ts +88 -0
  15. package/dist/providers/assetContracts.d.ts.map +1 -0
  16. package/dist/providers/capabilities.d.ts +50 -0
  17. package/dist/providers/capabilities.d.ts.map +1 -0
  18. package/dist/providers/catalog.d.ts +73 -0
  19. package/dist/providers/catalog.d.ts.map +1 -0
  20. package/dist/providers/config.d.ts +56 -0
  21. package/dist/providers/config.d.ts.map +1 -0
  22. package/dist/providers/contracts.d.ts +138 -0
  23. package/dist/providers/contracts.d.ts.map +1 -0
  24. package/dist/providers/cryptpad/assetProvider.d.ts +37 -0
  25. package/dist/providers/cryptpad/assetProvider.d.ts.map +1 -0
  26. package/dist/providers/cryptpad/chainpad.d.ts +15 -0
  27. package/dist/providers/cryptpad/chainpad.d.ts.map +1 -0
  28. package/dist/providers/cryptpad/client.d.ts +195 -0
  29. package/dist/providers/cryptpad/client.d.ts.map +1 -0
  30. package/dist/providers/cryptpad/crypto.d.ts +46 -0
  31. package/dist/providers/cryptpad/crypto.d.ts.map +1 -0
  32. package/dist/providers/cryptpad/driveCatalogProvider.d.ts +23 -0
  33. package/dist/providers/cryptpad/driveCatalogProvider.d.ts.map +1 -0
  34. package/dist/providers/cryptpad/driveClient.d.ts +42 -0
  35. package/dist/providers/cryptpad/driveClient.d.ts.map +1 -0
  36. package/dist/providers/cryptpad/fullProvider.d.ts +48 -0
  37. package/dist/providers/cryptpad/fullProvider.d.ts.map +1 -0
  38. package/dist/providers/cryptpad/index.d.ts +25 -0
  39. package/dist/providers/cryptpad/index.d.ts.map +1 -0
  40. package/dist/providers/cryptpad/netflux.d.ts +27 -0
  41. package/dist/providers/cryptpad/netflux.d.ts.map +1 -0
  42. package/dist/providers/cryptpad/provider.d.ts +37 -0
  43. package/dist/providers/cryptpad/provider.d.ts.map +1 -0
  44. package/dist/providers/cryptpad/sheetOutputProvider.d.ts +46 -0
  45. package/dist/providers/cryptpad/sheetOutputProvider.d.ts.map +1 -0
  46. package/dist/providers/cryptpad/sheetParser.d.ts +196 -0
  47. package/dist/providers/cryptpad/sheetParser.d.ts.map +1 -0
  48. package/dist/providers/cryptpad/sheetProvider.d.ts +38 -0
  49. package/dist/providers/cryptpad/sheetProvider.d.ts.map +1 -0
  50. package/dist/providers/cryptpad/sheetSyncProvider.d.ts +46 -0
  51. package/dist/providers/cryptpad/sheetSyncProvider.d.ts.map +1 -0
  52. package/dist/providers/google/index.d.ts +4 -0
  53. package/dist/providers/google/index.d.ts.map +1 -0
  54. package/dist/providers/google/providers.d.ts +106 -0
  55. package/dist/providers/google/providers.d.ts.map +1 -0
  56. package/dist/providers/index.d.ts +25 -0
  57. package/dist/providers/index.d.ts.map +1 -0
  58. package/dist/providers/orchestrator.d.ts +74 -0
  59. package/dist/providers/orchestrator.d.ts.map +1 -0
  60. package/dist/providers/runtime.d.ts +30 -0
  61. package/dist/providers/runtime.d.ts.map +1 -0
  62. package/dist/providers/syncEngine.d.ts +107 -0
  63. package/dist/providers/syncEngine.d.ts.map +1 -0
  64. package/dist/setup/cryptpadCli.d.ts +2 -0
  65. package/dist/setup/cryptpadCli.d.ts.map +1 -0
  66. package/dist/setup/gcpTransport.d.ts +25 -0
  67. package/dist/setup/gcpTransport.d.ts.map +1 -1
  68. package/dist/setup/migrateV3Cli.d.ts +2 -0
  69. package/dist/setup/migrateV3Cli.d.ts.map +1 -0
  70. package/dist/setup/providerCli.d.ts +2 -0
  71. package/dist/setup/providerCli.d.ts.map +1 -0
  72. package/dist/setup/wifSetup.d.ts +1 -1
  73. package/dist/setup/wifSetup.d.ts.map +1 -1
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/utils/auth.d.ts +1 -1
  76. package/dist/utils/auth.d.ts.map +1 -1
  77. package/dist/utils/configurationHandler.d.ts.map +1 -1
  78. package/dist/utils/dataConverter/convertFromDataJsonFormat.d.ts +1 -1
  79. package/dist/utils/dataConverter/convertFromDataJsonFormat.d.ts.map +1 -1
  80. package/dist/utils/dataConverter/convertToDataJsonFormat.d.ts +1 -1
  81. package/dist/utils/dataConverter/convertToDataJsonFormat.d.ts.map +1 -1
  82. package/dist/utils/dataConverter/findLocalChanges.d.ts +1 -1
  83. package/dist/utils/dataConverter/findLocalChanges.d.ts.map +1 -1
  84. package/dist/utils/docIngester.d.ts.map +1 -1
  85. package/dist/utils/docParser.d.ts.map +1 -1
  86. package/dist/utils/driveDocScanner.d.ts.map +1 -1
  87. package/dist/utils/driveFolderScanner.d.ts.map +1 -1
  88. package/dist/utils/driveImageSync.d.ts.map +1 -1
  89. package/dist/utils/driveSpreadsheetBootstrap.d.ts.map +1 -1
  90. package/dist/utils/fileWriter.d.ts +1 -1
  91. package/dist/utils/fileWriter.d.ts.map +1 -1
  92. package/dist/utils/getDriveTranslations.d.ts.map +1 -1
  93. package/dist/utils/isDataJsonNewer.d.ts.map +1 -1
  94. package/dist/utils/localImageUtils.d.ts.map +1 -1
  95. package/dist/utils/localeFilter.d.ts.map +1 -1
  96. package/dist/utils/localeNormalizer.d.ts.map +1 -1
  97. package/dist/utils/multiSpreadsheetMerger.d.ts.map +1 -1
  98. package/dist/utils/publicSheetReader.d.ts +1 -1
  99. package/dist/utils/publicSheetReader.d.ts.map +1 -1
  100. package/dist/utils/rateLimiter.d.ts.map +1 -1
  101. package/dist/utils/readDataJson.d.ts +1 -1
  102. package/dist/utils/sheetProcessor.d.ts +4 -9
  103. package/dist/utils/sheetProcessor.d.ts.map +1 -1
  104. package/dist/utils/spreadsheetCreator.d.ts +1 -1
  105. package/dist/utils/spreadsheetCreator.d.ts.map +1 -1
  106. package/dist/utils/spreadsheetFormulas.d.ts +1 -1
  107. package/dist/utils/spreadsheetFormulas.d.ts.map +1 -1
  108. package/dist/utils/spreadsheetUpdater.d.ts +3 -3
  109. package/dist/utils/spreadsheetUpdater.d.ts.map +1 -1
  110. package/dist/utils/syncManager.d.ts +2 -2
  111. package/dist/utils/syncManager.d.ts.map +1 -1
  112. package/dist/utils/translationDataStats.d.ts +13 -0
  113. package/dist/utils/translationDataStats.d.ts.map +1 -0
  114. package/dist/utils/translationHelpers.d.ts.map +1 -1
  115. package/dist/utils/validateEnv.d.ts +1 -1
  116. package/dist/utils/validateEnv.d.ts.map +1 -1
  117. package/dist/utils/wait.d.ts.map +1 -1
  118. package/dist-cli/cryptpad.mjs +6363 -0
  119. package/dist-cli/migrate-v3.mjs +406 -0
  120. package/dist-cli/run-provider.mjs +7441 -0
  121. package/dist-cli/setup-wif.mjs +334 -18949
  122. package/package.json +47 -24
@@ -0,0 +1,195 @@
1
+ import { type ParsedCryptPadUrl, type DerivedCryptPadKeys } from './crypto';
2
+ import { type CryptPadSheetGrid, type OnlyOfficeCellUpdate } from './sheetParser';
3
+ import type { SheetRow } from '../../types';
4
+ export interface CryptPadClientOptions {
5
+ /** Full CryptPad URL (e.g. https://cryptpad.fr/sheet/#/2/sheet/edit/seed/p/). */
6
+ url: string;
7
+ /** Password for password-protected pads. */
8
+ password?: string;
9
+ /** Optional custom WebSocket endpoint override. If omitted, automatically queried from instance config. */
10
+ websocketUrl?: string;
11
+ /** Optional timeout in milliseconds for history retrieval. Defaults to 10000ms. */
12
+ timeoutMs?: number;
13
+ /** Optional callback for progress/status messages during headless RT channel setup. */
14
+ onProgress?: (message: string) => void;
15
+ }
16
+ export interface CryptPadSheetResult {
17
+ url: string;
18
+ cells: CryptPadSheetGrid;
19
+ rows: SheetRow[];
20
+ sheets: Record<string, {
21
+ cells: CryptPadSheetGrid;
22
+ rows: SheetRow[];
23
+ }>;
24
+ sheetNames: string[];
25
+ sheetIds?: Record<string, string>;
26
+ metadata: {
27
+ app: string;
28
+ mode: string;
29
+ channelId: string;
30
+ rtChannelId?: string;
31
+ title?: string;
32
+ };
33
+ }
34
+ /**
35
+ * Headless programmatic client for interacting with CryptPad documents (spreadsheets)
36
+ * over end-to-end encrypted Netflux WebSockets without requiring a browser or user interaction.
37
+ */
38
+ export declare class CryptPadClient {
39
+ readonly parsedUrl: ParsedCryptPadUrl;
40
+ readonly password?: string;
41
+ websocketUrl?: string;
42
+ readonly timeoutMs: number;
43
+ readonly onProgress?: (message: string) => void;
44
+ private derivedKeys?;
45
+ constructor(options: CryptPadClientOptions);
46
+ /**
47
+ * Gets or derives the symmetric key and primary Netflux channel ID.
48
+ *
49
+ * @returns The derived CryptPad channel hex ID and 32-byte TweetNaCl secretbox key.
50
+ */
51
+ getKeys(): DerivedCryptPadKeys;
52
+ /**
53
+ * Resolves the Netflux WebSocket endpoint to connect to. Cached on this instance after
54
+ * the first successful resolution — every multi-step operation (`writeSheetRows` in
55
+ * particular) calls this once per sub-step, and re-resolving the same endpoint via a
56
+ * fresh HTTP request each time needlessly multiplies outbound connections for no benefit
57
+ * (the endpoint doesn't change within a single client's lifetime).
58
+ *
59
+ * @param signal - Optional AbortSignal to cancel connection discovery.
60
+ * @returns The WebSocket endpoint URL (wss:// or ws://).
61
+ */
62
+ getWebsocketUrl(signal?: AbortSignal): Promise<string>;
63
+ /**
64
+ * Initializes the OnlyOffice RT channel for a brand-new CryptPad sheet that has never
65
+ * been opened in a browser.
66
+ *
67
+ * ### CryptPad Protocol Details
68
+ * CryptPad pads use Netflux channels for real-time collaboration. The main pad channel
69
+ * stores document metadata. When a spreadsheet pad is opened in OnlyOffice, the OnlyOffice
70
+ * web wrapper creates a secondary Netflux channel for real-time document change frames
71
+ * and registers it in the pad's metadata channel.
72
+ *
73
+ * The metadata update is formatted as an edit sequence:
74
+ * `[sequenceNumber, [[offset, length, innerJsonString]]]`
75
+ * where `sequenceNumber` is 1, and `innerJsonString` is:
76
+ * `{"content":{"channel":"<32-hex-channel-id>"}}`.
77
+ *
78
+ * Broadcasting this envelope over the main channel headlessly replicates OnlyOffice's
79
+ * first-open handshake without requiring a browser or headless browser session.
80
+ *
81
+ * @param signal - Optional AbortSignal to cancel the initialization.
82
+ * @returns The newly allocated 32-character hexadecimal RT channel ID.
83
+ */
84
+ initializeRtChannel(signal?: AbortSignal): Promise<string>;
85
+ /**
86
+ * Creates a new sheet tab on this pad by broadcasting a real OnlyOffice
87
+ * `Workbook_SheetAdd` history record to the RT channel — the same operation a
88
+ * real OnlyOffice browser client sends when a user clicks "Add sheet". The
89
+ * binary layout was derived and byte-verified against two independent live
90
+ * captures from an actual browser session (see issue #161); it is not a guess.
91
+ *
92
+ * If the pad has never been opened by a real OnlyOffice client (no RT channel
93
+ * yet), the RT channel is initialized headlessly first, matching {@link sendCellUpdates}.
94
+ *
95
+ * @param name - Display name for the new sheet tab.
96
+ * @param insertBeforeIndex - 0-based tab position to insert at. Defaults to appending
97
+ * after all currently known tabs.
98
+ * @param signal - Optional AbortSignal.
99
+ * @returns The newly generated internal sheetId — use this for subsequent cell writes
100
+ * into the new sheet.
101
+ */
102
+ createSheet(name: string, insertBeforeIndex?: number, signal?: AbortSignal): Promise<string>;
103
+ /**
104
+ * Broadcasts a `Workbook_SheetAdd` record to an already-known RT channel, without
105
+ * re-fetching sheet data first. Used internally by {@link createSheet} (after it has
106
+ * resolved the channel) and by the `i18n`-header-linking path in {@link writeSheetRows}
107
+ * to avoid opening a fresh WebSocket connection for every step of a single push — CryptPad
108
+ * (and this environment's outbound networking) can drop a connection attempt when several
109
+ * are opened back-to-back in quick succession.
110
+ */
111
+ private broadcastSheetAdd;
112
+ /**
113
+ * Writes a literal-text header row (row 1) into a sheet — the canonical, non-linked
114
+ * form used for the `i18n` sheet itself (there is nothing to link an `i18n` header to)
115
+ * and as the safe fallback whenever a new sheet's columns can't be aligned 1:1 with an
116
+ * already-existing `i18n` sheet's header. Takes an already-known `rtChannel` to avoid an
117
+ * extra connection round-trip (see {@link broadcastSheetAdd}).
118
+ */
119
+ private writeLiteralHeaderRow;
120
+ /**
121
+ * Writes a header row (row 1) whose cells are formulas referencing the corresponding
122
+ * column of the reserved `i18n` sheet's own header row (`=i18n!A1`, `=i18n!B1`, ...),
123
+ * so a sheet's header visually mirrors `i18n` instead of duplicating literal text — see
124
+ * issue #165. Column `idx` here must already be verified to align with the `i18n`
125
+ * sheet's real column `idx` by the caller ({@link ensureI18nSheetHeader}). Takes an
126
+ * already-known `rtChannel` to avoid an extra connection round-trip.
127
+ */
128
+ private writeLinkedHeaderRow;
129
+ /**
130
+ * Ensures the reserved `i18n` sheet exists and has a header row, so other sheets can
131
+ * link their own header cells to it (see issue #165). Never overwrites an `i18n` header
132
+ * that already has content — it is the canonical source, so once populated it's treated
133
+ * as authoritative and only ever appended-to-by-creation, never silently rewritten.
134
+ *
135
+ * Takes the caller's already-fetched `data` snapshot and `rtChannel` instead of
136
+ * re-fetching — `data` was captured before this call's own sheet creation, but `i18n`'s
137
+ * own state is unaffected by creating a *different* sheet, so it stays accurate. This
138
+ * keeps a single `writeSheetRows` call from opening a new connection per sub-step.
139
+ *
140
+ * @param desiredHeaders - Header row to write if `i18n` doesn't exist yet (or exists but
141
+ * has no header row). Ignored if `i18n` already has a populated header row.
142
+ * @returns The `i18n` sheet's ID and its actual current header row (which may differ
143
+ * from `desiredHeaders` if the sheet already existed with different columns) — callers
144
+ * must compare before linking, since a mismatched column order would silently point a
145
+ * new sheet's header cells at the wrong `i18n` columns.
146
+ */
147
+ private ensureI18nSheetHeader;
148
+ /**
149
+ * Fetches the complete sheet data, including raw cell coordinate mappings,
150
+ * multi-sheet tabs, and structured rows formatted for translation ingestion.
151
+ *
152
+ * @param signal - Optional AbortSignal to cancel the fetch.
153
+ * @returns The structured {@link CryptPadSheetResult} containing grids, rows, and metadata.
154
+ */
155
+ fetchSheetData(signal?: AbortSignal): Promise<CryptPadSheetResult>;
156
+ /**
157
+ * Directly fetches tabular translation rows `[ { key: '...', en: '...', de: '...' } ]`.
158
+ * If `sheetName` is provided, returns rows for that specific tab.
159
+ *
160
+ * @param sheetName - Optional tab/sheet name to extract rows from.
161
+ * @param signal - Optional AbortSignal to cancel the operation.
162
+ * @returns An array of {@link SheetRow} objects.
163
+ */
164
+ fetchSheetRows(sheetName?: string, signal?: AbortSignal): Promise<SheetRow[]>;
165
+ /**
166
+ * Broadcasts cell updates to the OnlyOffice real-time collaboration channel.
167
+ * If the sheet has never been opened in a browser (RT channel is None), it is
168
+ * automatically initialized headlessly — no browser required.
169
+ *
170
+ * @param updates - Array of cell updates containing coordinates and text values.
171
+ * @param signal - Optional AbortSignal to cancel the broadcast.
172
+ * @param existingRtChannel - Optional pre-fetched RT channel ID to avoid refetching sheet data.
173
+ */
174
+ sendCellUpdates(updates: OnlyOfficeCellUpdate[], signal?: AbortSignal, existingRtChannel?: string): Promise<void>;
175
+ /**
176
+ * Updates or appends rows in a target sheet tab, creating new cells as needed.
177
+ *
178
+ * @param sheetName - Target sheet tab name (e.g. 'i18n' or 'common').
179
+ * @param rows - Array of translation rows to write.
180
+ * @param options - Write options: override existing non-empty values and optional signal.
181
+ * @returns The total number of cell update records sent.
182
+ */
183
+ writeSheetRows(sheetName: string, rows: SheetRow[], options?: {
184
+ override?: boolean;
185
+ signal?: AbortSignal;
186
+ /** When true (default false — opt-in, not yet live-verified against a real
187
+ * OnlyOffice session, see {@link encodeOnlyOfficeFormulaCellRecord}) and this call
188
+ * creates a brand-new, non-`i18n` sheet, that sheet's header row is written as
189
+ * formula cells linking to the `i18n` sheet's header row (`=i18n!A1`, ...) instead
190
+ * of duplicated literal text — see issue #165. Never touches a sheet's header on
191
+ * any push after its creation. */
192
+ linkHeadersToI18nSheet?: boolean;
193
+ }): Promise<number>;
194
+ }
195
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/client.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,46 @@
1
+ export interface ParsedCryptPadUrl {
2
+ origin: string;
3
+ version: number;
4
+ app: string;
5
+ mode: 'edit' | 'view';
6
+ seed: string;
7
+ isPasswordProtected: boolean;
8
+ cleanUrl: string;
9
+ }
10
+ export interface DerivedCryptPadKeys {
11
+ channelHex: string;
12
+ cryptKey: Uint8Array;
13
+ signKey: Uint8Array;
14
+ validateKey: Uint8Array;
15
+ }
16
+ /** Decodes CryptPad base64 string (which may have '-' instead of '/' and no padding). */
17
+ export declare function b64Decode(str: string): Uint8Array;
18
+ /** Encodes bytes to standard base64 string. */
19
+ export declare function b64Encode(bytes: Uint8Array): string;
20
+ /** Decodes UTF-8 string to Uint8Array. */
21
+ export declare function decodeUTF8(str: string): Uint8Array;
22
+ /** Encodes Uint8Array to UTF-8 string. */
23
+ export declare function encodeUTF8(bytes: Uint8Array): string;
24
+ /**
25
+ * Parses a CryptPad URL and extracts the app type, mode, seed, and whether it requires a password.
26
+ * Format: https://{host}/{app}/#/{version}/{app}/{mode}/{seed}[/p/]
27
+ */
28
+ export declare function parsePadUrl(url: string): ParsedCryptPadUrl;
29
+ /**
30
+ * Derives the Netflux channel ID (hex string), symmetric encryption key (32 bytes),
31
+ * and Ed25519 signing keypair from a CryptPad pad seed and optional password
32
+ * according to CryptPad's createEditCryptor2 / createViewCryptor2 protocol.
33
+ */
34
+ export declare function deriveCryptPadKeys(seedStr: string, password?: string): DerivedCryptPadKeys;
35
+ /**
36
+ * Decrypts an encrypted CryptPad message payload formatted as `nonce|ciphertext`
37
+ * (or optionally prefixed with a 64-byte Ed25519 signature from historyKeeper).
38
+ */
39
+ export declare function decryptCryptPadPayload(payload: string, cryptKey: Uint8Array): string | null;
40
+ /**
41
+ * Encrypts a plaintext message payload using TweetNaCl secretbox (XSalsa20-Poly1305).
42
+ * If signKey is provided, signs the `nonce|ciphertext` string using TweetNaCl Ed25519
43
+ * matching OnlyOffice / CryptPad real-time channel requirements.
44
+ */
45
+ export declare function encryptCryptPadPayload(plaintext: string, cryptKey: Uint8Array, signKey?: Uint8Array): string;
46
+ //# sourceMappingURL=crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/crypto.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,UAAU,CAAC;CACzB;AAED,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAKjD;AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEnD;AAED,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAElD;AAED,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEpD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAmC1D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAkC1F;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAwC3F;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,UAAU,EACpB,OAAO,CAAC,EAAE,UAAU,GACnB,MAAM,CAYR"}
@@ -0,0 +1,23 @@
1
+ import type { ProviderCatalogProvider } from '../catalog';
2
+ import { type ProviderCapabilitySet } from '../capabilities';
3
+ export interface CryptPadDriveCatalogOptions {
4
+ /** Full CryptPad Drive URL (e.g. https://cryptpad.fr/drive/#/2/drive/edit/seed/p/). */
5
+ driveUrl?: string;
6
+ /** Optional master password for the drive pad. */
7
+ password?: string;
8
+ /** Optional map of passwords keyed by pad URL or title. */
9
+ passwords?: Record<string, string>;
10
+ /** Optional custom provider identifier. Defaults to 'cryptpad-drive'. */
11
+ providerId?: string;
12
+ /** Optional custom provider display name. */
13
+ displayName?: string;
14
+ /** Optional timeout in milliseconds for WebSocket retrieval. */
15
+ timeoutMs?: number;
16
+ }
17
+ export declare const CRYPTPAD_DRIVE_CATALOG_CAPABILITIES: ProviderCapabilitySet;
18
+ /**
19
+ * Creates a {@link ProviderCatalogProvider} that inspects an encrypted CryptPad Drive folder,
20
+ * discovering all spreadsheets, document pads, and file assets within the directory tree.
21
+ */
22
+ export declare function createCryptPadDriveCatalogProvider(options?: CryptPadDriveCatalogOptions): ProviderCatalogProvider;
23
+ //# sourceMappingURL=driveCatalogProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driveCatalogProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/driveCatalogProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EAIxB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGlF,MAAM,WAAW,2BAA2B;IAC1C,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mCAAmC,EAAE,qBAEhD,CAAC;AAEH;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,GAAE,2BAAgC,GACxC,uBAAuB,CA+DzB"}
@@ -0,0 +1,42 @@
1
+ import { type ParsedCryptPadUrl } from './crypto';
2
+ export interface CryptPadDriveItem {
3
+ id: string;
4
+ title: string;
5
+ type: 'sheet' | 'file' | 'pad' | 'folder';
6
+ url: string;
7
+ password?: string;
8
+ channel?: string;
9
+ path: string;
10
+ ctime?: number;
11
+ mtime?: number;
12
+ }
13
+ export interface CryptPadDriveClientOptions {
14
+ /** Full CryptPad Drive URL (e.g. https://cryptpad.fr/drive/#/2/drive/edit/seed/p/). */
15
+ url: string;
16
+ /** Optional password if the drive pad is password-protected. */
17
+ password?: string;
18
+ /** Optional map of passwords keyed by pad URL or title. */
19
+ passwords?: Record<string, string>;
20
+ /** Optional timeout in milliseconds. */
21
+ timeoutMs?: number;
22
+ }
23
+ /**
24
+ * Headless client for inspecting and traversing encrypted CryptPad Drive folders.
25
+ */
26
+ export declare class CryptPadDriveClient {
27
+ readonly parsedUrl: ParsedCryptPadUrl;
28
+ readonly password?: string;
29
+ readonly passwords: Record<string, string>;
30
+ readonly timeoutMs: number;
31
+ constructor(options: CryptPadDriveClientOptions);
32
+ /**
33
+ * Fetches the drive pad's Netflux history, decrypts all changes, and parses
34
+ * the hierarchical filesystem tree into a flat list of items.
35
+ */
36
+ listDriveItems(signal?: AbortSignal): Promise<CryptPadDriveItem[]>;
37
+ /**
38
+ * Filters and returns only spreadsheets found within the drive folder.
39
+ */
40
+ listSheets(signal?: AbortSignal): Promise<CryptPadDriveItem[]>;
41
+ }
42
+ //# sourceMappingURL=driveClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driveClient.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/driveClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGnF,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,YAAY,OAAO,EAAE,0BAA0B,EAS9C;IAED;;;OAGG;IACG,cAAc,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAsHvE;IAED;;OAEG;IACG,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAGnE;CACF"}
@@ -0,0 +1,48 @@
1
+ import type { TranslationOutputProvider, TranslationSyncProvider } from '../contracts';
2
+ import { type ProviderCapabilitySet } from '../capabilities';
3
+ import { type SyncConflictPolicy } from '../syncEngine';
4
+ import type { TranslationData } from '../../types';
5
+ interface CryptPadWorkspaceSnapshot {
6
+ revision: number;
7
+ translations: TranslationData;
8
+ metadata?: Record<string, unknown>;
9
+ }
10
+ /**
11
+ * Options for configuring CryptPad workspace output and sync providers.
12
+ */
13
+ export interface CryptPadWorkspaceProviderOptions {
14
+ /** Path to the local JSON snapshot file acting as the CryptPad workspace state. */
15
+ filePath: string;
16
+ /** Optimistic-concurrency guard: if set, writes fail unless the on-disk revision matches. */
17
+ expectedRevision?: number;
18
+ /** Conflict resolution strategy used by the sync provider; ignored by the output provider. */
19
+ conflictPolicy?: SyncConflictPolicy;
20
+ /** Custom provider identifier. */
21
+ providerId?: string;
22
+ /** Custom human-friendly provider name. */
23
+ displayName?: string;
24
+ }
25
+ interface CryptPadWorkspaceProviderDeps {
26
+ readSnapshot: (filePath: string) => Promise<CryptPadWorkspaceSnapshot>;
27
+ writeSnapshot: (filePath: string, snapshot: CryptPadWorkspaceSnapshot) => Promise<void>;
28
+ }
29
+ declare const CRYPTPAD_WORKSPACE_OUTPUT_CAPABILITIES: ProviderCapabilitySet;
30
+ declare const CRYPTPAD_WORKSPACE_SYNC_CAPABILITIES: ProviderCapabilitySet;
31
+ /**
32
+ * Creates a {@link TranslationOutputProvider} that writes translations into a local
33
+ * JSON snapshot file representing CryptPad workspace state. Each write reads the
34
+ * current snapshot, checks `expectedRevision` (if set) for optimistic-concurrency
35
+ * safety, deep-merges the new translations over the existing ones, and writes back
36
+ * with the revision incremented by one.
37
+ */
38
+ export declare function createCryptPadWorkspaceOutputProvider(options: CryptPadWorkspaceProviderOptions, depsOverrides?: Partial<CryptPadWorkspaceProviderDeps>): TranslationOutputProvider;
39
+ /**
40
+ * Creates a {@link TranslationSyncProvider} that reconciles local translation changes
41
+ * against the CryptPad workspace snapshot using {@link resolveSyncPlan} (three-way
42
+ * diff against `payload.metadata.baseTranslations`, falling back to the remote
43
+ * snapshot as base) and the configured `conflictPolicy`. Like the output provider,
44
+ * it checks `expectedRevision` before writing and increments the revision on write.
45
+ */
46
+ export declare function createCryptPadWorkspaceSyncProvider(options: CryptPadWorkspaceProviderOptions, depsOverrides?: Partial<CryptPadWorkspaceProviderDeps>): TranslationSyncProvider;
47
+ export { CRYPTPAD_WORKSPACE_OUTPUT_CAPABILITIES, CRYPTPAD_WORKSPACE_SYNC_CAPABILITIES };
48
+ //# sourceMappingURL=fullProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fullProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/fullProvider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,yBAAyB,EAGzB,uBAAuB,EAExB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAmB,KAAK,kBAAkB,EAA2B,MAAM,eAAe,CAAC;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;IACjB,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8FAA8F;IAC9F,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,6BAA6B;IACrC,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACvE,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzF;AAED,QAAA,MAAM,sCAAsC,EAAE,qBAE5C,CAAC;AAEH,QAAA,MAAM,oCAAoC,EAAE,qBAG1C,CAAC;AAqEH;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,gCAAgC,EACzC,aAAa,GAAE,OAAO,CAAC,6BAA6B,CAAM,GACzD,yBAAyB,CAgC3B;AAqBD;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,gCAAgC,EACzC,aAAa,GAAE,OAAO,CAAC,6BAA6B,CAAM,GACzD,uBAAuB,CA4CzB;AAED,OAAO,EAAE,sCAAsC,EAAE,oCAAoC,EAAE,CAAC"}
@@ -0,0 +1,25 @@
1
+ /** Barrel for the CryptPad provider family: Sheet input/output/sync (E2EE), CSV input, workspace output/sync, Drive catalog, and asset sync. */
2
+ export { createCryptPadCsvInputProvider, CRYPTPAD_CSV_INPUT_CAPABILITIES } from './provider';
3
+ export { createCryptPadSheetInputProvider, CRYPTPAD_SHEET_INPUT_CAPABILITIES, } from './sheetProvider';
4
+ export { createCryptPadSheetOutputProvider, CRYPTPAD_SHEET_OUTPUT_CAPABILITIES, convertTranslationsToSheetRows, } from './sheetOutputProvider';
5
+ export { createCryptPadSheetSyncProvider, CRYPTPAD_SHEET_SYNC_CAPABILITIES, } from './sheetSyncProvider';
6
+ export { createCryptPadDriveCatalogProvider, CRYPTPAD_DRIVE_CATALOG_CAPABILITIES, } from './driveCatalogProvider';
7
+ export { createCryptPadWorkspaceOutputProvider, createCryptPadWorkspaceSyncProvider, CRYPTPAD_WORKSPACE_OUTPUT_CAPABILITIES, CRYPTPAD_WORKSPACE_SYNC_CAPABILITIES, } from './fullProvider';
8
+ export { createCryptPadAssetSyncProvider, CRYPTPAD_ASSET_SYNC_CAPABILITIES } from './assetProvider';
9
+ export { CryptPadClient } from './client';
10
+ export { CryptPadDriveClient } from './driveClient';
11
+ export { parsePadUrl, deriveCryptPadKeys, decryptCryptPadPayload, encryptCryptPadPayload, } from './crypto';
12
+ export { resolveCryptPadWebsocketUrl, fetchChannelHistory, broadcastChannelMessage, } from './netflux';
13
+ export { extractOnlyOfficeChannelId, extractOnlyOfficeMetadata, extractOnlyOfficeSheetIdMap, parseOnlyOfficeChanges, convertCellsToSheetRows, convertCellsToMultiSheetRows, groupCellsBySheet, buildCellRef, buildOnlyOfficeChangePayload, encodeOnlyOfficeCellRecord, colIndexToLetter, letterToColIndex, parseCellRef, } from './sheetParser';
14
+ export type { CryptPadCsvSource, CryptPadCsvInputProviderOptions } from './provider';
15
+ export type { CryptPadSheetSource, CryptPadSheetInputProviderOptions } from './sheetProvider';
16
+ export type { CryptPadSheetOutputProviderOptions } from './sheetOutputProvider';
17
+ export type { CryptPadSheetSyncProviderOptions } from './sheetSyncProvider';
18
+ export type { CryptPadDriveCatalogOptions } from './driveCatalogProvider';
19
+ export type { CryptPadDriveItem, CryptPadDriveClientOptions } from './driveClient';
20
+ export type { CryptPadClientOptions, CryptPadSheetResult } from './client';
21
+ export type { ParsedCryptPadUrl, DerivedCryptPadKeys } from './crypto';
22
+ export type { CryptPadSheetGrid, ReconstructedSheet, OnlyOfficeCellUpdate } from './sheetParser';
23
+ export type { CryptPadWorkspaceProviderOptions } from './fullProvider';
24
+ export type { CryptPadAssetSyncProviderOptions } from './assetProvider';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/index.ts"],"names":[],"mappings":"AAAA,gJAAgJ;AAChJ,OAAO,EAAE,8BAA8B,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAE7F,OAAO,EACL,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,GAC/B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,kCAAkC,EAClC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,qCAAqC,EACrC,mCAAmC,EACnC,sCAAsC,EACtC,oCAAoC,GACrC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,+BAA+B,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAEpG,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,0BAA0B,EAC1B,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AACrF,YAAY,EAAE,mBAAmB,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAC9F,YAAY,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAC;AAChF,YAAY,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AAC5E,YAAY,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AACnF,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC3E,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACvE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEjG,YAAY,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AACvE,YAAY,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,27 @@
1
+ export interface NetfluxBroadcastOptions {
2
+ timeoutMs?: number;
3
+ signal?: AbortSignal;
4
+ signKey?: Uint8Array;
5
+ }
6
+ export interface NetfluxHistoryOptions {
7
+ timeoutMs?: number;
8
+ quietPeriodMs?: number;
9
+ signal?: AbortSignal;
10
+ }
11
+ /**
12
+ * Discovers the real WebSocket URL for a CryptPad instance by querying its `/api/config` endpoint.
13
+ */
14
+ export declare function resolveCryptPadWebsocketUrl(origin: string, signal?: AbortSignal): Promise<string>;
15
+ /**
16
+ * Connects to the CryptPad Netflux WebSocket server, joins a channel,
17
+ * requests its complete history from the historyKeeper peer, decrypts all messages,
18
+ * and returns the decrypted message strings.
19
+ */
20
+ export declare function fetchChannelHistory(wsUrl: string, channelHex: string, cryptKey: Uint8Array, options?: NetfluxHistoryOptions): Promise<string[]>;
21
+ /**
22
+ * Connects to the CryptPad Netflux WebSocket server, joins a channel,
23
+ * encrypts the given message with TweetNaCl, and broadcasts it to all peers
24
+ * in the channel (including historyKeeper).
25
+ */
26
+ export declare function broadcastChannelMessage(wsUrl: string, channelHex: string, cryptKey: Uint8Array, message: string, options?: NetfluxBroadcastOptions): Promise<void>;
27
+ //# sourceMappingURL=netflux.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"netflux.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/netflux.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,UAAU,EACpB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CA8JnB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CAqGf"}
@@ -0,0 +1,37 @@
1
+ import type { TranslationInputProvider } from '../contracts';
2
+ import { type ProviderCapabilitySet } from '../capabilities';
3
+ /** One CSV source to read as a table. Provide exactly one of `url` or `filePath`. */
4
+ export interface CryptPadCsvSource {
5
+ tableName: string;
6
+ url?: string;
7
+ filePath?: string;
8
+ tableId?: string;
9
+ }
10
+ /**
11
+ * Options for configuring a CryptPad CSV input provider.
12
+ */
13
+ export interface CryptPadCsvInputProviderOptions {
14
+ /** Array of CSV source definitions mapping tables to URLs or local files. */
15
+ sources: CryptPadCsvSource[];
16
+ /** Optional CSV column delimiter (defaults to comma ','). */
17
+ delimiter?: string;
18
+ /** Optional custom provider identifier. Defaults to 'cryptpad-csv'. */
19
+ providerId?: string;
20
+ /** Optional custom provider display name. */
21
+ displayName?: string;
22
+ }
23
+ interface CryptPadCsvProviderDeps {
24
+ fetchCsv: (url: string, signal?: AbortSignal) => Promise<string>;
25
+ readCsvFile: (filePath: string) => Promise<string>;
26
+ }
27
+ declare const CRYPTPAD_CSV_INPUT_CAPABILITIES: ProviderCapabilitySet;
28
+ /**
29
+ * Creates a read-only {@link TranslationInputProvider} that reads one or more CSV
30
+ * sources (local files or public export URLs) as canonical tables. This is a CSV-only
31
+ * MVP: it has no output/sync capability, so it is always paired with another provider
32
+ * (e.g. `cryptpad-workspace`) for write-back. Public URLs require no authentication,
33
+ * reflected in `publicReadNoAuth: true`.
34
+ */
35
+ export declare function createCryptPadCsvInputProvider(options: CryptPadCsvInputProviderOptions, depsOverrides?: Partial<CryptPadCsvProviderDeps>): TranslationInputProvider;
36
+ export { CRYPTPAD_CSV_INPUT_CAPABILITIES };
37
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/provider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EAGzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAElF,qFAAqF;AACrF,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,6EAA6E;IAC7E,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACpD;AAED,QAAA,MAAM,+BAA+B,EAAE,qBAGrC,CAAC;AAwCH;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,+BAA+B,EACxC,aAAa,GAAE,OAAO,CAAC,uBAAuB,CAAM,GACnD,wBAAwB,CAoD1B;AAED,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { TranslationOutputProvider } from '../contracts';
2
+ import { type ProviderCapabilitySet } from '../capabilities';
3
+ import type { SheetRow, TranslationData } from '../../types';
4
+ export interface CryptPadSheetOutputProviderOptions {
5
+ /** Full CryptPad URL (e.g. https://cryptpad.fr/sheet/#/2/sheet/edit/seed/p/). */
6
+ url?: string;
7
+ /** Optional password if the pad is password-protected. */
8
+ password?: string;
9
+ /** When true, overwrites existing non-empty cells. Defaults to false. */
10
+ override?: boolean;
11
+ /** Column header mappings for locale normalization. */
12
+ localeMapping?: Record<string, string>;
13
+ /** Optional custom provider identifier. Defaults to 'cryptpad-sheet'. */
14
+ providerId?: string;
15
+ /** Optional custom provider display name. */
16
+ displayName?: string;
17
+ /** Optional key column name in row 1 (e.g. 'var' or 'key'). Defaults to 'key', matching
18
+ * the header a brand-new Google Sheets sheet is created with (see spreadsheetUpdater.ts)
19
+ * and the documented spreadsheet convention (website/guide/spreadsheet-setup.md). Only
20
+ * used when creating a sheet from scratch — writes to an existing sheet always respect
21
+ * whichever of 'var'/'key' that sheet's own header already uses. */
22
+ keyColumnName?: 'var' | 'key' | string;
23
+ /** When true (default false — opt-in, not yet live-verified against a real OnlyOffice
24
+ * session, see `encodeOnlyOfficeFormulaCellRecord`), a brand-new sheet's header row is
25
+ * written as formula cells linking to the reserved `i18n` sheet's header row
26
+ * (`=i18n!A1`, ...) instead of duplicated literal text, so header text stays visually
27
+ * in sync across sheets — see issue #165. Auto-creates the `i18n` sheet's own header
28
+ * row if it doesn't exist yet. Never rewrites an existing sheet's header on a later
29
+ * push. */
30
+ linkHeadersToI18nSheet?: boolean;
31
+ /** Optional timeout in milliseconds for WebSocket operations. */
32
+ timeoutMs?: number;
33
+ }
34
+ export declare const CRYPTPAD_SHEET_OUTPUT_CAPABILITIES: ProviderCapabilitySet;
35
+ /**
36
+ * Converts nested TranslationData `[locale][sheet][key] = value` into
37
+ * tabular rows `Record<sheetName, SheetRow[]>`.
38
+ */
39
+ export declare function convertTranslationsToSheetRows(translations: TranslationData, localeMapping?: Record<string, string>, keyColumnName?: string): Record<string, SheetRow[]>;
40
+ /**
41
+ * Creates a {@link TranslationOutputProvider} that writes translation data directly
42
+ * into password-protected or public CryptPad spreadsheets (multi-tab OnlyOffice workbooks)
43
+ * using end-to-end encrypted Netflux WebSockets.
44
+ */
45
+ export declare function createCryptPadSheetOutputProvider(options?: CryptPadSheetOutputProviderOptions): TranslationOutputProvider;
46
+ //# sourceMappingURL=sheetOutputProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheetOutputProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/cryptpad/sheetOutputProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,yBAAyB,EAE1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAElF,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG7D,MAAM,WAAW,kCAAkC;IACjD,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;yEAIqE;IACrE,aAAa,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IACvC;;;;;;gBAMY;IACZ,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,kCAAkC,EAAE,qBAE/C,CAAC;AAEH;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,eAAe,EAC7B,aAAa,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EAC1C,aAAa,GAAE,MAAc,GAC5B,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAsC5B;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,kCAAuC,GAC/C,yBAAyB,CAsD3B"}