@polyester/sdk 0.24.0 → 0.25.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 (177) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +18 -12
  3. package/dist/account-signer/create-polyester-account-signer.d.ts +9 -5
  4. package/dist/account-signer/create-polyester-account-signer.d.ts.map +1 -1
  5. package/dist/account-signer/create-polyester-account-signer.js +9 -5
  6. package/dist/account-signer/create-polyester-account-signer.js.map +1 -1
  7. package/dist/account-signer/types.d.ts +10 -4
  8. package/dist/account-signer/types.d.ts.map +1 -1
  9. package/dist/account-signer/types.js.map +1 -1
  10. package/dist/core-client.d.ts +3 -0
  11. package/dist/core-client.d.ts.map +1 -1
  12. package/dist/core-client.js +23 -45
  13. package/dist/core-client.js.map +1 -1
  14. package/dist/gen/auth/v1/auth_pb.d.ts +7 -4
  15. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  16. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  17. package/dist/gen/claims/v1/claims_pb.d.ts +313 -0
  18. package/dist/gen/claims/v1/claims_pb.d.ts.map +1 -0
  19. package/dist/gen/claims/v1/claims_pb.js +135 -0
  20. package/dist/gen/claims/v1/claims_pb.js.map +1 -0
  21. package/dist/gen/index.d.ts +2 -1
  22. package/dist/gen/index.js +2 -1
  23. package/dist/gen/orders/v1/orders_pb.d.ts +50 -3
  24. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  25. package/dist/gen/orders/v1/orders_pb.js +55 -43
  26. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  27. package/dist/gen/orders/v1/orders_read_pb.d.ts +10 -0
  28. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  29. package/dist/gen/orders/v1/orders_read_pb.js +3 -1
  30. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  31. package/dist/index.d.ts +4 -1
  32. package/dist/realtime/client.js +45 -26
  33. package/dist/realtime/client.js.map +1 -1
  34. package/dist/services/accounts/accounts.schemas.d.ts +2 -2
  35. package/dist/services/accounts/accounts.schemas.d.ts.map +1 -1
  36. package/dist/services/accounts/accounts.schemas.js +3 -3
  37. package/dist/services/accounts/accounts.schemas.js.map +1 -1
  38. package/dist/services/address-book/address-book.schemas.d.ts +67 -68
  39. package/dist/services/address-book/address-book.schemas.d.ts.map +1 -1
  40. package/dist/services/address-book/address-book.schemas.js +11 -13
  41. package/dist/services/address-book/address-book.schemas.js.map +1 -1
  42. package/dist/services/api-keys/api-keys.schemas.d.ts +1 -2
  43. package/dist/services/api-keys/api-keys.schemas.d.ts.map +1 -1
  44. package/dist/services/api-keys/api-keys.schemas.js +4 -9
  45. package/dist/services/api-keys/api-keys.schemas.js.map +1 -1
  46. package/dist/services/auth/account-signer-auth.js +1 -1
  47. package/dist/services/auth/account-signer-auth.js.map +1 -1
  48. package/dist/services/auth/auth.d.ts +2 -3
  49. package/dist/services/auth/auth.d.ts.map +1 -1
  50. package/dist/services/auth/auth.js +4 -2
  51. package/dist/services/auth/auth.js.map +1 -1
  52. package/dist/services/balances/balances.schemas.d.ts +3 -3
  53. package/dist/services/balances/balances.schemas.d.ts.map +1 -1
  54. package/dist/services/balances/balances.schemas.js +7 -12
  55. package/dist/services/balances/balances.schemas.js.map +1 -1
  56. package/dist/services/candles/candles.schemas.d.ts +3 -3
  57. package/dist/services/candles/candles.schemas.d.ts.map +1 -1
  58. package/dist/services/candles/candles.schemas.js +5 -6
  59. package/dist/services/candles/candles.schemas.js.map +1 -1
  60. package/dist/services/chain-analytics/chain-analytics.schemas.d.ts +3 -3
  61. package/dist/services/chain-analytics/chain-analytics.schemas.d.ts.map +1 -1
  62. package/dist/services/chain-analytics/chain-analytics.schemas.js +2 -3
  63. package/dist/services/chain-analytics/chain-analytics.schemas.js.map +1 -1
  64. package/dist/services/claims/claims.codecs.d.ts +8 -0
  65. package/dist/services/claims/claims.codecs.d.ts.map +1 -0
  66. package/dist/services/claims/claims.codecs.js +17 -0
  67. package/dist/services/claims/claims.codecs.js.map +1 -0
  68. package/dist/services/claims/claims.d.ts +19 -0
  69. package/dist/services/claims/claims.d.ts.map +1 -0
  70. package/dist/services/claims/claims.js +30 -0
  71. package/dist/services/claims/claims.js.map +1 -0
  72. package/dist/services/claims/claims.schemas.d.ts +122 -0
  73. package/dist/services/claims/claims.schemas.d.ts.map +1 -0
  74. package/dist/services/claims/claims.schemas.js +47 -0
  75. package/dist/services/claims/claims.schemas.js.map +1 -0
  76. package/dist/services/claims/claims.types.d.ts +3 -0
  77. package/dist/services/claims/index.d.ts +5 -0
  78. package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
  79. package/dist/services/heatmap/heatmap.schemas.d.ts.map +1 -1
  80. package/dist/services/heatmap/heatmap.schemas.js +10 -10
  81. package/dist/services/heatmap/heatmap.schemas.js.map +1 -1
  82. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts.map +1 -1
  83. package/dist/services/internal-transfers/internal-transfers.schemas.js +1 -5
  84. package/dist/services/internal-transfers/internal-transfers.schemas.js.map +1 -1
  85. package/dist/services/lifecycle/lifecycle.schemas.d.ts +90 -90
  86. package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
  87. package/dist/services/lifecycle/lifecycle.schemas.js +10 -11
  88. package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
  89. package/dist/services/market-overview/market-overview.schemas.d.ts +1 -1
  90. package/dist/services/market-overview/market-overview.schemas.d.ts.map +1 -1
  91. package/dist/services/market-overview/market-overview.schemas.js +3 -3
  92. package/dist/services/market-overview/market-overview.schemas.js.map +1 -1
  93. package/dist/services/mfa/mfa.schemas.d.ts +11 -11
  94. package/dist/services/mfa/mfa.schemas.d.ts.map +1 -1
  95. package/dist/services/mfa/mfa.schemas.js +4 -5
  96. package/dist/services/mfa/mfa.schemas.js.map +1 -1
  97. package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
  98. package/dist/services/orders/order-enums.codecs.js +2 -1
  99. package/dist/services/orders/order-enums.codecs.js.map +1 -1
  100. package/dist/services/orders/order-errors.schemas.d.ts +4 -5
  101. package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
  102. package/dist/services/orders/orders-batch.schemas.d.ts +110 -32
  103. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  104. package/dist/services/orders/orders-batch.schemas.js +9 -10
  105. package/dist/services/orders/orders-batch.schemas.js.map +1 -1
  106. package/dist/services/orders/orders-input.schemas.d.ts +111 -8
  107. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  108. package/dist/services/orders/orders-input.schemas.js +20 -4
  109. package/dist/services/orders/orders-input.schemas.js.map +1 -1
  110. package/dist/services/orders/orders-modify.schemas.d.ts +2 -2
  111. package/dist/services/orders/orders-modify.schemas.d.ts.map +1 -1
  112. package/dist/services/orders/orders-modify.schemas.js +3 -3
  113. package/dist/services/orders/orders-modify.schemas.js.map +1 -1
  114. package/dist/services/orders/orders-output.schemas.d.ts +48 -32
  115. package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
  116. package/dist/services/orders/orders-output.schemas.js +16 -16
  117. package/dist/services/orders/orders-output.schemas.js.map +1 -1
  118. package/dist/services/orders/orders-risk.schemas.d.ts +0 -1
  119. package/dist/services/orders/orders-risk.schemas.d.ts.map +1 -1
  120. package/dist/services/orders/orders-risk.schemas.js +4 -4
  121. package/dist/services/orders/orders-risk.schemas.js.map +1 -1
  122. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +4 -4
  123. package/dist/services/policies/shared.codecs.js +3 -3
  124. package/dist/services/policies/shared.codecs.js.map +1 -1
  125. package/dist/services/policies/shared.d.ts +0 -1
  126. package/dist/services/policies/shared.d.ts.map +1 -1
  127. package/dist/services/policies/shared.js +2 -3
  128. package/dist/services/policies/shared.js.map +1 -1
  129. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +2 -2
  130. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts.map +1 -1
  131. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +2 -5
  132. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js.map +1 -1
  133. package/dist/services/rate-limits/rate-limits.schemas.d.ts +6 -7
  134. package/dist/services/rate-limits/rate-limits.schemas.d.ts.map +1 -1
  135. package/dist/services/rate-limits/rate-limits.schemas.js +2 -3
  136. package/dist/services/rate-limits/rate-limits.schemas.js.map +1 -1
  137. package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
  138. package/dist/services/social-verification/social-verification.schemas.js +4 -4
  139. package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
  140. package/dist/services/subaccounts/subaccounts.schemas.d.ts +23 -24
  141. package/dist/services/subaccounts/subaccounts.schemas.d.ts.map +1 -1
  142. package/dist/services/subaccounts/subaccounts.schemas.js +10 -12
  143. package/dist/services/subaccounts/subaccounts.schemas.js.map +1 -1
  144. package/dist/services/trades/trades.schemas.d.ts +1 -1
  145. package/dist/services/trades/trades.schemas.d.ts.map +1 -1
  146. package/dist/services/trades/trades.schemas.js +4 -8
  147. package/dist/services/trades/trades.schemas.js.map +1 -1
  148. package/dist/services/transfers/transfers.schemas.d.ts +3 -4
  149. package/dist/services/transfers/transfers.schemas.d.ts.map +1 -1
  150. package/dist/services/transfers/transfers.schemas.js +5 -10
  151. package/dist/services/transfers/transfers.schemas.js.map +1 -1
  152. package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
  153. package/dist/services/triggers/triggers-output.schemas.d.ts +56 -58
  154. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  155. package/dist/services/triggers/triggers-output.schemas.js +34 -36
  156. package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
  157. package/dist/services/whiteboard/whiteboard.schemas.d.ts +42 -42
  158. package/dist/services/whiteboard/whiteboard.schemas.d.ts.map +1 -1
  159. package/dist/services/whiteboard/whiteboard.schemas.js +9 -10
  160. package/dist/services/whiteboard/whiteboard.schemas.js.map +1 -1
  161. package/dist/shared/proto-enum-codec.js +11 -6
  162. package/dist/shared/proto-enum-codec.js.map +1 -1
  163. package/dist/shared/rate-limit.schemas.d.ts +4 -5
  164. package/dist/shared/rate-limit.schemas.d.ts.map +1 -1
  165. package/dist/shared/rate-limit.schemas.js +41 -46
  166. package/dist/shared/rate-limit.schemas.js.map +1 -1
  167. package/dist/shared/schemas.js +5 -1
  168. package/dist/shared/schemas.js.map +1 -1
  169. package/dist/shared/transports.d.ts +5 -1
  170. package/dist/shared/transports.d.ts.map +1 -1
  171. package/dist/shared/transports.js.map +1 -1
  172. package/dist/utils/timestamp.js +8 -1
  173. package/dist/utils/timestamp.js.map +1 -1
  174. package/dist/wired-services.d.ts.map +1 -1
  175. package/dist/wired-services.js +2 -0
  176. package/dist/wired-services.js.map +1 -1
  177. package/package.json +1 -1
