@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
@@ -11,7 +11,9 @@ export type IJWTAuthority = z.infer<typeof JWTAuthoritySchema>;
11
11
  export declare enum AuthorityValidationType {
12
12
  JWT = "JWT"
13
13
  }
14
- export declare const AuthorityValidationTypeSchema: z.ZodEnum<["JWT"]>;
14
+ export declare const AuthorityValidationTypeSchema: z.ZodEnum<{
15
+ JWT: "JWT";
16
+ }>;
15
17
  /**
16
18
  * This is the payload for the jwt.
17
19
  */
@@ -23,13 +25,7 @@ export type IAuthorizationPayload = z.infer<typeof AuthorizationPayloadSchema>;
23
25
  export declare const AuthorizationHeaderSchema: z.ZodObject<{
24
26
  alg: z.ZodString;
25
27
  typ: z.ZodString;
26
- }, "strip", z.ZodTypeAny, {
27
- alg: string;
28
- typ: string;
29
- }, {
30
- alg: string;
31
- typ: string;
32
- }>;
28
+ }, z.core.$strip>;
33
29
  export type IAuthorizationHeader = z.infer<typeof AuthorizationHeaderSchema>;
34
30
  /**
35
31
  * This is the audience that the jwt is intended for.
@@ -42,7 +38,14 @@ export declare enum AuthorizationAudience {
42
38
  EVENTS = "EVENTS",
43
39
  ENDPOINTS = "ENDPOINTS"
44
40
  }
45
- export declare const AuthorizationAudienceSchema: z.ZodEnum<[AuthorizationAudience.AUTHORITIES, AuthorizationAudience.SHAREDATA, AuthorizationAudience.FUNCTIONS, AuthorizationAudience.RULES, AuthorizationAudience.EVENTS, AuthorizationAudience.ENDPOINTS]>;
41
+ export declare const AuthorizationAudienceSchema: z.ZodEnum<{
42
+ AUTHORITIES: AuthorizationAudience.AUTHORITIES;
43
+ SHAREDATA: AuthorizationAudience.SHAREDATA;
44
+ FUNCTIONS: AuthorizationAudience.FUNCTIONS;
45
+ RULES: AuthorizationAudience.RULES;
46
+ EVENTS: AuthorizationAudience.EVENTS;
47
+ ENDPOINTS: AuthorizationAudience.ENDPOINTS;
48
+ }>;
46
49
  /**
47
50
  * This contains the start of the subject for the authorization subject
48
51
  */
@@ -50,7 +53,10 @@ export declare enum AuthorizationSubjectStart {
50
53
  USER = "USER",
51
54
  SAFE_NETWORK = "SAFE_NETWORK"
52
55
  }
53
- export declare const AuthorizationSubjectStartSchema: z.ZodEnum<[AuthorizationSubjectStart.USER, AuthorizationSubjectStart.SAFE_NETWORK]>;
56
+ export declare const AuthorizationSubjectStartSchema: z.ZodEnum<{
57
+ USER: AuthorizationSubjectStart.USER;
58
+ SAFE_NETWORK: AuthorizationSubjectStart.SAFE_NETWORK;
59
+ }>;
54
60
  /**
55
61
  * This type represents the formatted authorization subject.
56
62
  */
@@ -70,55 +76,39 @@ export type ICustomClaims = z.infer<typeof CustomClaimsSchema>;
70
76
  * This interface represents the valid safe token payload (after deconstructing the jwt token).
71
77
  */
