@degenerate/generic 0.2.7 → 0.3.2

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 (162) hide show
  1. package/dist/application/audit-log/additional-ids/create-audit-log-additional-ids-with-query.d.ts.map +1 -1
  2. package/dist/application/audit-log/additional-ids/create-multiple-path-alai.d.ts.map +1 -1
  3. package/dist/application/audit-log/additional-ids/create-query-audit-log-for-alai.d.ts.map +1 -1
  4. package/dist/application/audit-log/create-application-audit-log.d.ts.map +1 -1
  5. package/dist/application/audit-log/create-application-audit-log.js +1 -1
  6. package/dist/application/database/firestore/generics/add-items-to-database.d.ts.map +1 -1
  7. package/dist/application/database/firestore/generics/add-items-to-database.js +2 -2
  8. package/dist/application/database/firestore/generics/add-or-update-items-to-database.d.ts.map +1 -1
  9. package/dist/application/database/firestore/generics/add-or-update-items-to-database.js +3 -3
  10. package/dist/application/database/firestore/generics/create-database-change-information.d.ts.map +1 -1
  11. package/dist/application/database/firestore/generics/delete-items-on-database.d.ts.map +1 -1
  12. package/dist/application/database/firestore/generics/delete-items-on-database.js +2 -2
  13. package/dist/application/database/firestore/generics/get-item-from-database.d.ts.map +1 -1
  14. package/dist/application/database/firestore/generics/get-item-from-database.js +2 -2
  15. package/dist/application/database/firestore/generics/get-items-different-path-on-database.d.ts.map +1 -1
  16. package/dist/application/database/firestore/generics/get-items-different-path-on-database.js +2 -2
  17. package/dist/application/database/firestore/generics/get-items-from-database.d.ts.map +1 -1
  18. package/dist/application/database/firestore/generics/get-items-from-database.js +1 -1
  19. package/dist/application/database/firestore/generics/update-items-on-database.d.ts.map +1 -1
  20. package/dist/application/database/firestore/generics/update-items-on-database.js +2 -2
  21. package/dist/application/database/firestore/generics/update-items-properties-on-database.d.ts.map +1 -1
  22. package/dist/application/database/firestore/generics/update-items-properties-on-database.js +2 -2
  23. package/dist/authorization/index.d.ts +1 -0
  24. package/dist/authorization/index.d.ts.map +1 -1
  25. package/dist/authorization/index.js +1 -0
  26. package/dist/authorization/jwt/keys/create-public-key-pem.d.ts.map +1 -1
  27. package/dist/authorization/jwt/keys/create-secret-key-pem.d.ts.map +1 -1
  28. package/dist/authorization/jwt/sign/create-authorization-issuer.d.ts.map +1 -1
  29. package/dist/authorization/jwt/sign/create-authorization-subject.d.ts.map +1 -1
  30. package/dist/authorization/jwt/sign/create-jwt-options.d.ts +7 -1
  31. package/dist/authorization/jwt/sign/create-jwt-options.d.ts.map +1 -1
  32. package/dist/authorization/jwt/sign/create-jwt-signed-token.d.ts.map +1 -1
  33. package/dist/authorization/jwt/transform/transform-token-payload-to-safe-payload.d.ts.map +1 -1
  34. package/dist/authorization/jwt/verify/get-decoded-jwt-header.d.ts.map +1 -1
  35. package/dist/authorization/jwt/verify/get-decoded-jwt-signed-token-payload.d.ts.map +1 -1
  36. package/dist/authorization/jwt/verify/verify-jwt-signed-token.d.ts.map +1 -1
  37. package/dist/authorization/safe/request/decode-bearer-token.d.ts.map +1 -1
  38. package/dist/authorization/safe/request/decode-safe-request.d.ts.map +1 -1
  39. package/dist/authorization/safe/request/determine-issuer-from-request.d.ts.map +1 -1
  40. package/dist/authorization/safe/request/issuer/determine-issuer-from-bearer-token.d.ts.map +1 -1
  41. package/dist/authorization/safe/request/verify-jwt-bearer-token-for-audience.d.ts +31 -0
  42. package/dist/authorization/safe/request/verify-jwt-bearer-token-for-audience.d.ts.map +1 -0
  43. package/dist/authorization/safe/request/verify-jwt-bearer-token-for-audience.js +50 -0
  44. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-audience.d.ts.map +1 -1
  45. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-expiration-time.d.ts.map +1 -1
  46. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-issued-at-time.d.ts.map +1 -1
  47. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-issuer.d.ts.map +1 -1
  48. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-not-before-time.d.ts.map +1 -1
  49. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-subject.d.ts.map +1 -1
  50. package/dist/authorization/safe/validation/jwt/verify-token-header.d.ts.map +1 -1
  51. package/dist/authorization/safe/validation/jwt/verify-token-payload.d.ts.map +1 -1
  52. package/dist/crypto/calculate-combined-hash.d.ts.map +1 -1
  53. package/dist/crypto/calculate-hash.d.ts +1 -1
  54. package/dist/crypto/calculate-hash.d.ts.map +1 -1
  55. package/dist/crypto/calculate-hash.js +1 -1
  56. package/dist/crypto/index.d.ts +1 -0
  57. package/dist/crypto/index.d.ts.map +1 -1
  58. package/dist/crypto/index.js +1 -0
  59. package/dist/crypto/private-public-keys/create-key-pair-from-mnemonic.d.ts.map +1 -1
  60. package/dist/crypto/private-public-keys/create-key-pair-from-private-key.d.ts.map +1 -1
  61. package/dist/crypto/private-public-keys/create-key-pair-from-private-key.js +1 -1
  62. package/dist/crypto/private-public-keys/create-key-pair-from-public-key.d.ts +11 -0
  63. package/dist/crypto/private-public-keys/create-key-pair-from-public-key.d.ts.map +1 -0
  64. package/dist/crypto/private-public-keys/create-key-pair-from-public-key.js +51 -0
  65. package/dist/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.d.ts.map +1 -1
  66. package/dist/crypto/private-public-keys/generation/generate-key-pair.d.ts.map +1 -1
  67. package/dist/crypto/private-public-keys/generation/get-private-public-key-from-keypair.d.ts.map +1 -1
  68. package/dist/crypto/signature/create-crypto-signature.d.ts +11 -0
  69. package/dist/crypto/signature/create-crypto-signature.d.ts.map +1 -1
  70. package/dist/crypto/signature/create-crypto-signature.js +14 -1
  71. package/dist/crypto/signature/verify-crypto-signature-by-data.d.ts +4 -0
  72. package/dist/crypto/signature/verify-crypto-signature-by-data.d.ts.map +1 -1
  73. package/dist/crypto/signature/verify-crypto-signature-by-data.js +8 -2
  74. package/dist/crypto/signature/verify-crypto-signature-by-hash.d.ts +4 -0
  75. package/dist/crypto/signature/verify-crypto-signature-by-hash.d.ts.map +1 -1
  76. package/dist/crypto/signature/verify-crypto-signature-by-hash.js +7 -1
  77. package/dist/errors/index.d.ts +2 -0
  78. package/dist/errors/index.d.ts.map +1 -1
  79. package/dist/errors/index.js +2 -0
  80. package/dist/errors/share-data/share-data-errors.d.ts +92 -1
  81. package/dist/errors/share-data/share-data-errors.d.ts.map +1 -1
  82. package/dist/errors/share-data/share-data-errors.js +130 -1
  83. package/dist/errors/shareblock/shareblock-errors.d.ts +40 -0
  84. package/dist/errors/shareblock/shareblock-errors.d.ts.map +1 -0
  85. package/dist/errors/shareblock/shareblock-errors.js +50 -0
  86. package/dist/errors/validation/crypto-validation-errors.d.ts +8 -0
  87. package/dist/errors/validation/crypto-validation-errors.d.ts.map +1 -0
  88. package/dist/errors/validation/crypto-validation-errors.js +15 -0
  89. package/dist/helpers/array/array-helpers.d.ts.map +1 -1
  90. package/dist/helpers/crypto/cryptography-helpers.d.ts.map +1 -1
  91. package/dist/helpers/data/data-helpers.d.ts.map +1 -1
  92. package/dist/helpers/file/file-helpers.d.ts.map +1 -1
  93. package/dist/helpers/id-helpers.d.ts.map +1 -1
  94. package/dist/helpers/lodash/lodash-helpers.d.ts.map +1 -1
  95. package/dist/helpers/object-helpers.d.ts.map +1 -1
  96. package/dist/helpers/object-validation-helpers.d.ts.map +1 -1
  97. package/dist/helpers/request/params-object-helpers.d.ts +6 -13
  98. package/dist/helpers/request/params-object-helpers.d.ts.map +1 -1
  99. package/dist/helpers/request/params-object-helpers.js +11 -21
  100. package/dist/helpers/request/query-object-helpers.d.ts.map +1 -1
  101. package/dist/helpers/request/request-object-helpers.d.ts.map +1 -1
  102. package/dist/models/application/audit-log/application-audit-log-models.d.ts +82 -92
  103. package/dist/models/application/audit-log/application-audit-log-models.d.ts.map +1 -1
  104. package/dist/models/application/database/firestore-models.d.ts +158 -307
  105. package/dist/models/application/database/firestore-models.d.ts.map +1 -1
  106. package/dist/models/authorization/authorization-models.d.ts +34 -44
  107. package/dist/models/authorization/authorization-models.d.ts.map +1 -1
  108. package/dist/models/authorization/authorization-models.js +2 -2
  109. package/dist/models/crypto/crypto-models.d.ts +1 -7
  110. package/dist/models/crypto/crypto-models.d.ts.map +1 -1
  111. package/dist/models/data/data-models.d.ts +27 -13
  112. package/dist/models/data/data-models.d.ts.map +1 -1
  113. package/dist/models/data/data-models.js +23 -2
  114. package/dist/models/dynamic-execution/dynamic-execution-models.d.ts +1 -9
  115. package/dist/models/dynamic-execution/dynamic-execution-models.d.ts.map +1 -1
  116. package/dist/models/events/share-event-models.d.ts +91 -120
  117. package/dist/models/events/share-event-models.d.ts.map +1 -1
  118. package/dist/models/events/share-event-models.js +35 -4
  119. package/dist/models/functions/share-data-function-models.d.ts +23 -193
  120. package/dist/models/functions/share-data-function-models.d.ts.map +1 -1
  121. package/dist/models/functions/share-data-function-models.js +1 -1
  122. package/dist/models/generic/request-response-models.d.ts +1 -7
  123. package/dist/models/generic/request-response-models.d.ts.map +1 -1
  124. package/dist/models/index.d.ts +4 -1
  125. package/dist/models/index.d.ts.map +1 -1
  126. package/dist/models/index.js +4 -1
  127. package/dist/models/rules/share-rule-models.d.ts +759 -1116
  128. package/dist/models/rules/share-rule-models.d.ts.map +1 -1
  129. package/dist/models/rules/share-rule-models.js +6 -6
  130. package/dist/models/safe/safe-transaction-models.d.ts +28 -30
  131. package/dist/models/safe/safe-transaction-models.d.ts.map +1 -1
  132. package/dist/models/safe/transactions/authorities-transactions-models.d.ts +77 -419
  133. package/dist/models/safe/transactions/authorities-transactions-models.d.ts.map +1 -1
  134. package/dist/models/safe/transactions/authorities-transactions-models.js +3 -3
  135. package/dist/models/safe/transactions/events-transactions-models.d.ts +22 -372
  136. package/dist/models/safe/transactions/events-transactions-models.d.ts.map +1 -1
  137. package/dist/models/safe/transactions/events-transactions-models.js +1 -1
  138. package/dist/models/safe/transactions/functions-transactions-models.d.ts +22 -372
  139. package/dist/models/safe/transactions/functions-transactions-models.d.ts.map +1 -1
  140. package/dist/models/safe/transactions/functions-transactions-models.js +1 -1
  141. package/dist/models/safe/transactions/rules-transactions-models.d.ts +59 -603
  142. package/dist/models/safe/transactions/rules-transactions-models.d.ts.map +1 -1
  143. package/dist/models/safe/transactions/sharedata-transactions-models.d.ts +251 -388
  144. package/dist/models/safe/transactions/sharedata-transactions-models.d.ts.map +1 -1
  145. package/dist/models/safe/transactions/sharedata-transactions-models.js +30 -4
  146. package/dist/models/share-data/share-data-crypto-models.d.ts +307 -0
  147. package/dist/models/share-data/share-data-crypto-models.d.ts.map +1 -0
  148. package/dist/models/share-data/share-data-crypto-models.js +91 -0
  149. package/dist/models/share-data/share-data-models.d.ts +114 -0
  150. package/dist/models/share-data/share-data-models.d.ts.map +1 -0
  151. package/dist/models/share-data/{share-data.js → share-data-models.js} +1 -1
  152. package/dist/models/share-data/share-data-persistence-models.d.ts +158 -0
  153. package/dist/models/share-data/share-data-persistence-models.d.ts.map +1 -0
  154. package/dist/models/share-data/share-data-persistence-models.js +94 -0
  155. package/dist/models/shareblock/shareblock-models.d.ts +280 -0
  156. package/dist/models/shareblock/shareblock-models.d.ts.map +1 -0
  157. package/dist/models/shareblock/shareblock-models.js +222 -0
  158. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts.map +1 -1
  159. package/dist/transactions/authority/create-safe-transaction-authority.d.ts.map +1 -1
  160. package/package.json +30 -22
  161. package/dist/models/share-data/share-data.d.ts +0 -181
  162. package/dist/models/share-data/share-data.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sharedata-transactions-models.d.ts","sourceRoot":"","sources":["../../../../src/models/safe/transactions/sharedata-transactions-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,mBAAmB,EACnB,yBAAyB,EAG5B,MAAM,4BAA4B,CAAC;AAIpC;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;EAI9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAIxF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