@@ -94,7 +94,7 @@ declare const WhiteboardPermissionsSchema: v.ObjectSchema<{
94
94
  }, undefined>;
95
95
  type WhiteboardPermissions = v.InferOutput<typeof WhiteboardPermissionsSchema>;
96
96
  declare const WhiteboardAccessSchema: v.ObjectSchema<{
97
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
97
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
98
98
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
99
99
  readonly canView: v.BooleanSchema<undefined>;
100
100
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -103,17 +103,17 @@ declare const WhiteboardAccessSchema: v.ObjectSchema<{
103
103
  }, undefined>;
104
104
  type WhiteboardAccess = v.InferOutput<typeof WhiteboardAccessSchema>;
105
105
  declare const WhiteboardAclEntrySchema: v.ObjectSchema<{
106
- readonly subjectType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAclSubjectType, undefined>, v.TransformAction<BoardAclSubjectType, "unspecified" | "user" | "group">]>;
106
+ readonly subjectType: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "user" | "group">]>;
107
107
  readonly subjectId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
108
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
108
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
109
109
  }, undefined>;
110
110
  type WhiteboardAclEntry = v.InferOutput<typeof WhiteboardAclEntrySchema>;
111
111
  declare const WhiteboardBoardSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
112
112
  readonly boardId: v.StringSchema<undefined>;
113
113
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
114
114
  readonly title: v.StringSchema<undefined>;
115
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
116
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
115
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
116
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
117
117
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
118
118
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
119
119
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -166,8 +166,8 @@ declare const WhiteboardBoardListItemSchema: v.ObjectSchema<{
166
166
  readonly boardId: v.StringSchema<undefined>;
167
167
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
168
168
  readonly title: v.StringSchema<undefined>;
169
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
170
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
169
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
170
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
171
171
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
172
172
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
173
173
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -215,7 +215,7 @@ declare const WhiteboardBoardListItemSchema: v.ObjectSchema<{
215
215
  initialSnapshot?: import("@bufbuild/protobuf").JsonObject | undefined;
216
216
  }>]>;
217
217
  readonly access: v.OptionalSchema<v.ObjectSchema<{
218
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
218
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
219
219
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
220
220
  readonly canView: v.BooleanSchema<undefined>;
221
221
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -229,8 +229,8 @@ declare const WhiteboardBoardDetailsSchema: v.ObjectSchema<{
229
229
  readonly boardId: v.StringSchema<undefined>;
230
230
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
231
231
  readonly title: v.StringSchema<undefined>;
232
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
233
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
232
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
233
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
234
234
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
235
235
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
236
236
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -278,12 +278,12 @@ declare const WhiteboardBoardDetailsSchema: v.ObjectSchema<{
278
278
  initialSnapshot?: import("@bufbuild/protobuf").JsonObject | undefined;
279
279
  }>]>;
280
280
  readonly aclEntries: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
281
- readonly subjectType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAclSubjectType, undefined>, v.TransformAction<BoardAclSubjectType, "unspecified" | "user" | "group">]>;
281
+ readonly subjectType: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "user" | "group">]>;
282
282
  readonly subjectId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
283
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
283
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
284
284
  }, undefined>, undefined>, readonly []>;
285
285
  readonly access: v.OptionalSchema<v.ObjectSchema<{
286
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
286
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
287
287
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
288
288
  readonly canView: v.BooleanSchema<undefined>;
289
289
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -297,8 +297,8 @@ declare const CreateWhiteboardBoardResultSchema: v.ObjectSchema<{
297
297
  readonly boardId: v.StringSchema<undefined>;
298
298
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
299
299
  readonly title: v.StringSchema<undefined>;
300
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
301
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
300
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
301
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
302
302
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
303
303
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
304
304
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -346,12 +346,12 @@ declare const CreateWhiteboardBoardResultSchema: v.ObjectSchema<{
346
346
  initialSnapshot?: import("@bufbuild/protobuf").JsonObject | undefined;
347
347
  }>]>;
348
348
  readonly aclEntries: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
349
- readonly subjectType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAclSubjectType, undefined>, v.TransformAction<BoardAclSubjectType, "unspecified" | "user" | "group">]>;
349
+ readonly subjectType: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "user" | "group">]>;
350
350
  readonly subjectId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
351
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
351
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
352
352
  }, undefined>, undefined>, readonly []>;
353
353
  readonly access: v.OptionalSchema<v.ObjectSchema<{
354
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
354
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
355
355
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
356
356
  readonly canView: v.BooleanSchema<undefined>;
357
357
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -365,8 +365,8 @@ declare const GetWhiteboardBoardResultSchema: v.ObjectSchema<{
365
365
  readonly boardId: v.StringSchema<undefined>;
366
366
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
367
367
  readonly title: v.StringSchema<undefined>;
368
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
369
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
368
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
369
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
370
370
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
371
371
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
372
372
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -414,12 +414,12 @@ declare const GetWhiteboardBoardResultSchema: v.ObjectSchema<{
414
414
  initialSnapshot?: import("@bufbuild/protobuf").JsonObject | undefined;
415
415
  }>]>;
416
416
  readonly aclEntries: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
417
- readonly subjectType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAclSubjectType, undefined>, v.TransformAction<BoardAclSubjectType, "unspecified" | "user" | "group">]>;
417
+ readonly subjectType: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "user" | "group">]>;
418
418
  readonly subjectId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
419
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
419
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
420
420
  }, undefined>, undefined>, readonly []>;
