@cipherstash/stack 0.18.0 → 1.0.0-rc.0

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 (111) hide show
  1. package/CHANGELOG.md +704 -0
  2. package/README.md +97 -79
  3. package/dist/adapter-kit.cjs +923 -0
  4. package/dist/adapter-kit.cjs.map +1 -0
  5. package/dist/adapter-kit.d.cts +82 -0
  6. package/dist/adapter-kit.d.ts +82 -0
  7. package/dist/adapter-kit.js +47 -0
  8. package/dist/adapter-kit.js.map +1 -0
  9. package/dist/base-operation-AOAIvsSB.d.cts +32 -0
  10. package/dist/base-operation-FXEzUXIq.d.ts +32 -0
  11. package/dist/{chunk-VPOTNP4K.js → chunk-3B5ZX3IS.js} +3 -1
  12. package/dist/chunk-3B5ZX3IS.js.map +1 -0
  13. package/dist/chunk-7333ZC6L.js +48 -0
  14. package/dist/chunk-7333ZC6L.js.map +1 -0
  15. package/dist/{chunk-XWPGAHBZ.js → chunk-BNO32ZMV.js} +1 -1
  16. package/dist/chunk-BNO32ZMV.js.map +1 -0
  17. package/dist/chunk-CLM7E4I6.js +4439 -0
  18. package/dist/chunk-CLM7E4I6.js.map +1 -0
  19. package/dist/{chunk-LLCCNKDL.js → chunk-HQANMV7R.js} +3 -3
  20. package/dist/{chunk-LLCCNKDL.js.map → chunk-HQANMV7R.js.map} +1 -1
  21. package/dist/chunk-JSG2AMDI.js +17 -0
  22. package/dist/chunk-JSG2AMDI.js.map +1 -0
  23. package/dist/chunk-OFQ555AX.js +191 -0
  24. package/dist/chunk-OFQ555AX.js.map +1 -0
  25. package/dist/chunk-PZ5AY32C.js +10 -0
  26. package/dist/chunk-PZ5AY32C.js.map +1 -0
  27. package/dist/chunk-V2Q3NYIH.js +494 -0
  28. package/dist/chunk-V2Q3NYIH.js.map +1 -0
  29. package/dist/chunk-X3JRXEIB.js +98 -0
  30. package/dist/chunk-X3JRXEIB.js.map +1 -0
  31. package/dist/{chunk-ZYOZHZMJ.js → chunk-ZTP5QJ27.js} +193 -169
  32. package/dist/chunk-ZTP5QJ27.js.map +1 -0
  33. package/dist/client.cjs +4124 -49
  34. package/dist/client.cjs.map +1 -1
  35. package/dist/client.d.cts +6 -5
  36. package/dist/client.d.ts +6 -5
  37. package/dist/client.js +3 -1
  38. package/dist/columns-D2_YzrCX.d.cts +622 -0
  39. package/dist/columns-rZc7fQHI.d.ts +622 -0
  40. package/dist/dynamodb/index.cjs +19 -12
  41. package/dist/dynamodb/index.cjs.map +1 -1
  42. package/dist/dynamodb/index.d.cts +3 -2
  43. package/dist/dynamodb/index.d.ts +3 -2
  44. package/dist/dynamodb/index.js +8 -10
  45. package/dist/dynamodb/index.js.map +1 -1
  46. package/dist/encryption/index.cjs +4496 -222
  47. package/dist/encryption/index.cjs.map +1 -1
  48. package/dist/encryption/index.d.cts +807 -6
  49. package/dist/encryption/index.d.ts +807 -6
  50. package/dist/encryption/index.js +15 -7
  51. package/dist/encryption/v3.cjs +7896 -0
  52. package/dist/encryption/v3.cjs.map +1 -0
  53. package/dist/encryption/v3.d.cts +103 -0
  54. package/dist/encryption/v3.d.ts +103 -0
  55. package/dist/encryption/v3.js +189 -0
  56. package/dist/encryption/v3.js.map +1 -0
  57. package/dist/eql/v3/index.cjs +663 -0
  58. package/dist/eql/v3/index.cjs.map +1 -0
  59. package/dist/eql/v3/index.d.cts +173 -0
  60. package/dist/eql/v3/index.d.ts +173 -0
  61. package/dist/eql/v3/index.js +99 -0
  62. package/dist/eql/v3/index.js.map +1 -0
  63. package/dist/errors/index.js +1 -0
  64. package/dist/identity/index.cjs +55 -35
  65. package/dist/identity/index.cjs.map +1 -1
  66. package/dist/identity/index.d.cts +54 -30
  67. package/dist/identity/index.d.ts +54 -30
  68. package/dist/identity/index.js +9 -177
  69. package/dist/identity/index.js.map +1 -1
  70. package/dist/index-BquA71_Y.d.ts +24 -0
  71. package/dist/index-fhWTOV0K.d.cts +24 -0
  72. package/dist/index.cjs +4547 -243
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.d.cts +18 -19
  75. package/dist/index.d.ts +18 -19
  76. package/dist/index.js +20 -5
  77. package/dist/index.js.map +1 -1
  78. package/dist/schema/index.cjs +4128 -49
  79. package/dist/schema/index.cjs.map +1 -1
  80. package/dist/schema/index.d.cts +1 -1
  81. package/dist/schema/index.d.ts +1 -1
  82. package/dist/schema/index.js +3 -1
  83. package/dist/{types-public-BTxqjmtv.d.cts → types-public-QMjYNfQO.d.cts} +448 -251
  84. package/dist/{types-public-BTxqjmtv.d.ts → types-public-QMjYNfQO.d.ts} +448 -251
  85. package/dist/types-public.cjs.map +1 -1
  86. package/dist/types-public.d.cts +2 -2
  87. package/dist/types-public.d.ts +2 -2
  88. package/dist/types-public.js +2 -1
  89. package/dist/wasm-inline.d.ts +1643 -0
  90. package/dist/wasm-inline.js +4901 -0
  91. package/dist/wasm-inline.js.map +1 -0
  92. package/package.json +74 -52
  93. package/dist/chunk-VPOTNP4K.js.map +0 -1
  94. package/dist/chunk-XWPGAHBZ.js.map +0 -1
  95. package/dist/chunk-YWQXTZ5M.js +0 -383
  96. package/dist/chunk-YWQXTZ5M.js.map +0 -1
  97. package/dist/chunk-ZYOZHZMJ.js.map +0 -1
  98. package/dist/client-CIsfZ2zg.d.ts +0 -692
  99. package/dist/client-Dt98Rugc.d.cts +0 -692
  100. package/dist/drizzle/index.cjs +0 -1558
  101. package/dist/drizzle/index.cjs.map +0 -1
  102. package/dist/drizzle/index.d.cts +0 -358
  103. package/dist/drizzle/index.d.ts +0 -358
  104. package/dist/drizzle/index.js +0 -1215
  105. package/dist/drizzle/index.js.map +0 -1
  106. package/dist/supabase/index.cjs +0 -1526
  107. package/dist/supabase/index.cjs.map +0 -1
  108. package/dist/supabase/index.d.cts +0 -144
  109. package/dist/supabase/index.d.ts +0 -144
  110. package/dist/supabase/index.js +0 -899
  111. package/dist/supabase/index.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,23 +1,22 @@