72
78
  export declare const ValidSafeTokenPayloadSchema: z.ZodObject<{
73
- aud: z.ZodEnum<[AuthorizationAudience.AUTHORITIES, AuthorizationAudience.SHAREDATA, AuthorizationAudience.FUNCTIONS, AuthorizationAudience.RULES, AuthorizationAudience.EVENTS, AuthorizationAudience.ENDPOINTS]>;
79
+ aud: z.ZodEnum<{
80
+ AUTHORITIES: AuthorizationAudience.AUTHORITIES;
81
+ SHAREDATA: AuthorizationAudience.SHAREDATA;
82
+ FUNCTIONS: AuthorizationAudience.FUNCTIONS;
83
+ RULES: AuthorizationAudience.RULES;
84
+ EVENTS: AuthorizationAudience.EVENTS;
85
+ ENDPOINTS: AuthorizationAudience.ENDPOINTS;
86
+ }>;
74
87
  exp: z.ZodNumber;
75
88
  iat: z.ZodNumber;
76
89
  nbf: z.ZodNumber;
77
90
  sub: z.ZodString;
78
91
  iss: z.ZodString;
79
- }, "strip", z.ZodAny, z.objectOutputType<{
80
- aud: z.ZodEnum<[AuthorizationAudience.AUTHORITIES, AuthorizationAudience.SHAREDATA, AuthorizationAudience.FUNCTIONS, AuthorizationAudience.RULES, AuthorizationAudience.EVENTS, AuthorizationAudience.ENDPOINTS]>;
81
- exp: z.ZodNumber;
82
- iat: z.ZodNumber;
83
- nbf: z.ZodNumber;
84
- sub: z.ZodString;
85
- iss: z.ZodString;
86
- }, z.ZodAny, "strip">, z.objectInputType<{
87
- aud: z.ZodEnum<[AuthorizationAudience.AUTHORITIES, AuthorizationAudience.SHAREDATA, AuthorizationAudience.FUNCTIONS, AuthorizationAudience.RULES, AuthorizationAudience.EVENTS, AuthorizationAudience.ENDPOINTS]>;
88
- exp: z.ZodNumber;
89
- iat: z.ZodNumber;
90
- nbf: z.ZodNumber;
91
- sub: z.ZodString;
92
- iss: z.ZodString;
93
- }, z.ZodAny, "strip">>;
92
+ }, z.core.$catchall<z.ZodAny>>;
94
93
  export type IValidSafeTokenPayload = z.infer<typeof ValidSafeTokenPayloadSchema>;
95
94
  /**
96
95
  * This is the decoded jwt token.
97
96
  */
98
97
  export declare const DecodedJwtTokenSchema: z.ZodObject<{
99
98
  customClaims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
100
- aud: z.ZodEnum<[AuthorizationAudience.AUTHORITIES, AuthorizationAudience.SHAREDATA, AuthorizationAudience.FUNCTIONS, AuthorizationAudience.RULES, AuthorizationAudience.EVENTS, AuthorizationAudience.ENDPOINTS]>;
99
+ aud: z.ZodEnum<{
100
+ AUTHORITIES: AuthorizationAudience.AUTHORITIES;
101
+ SHAREDATA: AuthorizationAudience.SHAREDATA;
102
+ FUNCTIONS: AuthorizationAudience.FUNCTIONS;
103
+ RULES: AuthorizationAudience.RULES;
104
+ EVENTS: AuthorizationAudience.EVENTS;
105
+ ENDPOINTS: AuthorizationAudience.ENDPOINTS;
106
+ }>;
101
107
  exp: z.ZodNumber;
102
108
  iat: z.ZodNumber;
103
109
  nbf: z.ZodNumber;
104
110
  sub: z.ZodString;
105
111
  iss: z.ZodString;
106
- }, "strip", z.ZodTypeAny, {
107
- aud: AuthorizationAudience;
108
- exp: number;
109
- iat: number;
110
- nbf: number;
111
- sub: string;
112
- iss: string;
113
- customClaims?: Record<string, any> | undefined;
114
- }, {
115
- aud: AuthorizationAudience;
116
- exp: number;
117
- iat: number;
118
- nbf: number;
119
- sub: string;
120
- iss: string;
121
- customClaims?: Record<string, any> | undefined;
122
- }>;
112
+ }, z.core.$strip>;
123
113
  export type IDecodedJwtToken = z.infer<typeof DecodedJwtTokenSchema>;
124
114
  //# sourceMappingURL=authorization-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authorization-models.d.ts","sourceRoot":"","sources":["../../../src/models/authorization/authorization-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,kBAAkB,oCAAgC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;GAEG;AACH,oBAAY,uBAAuB;IAC/B,GAAG,QAAQ;CACd;AAED,eAAO,MAAM,6BAA6B,oBAExC,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,0BAA0B,oCAAoB,CAAC;AAC5D,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE7E;;GAEG;AACH,oBAAY,qBAAqB;IAC7B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,2BAA2B,8MAOtC,CAAC;AAEH;;GAEG;AACH,oBAAY,yBAAyB;IACjC,IAAI,SAAS;IACb,YAAY,iBAAiB;CAChC;AAED,eAAO,MAAM,+BAA+B,qFAG1C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B,aAA+C,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,yBAAyB,aAAkD,CAAC;AACzF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E;;GAEG;AACH,eAAO,MAAM,kBAAkB,oCAAoB,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;sBAOpB,CAAC;AAErB,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EAQhC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"authorization-models.d.ts","sourceRoot":"","sources":["../../../src/models/authorization/authorization-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,kBAAkB,oCAAgC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;GAEG;AACH,oBAAY,uBAAuB;IAC/B,GAAG,QAAQ;CACd;AAED,eAAO,MAAM,6BAA6B;;EAExC,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,0BAA0B,oCAAgC,CAAC;AACxE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;iBAGpC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE7E;;GAEG;AACH,oBAAY,qBAAqB;IAC7B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,2BAA2B;;;;;;;EAOtC,CAAC;AAEH;;GAEG;AACH,oBAAY,yBAAyB;IACjC,IAAI,SAAS;IACb,YAAY,iBAAiB;CAChC;AAED,eAAO,MAAM,+BAA+B;;;EAG1C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B,aAA+C,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,yBAAyB,aAAkD,CAAC;AACzF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E;;GAEG;AACH,eAAO,MAAM,kBAAkB,oCAAgC,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;8BAOpB,CAAC;AAErB,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;iBAQhC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -23,7 +23,7 @@ exports.AuthorityValidationTypeSchema = zod_1.z.enum([