421
421
  readonly access: v.OptionalSchema<v.ObjectSchema<{
422
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
422
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
423
423
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
424
424
  readonly canView: v.BooleanSchema<undefined>;
425
425
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -433,8 +433,8 @@ declare const UpdateWhiteboardBoardResultSchema: v.ObjectSchema<{
433
433
  readonly boardId: v.StringSchema<undefined>;
434
434
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
435
435
  readonly title: v.StringSchema<undefined>;
436
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
437
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
436
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
437
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
438
438
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
439
439
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
440
440
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -482,12 +482,12 @@ declare const UpdateWhiteboardBoardResultSchema: v.ObjectSchema<{
482
482
  initialSnapshot?: import("@bufbuild/protobuf").JsonObject | undefined;
483
483
  }>]>;
484
484
  readonly aclEntries: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
485
- readonly subjectType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAclSubjectType, undefined>, v.TransformAction<BoardAclSubjectType, "unspecified" | "user" | "group">]>;
485
+ readonly subjectType: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "user" | "group">]>;
486
486
  readonly subjectId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
487
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
487
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
488
488
  }, undefined>, undefined>, readonly []>;
489
489
  readonly access: v.OptionalSchema<v.ObjectSchema<{
490
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
490
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
491
491
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
492
492
  readonly canView: v.BooleanSchema<undefined>;
493
493
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -501,8 +501,8 @@ declare const UpdateWhiteboardBoardAclResultSchema: v.ObjectSchema<{
501
501
  readonly boardId: v.StringSchema<undefined>;
502
502
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
503
503
  readonly title: v.StringSchema<undefined>;
504
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
505
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
504
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
505
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
506
506
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
507
507
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
508
508
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -550,12 +550,12 @@ declare const UpdateWhiteboardBoardAclResultSchema: v.ObjectSchema<{
550
550
  initialSnapshot?: import("@bufbuild/protobuf").JsonObject | undefined;
551
551
  }>]>;
552
552
  readonly aclEntries: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
553
- readonly subjectType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAclSubjectType, undefined>, v.TransformAction<BoardAclSubjectType, "unspecified" | "user" | "group">]>;
553
+ readonly subjectType: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "user" | "group">]>;
554
554
  readonly subjectId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
555
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
555
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
556
556
  }, undefined>, undefined>, readonly []>;
557
557
  readonly access: v.OptionalSchema<v.ObjectSchema<{
558
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
558
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
559
559
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
560
560
  readonly canView: v.BooleanSchema<undefined>;
561
561
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -570,8 +570,8 @@ declare const ListWhiteboardBoardsResultSchema: v.ObjectSchema<{
570
570
  readonly boardId: v.StringSchema<undefined>;
571
571
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
572
572
  readonly title: v.StringSchema<undefined>;
573
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
574
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
573
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
574
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
575
575
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
576
576
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
577
577
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -619,7 +619,7 @@ declare const ListWhiteboardBoardsResultSchema: v.ObjectSchema<{
619
619
  initialSnapshot?: import("@bufbuild/protobuf").JsonObject | undefined;
620
620
  }>]>;
621
621
  readonly access: v.OptionalSchema<v.ObjectSchema<{
622
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
622
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
623
623
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
624
624
  readonly canView: v.BooleanSchema<undefined>;
625
625
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -635,8 +635,8 @@ declare const ArchiveWhiteboardBoardResultSchema: v.ObjectSchema<{
635
635
  readonly boardId: v.StringSchema<undefined>;
636
636
  readonly ownerAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
637
637
  readonly title: v.StringSchema<undefined>;
638
- readonly audience: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardAudience, undefined>, v.TransformAction<BoardAudience, "unspecified" | "private" | "public" | "followers">]>;
639
- readonly defaultRole: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
638
+ readonly audience: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "private" | "public" | "followers">]>;
639
+ readonly defaultRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
640
640
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
641
641
  readonly initialSnapshot: v.OptionalSchema<v.CustomSchema<import("@bufbuild/protobuf").JsonObject, undefined>, undefined>;
642
642
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
@@ -684,7 +684,7 @@ declare const ArchiveWhiteboardBoardResultSchema: v.ObjectSchema<{
684
684
  initialSnapshot?: import("@bufbuild/protobuf").JsonObject | undefined;
685
685
  }>]>, undefined>;