1
- import { E as Encrypted } from './types-public-BTxqjmtv.cjs';
2
- export { e as encryptedColumn, a as encryptedField, b as encryptedTable } from './types-public-BTxqjmtv.cjs';
3
- export { E as Encryption } from './client-Dt98Rugc.cjs';
4
- import 'zod';
5
- import '@cipherstash/protect-ffi';
6
- import './errors/index.cjs';
1
+ export { Encryption } from './encryption/index.cjs';
2
+ export { e as encryptedToPgComposite, i as isEncryptedPayload } from './index-fhWTOV0K.cjs';
3
+ export { p as Encrypted, Z as encryptedColumn, _ as encryptedField, $ as encryptedTable } from './types-public-QMjYNfQO.cjs';
4
+ import auth from '@cipherstash/auth';
5
+ export { AuthErrorCode, AuthFailure, TokenResult } from '@cipherstash/auth';
7
6
  import '@byteslice/result';
7
+ import './errors/index.cjs';
8
+ import '@cipherstash/protect-ffi';
8
9
  import './identity/index.cjs';
10
+ import './base-operation-AOAIvsSB.cjs';
11
+ import 'zod';
9
12
 
10
- type EncryptedPgComposite = {
11
- data: Encrypted;
12
- };
13
- /**
14
- * Helper function to transform an encrypted payload into a PostgreSQL composite type.
15
- * Use this when inserting data via Supabase or similar clients.
16
- */
17
- declare function encryptedToPgComposite(obj: Encrypted): EncryptedPgComposite;
18
- /**
19
- * Helper function to check if a value is an encrypted payload
20
- */
21
- declare function isEncryptedPayload(value: unknown): value is Encrypted;
13
+ declare const AccessKeyStrategy: typeof auth.AccessKeyStrategy;
14
+ type AccessKeyStrategy = InstanceType<typeof auth.AccessKeyStrategy>;
15
+ declare const AutoStrategy: typeof auth.AutoStrategy;
16
+ type AutoStrategy = InstanceType<typeof auth.AutoStrategy>;
17
+ declare const DeviceSessionStrategy: typeof auth.DeviceSessionStrategy;
18
+ type DeviceSessionStrategy = InstanceType<typeof auth.DeviceSessionStrategy>;
19
+ declare const OidcFederationStrategy: typeof auth.OidcFederationStrategy;
20
+ type OidcFederationStrategy = InstanceType<typeof auth.OidcFederationStrategy>;
22
21
 