23
23
  /**
24
24
  * This is the payload for the jwt.
25
25
  */
26
- exports.AuthorizationPayloadSchema = zod_1.z.record(zod_1.z.any());
26
+ exports.AuthorizationPayloadSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.any());
27
27
  /**
28
28
  * This is the header for the jwt.
29
29
  */
@@ -75,7 +75,7 @@ exports.AuthorizationIssuerSchema = zod_1.z.string().regex(/^[a-zA-Z0-9]+-[a-zA-
75
75
  /**
76
76
  * Any custom network claims that are added to the token.
77
77
  */
78
- exports.CustomClaimsSchema = zod_1.z.record(zod_1.z.any());
78
+ exports.CustomClaimsSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.any());
79
79
  /**
80
80
  * This interface represents the valid safe token payload (after deconstructing the jwt token).
81
81
  */
@@ -2,12 +2,6 @@ import { z } from 'zod';
2
2
  export declare const PublicPrivateKeyDerPairSchema: z.ZodObject<{
3
3
  privateKeyDer: z.ZodString;
4
4
  publicKeyDer: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- privateKeyDer: string;
7
- publicKeyDer: string;
8
- }, {
9
- privateKeyDer: string;
10
- publicKeyDer: string;
11
- }>;
5
+ }, z.core.$strip>;
12
6
  export type IPublicPrivateKeyDerPair = z.infer<typeof PublicPrivateKeyDerPairSchema>;
13
7
  //# sourceMappingURL=crypto-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto-models.d.ts","sourceRoot":"","sources":["../../../src/models/crypto/crypto-models.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