1
+ {"version":3,"file":"sharedata-transactions-models.d.ts","sourceRoot":"","sources":["../../../../src/models/safe/transactions/sharedata-transactions-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,mBAAmB,EACnB,yBAAyB,EAG5B,MAAM,4BAA4B,CAAC;AASpC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAO1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAIxF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
@@ -3,14 +3,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ISAFETransactionShareDataDeleteSchema = exports.ISAFETransactionShareDataUpdateSchema = exports.ISAFETransactionShareDataAddSchema = exports.ISAFETransactionShareDataSchema = exports.ISAFETransactionShareDataDataSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const safe_transaction_models_1 = require("../safe-transaction-models");
6
+ const share_data_crypto_models_1 = require("../../share-data/share-data-crypto-models");
7
+ const shareblock_models_1 = require("../../shareblock/shareblock-models");
6
8
  //#region ShareData Transaction
7
9
  /**
8
- * This is the data for the sharedata in the SAFE Ecosystem.
10
+ * Wire-format payload for creating a ShareData over the SAFE HTTP / SAFE
11
+ * transaction layer. Carries everything the receiving server needs to
12
+ * dispatch to the matching ShareBlock factory and reconstruct the
13
+ * client-signed trust chain:
14
+ *
15
+ * - `metadata` — variant tag + creation attribution (also identifies
16
+ * which factory to call).
17
+ * - `initialState` — caller-supplied initial state inputs. Validated
18
+ * loosely here (currency/participants/balance) — the factory layers
19
+ * the variant-specific defaults (`isOpen: true`, `committed: false`,
20
+ * etc.) on top.
21
+ * - `initialCrypto` — the client's pre-computed creation hash / sig.
22
+ * `creationPublicKey` is derived from this — *not* taken from a
23
+ * separate field — so there is one source of truth for "who created
24
+ * this block."
25
+ * - `proofs` — bundle keyed by purpose. Each entry signs over the
26
+ * in-construction share-data state at the moment the factory will
27
+ * register the matching function/rule. The server cross-checks the
28
+ * bundle covers every purpose the chosen factory requires (via
29
+ * `*_REQUIRED_PROOF_PURPOSES`) before invoking the factory.
30
+ *
31
+ * Replaces the legacy free-form `shareDataContent: Record<string, any>`
32
+ * shape — that was the attack surface that let the HTTP create route
33
+ * accept attacker-controlled JSON as canonical state.
9
34
  */
10
35
  exports.ISAFETransactionShareDataDataSchema = zod_1.z.object({
11
- shareDataId: zod_1.z.string(),
12
- shareDataType: zod_1.z.string(),
13
- shareDataContent: zod_1.z.record(zod_1.z.any()),
36
+ metadata: shareblock_models_1.IShareBlockMetadataSchema,
37
+ initialState: shareblock_models_1.IShareBlockInitialStateInputSchema,
38
+ initialCrypto: share_data_crypto_models_1.IShareDataInitialCryptoDataSchema,
39
+ proofs: share_data_crypto_models_1.ShareDataProofsSchema,
14
40
  });
15
41
  /**
16
42
  * This is the transaction targeting a sharedata item in the SAFE Ecosystem.
@@ -0,0 +1,307 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * This contains the interface for the share data initial crypto data schema
4
+ */
5
+ export declare const IShareDataInitialCryptoDataSchema: z.ZodObject<{
6
+ publicKey: z.ZodString;
7
+ shareDataHash: z.ZodString;
8
+ shareDataSignature: z.ZodString;
9
+ timestamp: z.ZodNumber;
10
+ }, z.core.$strip>;
11
+ export type IShareDataInitialCryptoData = z.infer<typeof IShareDataInitialCryptoDataSchema>;
12
+ /**
13
+ * This contains the interface for the share data crypto proof schema.
14
+ *
15
+ * `purpose` identifies what this proof attests to (e.g. `'deposit'`,
16
+ * `'rule-balance'`, `'seed-function'`). It is folded into the canonical
17
+ * signed string so two proofs taken over the same share-data state at the
18
+ * same moment but tagged with different purposes produce different
19
+ * signatures. Verifiers consume `purpose` directly from the proof — the
20
+ * proof is self-describing, so the structural-add boundary
21
+ * (`addFunction` / `addRule`) does not need a separate purpose argument.
22
+ */
23
+ export declare const IShareDataCryptoProofSchema: z.ZodObject<{
24
+ publicKey: z.ZodString;
25
+ shareDataHash: z.ZodString;
26
+ shareDataPreviousHash: z.ZodString;
27
+ shareDataSignature: z.ZodString;
28
+ timestamp: z.ZodNumber;
29
+ purpose: z.ZodString;
30
+ }, z.core.$strip>;
31
+ export type IShareDataCryptoProof = z.infer<typeof IShareDataCryptoProofSchema>;
32
+ /**
33
+ * A bundle of structural proofs keyed by their `purpose`, used as the
34
+ * wire-format input to ShareBlock factories when the client (rather than
35
+ * the server) signs each registration. Matches how `_structuralProofs`
36
+ * end up shaped on a constructed ShareData — one proof per
37
+ * `addFunction` / `addRule` call.
38
+ */
39
+ export declare const ShareDataProofsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
40
+ publicKey: z.ZodString;
41
+ shareDataHash: z.ZodString;
42
+ shareDataPreviousHash: z.ZodString;
43
+ shareDataSignature: z.ZodString;
44
+ timestamp: z.ZodNumber;
45
+ purpose: z.ZodString;
46
+ }, z.core.$strip>>;
47
+ export type ShareDataProofs = z.infer<typeof ShareDataProofsSchema>;
48
+ /**
49
+ * This contains the interface for the share data property config
50
+ * for creating strings from the object to ensure that signatures and
51
+ * hashes are consistent
52
+ */
53
+ export declare const IShareDataPropertyConfigSchema: z.ZodObject<{
54
+ key: z.ZodString;
55
+ process: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodString>>;
56
+ }, z.core.$strip>;
57
+ export type IShareDataPropertyConfig = z.infer<typeof IShareDataPropertyConfigSchema>;
58
+ /**
59
+ * This contains the interface for the share data config array
60
+ * for creating strings from the object to ensure that signatures and
61
+ * hashes are consistent
62
+ */
63
+ export declare const IShareDataConfigSchema: z.ZodArray<z.ZodObject<{
64
+ key: z.ZodString;
65
+ process: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodString>>;
66
+ }, z.core.$strip>>;
67
+ export type IShareDataConfig = z.infer<typeof IShareDataConfigSchema>;
68
+ /**
69
+ * This contains the interface for additional data to include in the share data string.
70
+ *
71
+ * `purpose` is required and identifies what this signed snapshot is attesting to
72
+ * (e.g. `'deposit'`, `'rule-balance'`, `'seed-function'`). It is folded into the
73
+ * canonical string `calculateShareDataString` produces, so two proofs taken
74
+ * over the same share-data state at the same moment but tagged with different
75
+ * purposes produce different hashes and therefore different signatures. This
76
+ * structurally prevents replaying a proof signed for one purpose as a proof
77
+ * for another.
78
+ */
79
+ export declare const IShareDataAdditionalValuesToIncludeSchema: z.ZodObject<{
80
+ purpose: z.ZodString;
81
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
82
+ ruleId: z.ZodString;
83
+ currentDataConditions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
84
+ conditionTypeQualifier: z.ZodEnum<{
85
+ IS: "IS";
86
+ IS_NOT: "IS_NOT";
87
+ }>;
88
+ targettedProperty: z.ZodString;
89
+ conditionType: z.ZodLiteral<"TYPEOF">;
90
+ conditionValue: z.ZodEnum<{
91
+ NULL: "NULL";
92
+ STRING: "STRING";
93
+ NUMBER: "NUMBER";
94
+ INTEGER: "INTEGER";
95
+ BOOLEAN: "BOOLEAN";
96
+ OBJECT: "OBJECT";
97
+ ARRAY: "ARRAY";
98
+ UNDEFINED: "UNDEFINED";
99
+ FUNCTION: "FUNCTION";
100
+ BIGINT: "BIGINT";
101
+ }>;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ conditionTypeQualifier: z.ZodEnum<{
104
+ IS: "IS";
105
+ IS_NOT: "IS_NOT";
106
+ }>;
107
+ targettedProperty: z.ZodString;
108
+ conditionType: z.ZodLiteral<"EQUAL">;
109
+ conditionValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
110
+ }, z.core.$strip>, z.ZodObject<{
111
+ conditionTypeQualifier: z.ZodEnum<{
112
+ IS: "IS";
113
+ IS_NOT: "IS_NOT";
114
+ }>;
115
+ targettedProperty: z.ZodString;
116
+ conditionType: z.ZodEnum<{
117
+ GREATER_THAN: "GREATER_THAN";
118
+ LESS_THAN: "LESS_THAN";
119
+ GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL";
120
+ LESS_THAN_OR_EQUAL: "LESS_THAN_OR_EQUAL";
121
+ }>;
122
+ conditionValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ conditionTypeQualifier: z.ZodEnum<{
125
+ IS: "IS";
126
+ IS_NOT: "IS_NOT";
127
+ }>;
128
+ targettedProperty: z.ZodString;
129
+ conditionType: z.ZodLiteral<"CONTAINS">;
130
+ conditionValue: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>;
131
+ }, z.core.$strip>, z.ZodObject<{
132
+ conditionTypeQualifier: z.ZodEnum<{
133
+ IS: "IS";
134
+ IS_NOT: "IS_NOT";
135
+ }>;
136
+ targettedProperty: z.ZodString;
137
+ conditionType: z.ZodEnum<{
138
+ STARTS_WITH: "STARTS_WITH";
139
+ ENDS_WITH: "ENDS_WITH";
140
+ }>;
141
+ conditionValue: z.ZodString;
142
+ }, z.core.$strip>, z.ZodObject<{
143
+ conditionTypeQualifier: z.ZodEnum<{
144
+ IS: "IS";
145
+ IS_NOT: "IS_NOT";
146
+ }>;
147
+ targettedProperty: z.ZodString;
148
+ conditionType: z.ZodLiteral<"NULL">;
149
+ }, z.core.$strip>, z.ZodObject<{
150
+ conditionTypeQualifier: z.ZodEnum<{
151
+ IS: "IS";
152
+ IS_NOT: "IS_NOT";
153
+ }>;
154
+ targettedProperty: z.ZodString;
155
+ conditionType: z.ZodEnum<{
156
+ TRUE: "TRUE";
157
+ FALSE: "FALSE";
158
+ }>;
159
+ }, z.core.$strip>, z.ZodObject<{
160
+ conditionTypeQualifier: z.ZodEnum<{
161
+ IS: "IS";
162
+ IS_NOT: "IS_NOT";
163
+ }>;
164
+ targettedProperty: z.ZodString;
165
+ conditionType: z.ZodLiteral<"EMPTY">;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ conditionTypeQualifier: z.ZodEnum<{
168
+ IS: "IS";
169
+ IS_NOT: "IS_NOT";
170
+ }>;
171
+ targettedProperty: z.ZodString;
172
+ conditionType: z.ZodEnum<{
173
+ PATTERN: "PATTERN";
174
+ }>;
175
+ conditionValue: z.ZodString;
176
+ }, z.core.$strip>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
177
+ proposedDataConditions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
178
+ conditionTypeQualifier: z.ZodEnum<{
179
+ IS: "IS";
180
+ IS_NOT: "IS_NOT";
181
+ }>;
182
+ targettedProperty: z.ZodString;
183
+ conditionType: z.ZodLiteral<"TYPEOF">;
184
+ conditionValue: z.ZodEnum<{
185
+ NULL: "NULL";
186
+ STRING: "STRING";
187
+ NUMBER: "NUMBER";
188
+ INTEGER: "INTEGER";
189
+ BOOLEAN: "BOOLEAN";
190
+ OBJECT: "OBJECT";
191
+ ARRAY: "ARRAY";
192
+ UNDEFINED: "UNDEFINED";
193
+ FUNCTION: "FUNCTION";
194
+ BIGINT: "BIGINT";
195
+ }>;
196
+ }, z.core.$strip>, z.ZodObject<{
197
+ conditionTypeQualifier: z.ZodEnum<{
198
+ IS: "IS";
199
+ IS_NOT: "IS_NOT";
200
+ }>;
201
+ targettedProperty: z.ZodString;
202
+ conditionType: z.ZodLiteral<"EQUAL">;
203
+ conditionValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
204
+ }, z.core.$strip>, z.ZodObject<{
205
+ conditionTypeQualifier: z.ZodEnum<{
206
+ IS: "IS";
207
+ IS_NOT: "IS_NOT";
208
+ }>;
209
+ targettedProperty: z.ZodString;
210
+ conditionType: z.ZodEnum<{
211
+ GREATER_THAN: "GREATER_THAN";
212
+ LESS_THAN: "LESS_THAN";
213
+ GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL";
214
+ LESS_THAN_OR_EQUAL: "LESS_THAN_OR_EQUAL";
215
+ }>;
216
+ conditionValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
217
+ }, z.core.$strip>, z.ZodObject<{
218
+ conditionTypeQualifier: z.ZodEnum<{
219
+ IS: "IS";
220
+ IS_NOT: "IS_NOT";
221
+ }>;
222
+ targettedProperty: z.ZodString;
223
+ conditionType: z.ZodLiteral<"CONTAINS">;
224
+ conditionValue: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>;
225
+ }, z.core.$strip>, z.ZodObject<{
226
+ conditionTypeQualifier: z.ZodEnum<{
227
+ IS: "IS";
228
+ IS_NOT: "IS_NOT";
229
+ }>;
230
+ targettedProperty: z.ZodString;
231
+ conditionType: z.ZodEnum<{
232
+ STARTS_WITH: "STARTS_WITH";
233
+ ENDS_WITH: "ENDS_WITH";
234
+ }>;
235
+ conditionValue: z.ZodString;
236
+ }, z.core.$strip>, z.ZodObject<{
237
+ conditionTypeQualifier: z.ZodEnum<{
238
+ IS: "IS";
239
+ IS_NOT: "IS_NOT";
240
+ }>;
241
+ targettedProperty: z.ZodString;
242
+ conditionType: z.ZodLiteral<"NULL">;
243
+ }, z.core.$strip>, z.ZodObject<{
244
+ conditionTypeQualifier: z.ZodEnum<{
245
+ IS: "IS";
246
+ IS_NOT: "IS_NOT";
247
+ }>;
248
+ targettedProperty: z.ZodString;
249
+ conditionType: z.ZodEnum<{
250
+ TRUE: "TRUE";
251
+ FALSE: "FALSE";
252
+ }>;
253
+ }, z.core.$strip>, z.ZodObject<{
254
+ conditionTypeQualifier: z.ZodEnum<{
255
+ IS: "IS";
256
+ IS_NOT: "IS_NOT";
257
+ }>;
258
+ targettedProperty: z.ZodString;
259
+ conditionType: z.ZodLiteral<"EMPTY">;
260
+ }, z.core.$strip>, z.ZodObject<{
261
+ conditionTypeQualifier: z.ZodEnum<{
262
+ IS: "IS";
263
+ IS_NOT: "IS_NOT";
264
+ }>;
265
+ targettedProperty: z.ZodString;
266
+ conditionType: z.ZodEnum<{
267
+ PATTERN: "PATTERN";
268
+ }>;
269
+ conditionValue: z.ZodString;
270
+ }, z.core.$strip>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
271
+ targettedProperty: z.ZodString;
272
+ }, z.core.$strip>>>;
273
+ functions: z.ZodOptional<z.ZodArray<z.ZodObject<{
274
+ id: z.ZodString;
275
+ groupingId: z.ZodString;
276
+ groupingName: z.ZodString;
277
+ name: z.ZodString;
278
+ description: z.ZodString;
279
+ hash: z.ZodString;
280
+ stringifiedFunction: z.ZodString;
281
+ }, z.core.$strip>>>;
282
+ transactionHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
283
+ ruleOutcome: z.ZodBoolean;
284
+ ruleFailures: z.ZodArray<z.ZodObject<{
285
+ ruleId: z.ZodString;
286
+ }, z.core.$strip>>;
287
+ transactionFunction: z.ZodObject<{
288
+ input: z.ZodAny;
289
+ func: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
290
+ output: z.ZodAny;
291
+ }, z.core.$strip>;
292
+ }, z.core.$strip>>>;
293
+ events: z.ZodOptional<z.ZodArray<z.ZodObject<{
294
+ shareData: z.ZodArray<z.ZodObject<{
295
+ shareDataId: z.ZodString;
296
+ functionId: z.ZodString;
297
+ shareDataInputs: z.ZodArray<z.ZodString>;
298
+ inputs: z.ZodAny;
299
+ }, z.core.$strip>>;
300
+ processingType: z.ZodEnum<{
301
+ parallel: "parallel";
302
+ linear: "linear";
303
+ }>;
304
+ }, z.core.$strip>>>;
305
+ }, z.core.$strip>;
306
+ export type IShareDataAdditionalValuesToInclude = z.infer<typeof IShareDataAdditionalValuesToIncludeSchema>;
307
+ //# sourceMappingURL=share-data-crypto-models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-data-crypto-models.d.ts","sourceRoot":"","sources":["../../../src/models/share-data/share-data-crypto-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;iBAK5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;;;;;;;;;GAUG;AASH,eAAO,MAAM,2BAA2B;;;;;;;iBAOtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;kBAAoD,CAAC;AAEvF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;kBAA0C,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAMtE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMpD,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC"}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IShareDataAdditionalValuesToIncludeSchema = exports.IShareDataConfigSchema = exports.IShareDataPropertyConfigSchema = exports.ShareDataProofsSchema = exports.IShareDataCryptoProofSchema = exports.IShareDataInitialCryptoDataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const share_rule_models_1 = require("../rules/share-rule-models");
6
+ const share_data_models_1 = require("./share-data-models");
7
+ const share_event_models_1 = require("../events/share-event-models");
8
+ // This contains models that are used in the share data specifically around crypto
9
+ //#region Share Data Crypto Schemas
10
+ /**
11
+ * This contains the interface for the share data initial crypto data schema
12
+ */
13
+ exports.IShareDataInitialCryptoDataSchema = zod_1.z.object({
14
+ publicKey: zod_1.z.string(), // the public key of the share data
15
+ shareDataHash: zod_1.z.string(), // the share data hash
16
+ shareDataSignature: zod_1.z.string(), // the share data signature
17
+ timestamp: zod_1.z.number(), // the timestamp of the initial crypto data (in milliseconds)
18
+ });
19
+ /**
20
+ * This contains the interface for the share data crypto proof schema.
21
+ *
22
+ * `purpose` identifies what this proof attests to (e.g. `'deposit'`,
23
+ * `'rule-balance'`, `'seed-function'`). It is folded into the canonical
24
+ * signed string so two proofs taken over the same share-data state at the
25
+ * same moment but tagged with different purposes produce different
26
+ * signatures. Verifiers consume `purpose` directly from the proof — the
27
+ * proof is self-describing, so the structural-add boundary
28
+ * (`addFunction` / `addRule`) does not need a separate purpose argument.
29
+ */
30
+ // Field declaration order here is load-bearing, NOT cosmetic. Zod
31
+ // reconstructs a parsed object in *schema-declaration* order, and the
32
+ // canonical share-data hash folds structural proofs in via order-sensitive
33
+ // `JSON.stringify` (see `getArrayString` / `calculateShareDataString`). So a
34
+ // proof that round-trips through `.parse()` (wire load, HTTP create) must come
35
+ // back with the SAME key order a freshly-minted proof has, or its hash
36
+ // diverges and structural-proof verification fails. This order must therefore
37
+ // mirror the object literal in `createShareDataProposalProof` exactly.
38
+ exports.IShareDataCryptoProofSchema = zod_1.z.object({
39
+ publicKey: zod_1.z.string(), // the public key of the share data
40
+ shareDataHash: zod_1.z.string(), // the share data hash
41
+ shareDataPreviousHash: zod_1.z.string(), // the previous share data hash
42
+ shareDataSignature: zod_1.z.string(), // the share data signature
43
+ timestamp: zod_1.z.number(), // the timestamp of the initial crypto data (in milliseconds)
44
+ purpose: zod_1.z.string().min(1), // what this proof attests to (e.g. 'deposit', 'rule-balance')
45
+ });
46
+ /**
47
+ * A bundle of structural proofs keyed by their `purpose`, used as the
48
+ * wire-format input to ShareBlock factories when the client (rather than
49
+ * the server) signs each registration. Matches how `_structuralProofs`
50
+ * end up shaped on a constructed ShareData — one proof per
51
+ * `addFunction` / `addRule` call.
52
+ */
53
+ exports.ShareDataProofsSchema = zod_1.z.record(zod_1.z.string(), exports.IShareDataCryptoProofSchema);
54
+ //#endregion Share Data Crypto Schemas
55
+ //#region Stringify Configurations
56
+ /**
57
+ * This contains the interface for the share data property config
58
+ * for creating strings from the object to ensure that signatures and
59
+ * hashes are consistent
60
+ */
61
+ exports.IShareDataPropertyConfigSchema = zod_1.z.object({
62
+ key: zod_1.z.string(),
63
+ process: zod_1.z.function({ input: zod_1.z.tuple([zod_1.z.any()]), output: zod_1.z.string() }).optional(), // Simplified process type
64
+ });
65
+ /**
66
+ * This contains the interface for the share data config array
67
+ * for creating strings from the object to ensure that signatures and
68
+ * hashes are consistent
69
+ */
70
+ exports.IShareDataConfigSchema = zod_1.z.array(exports.IShareDataPropertyConfigSchema);
71
+ //#endregion Stringify Configurations
72
+ //#region Additional Data to include
73
+ /**
74
+ * This contains the interface for additional data to include in the share data string.
75
+ *
76
+ * `purpose` is required and identifies what this signed snapshot is attesting to
77
+ * (e.g. `'deposit'`, `'rule-balance'`, `'seed-function'`). It is folded into the
78
+ * canonical string `calculateShareDataString` produces, so two proofs taken
79
+ * over the same share-data state at the same moment but tagged with different
80
+ * purposes produce different hashes and therefore different signatures. This
81
+ * structurally prevents replaying a proof signed for one purpose as a proof
82
+ * for another.
83
+ */
84
+ exports.IShareDataAdditionalValuesToIncludeSchema = zod_1.z.object({
85
+ purpose: zod_1.z.string().min(1),
86
+ rules: zod_1.z.array(share_rule_models_1.IShareRuleAppliedSchema).optional(),
87
+ functions: zod_1.z.array(share_data_models_1.IShareFunctionRecordSchema).optional(),
88
+ transactionHistory: zod_1.z.array(share_data_models_1.IShareDataTransactionBaseSchema).optional(),
89
+ events: zod_1.z.array(share_event_models_1.IShareDataEventSchema).optional(),
90
+ });
91
+ //#endregion Additional Data to include
@@ -0,0 +1,114 @@
1
+ import z from 'zod';
2
+ import type { IShareDataCryptoProof } from './share-data-crypto-models';
3
+ /**
4
+ * This contains the data for the share data object
5
+ */
6
+ export declare enum ShareDataTypes {
7
+ AUTHORIZATION = "AUTHORIZATION",
8
+ RULE = "RULE",
9
+ FUNCTION = "FUNCTION",
10
+ TRANSACTION_HISTORY = "TRANSACTION_HISTORY",
11
+ DATA = "DATA"
12
+ }
13
+ export declare const ShareDataTypesSchema: z.ZodEnum<{
14
+ FUNCTION: "FUNCTION";
15
+ AUTHORIZATION: "AUTHORIZATION";
16
+ RULE: "RULE";
17
+ TRANSACTION_HISTORY: "TRANSACTION_HISTORY";
18
+ DATA: "DATA";
19
+ }>;
20
+ /**
21
+ * This contains the interface for a data in a share data object
22
+ */
23
+ export declare const IShareDataSchema: z.ZodRecord<z.ZodString, z.ZodAny>;
24
+ export type IShareData = z.infer<typeof IShareDataSchema>;
25
+ /**
26
+ * This contains the interface for a share function record in the share data object
27
+ */
28
+ export declare const IShareFunctionRecordSchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ groupingId: z.ZodString;
31
+ groupingName: z.ZodString;
32
+ name: z.ZodString;
33
+ description: z.ZodString;
34
+ hash: z.ZodString;
35
+ stringifiedFunction: z.ZodString;
36
+ }, z.core.$strip>;
37
+ export type IShareFunctionRecord = z.infer<typeof IShareFunctionRecordSchema>;
38
+ /**
39
+ * This contains the interface for a share function in the share data object
40
+ */
41
+ export declare const IShareFunctionSchema: z.ZodObject<{
42
+ input: z.ZodAny;
43
+ func: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
44
+ output: z.ZodAny;
45
+ }, z.core.$strip>;
46
+ export interface IShareFunction<TInput, TFunction extends (...args: any[]) => any, TOutput> {
47
+ /**
48
+ * Stable identifier the host application can use to refer to this
49
+ * function from outside the runtime — e.g., when a client submits a
50
+ * `propose` over the realtime transport and needs to name which
51
+ * registered function should evaluate the proposal.
52
+ *
53
+ * Optional today for backwards compatibility with existing
54
+ * constructions that don't set it. Functions without an id are
55
+ * invisible to id-based lookup (see `createIdBasedFunctionResolver`
56
+ * in `@degenerate/realtime`); the host can still resolve them via a
57
+ * custom `FunctionResolver`.
58
+ */
59
+ id?: string;
60
+ input: TInput;
61
+ func: TFunction;
62
+ output: TOutput;
63
+ }
64
+ /**
65
+ * This contains the interface for the rule failures in the share data object
66
+ */
67
+ export declare const IShareDataRuleFailuresSchema: z.ZodObject<{
68
+ ruleId: z.ZodString;
69
+ }, z.core.$strip>;
70
+ export type IShareDataRuleFailures = z.infer<typeof IShareDataRuleFailuresSchema>;
71
+ /**
72
+ * This contains the interface for the share transaction history in the share data object
73
+ */
74
+ export declare const IShareDataTransactionBaseSchema: z.ZodObject<{
75
+ ruleOutcome: z.ZodBoolean;
76
+ ruleFailures: z.ZodArray<z.ZodObject<{
77
+ ruleId: z.ZodString;
78
+ }, z.core.$strip>>;
79
+ transactionFunction: z.ZodObject<{
80
+ input: z.ZodAny;
81
+ func: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
82
+ output: z.ZodAny;
83
+ }, z.core.$strip>;
84
+ }, z.core.$strip>;
85
+ export type IShareDataTransactionBase = z.infer<typeof IShareDataTransactionBaseSchema>;
86
+ /**
87
+ * This contains the interface for the share transaction history in the share data object
88
+ * This is done for storage
89
+ */
90
+ export declare const IShareDataTransactionHistorySchema: z.ZodObject<{
91
+ ruleOutcome: z.ZodBoolean;
92
+ ruleFailures: z.ZodArray<z.ZodObject<{
93
+ ruleId: z.ZodString;
94
+ }, z.core.$strip>>;
95
+ transactionFunction: z.ZodObject<{
96
+ input: z.ZodAny;
97
+ func: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
98
+ output: z.ZodAny;
99
+ }, z.core.$strip>;
100
+ transactionId: z.ZodString;
101
+ transactionTime: z.ZodNumber;
102
+ }, z.core.$strip>;
103
+ /**
104
+ * `proof` is the transaction proposal proof that authorized this state change
105
+ * (present for transactions applied through the signed `addTransaction` path;
106
+ * absent for legacy/internal applies). It makes the audit log itself carry the
107
+ * signature, not just the function + rule outcome. Typed here rather than in
108
+ * the Zod schema to avoid a module load-time cycle — see the `import type` note
109
+ * at the top of this file.
110
+ */
111
+ export type IShareDataTransactionHistory = z.infer<typeof IShareDataTransactionHistorySchema> & {
112
+ proof?: IShareDataCryptoProof;
113
+ };
114
+ //# sourceMappingURL=share-data-models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-data-models.d.ts","sourceRoot":"","sources":["../../../src/models/share-data/share-data-models.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAOpB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE;;GAEG;AACH,oBAAY,cAAc;IACtB,aAAa,kBAAkB;IAC/B,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,mBAAmB,wBAAwB;IAC3C,IAAI,SAAS;CAChB;AAED,eAAO,MAAM,oBAAoB;;;;;;EAM/B,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,gBAAgB,oCAAgC,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;iBAQrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAGH,MAAM,WAAW,cAAc,CAAC,MAAM,EAAE,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,OAAO;IACtF;;;;;;;;;;;OAWG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACnB;AAGD;;GAEG;AACH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;iBAI1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;iBAG7C,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,GAAG;IAC5F,KAAK,CAAC,EAAE,qBAAqB,CAAC;CACjC,CAAC"}
@@ -29,7 +29,7 @@ exports.ShareDataTypesSchema = zod_1.default.enum([
29
29
  /**
30
30
  * This contains the interface for a data in a share data object
31
31
  */
32
- exports.IShareDataSchema = zod_1.default.record(zod_1.default.any());
32
+ exports.IShareDataSchema = zod_1.default.record(zod_1.default.string(), zod_1.default.any());
33
33
  /**
34
34
  * This contains the interface for a share function record in the share data object
35
35
  */