23
- export { Encrypted, encryptedToPgComposite, isEncryptedPayload };
22
+ export { AccessKeyStrategy, AutoStrategy, DeviceSessionStrategy, OidcFederationStrategy };
package/dist/index.d.ts CHANGED
@@ -1,23 +1,22 @@
1
- import { E as Encrypted } from './types-public-BTxqjmtv.js';
2
- export { e as encryptedColumn, a as encryptedField, b as encryptedTable } from './types-public-BTxqjmtv.js';
3
- export { E as Encryption } from './client-CIsfZ2zg.js';
4
- import 'zod';
5
- import '@cipherstash/protect-ffi';
6
- import './errors/index.js';
1
+ export { Encryption } from './encryption/index.js';
2
+ export { e as encryptedToPgComposite, i as isEncryptedPayload } from './index-BquA71_Y.js';
3
+ export { p as Encrypted, Z as encryptedColumn, _ as encryptedField, $ as encryptedTable } from './types-public-QMjYNfQO.js';
4
+ import auth from '@cipherstash/auth';
5
+ export { AuthErrorCode, AuthFailure, TokenResult } from '@cipherstash/auth';
7
6
  import '@byteslice/result';
7
+ import './errors/index.js';
8
+ import '@cipherstash/protect-ffi';
8
9
  import './identity/index.js';
10
+ import './base-operation-FXEzUXIq.js';
11
+ import 'zod';
9
12
 
10
- type EncryptedPgComposite = {
11
- data: Encrypted;
12
- };
13
- /**
14
- * Helper function to transform an encrypted payload into a PostgreSQL composite type.
15
- * Use this when inserting data via Supabase or similar clients.
16
- */
17
- declare function encryptedToPgComposite(obj: Encrypted): EncryptedPgComposite;
18
- /**
19
- * Helper function to check if a value is an encrypted payload
20
- */
21
- declare function isEncryptedPayload(value: unknown): value is Encrypted;
13
+ declare const AccessKeyStrategy: typeof auth.AccessKeyStrategy;
14
+ type AccessKeyStrategy = InstanceType<typeof auth.AccessKeyStrategy>;
15
+ declare const AutoStrategy: typeof auth.AutoStrategy;
16
+ type AutoStrategy = InstanceType<typeof auth.AutoStrategy>;
17
+ declare const DeviceSessionStrategy: typeof auth.DeviceSessionStrategy;
18
+ type DeviceSessionStrategy = InstanceType<typeof auth.DeviceSessionStrategy>;
19
+ declare const OidcFederationStrategy: typeof auth.OidcFederationStrategy;
20
+ type OidcFederationStrategy = InstanceType<typeof auth.OidcFederationStrategy>;
22
21
 