1
+ {"version":3,"file":"crypto-models.d.ts","sourceRoot":"","sources":["../../../src/models/crypto/crypto-models.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,6BAA6B;;;iBAGxC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
@@ -8,19 +8,7 @@ export declare const GenericDataSchema: z.ZodObject<{
8
8
  updatedAt: z.ZodNumber;
9
9
  updatedBy: z.ZodString;
10
10
  versionNumber: z.ZodNumber;
11
- }, "strip", z.ZodTypeAny, {
12
- createdAt: number;
13
- createdBy: string;
14
- updatedAt: number;
15
- updatedBy: string;
16
- versionNumber: number;
17
- }, {
18
- createdAt: number;
19
- createdBy: string;
20
- updatedAt: number;
21
- updatedBy: string;
22
- versionNumber: number;
23
- }>;
11
+ }, z.core.$strip>;
24
12
  export type IGenericData = z.infer<typeof GenericDataSchema>;
25
13
  /**
26
14
  * This contains the data for an item with a searchable index.
@@ -34,4 +22,30 @@ export type IGenericData = z.infer<typeof GenericDataSchema>;
34
22
  */
35
23
  export declare const SearchableIndexSchema: z.ZodRecord<z.ZodString, z.ZodLiteral<true>>;
36
24
  export type ISearchableIndex = z.infer<typeof SearchableIndexSchema>;
25
+ /**
26
+ * This is the network data proof that is being sent with the response.
27
+ */
28
+ export declare const ISAFENetworkResponseCryptoProofSchema: z.ZodObject<{
29
+ responsePublicKey: z.ZodString;
30
+ responseSignature: z.ZodString;
31
+ responseTimestamp: z.ZodNumber;
32
+ responseHash: z.ZodString;
33
+ }, z.core.$strip>;
34
+ export type ISAFENetworkResponseCryptoProof = z.infer<typeof ISAFENetworkResponseCryptoProofSchema>;
35
+ /**
36
+ * This is the network data proof.
37
+ */
38
+ export declare const ISAFENetworkDataProofSchema: z.ZodObject<{
39
+ owningPublicKey: z.ZodString;
40
+ lastUpdatePublicKey: z.ZodString;
41
+ lastUpdateSignature: z.ZodString;
42
+ responseProof: z.ZodObject<{
43
+ responsePublicKey: z.ZodString;
44
+ responseSignature: z.ZodString;
45
+ responseTimestamp: z.ZodNumber;
46
+ responseHash: z.ZodString;
47
+ }, z.core.$strip>;
48
+ responseVersion: z.ZodNumber;
49
+ }, z.core.$strip>;
50
+ export type ISAFENetworkDataProof = z.infer<typeof ISAFENetworkDataProofSchema>;
37
51
  //# sourceMappingURL=data-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-models.d.ts","sourceRoot":"","sources":["../../../src/models/data/data-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,8CAA4B,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"data-models.d.ts","sourceRoot":"","sources":["../../../src/models/data/data-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,8CAAwC,CAAC;AAE3E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAKrE;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;iBAKhD,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;iBAMtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchableIndexSchema = exports.GenericDataSchema = void 0;
3
+ exports.ISAFENetworkDataProofSchema = exports.ISAFENetworkResponseCryptoProofSchema = exports.SearchableIndexSchema = exports.GenericDataSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  /// This contains the models for data in the degenerate package
6
6
  /**
@@ -23,4 +23,25 @@ exports.GenericDataSchema = zod_1.z.object({
23
23
  * foun: true,
24
24
  * found: true,
25
25
  */
26
- exports.SearchableIndexSchema = zod_1.z.record(zod_1.z.literal(true));
26
+ exports.SearchableIndexSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.literal(true));
27
+ //#region network data proofs
28
+ /**
29
+ * This is the network data proof that is being sent with the response.
30
+ */
31
+ exports.ISAFENetworkResponseCryptoProofSchema = zod_1.z.object({
32
+ responsePublicKey: zod_1.z.string(), // the response public key.
33
+ responseSignature: zod_1.z.string(), // the response signature.
34
+ responseTimestamp: zod_1.z.number(), // the response timestamp that this was sent. (in milliseconds).
35
+ responseHash: zod_1.z.string(), // the response hash.
36
+ });
37
+ /**
38
+ * This is the network data proof.
39
+ */
40
+ exports.ISAFENetworkDataProofSchema = zod_1.z.object({
41
+ owningPublicKey: zod_1.z.string(), // the network data to be validated.
42
+ lastUpdatePublicKey: zod_1.z.string(), // the last update public key.
43
+ lastUpdateSignature: zod_1.z.string(), // the last update signature.
44
+ responseProof: exports.ISAFENetworkResponseCryptoProofSchema, // the response proof.
45
+ responseVersion: zod_1.z.number(), // the response version.
46
+ });
47
+ //#endregion network data proofs
@@ -6,14 +6,6 @@ export declare const DynamicExecutionOutputSchema: z.ZodObject<{
6
6
  output: z.ZodAny;
7
7
  executionTime: z.ZodNumber;
8
8
  timeoutStepsConsumed: z.ZodNumber;
9
- }, "strip", z.ZodTypeAny, {
10
- executionTime: number;
11
- timeoutStepsConsumed: number;
12
- output?: any;
13
- }, {
14
- executionTime: number;
15
- timeoutStepsConsumed: number;
16
- output?: any;
17
- }>;
9
+ }, z.core.$strip>;
18
10
  export type IDynamicExecutionOutput = z.infer<typeof DynamicExecutionOutputSchema>;
19
11
  //# sourceMappingURL=dynamic-execution-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-execution-models.d.ts","sourceRoot":"","sources":["../../../src/models/dynamic-execution/dynamic-execution-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;EAIvC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
