@majikah/majik-signature-client-tauri 1.2.2 → 1.3.4

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/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MajikKeyClientTauri, type MajikKeyClientTauriOptions, type MajikContactMeta, type OpenedSession } from "@majikah/majik-key-client-tauri";
2
- import type { ApiResponse, AppDataSummary, BackupType, BatchDetached, BatchDetachedArgs, BatchSignFilesArgs, BatchSignOutcome, BytesOutput, Cosign, CosignArgs, CreateGroupArgs, CreateStampArgs, Ctx, DetachedSigned, ExpectedSigner, FileChain, FileInput, FileSignatureInfo, HistoryLog, HistorySource, Json, MajikChainAnchor, MajikSignatureJSON, MajikTimestamp, MapFileInfo, MapOrder, MapVerify, OrderArgs, OutputTarget, Permit, ResignArgs, RevisionSet, SealedFile, SelectiveRestoreOptions, SerializedMajikContact, SerializedMajikContactGroup, SigHydrateReport, SigOnlyEventMap, SigOnlyEventType, SignatoriesFilter, SignatureMetadata, SignDetachedArgs, SignedFile, SignerRef, SignFileArgs, SignTextOptions, SignTextResult, SkippedItem, StampAssetKind, StampMeta, TsaBegin, UpdateGroupMetaArgs, UserActivityLog, UserAppPreferences, VerifyDetachedArgs, VerifyFileArgs, VerifyMapArgs, VerifyResult, VerifyTextArgs } from "./types.js";
2
+ import type { ApiResponse, AppDataSummary, BackupType, BatchDetached, BatchDetachedArgs, BatchSignFilesArgs, BatchSignOutcome, BytesOutput, Cosign, CosignArgs, CreateGroupArgs, CreateStampArgs, Ctx, DetachedSigned, ExpectedSigner, FileChain, FileInput, FileSignatureInfo, HistoryLog, HistorySource, Json, MajikChainAnchor, MajikSignatureJSON, MajikTimestamp, MapFileInfo, MapOrder, MapVerify, OrderArgs, OutputTarget, Permit, ResignArgs, RevisionSet, SealedFile, SelectiveRestoreOptions, SerializedMajikContact, SerializedMajikContactGroup, SigHydrateReport, SigOnlyEventMap, SigOnlyEventType, SignatoriesFilter, SignatureMetadata, SignDetachedArgs, SignSessionFileArgs, SessionSigned, EncryptSignRoomFileArgs, EncryptSignRoomFileResult, DecryptSignRoomFileArgs, DecryptSignRoomFileResult, SignedFile, SignerRef, SignFileArgs, SignTextOptions, SignTextResult, SkippedItem, StampAssetKind, StampMeta, TsaBegin, UpdateGroupMetaArgs, UserActivityLog, UserAppPreferences, VerifyDetachedArgs, VerifyFileArgs, VerifyMapArgs, VerifyResult, VerifyTextArgs } from "./types.js";
3
3
  export declare const SIGNATURE_PLUGIN = "majik-signature-client";
4
4
  export declare const SIGNATURE_EVENT_CHANNEL = "majik-signature-client:event";
5
5
  export type MajikSignatureClientTauriOptions = MajikKeyClientTauriOptions;
