@cipherstash/stack 1.0.0-rc.0 → 1.0.0-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.
Files changed (40) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +321 -239
  3. package/dist/adapter-kit.cjs +81 -2
  4. package/dist/adapter-kit.cjs.map +1 -1
  5. package/dist/adapter-kit.d.cts +41 -3
  6. package/dist/adapter-kit.d.ts +41 -3
  7. package/dist/adapter-kit.js +77 -2
  8. package/dist/adapter-kit.js.map +1 -1
  9. package/dist/{chunk-V2Q3NYIH.js → chunk-6SGN52W6.js} +1 -1
  10. package/dist/{chunk-V2Q3NYIH.js.map → chunk-6SGN52W6.js.map} +1 -1
  11. package/dist/{chunk-OFQ555AX.js → chunk-IDKP6ABU.js} +2 -2
  12. package/dist/{chunk-ZTP5QJ27.js → chunk-L7ISHSG7.js} +3 -3
  13. package/dist/{chunk-LBMC4D6D.js → chunk-NVKK7UDN.js} +1 -1
  14. package/dist/chunk-NVKK7UDN.js.map +1 -0
  15. package/dist/{columns-rZc7fQHI.d.ts → columns-0lbT9stl.d.ts} +2 -2
  16. package/dist/{columns-D2_YzrCX.d.cts → columns-Bxv7Oo9o.d.cts} +2 -2
  17. package/dist/encryption/index.cjs.map +1 -1
  18. package/dist/encryption/index.js +3 -3
  19. package/dist/encryption/v3.cjs.map +1 -1
  20. package/dist/encryption/v3.d.cts +2 -2
  21. package/dist/encryption/v3.d.ts +2 -2
  22. package/dist/encryption/v3.js +4 -4
  23. package/dist/eql/v3/index.cjs.map +1 -1
  24. package/dist/eql/v3/index.d.cts +2 -2
  25. package/dist/eql/v3/index.d.ts +2 -2
  26. package/dist/eql/v3/index.js +1 -1
  27. package/dist/errors/index.cjs.map +1 -1
  28. package/dist/errors/index.d.cts +5 -5
  29. package/dist/errors/index.d.ts +5 -5
  30. package/dist/errors/index.js +1 -1
  31. package/dist/identity/index.cjs.map +1 -1
  32. package/dist/identity/index.js +2 -2
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.js +3 -3
  35. package/dist/wasm-inline.d.ts +2 -2
  36. package/dist/wasm-inline.js.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-LBMC4D6D.js.map +0 -1
  39. /package/dist/{chunk-OFQ555AX.js.map → chunk-IDKP6ABU.js.map} +0 -0
  40. /package/dist/{chunk-ZTP5QJ27.js.map → chunk-L7ISHSG7.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cipherstash/stack",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.1",
4
4
  "description": "CipherStash Stack for TypeScript and JavaScript",
5
5
  "keywords": [
6
6
  "encrypted",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/errors/index.ts"],"sourcesContent":["import type { ProtectErrorCode } from '@cipherstash/protect-ffi'\n\nexport const EncryptionErrorTypes = {\n ClientInitError: 'ClientInitError',\n EncryptionError: 'EncryptionError',\n DecryptionError: 'DecryptionError',\n LockContextError: 'LockContextError',\n CtsTokenError: 'CtsTokenError',\n}\n\n/**\n * Base error interface returned by all encryption operations.\n *\n * Every operation that can fail returns `Result<T, EncryptionError>`.\n * Use the `type` field to narrow to a specific error kind, or use\n * {@link StackError} for an exhaustive discriminated union.\n *\n * @example\n * ```typescript\n * const result = await client.encrypt(value, opts)\n * if (result.failure) {\n * switch (result.failure.type) {\n * case EncryptionErrorTypes.EncryptionError:\n * console.error('Encryption failed:', result.failure.message)\n * break\n * case EncryptionErrorTypes.LockContextError:\n * console.error('Lock context issue:', result.failure.message)\n * break\n * }\n * }\n * ```\n */\nexport interface EncryptionError {\n type: (typeof EncryptionErrorTypes)[keyof typeof EncryptionErrorTypes]\n message: string\n code?: ProtectErrorCode\n}\n\n// ---------------------------------------------------------------------------\n// Specific error types (discriminated union members)\n// ---------------------------------------------------------------------------\n\nexport interface ClientInitError {\n type: typeof EncryptionErrorTypes.ClientInitError\n message: string\n}\n\nexport interface EncryptionOperationError {\n type: typeof EncryptionErrorTypes.EncryptionError\n message: string\n code?: ProtectErrorCode\n}\n\nexport interface DecryptionOperationError {\n type: typeof EncryptionErrorTypes.DecryptionError\n message: string\n code?: ProtectErrorCode\n}\n\nexport interface LockContextError {\n type: typeof EncryptionErrorTypes.LockContextError\n message: string\n}\n\nexport interface CtsTokenError {\n type: typeof EncryptionErrorTypes.CtsTokenError\n message: string\n}\n\n/**\n * Discriminated union of all specific error types.\n *\n * Use `StackError` when you need exhaustive error handling via `switch` on the `type` field.\n *\n * @example\n * ```typescript\n * function handleError(error: StackError) {\n * switch (error.type) {\n * case 'ClientInitError':\n * // re-initialize client\n * break\n * case 'EncryptionError':\n * case 'DecryptionError':\n * // log and retry\n * break\n * case 'LockContextError':\n * // re-authenticate\n * break\n * case 'CtsTokenError':\n * // refresh token\n * break\n * default:\n * error satisfies never\n * }\n * }\n * ```\n */\nexport type StackError =\n | ClientInitError\n | EncryptionOperationError\n | DecryptionOperationError\n | LockContextError\n | CtsTokenError\n\n// ---------------------------------------------------------------------------\n// Error utilities\n// ---------------------------------------------------------------------------\n\n/**\n * Safely extract an error message from an unknown thrown value.\n * Unlike `(error as Error).message`, this handles non-Error values gracefully.\n */\nexport function getErrorMessage(error: unknown): string {\n if (error instanceof Error) return error.message\n if (typeof error === 'string') return error\n return String(error)\n}\n"],"mappings":";AAEO,IAAM,uBAAuB;AAAA,EAClC,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,eAAe;AACjB;AAwGO,SAAS,gBAAgB,OAAwB;AACtD,MAAI,iBAAiB,MAAO,QAAO,MAAM;AACzC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,SAAO,OAAO,KAAK;AACrB;","names":[]}