1
+ {"version":3,"file":"dynamic-execution-models.d.ts","sourceRoot":"","sources":["../../../src/models/dynamic-execution/dynamic-execution-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;iBAIvC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -7,7 +7,11 @@ export declare enum ShareEventType {
7
7
  DataChange = "DataChange",
8
8
  Scheduled = "Scheduled"
9
9
  }
10
- export declare const ShareEventTypeSchema: z.ZodEnum<["Application", "DataChange", "Scheduled"]>;
10
+ export declare const ShareEventTypeSchema: z.ZodEnum<{
11
+ Application: "Application";
12
+ DataChange: "DataChange";
13
+ Scheduled: "Scheduled";
14
+ }>;
11
15
  /**
12
16
  * All sources of event trusts
13
17
  */
@@ -16,7 +20,11 @@ export declare enum EventSourceTruthType {
16
20
  Oauth = "Oauth",
17
21
  ShareBlock = "ShareBlock"
18
22
  }
19
- export declare const EventSourceTruthTypeSchema: z.ZodEnum<["Crypto", "Oauth", "ShareBlock"]>;
23
+ export declare const EventSourceTruthTypeSchema: z.ZodEnum<{
24
+ Crypto: "Crypto";
25
+ Oauth: "Oauth";
26
+ ShareBlock: "ShareBlock";
27
+ }>;
20
28
  /**
21
29
  * All the types of proofs that can be sent from the sources of event execution truths.
22
30
  */
@@ -24,7 +32,10 @@ export declare enum EventSourceTruthProofType {
24
32
  Hash = "Hash",
25
33
  Signature = "Signature"
26
34
  }
27
- export declare const EventSourceTruthProofTypeSchema: z.ZodEnum<["Hash", "Signature"]>;
35
+ export declare const EventSourceTruthProofTypeSchema: z.ZodEnum<{
36
+ Hash: "Hash";
37
+ Signature: "Signature";
38
+ }>;
28
39
  /**
29
40
  * This is the type of processing that can be done on the share data event.
30
41
  */
@@ -32,26 +43,19 @@ export declare enum ShareDataEventProcessingType {
32
43
  Parallel = "parallel",
33
44
  Linear = "linear"
34
45
  }
35
- export declare const ShareDataEventProcessingTypeSchema: z.ZodEnum<["parallel", "linear"]>;
46
+ export declare const ShareDataEventProcessingTypeSchema: z.ZodEnum<{
47
+ parallel: "parallel";
48
+ linear: "linear";
49
+ }>;
36
50
  /**
37
51
  * This is all data that is required to find the sharedata and function to execute.
38
52
  */
39
53
  export declare const ShareDataAndFunctionEventSchema: z.ZodObject<{
40
54
  shareDataId: z.ZodString;
41
55
  functionId: z.ZodString;
42
- shareDataInputs: z.ZodArray<z.ZodString, "many">;
56
+ shareDataInputs: z.ZodArray<z.ZodString>;
43
57
  inputs: z.ZodAny;
44
- }, "strip", z.ZodTypeAny, {
45
- shareDataId: string;
46
- functionId: string;
47
- shareDataInputs: string[];
48
- inputs?: any;
49
- }, {
50
- shareDataId: string;
51
- functionId: string;
52
- shareDataInputs: string[];
53
- inputs?: any;
54
- }>;
58
+ }, z.core.$strip>;
55
59
  export type IShareDataAndFunctionEvent = z.infer<typeof ShareDataAndFunctionEventSchema>;