@@ -124,6 +124,12 @@ export declare class MajikSignatureClientTauri extends MajikKeyClientTauri {
124
124
  signFile(args: SignFileArgs): Promise<SignedFile>;
125
125
  /** Sign `input` and produce a separate `.mjksig` envelope. */
126
126
  signFileDetached(args: SignDetachedArgs): Promise<DetachedSigned>;
127
+ /** Sign a SignRoom document using the issued challenge and revision-chain commitment. */
128
+ signSessionFile(args: SignSessionFileArgs): Promise<SessionSigned>;
129
+ /** Encrypt a SignRoom source with the owner's public key and pinned recipients. */
130
+ encryptSignRoomFile(args: EncryptSignRoomFileArgs): Promise<EncryptSignRoomFileResult>;
131
+ /** Decrypt and verify a SignRoom MJKB with the selected local Majik Key. */
132
+ decryptSignRoomFile(args: DecryptSignRoomFileArgs): Promise<DecryptSignRoomFileResult>;
127
133
  resignFile(args: ResignArgs): Promise<SignedFile>;
128
134
  batchSignFiles(args: BatchSignFilesArgs): Promise<BatchSignOutcome[]>;
129
135
  /** Step 1 of a timestamped signature: sign, then POST `tsaRequest` to the TSA. */
package/dist/client.js CHANGED
@@ -285,6 +285,18 @@ export class MajikSignatureClientTauri extends MajikKeyClientTauri {
285
285
  signFileDetached(args) {
286
286
  return this.invoke("sign_file_detached", compact({ args }));
287
287
  }
288
+ /** Sign a SignRoom document using the issued challenge and revision-chain commitment. */
289
+ signSessionFile(args) {
290
+ return this.invoke("sign_session_file", compact({ args }));
291
+ }
292
+ /** Encrypt a SignRoom source with the owner's public key and pinned recipients. */
293
+ encryptSignRoomFile(args) {
294
+ return this.invoke("encrypt_signroom_file", compact({ args }));
295
+ }
296
+ /** Decrypt and verify a SignRoom MJKB with the selected local Majik Key. */
297
+ decryptSignRoomFile(args) {
298
+ return this.invoke("decrypt_signroom_file", compact({ args }));
299
+ }
288
300
  resignFile(args) {
289
301
  return this.invoke("resign_file", compact({ args }));
290
302
  }
package/dist/types.d.ts CHANGED
@@ -151,6 +151,82 @@ export interface SignDetachedArgs {
151
151
  options?: SignDetachedOptions;
152
152
  ctx?: Ctx;
153
153
  }
154
+ /** Authoritative SignRoom context issued by the session service. */
155
+ export interface SessionSigningContext {
156
+ sessionId: string;
157
+ challengeId: string;
158
+ policyHash: string;
159
+ }
160
+ /** Immutable SignRoom document-revision entry committed by the signature. */
161
+ export interface FileVersion {
162
+ version: number;
163
+ timestamp: string;
164
+ contentHash: string;
165
+ createdBy: string;
166
+ previousVersionHash?: string;
167
+ message?: string;
168
+ }
169
+ export interface SignSessionFileOptions {
170
+ sessionContext: SessionSigningContext;
171
+ contentType?: string;
172
+ timestamp?: string;
173
+ mimeType?: string;
174
+ expectedSigners?: SignerRef[];
175
+ validUntil?: string;
176
+ existingEnvelope?: FileInput;
177
+ fileVersion?: FileVersion;
178
+ priorFile?: FileInput;
179
+ message?: string;
180
+ }
181
+ export interface SignSessionFileArgs {
182
+ input: FileInput;
183
+ options: SignSessionFileOptions;
184
+ ctx?: Ctx;
185
+ }
186
+ export interface SessionSigned {
187
+ signature: MajikSignatureJSON;
188
+ handler: string;
189
+ mimeType: string;
190
+ }
191
+ export interface SignRoomPublicEncryptionIdentity {
192
+ fingerprint: string;
193
+ publicKey: string;
194
+ mlKemPublicKey: string;
195
+ }
196
+ export interface SignRoomPublicRecipient {
197
+ fingerprint: string;
198
+ publicKey: string;
199
+ mlKemPublicKey: string;
200
+ }
201
+ export interface EncryptSignRoomFileArgs {
202
+ input: FileInput;
203
+ owner: SignRoomPublicEncryptionIdentity;
204
+ recipients?: SignRoomPublicRecipient[];
205
+ output?: OutputTarget;
206
+ }
207
+ export interface EncryptSignRoomFileResult {
208
+ file: BytesOutput;
209
+ contentHash: string;
210
+ originalName: string;
211
+ contentType: string;
212
+ sizeBytes: number;
213
+ }
214
+ export interface DecryptSignRoomFileArgs {
215
+ input: FileInput;
216
+ accountId: string;
217
+ expectedOriginalName: string;
218
+ expectedContentType: string;
219
+ expectedSizeBytes: number;
220
+ expectedContentHash: string;
221
+ output?: OutputTarget;
222
+ }
223
+ export interface DecryptSignRoomFileResult {
224
+ file: BytesOutput;
225
+ originalName: string;
226
+ contentType: string;
227
+ sizeBytes: number;
228
+ contentHash: string;
229
+ }
154
230
  export interface ResignArgs {
155
231
  previousSignedFile: FileInput;
156
232
  newFile: FileInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majikah/majik-signature-client-tauri",
3
- "version": "1.2.2",
3
+ "version": "1.3.4",
4
4
  "description": "Typed TypeScript facade over tauri-plugin-majik-signature-client. Extends the key client facade; keys, contacts, stamps, logs and signing live in Rust.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",