openmates 0.11.0-alpha.21 → 0.11.0-alpha.23

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/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getExtForLang,
4
4
  serializeToYaml
5
- } from "./chunk-JQ5CPV6P.js";
5
+ } from "./chunk-Z7CD2LI4.js";
6
6
  import "./chunk-AXNRPVLE.js";
7
7
  export {
8
8
  getExtForLang,
package/dist/index.d.ts CHANGED
@@ -72,10 +72,31 @@ interface SubChatEvent {
72
72
  payload: Record<string, unknown>;
73
73
  }
74
74
 
75
+ interface SignupCryptoMaterial {
76
+ hashedEmail: string;
77
+ encryptedEmail: string;
78
+ encryptedEmailWithMasterKey: string;
79
+ userEmailSaltB64: string;
80
+ emailEncryptionKeyB64: string;
81
+ masterKeyB64: string;
82
+ encryptedMasterKey: string;
83
+ keyIv: string;
84
+ saltB64: string;
85
+ lookupHash: string;
86
+ }
87
+ interface RecoveryKeyMaterial {
88
+ recoveryKey: string;
89
+ lookupHash: string;
90
+ wrappedMasterKey: string;
91
+ keyIv: string;
92
+ saltB64: string;
93
+ }
94
+
75
95
  /** Minimal model info needed for mention resolution */
76
96
  interface ModelInfo {
77
97
  id: string;
78
98
  name: string;
99
+ providerId?: string;
79
100
  }
80
101
  /** Minimal app info from /v1/apps */
81
102
  interface AppInfo {
@@ -362,6 +383,57 @@ interface DownloadedDocument {
362
383
  filename: string;
363
384
  data: Uint8Array;
364
385
  }
386
+ interface BankTransferOrderDetails {
387
+ order_id: string;
388
+ reference: string;
389
+ iban: string;
390
+ bic: string;
391
+ bank_name: string;
392
+ account_holder_name: string;
393
+ account_holder_address_line1?: string;
394
+ account_holder_address_line2?: string;
395
+ account_holder_postal_code?: string;
396
+ account_holder_city?: string;
397
+ account_holder_country?: string;
398
+ amount_eur: string;
399
+ credits_amount: number;
400
+ expires_at: string;
401
+ }
402
+ interface BankTransferStatus {
403
+ order_id: string;
404
+ status: string;
405
+ credits_amount: number;
406
+ amount_eur: string;
407
+ reference: string;
408
+ expires_at: string;
409
+ created_at?: string;
410
+ }
411
+ interface GiftCardBankTransferStatus extends BankTransferStatus {
412
+ gift_card_code?: string | null;
413
+ }
414
+ interface AuthMethodsStatus {
415
+ has_passkey?: boolean;
416
+ has_2fa?: boolean;
417
+ has_password?: boolean;
418
+ has_recovery_key?: boolean;
419
+ }
420
+ interface CliSignupResult {
421
+ success: boolean;
422
+ message: string;
423
+ user?: Record<string, unknown>;
424
+ crypto: SignupCryptoMaterial;
425
+ }
426
+ interface TotpSetupStartResult {
427
+ success: boolean;
428
+ message: string;
429
+ secret?: string | null;
430
+ otpauth_url?: string | null;
431
+ }
432
+ interface BackupCodesResult {
433
+ success: boolean;
434
+ message: string;
435
+ backup_codes: string[];
436
+ }
365
437
  /**
366
438
  * Derive the web app URL from the API URL so the pair token is always looked
367
439
  * up on the same backend the CLI created it on.
@@ -370,7 +442,7 @@ interface DownloadedDocument {
370
442
  declare function deriveAppUrl(apiUrl: string): string;
371
443
  declare class OpenMatesClient {
372
444
  readonly apiUrl: string;
373
- private readonly session;
445
+ private session;
374
446
  private readonly http;
375
447
  constructor(options?: OpenMatesClientOptions);
376
448
  static load(options?: OpenMatesClientOptions): OpenMatesClient;
@@ -378,6 +450,35 @@ declare class OpenMatesClient {
378
450
  loginWithPairAuth(): Promise<void>;
379
451
  whoAmI(): Promise<Record<string, unknown>>;
380
452
  logout(): Promise<void>;
453
+ requestSignupEmailCode(params: {
454
+ email: string;
455
+ inviteCode?: string;
456
+ language?: string;
457
+ darkmode?: boolean;
458
+ }): Promise<unknown>;
459
+ verifySignupEmailCode(params: {
460
+ email: string;
461
+ username: string;
462
+ inviteCode?: string;
463
+ code: string;
464
+ language?: string;
465
+ darkmode?: boolean;
466
+ }): Promise<unknown>;
467
+ setupPasswordAccount(params: {
468
+ email: string;
469
+ username: string;
470
+ password: string;
471
+ inviteCode?: string;
472
+ language?: string;
473
+ darkmode?: boolean;
474
+ }): Promise<CliSignupResult>;
475
+ startTotpSetup(): Promise<TotpSetupStartResult>;
476
+ renderTotpQrCode(otpauthUrl: string): void;
477
+ verifyTotpSetup(code: string): Promise<unknown>;
478
+ setTotpProvider(provider: string): Promise<unknown>;
479
+ requestBackupCodes(): Promise<BackupCodesResult>;
480
+ confirmBackupCodesStored(): Promise<unknown>;
481
+ createAndConfirmRecoveryKey(): Promise<RecoveryKeyMaterial>;
381
482
  /**
382
483
  * Decrypt a single chat's key using the master key.
383
484
  * Returns raw Uint8Array (32 bytes) — the AES-256 key used to
@@ -517,6 +618,11 @@ declare class OpenMatesClient {
517
618
  inputData: Record<string, unknown>;
518
619
  apiKey?: string;
519
620
  }): Promise<unknown>;
621
+ getCodeRunStreamAuth(): {
622
+ sessionId: string;
623
+ token: string;
624
+ } | null;
625
+ getCodeRunStatus(path: string, apiKey?: string): Promise<Record<string, unknown>>;
520
626
  /**
521
627
  * Look up a booking URL for a flight using its booking_token.
522
628
  *
@@ -547,12 +653,22 @@ declare class OpenMatesClient {
547
653
  message: string;
548
654
  }>;
549
655
  listRedeemedGiftCards(): Promise<unknown>;
656
+ listPurchasedGiftCards(): Promise<unknown>;
657
+ createBankTransferOrder(creditsAmount: number): Promise<BankTransferOrderDetails>;
658
+ createGiftCardBankTransferOrder(creditsAmount: number): Promise<BankTransferOrderDetails>;
659
+ getBankTransferStatus(orderId: string): Promise<BankTransferStatus>;
660
+ listBankTransferOrders(): Promise<BankTransferStatus[]>;
661
+ getGiftCardPurchaseStatus(orderId: string): Promise<GiftCardBankTransferStatus>;
550
662
  listInvoices(): Promise<{
551
663
  invoices: InvoiceListItem[];
552
664
  }>;
553
665
  downloadInvoice(invoiceId: string): Promise<DownloadedDocument>;
554
666
  downloadCreditNote(invoiceId: string): Promise<DownloadedDocument>;
555
667
  requestRefund(invoiceId: string): Promise<unknown>;
668
+ getAuthMethodsStatus(): Promise<AuthMethodsStatus>;
669
+ requestDeleteAccountEmailCode(): Promise<unknown>;
670
+ verifyDeleteAccountEmailCode(code: string): Promise<unknown>;
671
+ deleteAccountWithCliVerification(totpCode?: string): Promise<unknown>;
556
672
  updateUsername(username: string): Promise<unknown>;
557
673
  updateProfileImage(filePath: string): Promise<unknown>;
558
674
  getNewsletterCategories(): Promise<unknown>;
@@ -783,4 +899,4 @@ declare function parseNewChatSuggestionText(text: string): {
783
899
 
784
900
  declare function defaultCloneBranchForVersion(version: string): string | null;
785
901
 
786
- export { type CachedChat, type CachedNewChatSuggestion, type ChatListPage, type DecryptedEmbed, type DecryptedMemoryEntry, type DecryptedMessage, type DecryptedNewChatSuggestion, type DocsFile, type DocsFolder, type DocsSearchResult, type DocsTree, MATE_NAMES, MEMORY_TYPE_REGISTRY, type MemoryFieldDef, type MemoryTypeDef, OpenMatesClient, type OpenMatesClientOptions, type OpenMatesSession, type SyncCache, defaultCloneBranchForVersion, deriveAppUrl, parseNewChatSuggestionText };
902
+ export { type AuthMethodsStatus, type BackupCodesResult, type BankTransferOrderDetails, type BankTransferStatus, type CachedChat, type CachedNewChatSuggestion, type ChatListPage, type CliSignupResult, type DecryptedEmbed, type DecryptedMemoryEntry, type DecryptedMessage, type DecryptedNewChatSuggestion, type DocsFile, type DocsFolder, type DocsSearchResult, type DocsTree, type GiftCardBankTransferStatus, MATE_NAMES, MEMORY_TYPE_REGISTRY, type MemoryFieldDef, type MemoryTypeDef, OpenMatesClient, type OpenMatesClientOptions, type OpenMatesSession, type SyncCache, type TotpSetupStartResult, defaultCloneBranchForVersion, deriveAppUrl, parseNewChatSuggestionText };
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  getExtForLang,
8
8
  parseNewChatSuggestionText,
9
9
  serializeToYaml
10
- } from "./chunk-JQ5CPV6P.js";
10
+ } from "./chunk-Z7CD2LI4.js";
11
11
  import "./chunk-AXNRPVLE.js";
12
12
  export {
13
13
  MATE_NAMES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.11.0-alpha.21",
3
+ "version": "0.11.0-alpha.23",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -18,11 +18,16 @@
18
18
  "test:unit:crypto": "node --test --experimental-strip-types tests/crypto.test.ts",
19
19
  "test:unit:storage": "node --test --experimental-strip-types --loader ./tests/loader.mjs tests/storage.test.ts",
20
20
  "test:unit:keychain": "node --test --experimental-strip-types tests/keychain.test.ts",
21
+ "test:unit:signup": "node --test tests/signup.test.ts",
22
+ "test:unit:security-setup": "node --test tests/security-setup.test.ts",
23
+ "test:unit:e2e-provisioning": "node --test tests/e2e-provisioning.test.ts",
21
24
  "test:unit:ws": "node --test --experimental-strip-types tests/ws.test.ts",
22
25
  "test:unit:url-embed": "node --test --experimental-strip-types --loader ./tests/loader.mjs tests/urlEmbed.test.ts",
23
26
  "test:unit:server": "node --test --experimental-strip-types tests/server.test.ts",
27
+ "test:unit:billing": "node --test tests/billing.test.ts",
28
+ "test:unit:account-delete": "node --test tests/account-delete.test.ts",
24
29
  "test:unit:cli": "node --test tests/cli.test.ts",
25
- "test": "node --test --experimental-strip-types --loader ./tests/loader.mjs tests/crypto.test.ts tests/storage.test.ts tests/keychain.test.ts tests/mentions.test.ts tests/outputRedactor.test.ts tests/fileEmbed.test.ts tests/embedCreator.test.ts tests/shareEncryption.test.ts tests/server.test.ts tests/ws.test.ts tests/urlEmbed.test.ts && node --test tests/cli.test.ts"
30
+ "test": "node --test --experimental-strip-types --loader ./tests/loader.mjs tests/crypto.test.ts tests/storage.test.ts tests/keychain.test.ts tests/mentions.test.ts tests/outputRedactor.test.ts tests/fileEmbed.test.ts tests/embedCreator.test.ts tests/shareEncryption.test.ts tests/server.test.ts tests/ws.test.ts tests/urlEmbed.test.ts && node --test tests/cli.test.ts tests/billing.test.ts tests/account-delete.test.ts tests/signup.test.ts tests/security-setup.test.ts tests/e2e-provisioning.test.ts"
26
31
  },
27
32
  "keywords": [
28
33
  "openmates",
@@ -45,6 +50,7 @@
45
50
  "@toon-format/toon": "2.1.0",
46
51
  "ahocorasick": "1.0.2",
47
52
  "qrcode-terminal": "^0.12.0",
53
+ "tweetnacl": "^1.0.3",
48
54
  "ws": "8.20.1"
49
55
  },
50
56
  "devDependencies": {