@s2-dev/streamstore 0.2.6 → 0.2.7

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.
@@ -13,7 +13,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
13
13
  * @remarks
14
14
  * If set to 0, the stream will have infinite retention.
15
15
  */
16
- export type One = {
16
+ export type Age = {
17
17
  /**
18
18
  * Age in seconds for automatic trimming of records older than this threshold.
19
19
  *
@@ -29,21 +29,21 @@ export type One = {
29
29
  * @remarks
30
30
  * If unspecified, the default is to retain records for 7 days.
31
31
  */
32
- export type RetentionPolicy = One;
32
+ export type RetentionPolicy = Age;
33
33
 
34
34
  /** @internal */
35
- export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
35
+ export const Age$inboundSchema: z.ZodType<Age, z.ZodTypeDef, unknown> = z
36
36
  .object({
37
37
  age: z.number().int(),
38
38
  });
39
39
 
40
40
  /** @internal */
41
- export type One$Outbound = {
41
+ export type Age$Outbound = {
42
42
  age: number;
43
43
  };
44
44
 
45
45
  /** @internal */
46
- export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
46
+ export const Age$outboundSchema: z.ZodType<Age$Outbound, z.ZodTypeDef, Age> = z
47
47
  .object({
48
48
  age: z.number().int(),
49
49
  });
@@ -52,26 +52,26 @@ export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
52
52
  * @internal
53
53
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
54
54
  */
55
- export namespace One$ {
56
- /** @deprecated use `One$inboundSchema` instead. */
57
- export const inboundSchema = One$inboundSchema;
58
- /** @deprecated use `One$outboundSchema` instead. */
59
- export const outboundSchema = One$outboundSchema;
60
- /** @deprecated use `One$Outbound` instead. */
61
- export type Outbound = One$Outbound;
55
+ export namespace Age$ {
56
+ /** @deprecated use `Age$inboundSchema` instead. */
57
+ export const inboundSchema = Age$inboundSchema;
58
+ /** @deprecated use `Age$outboundSchema` instead. */
59
+ export const outboundSchema = Age$outboundSchema;
60
+ /** @deprecated use `Age$Outbound` instead. */
61
+ export type Outbound = Age$Outbound;
62
62
  }
63
63
 
64
- export function oneToJSON(one: One): string {
65
- return JSON.stringify(One$outboundSchema.parse(one));
64
+ export function ageToJSON(age: Age): string {
65
+ return JSON.stringify(Age$outboundSchema.parse(age));
66
66
  }
67
67
 
68
- export function oneFromJSON(
68
+ export function ageFromJSON(
69
69
  jsonString: string,
70
- ): SafeParseResult<One, SDKValidationError> {
70
+ ): SafeParseResult<Age, SDKValidationError> {
71
71
  return safeParse(
72
72
  jsonString,
73
- (x) => One$inboundSchema.parse(JSON.parse(x)),
74
- `Failed to parse 'One' from JSON`,
73
+ (x) => Age$inboundSchema.parse(JSON.parse(x)),
74
+ `Failed to parse 'Age' from JSON`,
75
75
  );
76
76
  }
77
77
 
@@ -80,17 +80,17 @@ export const RetentionPolicy$inboundSchema: z.ZodType<
80
80
  RetentionPolicy,
81
81
  z.ZodTypeDef,
82
82
  unknown
83
- > = z.lazy(() => One$inboundSchema);
83
+ > = z.lazy(() => Age$inboundSchema);
84
84
 
85
85
  /** @internal */
86
- export type RetentionPolicy$Outbound = One$Outbound;
86
+ export type RetentionPolicy$Outbound = Age$Outbound;
87
87
 
88
88
  /** @internal */
89
89
  export const RetentionPolicy$outboundSchema: z.ZodType<
90
90
  RetentionPolicy$Outbound,
91
91
  z.ZodTypeDef,
92
92
  RetentionPolicy
93
- > = z.lazy(() => One$outboundSchema);
93
+ > = z.lazy(() => Age$outboundSchema);
94
94
 
95
95
  /**
96
96
  * @internal