23
- export { Encrypted, encryptedToPgComposite, isEncryptedPayload };
22
+ export { AccessKeyStrategy, AutoStrategy, DeviceSessionStrategy, OidcFederationStrategy };
package/dist/index.js CHANGED
@@ -1,20 +1,35 @@
1
1
  import {
2
2
  Encryption
3
- } from "./chunk-ZYOZHZMJ.js";
3
+ } from "./chunk-ZTP5QJ27.js";
4
+ import "./chunk-OFQ555AX.js";
4
5
  import {
5
6
  encryptedToPgComposite,
6
7
  isEncryptedPayload
7
- } from "./chunk-XWPGAHBZ.js";
8
+ } from "./chunk-BNO32ZMV.js";
8
9
  import {
9
10
  encryptedColumn,
10
11
  encryptedField,
11
12
  encryptedTable
12
- } from "./chunk-YWQXTZ5M.js";
13
- import "./chunk-VPOTNP4K.js";
14
- import "./chunk-LLCCNKDL.js";
13
+ } from "./chunk-CLM7E4I6.js";
14
+ import "./chunk-7333ZC6L.js";
15
+ import "./chunk-3B5ZX3IS.js";
16
+ import "./chunk-JSG2AMDI.js";
17
+ import "./chunk-HQANMV7R.js";
15
18
  import "./chunk-LBMC4D6D.js";
19
+ import "./chunk-PZ5AY32C.js";
20
+
21
+ // src/index.ts
22
+ import auth from "@cipherstash/auth";
23
+ var AccessKeyStrategy = auth.AccessKeyStrategy;
24
+ var AutoStrategy = auth.AutoStrategy;
25
+ var DeviceSessionStrategy = auth.DeviceSessionStrategy;
26
+ var OidcFederationStrategy = auth.OidcFederationStrategy;
16
27
  export {
28
+ AccessKeyStrategy,
29
+ AutoStrategy,
30
+ DeviceSessionStrategy,
17
31
  Encryption,
32
+ OidcFederationStrategy,
18
33
  encryptedColumn,
19
34
  encryptedField,
20
35
  encryptedTable,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Re-export main stack components for convenience\n\nexport { Encryption } from '@/encryption'\n// Re-export encryption helpers for convenience\nexport {\n encryptedToPgComposite,\n isEncryptedPayload,\n} from '@/encryption/helpers'\nexport { encryptedColumn, encryptedField, encryptedTable } from '@/schema'\n\n// Re-export auth strategies for convenience. Pass one as `config.authStrategy`\n// to `Encryption()` to control how ZeroKMS requests are authenticated — notably\n// `OidcFederationStrategy` for per-user, identity-bound encryption (pair with\n// `.withLockContext({ identityClaim })`). Re-exported so integrators don't need\n// a separate `@cipherstash/auth` install.\n//\n// `@cipherstash/auth`'s Node entry is a CommonJS NAPI module whose exports come\n// via `module.exports = { ...native }`. The spread defeats cjs-module-lexer, so\n// Node's ESM loader can't see those names through a static `export { … } from`\n// re-export (it throws \"Named export not found\"). We default-import the module\n// (which IS `module.exports` at runtime, with every name present) and re-export\n// each binding explicitly — both the value and, for the strategy classes, the\n// instance type — so this works under real Node ESM, not just the bundler.\nimport auth from '@cipherstash/auth'\n\nexport const AccessKeyStrategy = auth.AccessKeyStrategy\nexport type AccessKeyStrategy = InstanceType<typeof auth.AccessKeyStrategy>\nexport const AutoStrategy = auth.AutoStrategy\nexport type AutoStrategy = InstanceType<typeof auth.AutoStrategy>\nexport const DeviceSessionStrategy = auth.DeviceSessionStrategy\nexport type DeviceSessionStrategy = InstanceType<\n typeof auth.DeviceSessionStrategy\n>\nexport const OidcFederationStrategy = auth.OidcFederationStrategy\nexport type OidcFederationStrategy = InstanceType<\n typeof auth.OidcFederationStrategy\n>\n\nexport type {\n AuthErrorCode,\n AuthFailure,\n TokenResult,\n} from '@cipherstash/auth'\n// Re-export types for convenience\nexport type { Encrypted } from '@/types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,UAAU;AAEV,IAAM,oBAAoB,KAAK;AAE/B,IAAM,eAAe,KAAK;AAE1B,IAAM,wBAAwB,KAAK;AAInC,IAAM,yBAAyB,KAAK;","names":[]}