56
60
  /**
57
61
  * This is the interface for the share data event.
@@ -60,124 +64,91 @@ export declare const IShareDataEventSchema: z.ZodObject<{
60
64
  shareData: z.ZodArray<z.ZodObject<{
61
65
  shareDataId: z.ZodString;
62
66
  functionId: z.ZodString;
63
- shareDataInputs: z.ZodArray<z.ZodString, "many">;
67
+ shareDataInputs: z.ZodArray<z.ZodString>;
64
68
  inputs: z.ZodAny;
65
- }, "strip", z.ZodTypeAny, {
66
- shareDataId: string;
67
- functionId: string;
68
- shareDataInputs: string[];
69
- inputs?: any;
70
- }, {
71
- shareDataId: string;
72
- functionId: string;
73
- shareDataInputs: string[];
74
- inputs?: any;
75
- }>, "many">;
76
- processingType: z.ZodEnum<["parallel", "linear"]>;
77
- }, "strip", z.ZodTypeAny, {
78
- shareData: {
79
- shareDataId: string;
80
- functionId: string;
81
- shareDataInputs: string[];
82
- inputs?: any;
83
- }[];
84
- processingType: "parallel" | "linear";
85
- }, {
86
- shareData: {
87
- shareDataId: string;
88
- functionId: string;
89
- shareDataInputs: string[];
90
- inputs?: any;
91
- }[];
92
- processingType: "parallel" | "linear";
93
- }>;
69
+ }, z.core.$strip>>;
70
+ processingType: z.ZodEnum<{
71
+ parallel: "parallel";
72
+ linear: "linear";
73
+ }>;
74
+ }, z.core.$strip>;
94
75
  export type IShareDataEvent = z.infer<typeof IShareDataEventSchema>;
76
+ /**
77
+ * A scheduled variant of {@link IShareDataEvent}: a deadline-bound automated
78
+ * proposal that lives inside the ShareBlock's own `_events` structure. Because
79
+ * `_events` is folded into the canonical share-data string, the `scheduledAt`
80
+ * deadline is signed along with the rest of the block — so on restart the
81
+ * schedule is reconstructed from the block itself (via factory replay) rather
82
+ * than from any external timer store.
83
+ *
84
+ * - `eventType` — discriminator pinning this as a `Scheduled` event so a
85
+ * hydrate walk can pick scheduled events out of a heterogeneous
86
+ * `_events` array.
87
+ * - `scheduledAt` — epoch-ms deadline at which the targeted function(s) are
88
+ * proposed. Must be deterministic from the block's creation recipe so it
89
+ * reproduces byte-identically on replay (otherwise the structural-proof
90
+ * chain that now covers it would not re-verify).
91
+ *
92
+ * Inherits `shareData` (the function targets) and `processingType` from
93
+ * {@link IShareDataEventSchema}.
94
+ */
95
+ export declare const IScheduledShareDataEventSchema: z.ZodObject<{
96
+ shareData: z.ZodArray<z.ZodObject<{
97
+ shareDataId: z.ZodString;
98
+ functionId: z.ZodString;
99
+ shareDataInputs: z.ZodArray<z.ZodString>;
100
+ inputs: z.ZodAny;
101
+ }, z.core.$strip>>;
102
+ processingType: z.ZodEnum<{
103
+ parallel: "parallel";
104
+ linear: "linear";
105
+ }>;
106
+ eventType: z.ZodLiteral<ShareEventType.Scheduled>;
107
+ scheduledAt: z.ZodNumber;
108
+ }, z.core.$strip>;
109
+ export type IScheduledShareDataEvent = z.infer<typeof IScheduledShareDataEventSchema>;
110
+ /**
111
+ * Narrows an {@link IShareDataEvent} to a {@link IScheduledShareDataEvent}.
112
+ * `_events` is heterogeneous; this is the guard a hydrate-time rederivation
113
+ * walk uses to pull the scheduled events out for rescheduling.
114
+ */
115
+ export declare const isScheduledShareDataEvent: (event: IShareDataEvent) => event is IScheduledShareDataEvent;
95
116
  /**
96
117
  * This is the interface for the share data event.
97
118
  */
98
119
  export declare const ShareDataEventSchema: z.ZodObject<{
99
120
  eventId: z.ZodString;
100
121
  locked: z.ZodBoolean;
101
- eventType: z.ZodEnum<["Application", "DataChange", "Scheduled"]>;
122
+ eventType: z.ZodEnum<{
123
+ Application: "Application";
124
+ DataChange: "DataChange";
125
+ Scheduled: "Scheduled";
126
+ }>;
102
127
  eventSource: z.ZodString;
103
- eventSourceTruthType: z.ZodEnum<["Crypto", "Oauth", "ShareBlock"]>;
104
- eventSourceTruthProofType: z.ZodEnum<["Hash", "Signature"]>;
105
- eventSourceTruthProof: z.ZodString;
106
- triggerCondition: z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodBoolean>;
128
+ eventSourceTruthType: z.ZodEnum<{
129
+ Crypto: "Crypto";
130
+ Oauth: "Oauth";
131
+ ShareBlock: "ShareBlock";
132
+ }>;
133
+ eventSourceTruthProofType: z.ZodEnum<{
134
+ Hash: "Hash";
135
+ Signature: "Signature";
136
+ }>;
137
+ EventSourceTruthProof: z.ZodString;
138
+ triggerCondition: z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodBoolean>;
107
139
  shareDataEventInformation: z.ZodArray<z.ZodObject<{
108
140
  shareData: z.ZodArray<z.ZodObject<{
109
141
  shareDataId: z.ZodString;
110
142
  functionId: z.ZodString;
111
- shareDataInputs: z.ZodArray<z.ZodString, "many">;
143
+ shareDataInputs: z.ZodArray<z.ZodString>;
112
144
  inputs: z.ZodAny;
113
- }, "strip", z.ZodTypeAny, {
114
- shareDataId: string;
115
- functionId: string;
116
- shareDataInputs: string[];
117
- inputs?: any;
118
- }, {
119
- shareDataId: string;
120
- functionId: string;
121
- shareDataInputs: string[];
122
- inputs?: any;
123
- }>, "many">;
124
- processingType: z.ZodEnum<["parallel", "linear"]>;
125
- }, "strip", z.ZodTypeAny, {
126
- shareData: {
127
- shareDataId: string;
128
- functionId: string;
129
- shareDataInputs: string[];
130
- inputs?: any;
131
- }[];
132
- processingType: "parallel" | "linear";
133
- }, {
134
- shareData: {
135
- shareDataId: string;
136
- functionId: string;
137
- shareDataInputs: string[];
138
- inputs?: any;
139
- }[];
140
- processingType: "parallel" | "linear";
141
- }>, "many">;
145
+ }, z.core.$strip>>;
146
+ processingType: z.ZodEnum<{
147
+ parallel: "parallel";
148
+ linear: "linear";
149
+ }>;
150
+ }, z.core.$strip>>;
142
151
  eventContext: z.ZodRecord<z.ZodString, z.ZodAny>;