686
686
  readonly access: v.OptionalSchema<v.ObjectSchema<{
687
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
687
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
688
688
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
689
689
  readonly canView: v.BooleanSchema<undefined>;
690
690
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -695,13 +695,13 @@ declare const ArchiveWhiteboardBoardResultSchema: v.ObjectSchema<{
695
695
  type ArchiveWhiteboardBoardResult = v.InferOutput<typeof ArchiveWhiteboardBoardResultSchema>;
696
696
  declare const WhiteboardPresencePayloadSchema: v.ObjectSchema<{
697
697
  readonly accountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
698
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
698
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
699
699
  }, undefined>;
700
700
  type WhiteboardPresencePayload = v.InferOutput<typeof WhiteboardPresencePayloadSchema>;
701
701
  declare const WhiteboardJoinTokenResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
702
702
  readonly boardId: v.StringSchema<undefined>;
703
703
  readonly access: v.OptionalSchema<v.ObjectSchema<{
704
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
704
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
705
705
  readonly permissions: v.OptionalSchema<v.ObjectSchema<{
706
706
  readonly canView: v.BooleanSchema<undefined>;
707
707
  readonly canEdit: v.BooleanSchema<undefined>;
@@ -721,7 +721,7 @@ declare const WhiteboardJoinTokenResultSchema: v.SchemaWithPipe<readonly [v.Obje
721
721
  readonly socketPath: v.StringSchema<undefined>;
722
722
  readonly presence: v.OptionalSchema<v.ObjectSchema<{
723
723
  readonly accountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
724
- readonly role: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BoardRole, undefined>, v.TransformAction<BoardRole, "unspecified" | "owner" | "viewer" | "editor">]>;
724
+ readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "viewer" | "editor">]>;
725
725
  }, undefined>, undefined>;
726
726
  readonly accessVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
727
727
  }, undefined>, v.TransformAction<{
@@ -1 +1 @@
1
- {"version":3,"file":"whiteboard.schemas.d.ts","names":[],"sources":["../../../src/services/whiteboard/whiteboard.schemas.ts"],"mappings":";;;cAmCa,0BAAwB,EAAA;KACzB,qBAAqB,EAAE,mBAAmB;cAEzC,8BAA4B,EAAA;KAC7B,yBAAyB,EAAE,mBAAmB;cAE7C,8BAA4B,EAAA;KAC7B,yBAAyB,EAAE,mBAAmB;cAE7C,gCAA8B,EAAA;KAC/B,2BAA2B,EAAE,mBAAmB;cAE/C,0BAAwB,EAAA,0CAAA;KACzB,qBAAqB,EAAE,mBAAmB;cAiBzC,+BAA6B,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAClC,8BAA8B,EAAE,mBAAmB;cAElD,sCAAoC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACrC,iCAAiC,EAAE,mBACpC;cAGE,kCAAgC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKjC,6BAA6B,EAAE,mBAAmB;cAEjD,oCAAkC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKnC,+BAA+B,EAAE,mBAAmB;cAEnD,iCAA+B,EAAA;;;;KAKhC,4BAA4B,EAAE,mBAAmB;cAEhD,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkBhC,4BAA4B,EAAE,mBAAmB"}
@@ -1,12 +1,11 @@
1
- import { requiredEnumLabel } from "../../shared/proto-enum-codec.js";
1
+ import { enumLabel, enumLabelSchema } from "../../shared/proto-enum-codec.js";
2
2
  import { idToBigInt } from "../../utils/base58-id.js";
3
3
  import { JsonObjectSchema, OptionalTimestampMsSchema, PublicIdSchema } from "../../shared/schemas.js";
4
- import { BoardAclSubjectType, BoardAudience, BoardRole } from "../../gen/collab/v1/whiteboard_pb.js";
5
4
  import { WHITEBOARD_ACL_SUBJECT_TYPE_VALUES, WHITEBOARD_AUDIENCE_VALUES, WHITEBOARD_RESOLVED_ROLE_VALUES, WHITEBOARD_WRITABLE_ROLE_VALUES, WhiteboardAclSubjectTypeCodec, WhiteboardAudienceCodec, WhiteboardRoleCodec } from "./whiteboard.codecs.js";
6
5
  import * as v from "valibot";
7
6
  //#region src/services/whiteboard/whiteboard.schemas.ts
8
- function requiredRoleLabelFor(value) {
9
- return requiredEnumLabel(WhiteboardRoleCodec.protoToOutput, value, "WhiteboardRoleSchema", "role");
7
+ function roleLabelFor(value) {
8
+ return enumLabel(WhiteboardRoleCodec.protoToOutput, value);
10
9
  }
11
10
  const WhiteboardIdSchema = v.pipe(v.string(), v.trim(), v.minLength(1));
12
11
  const WhiteboardTitleSchema = v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(200));
@@ -63,20 +62,20 @@ const WhiteboardPermissionsSchema = v.object({
63
62
  canManage: v.boolean()
64
63
  });
65
64
  const WhiteboardAccessSchema = v.object({
66
- role: v.pipe(v.enum(BoardRole), v.transform(requiredRoleLabelFor)),
65
+ role: v.pipe(v.number(), v.transform(roleLabelFor)),
67
66
  permissions: v.optional(WhiteboardPermissionsSchema)
68
67
  });
69
68
  const WhiteboardAclEntrySchema = v.object({
70
- subjectType: v.pipe(v.enum(BoardAclSubjectType), v.transform((value) => requiredEnumLabel(WhiteboardAclSubjectTypeCodec.protoToOutput, value, "WhiteboardAclSubjectTypeSchema", "subject type"))),
69
+ subjectType: enumLabelSchema(WhiteboardAclSubjectTypeCodec.protoToOutput),
71
70
  subjectId: PublicIdSchema,
72
- role: v.pipe(v.enum(BoardRole), v.transform(requiredRoleLabelFor))
71
+ role: v.pipe(v.number(), v.transform(roleLabelFor))
73
72
  });
74
73
  const WhiteboardBoardSchema = v.pipe(v.object({
75
74
  boardId: v.string(),
76
75
  ownerAccountId: PublicIdSchema,
77
76
  title: v.string(),
78
- audience: v.pipe(v.enum(BoardAudience), v.transform((value) => requiredEnumLabel(WhiteboardAudienceCodec.protoToOutput, value, "WhiteboardAudienceSchema", "audience"))),
79
- defaultRole: v.pipe(v.enum(BoardRole), v.transform(requiredRoleLabelFor)),
77
+ audience: enumLabelSchema(WhiteboardAudienceCodec.protoToOutput),
78
+ defaultRole: v.pipe(v.number(), v.transform(roleLabelFor)),
80
79
  accessVersion: Uint64StringSchema,
81
80
  initialSnapshot: v.optional(WhiteboardSnapshotSchema),
82
81
  createdAt: OptionalTimestampMsSchema,
@@ -111,7 +110,7 @@ const ArchiveWhiteboardBoardResultSchema = v.object({
111
110
  });
112
111
  const WhiteboardPresencePayloadSchema = v.object({
113
112
  accountId: PublicIdSchema,
114
- role: v.pipe(v.enum(BoardRole), v.transform(requiredRoleLabelFor))
113
+ role: v.pipe(v.number(), v.transform(roleLabelFor))
115
114
  });
116
115
  const WhiteboardJoinTokenResultSchema = v.pipe(v.object({
117
116
  boardId: v.string(),
@@ -1 +1 @@
1
- {"version":3,"file":"whiteboard.schemas.js","names":["Proto.BoardRole","Proto.BoardAclSubjectType","Proto.BoardAudience"],"sources":["../../../src/services/whiteboard/whiteboard.schemas.ts"],"sourcesContent":["import * as Proto from \"../../gen/collab/v1/whiteboard_pb.js\";\nimport * as v from \"valibot\";\nimport {\n JsonObjectSchema,\n OptionalTimestampMsSchema,\n PublicIdSchema,\n} from \"../../shared/schemas.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport {\n WHITEBOARD_ACL_SUBJECT_TYPE_VALUES,\n WHITEBOARD_AUDIENCE_VALUES,\n WHITEBOARD_RESOLVED_ROLE_VALUES,\n WHITEBOARD_WRITABLE_ROLE_VALUES,\n WhiteboardAclSubjectTypeCodec,\n WhiteboardAudienceCodec,\n WhiteboardRoleCodec,\n} from \"./whiteboard.codecs.js\";\nimport { idToBigInt } from \"../../utils/base58-id.js\";\n\nfunction requiredRoleLabelFor(value: Proto.BoardRole) {\n return requiredEnumLabel(\n WhiteboardRoleCodec.protoToOutput,\n value,\n \"WhiteboardRoleSchema\",\n \"role\",\n );\n}\n\nconst WhiteboardIdSchema = v.pipe(v.string(), v.trim(), v.minLength(1));\nconst WhiteboardTitleSchema = v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(200));\nconst Uint64StringSchema = v.pipe(\n v.bigint(),\n v.transform((value) => value.toString()),\n);\n\nexport const WhiteboardAudienceSchema = v.picklist(WHITEBOARD_AUDIENCE_VALUES);\nexport type WhiteboardAudience = v.InferOutput<typeof WhiteboardAudienceSchema>;\n\nexport const WhiteboardWritableRoleSchema = v.picklist(WHITEBOARD_WRITABLE_ROLE_VALUES);\nexport type WhiteboardWritableRole = v.InferOutput<typeof WhiteboardWritableRoleSchema>;\n\nexport const WhiteboardResolvedRoleSchema = v.picklist(WHITEBOARD_RESOLVED_ROLE_VALUES);\nexport type WhiteboardResolvedRole = v.InferOutput<typeof WhiteboardResolvedRoleSchema>;\n\nexport const WhiteboardAclSubjectTypeSchema = v.picklist(WHITEBOARD_ACL_SUBJECT_TYPE_VALUES);\nexport type WhiteboardAclSubjectType = v.InferOutput<typeof WhiteboardAclSubjectTypeSchema>;\n\nexport const WhiteboardSnapshotSchema = JsonObjectSchema;\nexport type WhiteboardSnapshot = v.InferOutput<typeof WhiteboardSnapshotSchema>;\n\nconst WhiteboardAudienceInputSchema = v.pipe(\n WhiteboardAudienceSchema,\n v.transform((value) => WhiteboardAudienceCodec.inputToProto[value]),\n);\n\nconst WhiteboardRoleInputSchema = v.pipe(\n WhiteboardWritableRoleSchema,\n v.transform((value) => WhiteboardRoleCodec.inputToProto[value]),\n);\n\nconst WhiteboardAclSubjectTypeInputSchema = v.pipe(\n WhiteboardAclSubjectTypeSchema,\n v.transform((value) => WhiteboardAclSubjectTypeCodec.inputToProto[value]),\n);\n\nexport const WhiteboardAclEntryInputSchema = v.strictObject({\n subjectType: WhiteboardAclSubjectTypeInputSchema,\n subjectId: v.pipe(\n v.string(),\n v.trim(),\n v.minLength(1),\n v.transform((value) => idToBigInt(value, \"subjectId\")),\n ),\n role: WhiteboardRoleInputSchema,\n});\n\nexport type WhiteboardAclEntryInput = v.InferInput<typeof WhiteboardAclEntryInputSchema>;\n\nconst WhiteboardAclEntriesInputSchema = v.pipe(\n v.array(WhiteboardAclEntryInputSchema),\n v.maxLength(256),\n v.check((entries) => {\n const keys = entries.map((entry) => `${entry.subjectType}:${entry.subjectId.toString()}`);\n return new Set(keys).size === keys.length;\n }, \"aclEntries must not contain duplicate subjects\"),\n);\n\nexport const CreateWhiteboardBoardInputSchema = v.strictObject({\n title: WhiteboardTitleSchema,\n audience: WhiteboardAudienceInputSchema,\n defaultRole: WhiteboardRoleInputSchema,\n aclEntries: v.optional(WhiteboardAclEntriesInputSchema, []),\n initialSnapshot: v.optional(WhiteboardSnapshotSchema),\n});\n\nexport type CreateWhiteboardBoardInput = v.InferInput<typeof CreateWhiteboardBoardInputSchema>;\n\nexport const GetWhiteboardBoardInputSchema = v.object({\n boardId: WhiteboardIdSchema,\n});\n\nexport type GetWhiteboardBoardInput = v.InferInput<typeof GetWhiteboardBoardInputSchema>;\n\nexport const ListWhiteboardBoardsInputSchema = v.object({\n includeArchived: v.optional(v.boolean(), false),\n limit: v.optional(v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(500))),\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n});\n\nexport type ListWhiteboardBoardsInput = v.InferInput<typeof ListWhiteboardBoardsInputSchema>;\n\nexport const UpdateWhiteboardBoardInputSchema = v.pipe(\n v.strictObject({\n boardId: WhiteboardIdSchema,\n title: v.optional(WhiteboardTitleSchema),\n audience: v.optional(WhiteboardAudienceInputSchema),\n defaultRole: v.optional(WhiteboardRoleInputSchema),\n initialSnapshot: v.optional(WhiteboardSnapshotSchema),\n }),\n v.check(\n (input) =>\n input.title !== undefined ||\n input.audience !== undefined ||\n input.defaultRole !== undefined ||\n input.initialSnapshot !== undefined,\n \"At least one mutable board field is required\",\n ),\n);\n\nexport type UpdateWhiteboardBoardInput = v.InferInput<typeof UpdateWhiteboardBoardInputSchema>;\n\nexport const UpdateWhiteboardBoardAclInputSchema = v.strictObject({\n boardId: WhiteboardIdSchema,\n aclEntries: WhiteboardAclEntriesInputSchema,\n});\n\nexport type UpdateWhiteboardBoardAclInput = v.InferInput<\n typeof UpdateWhiteboardBoardAclInputSchema\n>;\n\nexport const ArchiveWhiteboardBoardInputSchema = v.strictObject({\n boardId: WhiteboardIdSchema,\n archived: v.boolean(),\n});\n\nexport type ArchiveWhiteboardBoardInput = v.InferInput<typeof ArchiveWhiteboardBoardInputSchema>;\n\nexport const MintWhiteboardJoinTokenInputSchema = v.strictObject({\n boardId: WhiteboardIdSchema,\n});\n\nexport type MintWhiteboardJoinTokenInput = v.InferInput<typeof MintWhiteboardJoinTokenInputSchema>;\n\nexport const WhiteboardPermissionsSchema = v.object({\n canView: v.boolean(),\n canEdit: v.boolean(),\n canManage: v.boolean(),\n});\n\nexport type WhiteboardPermissions = v.InferOutput<typeof WhiteboardPermissionsSchema>;\n\nexport const WhiteboardAccessSchema = v.object({\n role: v.pipe(v.enum(Proto.BoardRole), v.transform(requiredRoleLabelFor)),\n permissions: v.optional(WhiteboardPermissionsSchema),\n});\n\nexport type WhiteboardAccess = v.InferOutput<typeof WhiteboardAccessSchema>;\n\nexport const WhiteboardAclEntrySchema = v.object({\n subjectType: v.pipe(\n v.enum(Proto.BoardAclSubjectType),\n v.transform((value) =>\n requiredEnumLabel(\n WhiteboardAclSubjectTypeCodec.protoToOutput,\n value,\n \"WhiteboardAclSubjectTypeSchema\",\n \"subject type\",\n ),\n ),\n ),\n subjectId: PublicIdSchema,\n role: v.pipe(v.enum(Proto.BoardRole), v.transform(requiredRoleLabelFor)),\n});\n\nexport type WhiteboardAclEntry = v.InferOutput<typeof WhiteboardAclEntrySchema>;\n\nexport const WhiteboardBoardSchema = v.pipe(\n v.object({\n boardId: v.string(),\n ownerAccountId: PublicIdSchema,\n title: v.string(),\n audience: v.pipe(\n v.enum(Proto.BoardAudience),\n v.transform((value) =>\n requiredEnumLabel(\n WhiteboardAudienceCodec.protoToOutput,\n value,\n \"WhiteboardAudienceSchema\",\n \"audience\",\n ),\n ),\n ),\n defaultRole: v.pipe(v.enum(Proto.BoardRole), v.transform(requiredRoleLabelFor)),\n accessVersion: Uint64StringSchema,\n initialSnapshot: v.optional(WhiteboardSnapshotSchema),\n createdAt: OptionalTimestampMsSchema,\n updatedAt: OptionalTimestampMsSchema,\n archivedAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ createdAt, updatedAt, archivedAt, ...board }) => ({\n ...board,\n createdAtMs: createdAt,\n updatedAtMs: updatedAt,\n archivedAtMs: archivedAt,\n })),\n);\n\nexport type WhiteboardBoard = v.InferOutput<typeof WhiteboardBoardSchema>;\n\nexport const WhiteboardBoardListItemSchema = v.object({\n board: WhiteboardBoardSchema,\n access: v.optional(WhiteboardAccessSchema),\n});\n\nexport type WhiteboardBoardListItem = v.InferOutput<typeof WhiteboardBoardListItemSchema>;\n\nexport const WhiteboardBoardDetailsSchema = v.object({\n board: WhiteboardBoardSchema,\n aclEntries: v.optional(v.array(WhiteboardAclEntrySchema), []),\n access: v.optional(WhiteboardAccessSchema),\n});\n\nexport type WhiteboardBoardDetails = v.InferOutput<typeof WhiteboardBoardDetailsSchema>;\n\nexport const CreateWhiteboardBoardResultSchema = WhiteboardBoardDetailsSchema;\nexport type CreateWhiteboardBoardResult = v.InferOutput<typeof CreateWhiteboardBoardResultSchema>;\n\nexport const GetWhiteboardBoardResultSchema = WhiteboardBoardDetailsSchema;\nexport type GetWhiteboardBoardResult = v.InferOutput<typeof GetWhiteboardBoardResultSchema>;\n\nexport const UpdateWhiteboardBoardResultSchema = WhiteboardBoardDetailsSchema;\nexport type UpdateWhiteboardBoardResult = v.InferOutput<typeof UpdateWhiteboardBoardResultSchema>;\n\nexport const UpdateWhiteboardBoardAclResultSchema = WhiteboardBoardDetailsSchema;\nexport type UpdateWhiteboardBoardAclResult = v.InferOutput<\n typeof UpdateWhiteboardBoardAclResultSchema\n>;\n\nexport const ListWhiteboardBoardsResultSchema = v.object({\n boards: v.optional(v.array(WhiteboardBoardListItemSchema), []),\n nextPageToken: v.optional(v.string(), \"\"),\n});\n\nexport type ListWhiteboardBoardsResult = v.InferOutput<typeof ListWhiteboardBoardsResultSchema>;\n\nexport const ArchiveWhiteboardBoardResultSchema = v.object({\n board: v.optional(WhiteboardBoardSchema),\n access: v.optional(WhiteboardAccessSchema),\n});\n\nexport type ArchiveWhiteboardBoardResult = v.InferOutput<typeof ArchiveWhiteboardBoardResultSchema>;\n\nexport const WhiteboardPresencePayloadSchema = v.object({\n accountId: PublicIdSchema,\n role: v.pipe(v.enum(Proto.BoardRole), v.transform(requiredRoleLabelFor)),\n});\n\nexport type WhiteboardPresencePayload = v.InferOutput<typeof WhiteboardPresencePayloadSchema>;\n\nexport const WhiteboardJoinTokenResultSchema = v.pipe(\n v.object({\n boardId: v.string(),\n access: v.optional(WhiteboardAccessSchema),\n expiresAt: OptionalTimestampMsSchema,\n token: v.string(),\n roomId: v.string(),\n connectionId: v.string(),\n socketPath: v.string(),\n presence: v.optional(WhiteboardPresencePayloadSchema),\n accessVersion: Uint64StringSchema,\n }),\n v.transform(({ expiresAt, ...rest }) => ({\n ...rest,\n expiresAtMs: expiresAt,\n })),\n);\n\nexport type WhiteboardJoinTokenResult = v.InferOutput<typeof WhiteboardJoinTokenResultSchema>;\n"],"mappings":";;;;;;;AAmBA,SAAS,qBAAqB,OAAwB;CAClD,OAAO,kBACH,oBAAoB,eACpB,OACA,wBACA,MACJ;AACJ;AAEA,MAAM,qBAAqB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;AACtE,MAAM,wBAAwB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC;AAC3F,MAAM,qBAAqB,EAAE,KACzB,EAAE,OAAO,GACT,EAAE,WAAW,UAAU,MAAM,SAAS,CAAC,CAC3C;AAEA,MAAa,2BAA2B,EAAE,SAAS,0BAA0B;AAG7E,MAAa,+BAA+B,EAAE,SAAS,+BAA+B;AAG1C,EAAE,SAAS,+BAA+B;AAGtF,MAAa,iCAAiC,EAAE,SAAS,kCAAkC;AAG3F,MAAa,2BAA2B;AAGxC,MAAM,gCAAgC,EAAE,KACpC,0BAC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OAAO;CACrB,UAAU,EAAE,SAAS,+BAA+B;CACpD,eAAe;AACnB,CAAC,GACD,EAAE,WAAW,EAAE,WAAW,GAAG,YAAY;CACrC,GAAG;CACH,aAAa;AACjB,EAAE,CACN"}
1
+ {"version":3,"file":"whiteboard.schemas.js","names":[],"sources":["../../../src/services/whiteboard/whiteboard.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport {\n JsonObjectSchema,\n OptionalTimestampMsSchema,\n PublicIdSchema,\n} from \"../../shared/schemas.js\";\nimport { enumLabel, enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n WHITEBOARD_ACL_SUBJECT_TYPE_VALUES,\n WHITEBOARD_AUDIENCE_VALUES,\n WHITEBOARD_RESOLVED_ROLE_VALUES,\n WHITEBOARD_WRITABLE_ROLE_VALUES,\n WhiteboardAclSubjectTypeCodec,\n WhiteboardAudienceCodec,\n WhiteboardRoleCodec,\n} from \"./whiteboard.codecs.js\";\nimport { idToBigInt } from \"../../utils/base58-id.js\";\n\nfunction roleLabelFor(value: number) {\n return enumLabel(WhiteboardRoleCodec.protoToOutput, value);\n}\n\nconst WhiteboardIdSchema = v.pipe(v.string(), v.trim(), v.minLength(1));\nconst WhiteboardTitleSchema = v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(200));\nconst Uint64StringSchema = v.pipe(\n v.bigint(),\n v.transform((value) => value.toString()),\n);\n\nexport const WhiteboardAudienceSchema = v.picklist(WHITEBOARD_AUDIENCE_VALUES);\nexport type WhiteboardAudience = v.InferOutput<typeof WhiteboardAudienceSchema>;\n\nexport const WhiteboardWritableRoleSchema = v.picklist(WHITEBOARD_WRITABLE_ROLE_VALUES);\nexport type WhiteboardWritableRole = v.InferOutput<typeof WhiteboardWritableRoleSchema>;\n\nexport const WhiteboardResolvedRoleSchema = v.picklist(WHITEBOARD_RESOLVED_ROLE_VALUES);\nexport type WhiteboardResolvedRole = v.InferOutput<typeof WhiteboardResolvedRoleSchema>;\n\nexport const WhiteboardAclSubjectTypeSchema = v.picklist(WHITEBOARD_ACL_SUBJECT_TYPE_VALUES);\nexport type WhiteboardAclSubjectType = v.InferOutput<typeof WhiteboardAclSubjectTypeSchema>;\n\nexport const WhiteboardSnapshotSchema = JsonObjectSchema;\nexport type WhiteboardSnapshot = v.InferOutput<typeof WhiteboardSnapshotSchema>;\n\nconst WhiteboardAudienceInputSchema = v.pipe(\n WhiteboardAudienceSchema,\n v.transform((value) => WhiteboardAudienceCodec.inputToProto[value]),\n);\n\nconst WhiteboardRoleInputSchema = v.pipe(\n WhiteboardWritableRoleSchema,\n v.transform((value) => WhiteboardRoleCodec.inputToProto[value]),\n);\n\nconst WhiteboardAclSubjectTypeInputSchema = v.pipe(\n WhiteboardAclSubjectTypeSchema,\n v.transform((value) => WhiteboardAclSubjectTypeCodec.inputToProto[value]),\n);\n\nexport const WhiteboardAclEntryInputSchema = v.strictObject({\n subjectType: WhiteboardAclSubjectTypeInputSchema,\n subjectId: v.pipe(\n v.string(),\n v.trim(),\n v.minLength(1),\n v.transform((value) => idToBigInt(value, \"subjectId\")),\n ),\n role: WhiteboardRoleInputSchema,\n});\n\nexport type WhiteboardAclEntryInput = v.InferInput<typeof WhiteboardAclEntryInputSchema>;\n\nconst WhiteboardAclEntriesInputSchema = v.pipe(\n v.array(WhiteboardAclEntryInputSchema),\n v.maxLength(256),\n v.check((entries) => {\n const keys = entries.map((entry) => `${entry.subjectType}:${entry.subjectId.toString()}`);\n return new Set(keys).size === keys.length;\n }, \"aclEntries must not contain duplicate subjects\"),\n);\n\nexport const CreateWhiteboardBoardInputSchema = v.strictObject({\n title: WhiteboardTitleSchema,\n audience: WhiteboardAudienceInputSchema,\n defaultRole: WhiteboardRoleInputSchema,\n aclEntries: v.optional(WhiteboardAclEntriesInputSchema, []),\n initialSnapshot: v.optional(WhiteboardSnapshotSchema),\n});\n\nexport type CreateWhiteboardBoardInput = v.InferInput<typeof CreateWhiteboardBoardInputSchema>;\n\nexport const GetWhiteboardBoardInputSchema = v.object({\n boardId: WhiteboardIdSchema,\n});\n\nexport type GetWhiteboardBoardInput = v.InferInput<typeof GetWhiteboardBoardInputSchema>;\n\nexport const ListWhiteboardBoardsInputSchema = v.object({\n includeArchived: v.optional(v.boolean(), false),\n limit: v.optional(v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(500))),\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n});\n\nexport type ListWhiteboardBoardsInput = v.InferInput<typeof ListWhiteboardBoardsInputSchema>;\n\nexport const UpdateWhiteboardBoardInputSchema = v.pipe(\n v.strictObject({\n boardId: WhiteboardIdSchema,\n title: v.optional(WhiteboardTitleSchema),\n audience: v.optional(WhiteboardAudienceInputSchema),\n defaultRole: v.optional(WhiteboardRoleInputSchema),\n initialSnapshot: v.optional(WhiteboardSnapshotSchema),\n }),\n v.check(\n (input) =>\n input.title !== undefined ||\n input.audience !== undefined ||\n input.defaultRole !== undefined ||\n input.initialSnapshot !== undefined,\n \"At least one mutable board field is required\",\n ),\n);\n\nexport type UpdateWhiteboardBoardInput = v.InferInput<typeof UpdateWhiteboardBoardInputSchema>;\n\nexport const UpdateWhiteboardBoardAclInputSchema = v.strictObject({\n boardId: WhiteboardIdSchema,\n aclEntries: WhiteboardAclEntriesInputSchema,\n});\n\nexport type UpdateWhiteboardBoardAclInput = v.InferInput<\n typeof UpdateWhiteboardBoardAclInputSchema\n>;\n\nexport const ArchiveWhiteboardBoardInputSchema = v.strictObject({\n boardId: WhiteboardIdSchema,\n archived: v.boolean(),\n});\n\nexport type ArchiveWhiteboardBoardInput = v.InferInput<typeof ArchiveWhiteboardBoardInputSchema>;\n\nexport const MintWhiteboardJoinTokenInputSchema = v.strictObject({\n boardId: WhiteboardIdSchema,\n});\n\nexport type MintWhiteboardJoinTokenInput = v.InferInput<typeof MintWhiteboardJoinTokenInputSchema>;\n\nexport const WhiteboardPermissionsSchema = v.object({\n canView: v.boolean(),\n canEdit: v.boolean(),\n canManage: v.boolean(),\n});\n\nexport type WhiteboardPermissions = v.InferOutput<typeof WhiteboardPermissionsSchema>;\n\nexport const WhiteboardAccessSchema = v.object({\n role: v.pipe(v.number(), v.transform(roleLabelFor)),\n permissions: v.optional(WhiteboardPermissionsSchema),\n});\n\nexport type WhiteboardAccess = v.InferOutput<typeof WhiteboardAccessSchema>;\n\nexport const WhiteboardAclEntrySchema = v.object({\n subjectType: enumLabelSchema(WhiteboardAclSubjectTypeCodec.protoToOutput),\n subjectId: PublicIdSchema,\n role: v.pipe(v.number(), v.transform(roleLabelFor)),\n});\n\nexport type WhiteboardAclEntry = v.InferOutput<typeof WhiteboardAclEntrySchema>;\n\nexport const WhiteboardBoardSchema = v.pipe(\n v.object({\n boardId: v.string(),\n ownerAccountId: PublicIdSchema,\n title: v.string(),\n audience: enumLabelSchema(WhiteboardAudienceCodec.protoToOutput),\n defaultRole: v.pipe(v.number(), v.transform(roleLabelFor)),\n accessVersion: Uint64StringSchema,\n initialSnapshot: v.optional(WhiteboardSnapshotSchema),\n createdAt: OptionalTimestampMsSchema,\n updatedAt: OptionalTimestampMsSchema,\n archivedAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ createdAt, updatedAt, archivedAt, ...board }) => ({\n ...board,\n createdAtMs: createdAt,\n updatedAtMs: updatedAt,\n archivedAtMs: archivedAt,\n })),\n);\n\nexport type WhiteboardBoard = v.InferOutput<typeof WhiteboardBoardSchema>;\n\nexport const WhiteboardBoardListItemSchema = v.object({\n board: WhiteboardBoardSchema,\n access: v.optional(WhiteboardAccessSchema),\n});\n\nexport type WhiteboardBoardListItem = v.InferOutput<typeof WhiteboardBoardListItemSchema>;\n\nexport const WhiteboardBoardDetailsSchema = v.object({\n board: WhiteboardBoardSchema,\n aclEntries: v.optional(v.array(WhiteboardAclEntrySchema), []),\n access: v.optional(WhiteboardAccessSchema),\n});\n\nexport type WhiteboardBoardDetails = v.InferOutput<typeof WhiteboardBoardDetailsSchema>;\n\nexport const CreateWhiteboardBoardResultSchema = WhiteboardBoardDetailsSchema;\nexport type CreateWhiteboardBoardResult = v.InferOutput<typeof CreateWhiteboardBoardResultSchema>;\n\nexport const GetWhiteboardBoardResultSchema = WhiteboardBoardDetailsSchema;\nexport type GetWhiteboardBoardResult = v.InferOutput<typeof GetWhiteboardBoardResultSchema>;\n\nexport const UpdateWhiteboardBoardResultSchema = WhiteboardBoardDetailsSchema;\nexport type UpdateWhiteboardBoardResult = v.InferOutput<typeof UpdateWhiteboardBoardResultSchema>;\n\nexport const UpdateWhiteboardBoardAclResultSchema = WhiteboardBoardDetailsSchema;\nexport type UpdateWhiteboardBoardAclResult = v.InferOutput<\n typeof UpdateWhiteboardBoardAclResultSchema\n>;\n\nexport const ListWhiteboardBoardsResultSchema = v.object({\n boards: v.optional(v.array(WhiteboardBoardListItemSchema), []),\n nextPageToken: v.optional(v.string(), \"\"),\n});\n\nexport type ListWhiteboardBoardsResult = v.InferOutput<typeof ListWhiteboardBoardsResultSchema>;\n\nexport const ArchiveWhiteboardBoardResultSchema = v.object({\n board: v.optional(WhiteboardBoardSchema),\n access: v.optional(WhiteboardAccessSchema),\n});\n\nexport type ArchiveWhiteboardBoardResult = v.InferOutput<typeof ArchiveWhiteboardBoardResultSchema>;\n\nexport const WhiteboardPresencePayloadSchema = v.object({\n accountId: PublicIdSchema,\n role: v.pipe(v.number(), v.transform(roleLabelFor)),\n});\n\nexport type WhiteboardPresencePayload = v.InferOutput<typeof WhiteboardPresencePayloadSchema>;\n\nexport const WhiteboardJoinTokenResultSchema = v.pipe(\n v.object({\n boardId: v.string(),\n access: v.optional(WhiteboardAccessSchema),\n expiresAt: OptionalTimestampMsSchema,\n token: v.string(),\n roomId: v.string(),\n connectionId: v.string(),\n socketPath: v.string(),\n presence: v.optional(WhiteboardPresencePayloadSchema),\n accessVersion: Uint64StringSchema,\n }),\n v.transform(({ expiresAt, ...rest }) => ({\n ...rest,\n expiresAtMs: expiresAt,\n })),\n);\n\nexport type WhiteboardJoinTokenResult = v.InferOutput<typeof WhiteboardJoin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AE,OAAO;CACvD,OAAO,EAAE,SAAS,qBAAqB;CACvC,QAAQ,EAAE,SAAS,sBAAsB;AAC7C,CAAC;AAID,MAAa,kCAAkC,EAAE,OAAO;CACpD,WAAW;CACX,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,UAAU,YAAY,CAAC;AACtD,CAAC;AAID,MAAa,kCAAkC,EAAE,KAC7C,EAAE,OAAO;CACL,SAAS,EAAE,OAAO;CAClB,QAAQ,EAAE,SAAS,sBAAsB;CACzC,WAAW;CACX,OAAO,EAAE,OAAO;CAChB,QAAQ,EAAE,OAAO;CACjB,cAAc,EAAE,OAAO;CACvB,YAAY,EAAE,OAAO;CACrB,UAAU,EAAE,SAAS,+BAA+B;CACpD,eAAe;AACnB,CAAC,GACD,EAAE,WAAW,EAAE,WAAW,GAAG,YAAY;CACrC,GAAG;CACH,aAAa;AACjB,EAAE,CACN"}
@@ -1,13 +1,18 @@
1
+ import * as v from "valibot";
1
2
  //#region src/shared/proto-enum-codec.ts
2
3
  /**
3
- * Creates a schema transform that rejects unspecified proto enum labels.
4
+ * Maps a proto enum value to its public label. Values the SDK does not know
5
+ * (e.g. added server-side after this build) fall back to "unspecified" so a
6
+ * newer enum member degrades one field instead of failing the whole decode.
4
7
  */
5
- function requiredEnumLabel(mapping, value, schemaName, enumName) {
6
- const output = mapping[value];
7
- if (output === void 0) throw new Error(`[${schemaName}]: invalid ${enumName} ${value}`);
8
- return output;
8
+ function enumLabel(mapping, value) {
9
+ return mapping[value] ?? "unspecified";
10
+ }
11
+ /** Schema form of {@link enumLabel}: accepts any number and yields the label. */
12
+ function enumLabelSchema(mapping) {
13
+ return v.pipe(v.number(), v.transform((value) => enumLabel(mapping, value)));
9
14
  }
10
15
  //#endregion
11
- export { requiredEnumLabel };
16
+ export { enumLabel, enumLabelSchema };
12
17
 
13
18
  //# sourceMappingURL=proto-enum-codec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proto-enum-codec.js","names":[],"sources":["../../src/shared/proto-enum-codec.ts"],"sourcesContent":["/**\n * Creates a schema transform that rejects unspecified proto enum labels.\n */\nexport function requiredEnumLabel<TOutput>(\n mapping: Readonly<Partial<Record<number, TOutput>>>,\n value: number,\n schemaName: string,\n enumName: string,\n): TOutput {\n const output = mapping[value];\n if (output === undefined) throw new Error(`[${schemaName}]: invalid ${enumName} ${value}`);\n return output;\n}\n"],"mappings":";;;;AAGA,SAAgB,kBACZ,SACA,OACA,YACA,UACO;CACP,MAAM,SAAS,QAAQ;CACvB,IAAI,WAAW,KAAA,GAAW,MAAM,IAAI,MAAM,IAAI,WAAW,aAAa,SAAS,GAAG,OAAO;CACzF,OAAO;AACX"}
1
+ {"version":3,"file":"proto-enum-codec.js","names":[],"sources":["../../src/shared/proto-enum-codec.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport type { UnspecifiedEnumValue } from \"../utils/types.js\";\n\n/**\n * Maps a proto enum value to its public label. Values the SDK does not know\n * (e.g. added server-side after this build) fall back to \"unspecified\" so a\n * newer enum member degrades one field instead of failing the whole decode.\n */\nexport function enumLabel<TOutput>(\n mapping: Readonly<Partial<Record<number, TOutput>>>,\n value: number,\n): TOutput | UnspecifiedEnumValue {\n return mapping[value] ?? \"unspecified\";\n}\n\n/** Schema form of {@link enumLabel}: accepts any number and yields the label. */\nexport function enumLabelSchema<TOutput>(mapping: Readonly<Partial<Record<number, TOutput>>>) {\n return v.pipe(\n v.number(),\n v.transform((value) => enumLabel(mapping, value)),\n );\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,UACZ,SACA,OAC8B;CAC9B,OAAO,QAAQ,UAAU;AAC7B;;AAGA,SAAgB,gBAAyB,SAAqD;CAC1F,OAAO,EAAE,KACL,EAAE,OAAO,GACT,EAAE,WAAW,UAAU,UAAU,SAAS,KAAK,CAAC,CACpD;AACJ"}
@@ -1,4 +1,3 @@
1
- import { FailureReason, LimiterScope, PolicyClass, RefillModel } from "../gen/polyester/ratelimit/v1/types_pb.js";
2
1
  import * as v from "valibot";
3
2
  //#region src/shared/rate-limit.schemas.d.ts
4
3
  declare const RATE_LIMIT_FAILURE_REASON_VALUES: readonly ["unspecified", "quota_exceeded", "authority_unavailable"];
@@ -15,15 +14,15 @@ type RateLimitScope = (typeof RATE_LIMIT_SCOPE_VALUES)[number];
15
14
  type RateLimitRefillModel = (typeof RATE_LIMIT_REFILL_MODEL_VALUES)[number];
16
15
  /** Parses protobuf quota state into the stable SDK rate-limit detail shape. */
17
16
  declare const RateLimitDetailSchema: v.ObjectSchema<{
18
- readonly reason: v.SchemaWithPipe<readonly [v.EnumSchema<typeof FailureReason, undefined>, v.TransformAction<FailureReason, "unspecified" | "quota_exceeded" | "authority_unavailable">]>;
17
+ readonly reason: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "quota_exceeded" | "authority_unavailable">]>;
19
18
  readonly limit: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
20
19
  readonly remaining: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
21
20
  readonly retryAfterMs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
22
21
  readonly policyVersion: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
23
22
  readonly operationId: v.StringSchema<undefined>;
24
- readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof PolicyClass, undefined>, v.TransformAction<PolicyClass, "unspecified" | "auth_public" | "trading_place" | "trading_cancel" | "trading_read" | "account_admin" | "public_read" | "account_security" | "deposit_create" | "internal_transfer" | "withdraw_submit" | "withdraw_validate" | "guard_sign" | "social_provider">]>;
25
- readonly scope: v.SchemaWithPipe<readonly [v.EnumSchema<typeof LimiterScope, undefined>, v.TransformAction<LimiterScope, "symbol" | "unspecified" | "client_ip" | "api_key" | "account" | "subaccount" | "connection" | "service" | "region" | "auth_subject">]>;
26
- readonly refillModel: v.SchemaWithPipe<readonly [v.EnumSchema<typeof RefillModel, undefined>, v.TransformAction<RefillModel, "unspecified" | "continuous" | "fixed_window" | "rolling_window">]>;
23
+ readonly policyClass: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "auth_public" | "trading_place" | "trading_cancel" | "trading_read" | "account_admin" | "public_read" | "account_security" | "deposit_create" | "internal_transfer" | "withdraw_submit" | "withdraw_validate" | "guard_sign" | "social_provider">]>;
24
+ readonly scope: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "symbol" | "unspecified" | "client_ip" | "api_key" | "account" | "subaccount" | "connection" | "service" | "region" | "auth_subject">]>;
25
+ readonly refillModel: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "continuous" | "fixed_window" | "rolling_window">]>;
27
26
  }, undefined>;
28
27
  /** Structured quota state exposed by order rejections and {@link RateLimitError}. */
29
28
  type RateLimitDetail = v.InferOutput<typeof RateLimitDetailSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"rate-limit.schemas.d.ts","names":[],"sources":["../../src/shared/rate-limit.schemas.ts"],"mappings":";;;cAMM;cAMA;cAiBA;cAaA;;KAQM,iCAAiC;;KAEjC,+BAA+B;;KAE/B,yBAAyB;;KAEzB,+BAA+B;;cAsD9B,uBAAqB,EAAA;;;;;;;;;;;;KAqDtB,kBAAkB,EAAE,mBAAmB"}
1
+ {"version":3,"file":"rate-limit.schemas.d.ts","names":[],"sources":["../../src/shared/rate-limit.schemas.ts"],"mappings":";;cAMM;cAMA;cAiBA;cAaA;;KAQM,iCAAiC;;KAEjC,+BAA+B;;KAE/B,yBAAyB;;KAEzB,+BAA+B;;cAsD9B,uBAAqB,EAAA;;;;;;;;;;;;KAatB,kBAAkB,EAAE,mBAAmB"}
@@ -1,58 +1,53 @@
1
- import { FailureReason, LimiterScope, PolicyClass, RefillModel } from "../gen/polyester/ratelimit/v1/types_pb.js";
2
- import { requiredEnumLabel } from "./proto-enum-codec.js";
1
+ import "../gen/polyester/ratelimit/v1/types_pb.js";
2
+ import { enumLabelSchema } from "./proto-enum-codec.js";
3
3
  import { OptionalBigIntStringSchema } from "./schemas.js";
4
4
  import * as v from "valibot";
5
- //#region src/shared/rate-limit.schemas.ts
6
- const RateLimitFailureReasonCodec = { protoToOutput: {
7
- [0]: "unspecified",
8
- [1]: "quota_exceeded",
9
- [2]: "authority_unavailable"
10
- } };
11
- const RateLimitPolicyClassCodec = { protoToOutput: {
12
- [0]: "unspecified",
13
- [1]: "auth_public",
14
- [2]: "trading_place",
15
- [3]: "trading_cancel",
16
- [4]: "trading_read",
17
- [5]: "account_admin",
18
- [6]: "public_read",
19
- [7]: "account_security",
20
- [8]: "deposit_create",
21
- [9]: "internal_transfer",
22
- [10]: "withdraw_submit",
23
- [11]: "withdraw_validate",
24
- [12]: "guard_sign",
25
- [13]: "social_provider"
26
- } };
27
- const RateLimitScopeCodec = { protoToOutput: {
28
- [0]: "unspecified",
29
- [1]: "client_ip",
30
- [2]: "api_key",
31
- [3]: "account",
32
- [4]: "subaccount",
33
- [5]: "connection",
34
- [6]: "service",
35
- [7]: "region",
36
- [8]: "symbol",
37
- [9]: "auth_subject"
38
- } };
39
- const RateLimitRefillModelCodec = { protoToOutput: {
40
- [0]: "unspecified",
41
- [1]: "continuous",
42
- [2]: "fixed_window",
43
- [3]: "rolling_window"
44
- } };
45
5
  /** Parses protobuf quota state into the stable SDK rate-limit detail shape. */
46
6
  const RateLimitDetailSchema = v.object({
47
- reason: v.pipe(v.enum(FailureReason), v.transform((reason) => requiredEnumLabel(RateLimitFailureReasonCodec.protoToOutput, reason, "RateLimitDetailSchema", "reason"))),
7
+ reason: enumLabelSchema({ protoToOutput: {
8
+ [0]: "unspecified",
9
+ [1]: "quota_exceeded",
10
+ [2]: "authority_unavailable"
11
+ } }.protoToOutput),
48
12
  limit: OptionalBigIntStringSchema,
49
13
  remaining: OptionalBigIntStringSchema,
50
14
  retryAfterMs: OptionalBigIntStringSchema,
51
15
  policyVersion: OptionalBigIntStringSchema,
52
16
  operationId: v.string(),
53
- policyClass: v.pipe(v.enum(PolicyClass), v.transform((policyClass) => requiredEnumLabel(RateLimitPolicyClassCodec.protoToOutput, policyClass, "RateLimitDetailSchema", "policyClass"))),
54
- scope: v.pipe(v.enum(LimiterScope), v.transform((scope) => requiredEnumLabel(RateLimitScopeCodec.protoToOutput, scope, "RateLimitDetailSchema", "scope"))),
55
- refillModel: v.pipe(v.enum(RefillModel), v.transform((refillModel) => requiredEnumLabel(RateLimitRefillModelCodec.protoToOutput, refillModel, "RateLimitDetailSchema", "refillModel")))
17
+ policyClass: enumLabelSchema({ protoToOutput: {
18
+ [0]: "unspecified",
19
+ [1]: "auth_public",
20
+ [2]: "trading_place",
21
+ [3]: "trading_cancel",
22
+ [4]: "trading_read",
23
+ [5]: "account_admin",
24
+ [6]: "public_read",
25
+ [7]: "account_security",
26
+ [8]: "deposit_create",
27
+ [9]: "internal_transfer",
28
+ [10]: "withdraw_submit",
29
+ [11]: "withdraw_validate",
30
+ [12]: "guard_sign",
31
+ [13]: "social_provider"
32
+ } }.protoToOutput),
33
+ scope: enumLabelSchema({ protoToOutput: {
34
+ [0]: "unspecified",
35
+ [1]: "client_ip",
36
+ [2]: "api_key",
37
+ [3]: "account",
38
+ [4]: "subaccount",
39
+ [5]: "connection",
40
+ [6]: "service",
41
+ [7]: "region",
42
+ [8]: "symbol",
43
+ [9]: "auth_subject"
44
+ } }.protoToOutput),
45
+ refillModel: enumLabelSchema({ protoToOutput: {
46
+ [0]: "unspecified",
47
+ [1]: "continuous",
48
+ [2]: "fixed_window",
49
+ [3]: "rolling_window"
50
+ } }.protoToOutput)
56
51
  });
57
52
  //#endregion
58
53
  export { RateLimitDetailSchema };