143
- }, "strip", z.ZodTypeAny, {
144
- eventId: string;
145
- locked: boolean;
146
- eventType: "Application" | "DataChange" | "Scheduled";
147
- eventSource: string;
148
- eventSourceTruthType: "Crypto" | "Oauth" | "ShareBlock";
149
- eventSourceTruthProofType: "Hash" | "Signature";
150
- eventSourceTruthProof: string;
151
- triggerCondition: (args_0: any, ...args: unknown[]) => boolean;
152
- shareDataEventInformation: {
153
- shareData: {
154
- shareDataId: string;
155
- functionId: string;
156
- shareDataInputs: string[];
157
- inputs?: any;
158
- }[];
159
- processingType: "parallel" | "linear";
160
- }[];
161
- eventContext: Record<string, any>;
162
- }, {
163
- eventId: string;
164
- locked: boolean;
165
- eventType: "Application" | "DataChange" | "Scheduled";
166
- eventSource: string;
167
- eventSourceTruthType: "Crypto" | "Oauth" | "ShareBlock";
168
- eventSourceTruthProofType: "Hash" | "Signature";
169
- eventSourceTruthProof: string;
170
- triggerCondition: (args_0: any, ...args: unknown[]) => boolean;
171
- shareDataEventInformation: {
172
- shareData: {
173
- shareDataId: string;
174
- functionId: string;
175
- shareDataInputs: string[];
176
- inputs?: any;
177
- }[];
178
- processingType: "parallel" | "linear";
179
- }[];
180
- eventContext: Record<string, any>;
181
- }>;
152
+ }, z.core.$strip>;
182
153
  export type ShareDataEvent = z.infer<typeof ShareDataEventSchema>;
183
154
  //# sourceMappingURL=share-event-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"share-event-models.d.ts","sourceRoot":"","sources":["../../../src/models/events/share-event-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAuB,MAAM,KAAK,CAAC;AAoB7C;;GAEG;AACH,oBAAY,cAAc;IACtB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,oBAAoB,uDAI/B,CAAC;AAEH;;GAEG;AACH,oBAAY,oBAAoB;IAC5B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,UAAU,eAAe;CAC5B;AAED,eAAO,MAAM,0BAA0B,8CAIrC,CAAC;AAEH;;GAEG;AACH,oBAAY,yBAAyB;IACjC,IAAI,SAAS;IACb,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,+BAA+B,kCAG1C,CAAC;AAEH;;GAEG;AACH,oBAAY,4BAA4B;IACpC,QAAQ,aAAa;IACrB,MAAM,WAAW;CACpB;AAED,eAAO,MAAM,kCAAkC,mCAG7C,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;EAK1C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"share-event-models.d.ts","sourceRoot":"","sources":["../../../src/models/events/share-event-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAC;AAoBjC;;GAEG;AACH,oBAAY,cAAc;IACtB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,oBAAoB;;;;EAI/B,CAAC;AAEH;;GAEG;AACH,oBAAY,oBAAoB;IAC5B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,UAAU,eAAe;CAC5B;AAED,eAAO,MAAM,0BAA0B;;;;EAIrC,CAAC;AAEH;;GAEG;AACH,oBAAY,yBAAyB;IACjC,IAAI,SAAS;IACb,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,+BAA+B;;;EAG1C,CAAC;AAEH;;GAEG;AACH,oBAAY,4BAA4B;IACpC,QAAQ,aAAa;IACrB,MAAM,WAAW;CACpB;AAED,eAAO,MAAM,kCAAkC;;;EAG7C,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;iBAK1C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;iBAGhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;iBAGzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAClC,OAAO,eAAe,KACvB,KAAK,IAAI,wBAEoE,CAAC;AAEjF;;GAEG;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAY/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShareDataEventSchema = exports.IShareDataEventSchema = exports.ShareDataAndFunctionEventSchema = exports.ShareDataEventProcessingTypeSchema = exports.ShareDataEventProcessingType = exports.EventSourceTruthProofTypeSchema = exports.EventSourceTruthProofType = exports.EventSourceTruthTypeSchema = exports.EventSourceTruthType = exports.ShareEventTypeSchema = exports.ShareEventType = void 0;
3
+ exports.ShareDataEventSchema = exports.isScheduledShareDataEvent = exports.IScheduledShareDataEventSchema = exports.IShareDataEventSchema = exports.ShareDataAndFunctionEventSchema = exports.ShareDataEventProcessingTypeSchema = exports.ShareDataEventProcessingType = exports.EventSourceTruthProofTypeSchema = exports.EventSourceTruthProofType = exports.EventSourceTruthTypeSchema = exports.EventSourceTruthType = exports.ShareEventTypeSchema = exports.ShareEventType = void 0;
4
4
  const zod_1 = require("zod");
5
5
  /**
6
6
  * This contains the interfaces for all event data types that can be run on the network.
@@ -85,6 +85,37 @@ exports.IShareDataEventSchema = zod_1.z.object({
85
85
  shareData: zod_1.z.array(exports.ShareDataAndFunctionEventSchema), // the data required to find an execute a function in the network. These run in order of the items in the array.
86
86
  processingType: exports.ShareDataEventProcessingTypeSchema, // specifies whether to process the shareData in parallel or linear order.
87
87
  });
88
+ /**
89
+ * A scheduled variant of {@link IShareDataEvent}: a deadline-bound automated
90
+ * proposal that lives inside the ShareBlock's own `_events` structure. Because
91
+ * `_events` is folded into the canonical share-data string, the `scheduledAt`
92
+ * deadline is signed along with the rest of the block — so on restart the
93
+ * schedule is reconstructed from the block itself (via factory replay) rather
94
+ * than from any external timer store.
95
+ *
96
+ * - `eventType` — discriminator pinning this as a `Scheduled` event so a
97
+ * hydrate walk can pick scheduled events out of a heterogeneous
98
+ * `_events` array.
99
+ * - `scheduledAt` — epoch-ms deadline at which the targeted function(s) are
100
+ * proposed. Must be deterministic from the block's creation recipe so it
101
+ * reproduces byte-identically on replay (otherwise the structural-proof
102
+ * chain that now covers it would not re-verify).
103
+ *
104
+ * Inherits `shareData` (the function targets) and `processingType` from
105
+ * {@link IShareDataEventSchema}.
106
+ */
107
+ exports.IScheduledShareDataEventSchema = exports.IShareDataEventSchema.extend({
108
+ eventType: zod_1.z.literal(ShareEventType.Scheduled),
109
+ scheduledAt: zod_1.z.number(),
110
+ });
111
+ /**
112
+ * Narrows an {@link IShareDataEvent} to a {@link IScheduledShareDataEvent}.
113
+ * `_events` is heterogeneous; this is the guard a hydrate-time rederivation
114
+ * walk uses to pull the scheduled events out for rescheduling.
115
+ */
116
+ const isScheduledShareDataEvent = (event) => event.eventType === ShareEventType.Scheduled &&
117
+ typeof event.scheduledAt === 'number';
118
+ exports.isScheduledShareDataEvent = isScheduledShareDataEvent;
88
119
  /**
89
120
  * This is the interface for the share data event.
90
121
  */
@@ -95,11 +126,11 @@ exports.ShareDataEventSchema = zod_1.z.object({
95
126
  eventSource: zod_1.z.string(),
96
127
  eventSourceTruthType: exports.EventSourceTruthTypeSchema,
97
128
  eventSourceTruthProofType: exports.EventSourceTruthProofTypeSchema,
98
- eventSourceTruthProof: zod_1.z.string(),
129
+ EventSourceTruthProof: zod_1.z.string(),
99
130
  // eventSourceTruthProof: z.union([z.string(), BufferSchema]),
100
- triggerCondition: zod_1.z.function().args(zod_1.z.any()).returns(zod_1.z.boolean()),
131
+ triggerCondition: zod_1.z.function({ input: zod_1.z.tuple([zod_1.z.any()]), output: zod_1.z.boolean() }),
101
132
  shareDataEventInformation: zod_1.z.array(exports.IShareDataEventSchema),
102
- eventContext: zod_1.z.record(zod_1.z.any()),
133
+ eventContext: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
103
134
  });
104
135
  // const applicationEvent: ShareDataEvent = {
105
136
  // eventId: 'appEvent123',