? inferRaw : never;
+export declare type inferParsedPropertySchema
| Schema> = P extends Property ? Parsed : P extends Schema ? inferParsed : never;
+export declare type inferRawKey | Schema> = P extends Property ? Raw : ParsedKey;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/object/types.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/object/types.js
new file mode 100644
index 00000000000..c8ad2e549bd
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/object/types.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/any.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/any.d.ts
new file mode 100644
index 00000000000..e818e346703
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/any.d.ts
@@ -0,0 +1 @@
+export declare const any: () => import("../../Schema").Schema;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/any.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/any.js
new file mode 100644
index 00000000000..0c6fe3c126f
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/any.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.any = void 0;
+const Schema_1 = require("../../Schema");
+const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
+exports.any = (0, createIdentitySchemaCreator_1.createIdentitySchemaCreator)(Schema_1.SchemaType.ANY, (value) => ({ ok: true, value }));
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/boolean.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/boolean.d.ts
new file mode 100644
index 00000000000..0efe0adbe7b
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/boolean.d.ts
@@ -0,0 +1 @@
+export declare const boolean: () => import("../../Schema").Schema;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/boolean.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/boolean.js
new file mode 100644
index 00000000000..81152deff52
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/boolean.js
@@ -0,0 +1,25 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.boolean = void 0;
+const Schema_1 = require("../../Schema");
+const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
+const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
+exports.boolean = (0, createIdentitySchemaCreator_1.createIdentitySchemaCreator)(Schema_1.SchemaType.BOOLEAN, (value, { breadcrumbsPrefix = [] } = {}) => {
+ if (typeof value === "boolean") {
+ return {
+ ok: true,
+ value,
+ };
+ }
+ else {
+ return {
+ ok: false,
+ errors: [
+ {
+ path: breadcrumbsPrefix,
+ message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "boolean"),
+ },
+ ],
+ };
+ }
+});
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/index.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/index.d.ts
new file mode 100644
index 00000000000..788f9416bfe
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/index.d.ts
@@ -0,0 +1,5 @@
+export { any } from "./any";
+export { boolean } from "./boolean";
+export { number } from "./number";
+export { string } from "./string";
+export { unknown } from "./unknown";
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/index.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/index.js
new file mode 100644
index 00000000000..1cb8b3802c1
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/index.js
@@ -0,0 +1,13 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.unknown = exports.string = exports.number = exports.boolean = exports.any = void 0;
+var any_1 = require("./any");
+Object.defineProperty(exports, "any", { enumerable: true, get: function () { return any_1.any; } });
+var boolean_1 = require("./boolean");
+Object.defineProperty(exports, "boolean", { enumerable: true, get: function () { return boolean_1.boolean; } });
+var number_1 = require("./number");
+Object.defineProperty(exports, "number", { enumerable: true, get: function () { return number_1.number; } });
+var string_1 = require("./string");
+Object.defineProperty(exports, "string", { enumerable: true, get: function () { return string_1.string; } });
+var unknown_1 = require("./unknown");
+Object.defineProperty(exports, "unknown", { enumerable: true, get: function () { return unknown_1.unknown; } });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/number.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/number.d.ts
new file mode 100644
index 00000000000..e1de2f52639
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/number.d.ts
@@ -0,0 +1 @@
+export declare const number: () => import("../../Schema").Schema;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/number.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/number.js
new file mode 100644
index 00000000000..40095cc867c
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/number.js
@@ -0,0 +1,25 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.number = void 0;
+const Schema_1 = require("../../Schema");
+const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
+const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
+exports.number = (0, createIdentitySchemaCreator_1.createIdentitySchemaCreator)(Schema_1.SchemaType.NUMBER, (value, { breadcrumbsPrefix = [] } = {}) => {
+ if (typeof value === "number") {
+ return {
+ ok: true,
+ value,
+ };
+ }
+ else {
+ return {
+ ok: false,
+ errors: [
+ {
+ path: breadcrumbsPrefix,
+ message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "number"),
+ },
+ ],
+ };
+ }
+});
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/string.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/string.d.ts
new file mode 100644
index 00000000000..03817da8f43
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/string.d.ts
@@ -0,0 +1 @@
+export declare const string: () => import("../../Schema").Schema;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/string.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/string.js
new file mode 100644
index 00000000000..32782ea7632
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/string.js
@@ -0,0 +1,25 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.string = void 0;
+const Schema_1 = require("../../Schema");
+const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
+const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
+exports.string = (0, createIdentitySchemaCreator_1.createIdentitySchemaCreator)(Schema_1.SchemaType.STRING, (value, { breadcrumbsPrefix = [] } = {}) => {
+ if (typeof value === "string") {
+ return {
+ ok: true,
+ value,
+ };
+ }
+ else {
+ return {
+ ok: false,
+ errors: [
+ {
+ path: breadcrumbsPrefix,
+ message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "string"),
+ },
+ ],
+ };
+ }
+});
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/unknown.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/unknown.d.ts
new file mode 100644
index 00000000000..411d10eff92
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/unknown.d.ts
@@ -0,0 +1 @@
+export declare const unknown: () => import("../../Schema").Schema;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/unknown.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/unknown.js
new file mode 100644
index 00000000000..631d07c835d
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/primitives/unknown.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.unknown = void 0;
+const Schema_1 = require("../../Schema");
+const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
+exports.unknown = (0, createIdentitySchemaCreator_1.createIdentitySchemaCreator)(Schema_1.SchemaType.UNKNOWN, (value) => ({ ok: true, value }));
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/index.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/index.d.ts
new file mode 100644
index 00000000000..82e25c5c2af
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/index.d.ts
@@ -0,0 +1,2 @@
+export { record } from "./record";
+export type { BaseRecordSchema, RecordSchema } from "./types";
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/index.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/index.js
new file mode 100644
index 00000000000..96633da9b83
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/index.js
@@ -0,0 +1,5 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.record = void 0;
+var record_1 = require("./record");
+Object.defineProperty(exports, "record", { enumerable: true, get: function () { return record_1.record; } });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/record.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/record.d.ts
new file mode 100644
index 00000000000..843be20783e
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/record.d.ts
@@ -0,0 +1,3 @@
+import { Schema } from "../../Schema";
+import { RecordSchema } from "./types";
+export declare function record(keySchema: Schema, valueSchema: Schema): RecordSchema;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/record.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/record.js
new file mode 100644
index 00000000000..5d6d6af92b9
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/record.js
@@ -0,0 +1,95 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.record = void 0;
+const Schema_1 = require("../../Schema");
+const entries_1 = require("../../utils/entries");
+const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
+const isPlainObject_1 = require("../../utils/isPlainObject");
+const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
+const schema_utils_1 = require("../schema-utils");
+function record(keySchema, valueSchema) {
+ const baseSchema = {
+ parse: (raw, opts) => {
+ return validateAndTransformRecord({
+ value: raw,
+ isKeyNumeric: keySchema.getType() === Schema_1.SchemaType.NUMBER,
+ transformKey: (key) => {
+ var _a;
+ return keySchema.parse(key, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key} (key)`] }));
+ },
+ transformValue: (value, key) => {
+ var _a;
+ return valueSchema.parse(value, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key}`] }));
+ },
+ breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
+ });
+ },
+ json: (parsed, opts) => {
+ return validateAndTransformRecord({
+ value: parsed,
+ isKeyNumeric: keySchema.getType() === Schema_1.SchemaType.NUMBER,
+ transformKey: (key) => {
+ var _a;
+ return keySchema.json(key, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key} (key)`] }));
+ },
+ transformValue: (value, key) => {
+ var _a;
+ return valueSchema.json(value, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key}`] }));
+ },
+ breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
+ });
+ },
+ getType: () => Schema_1.SchemaType.RECORD,
+ };
+ return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
+}
+exports.record = record;
+function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transformValue, breadcrumbsPrefix = [], }) {
+ if (!(0, isPlainObject_1.isPlainObject)(value)) {
+ return {
+ ok: false,
+ errors: [
+ {
+ path: breadcrumbsPrefix,
+ message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
+ },
+ ],
+ };
+ }
+ return (0, entries_1.entries)(value).reduce((accPromise, [stringKey, value]) => {
+ // skip nullish keys
+ if (value == null) {
+ return accPromise;
+ }
+ const acc = accPromise;
+ let key = stringKey;
+ if (isKeyNumeric) {
+ const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
+ if (!isNaN(numberKey)) {
+ key = numberKey;
+ }
+ }
+ const transformedKey = transformKey(key);
+ const transformedValue = transformValue(value, key);
+ if (acc.ok && transformedKey.ok && transformedValue.ok) {
+ return {
+ ok: true,
+ value: Object.assign(Object.assign({}, acc.value), { [transformedKey.value]: transformedValue.value }),
+ };
+ }
+ const errors = [];
+ if (!acc.ok) {
+ errors.push(...acc.errors);
+ }
+ if (!transformedKey.ok) {
+ errors.push(...transformedKey.errors);
+ }
+ if (!transformedValue.ok) {
+ errors.push(...transformedValue.errors);
+ }
+ return {
+ ok: false,
+ errors,
+ };
+ }, { ok: true, value: {} });
+}
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/types.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/types.d.ts
new file mode 100644
index 00000000000..e4ed1b903e2
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/types.d.ts
@@ -0,0 +1,4 @@
+import { BaseSchema } from "../../Schema";
+import { SchemaUtils } from "../schema-utils";
+export declare type RecordSchema = BaseRecordSchema & SchemaUtils, Record>;
+export declare type BaseRecordSchema = BaseSchema, Record>;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/types.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/types.js
new file mode 100644
index 00000000000..c8ad2e549bd
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/record/types.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/JsonError.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/JsonError.d.ts
new file mode 100644
index 00000000000..40796c8fc84
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/JsonError.d.ts
@@ -0,0 +1,5 @@
+import { ValidationError } from "../../Schema";
+export declare class JsonError extends Error {
+ readonly errors: ValidationError[];
+ constructor(errors: ValidationError[]);
+}
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/JsonError.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/JsonError.js
new file mode 100644
index 00000000000..5f010626993
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/JsonError.js
@@ -0,0 +1,12 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.JsonError = void 0;
+const stringifyValidationErrors_1 = require("./stringifyValidationErrors");
+class JsonError extends Error {
+ constructor(errors) {
+ super(errors.map(stringifyValidationErrors_1.stringifyValidationError).join("; "));
+ this.errors = errors;
+ Object.setPrototypeOf(this, JsonError.prototype);
+ }
+}
+exports.JsonError = JsonError;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/ParseError.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/ParseError.d.ts
new file mode 100644
index 00000000000..182193e4dc5
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/ParseError.d.ts
@@ -0,0 +1,5 @@
+import { ValidationError } from "../../Schema";
+export declare class ParseError extends Error {
+ readonly errors: ValidationError[];
+ constructor(errors: ValidationError[]);
+}
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/ParseError.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/ParseError.js
new file mode 100644
index 00000000000..9ef24e27ec7
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/ParseError.js
@@ -0,0 +1,12 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ParseError = void 0;
+const stringifyValidationErrors_1 = require("./stringifyValidationErrors");
+class ParseError extends Error {
+ constructor(errors) {
+ super(errors.map(stringifyValidationErrors_1.stringifyValidationError).join("; "));
+ this.errors = errors;
+ Object.setPrototypeOf(this, ParseError.prototype);
+ }
+}
+exports.ParseError = ParseError;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts
new file mode 100644
index 00000000000..dfc074e2746
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts
@@ -0,0 +1,17 @@
+import { BaseSchema, Schema, SchemaOptions } from "../../Schema";
+export interface SchemaUtils {
+ optional: () => Schema;
+ transform: (transformer: SchemaTransformer) => Schema;
+ parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Parsed;
+ jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Raw;
+}
+export interface SchemaTransformer {
+ transform: (parsed: Parsed) => Transformed;
+ untransform: (transformed: any) => Parsed;
+}
+export declare function getSchemaUtils(schema: BaseSchema): SchemaUtils;
+/**
+ * schema utils are defined in one file to resolve issues with circular imports
+ */
+export declare function optional(schema: BaseSchema): Schema;
+export declare function transform(schema: BaseSchema, transformer: SchemaTransformer): Schema;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/getSchemaUtils.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/getSchemaUtils.js
new file mode 100644
index 00000000000..ad0c354ae38
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/getSchemaUtils.js
@@ -0,0 +1,82 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.transform = exports.optional = exports.getSchemaUtils = void 0;
+const Schema_1 = require("../../Schema");
+const JsonError_1 = require("./JsonError");
+const ParseError_1 = require("./ParseError");
+function getSchemaUtils(schema) {
+ return {
+ optional: () => optional(schema),
+ transform: (transformer) => transform(schema, transformer),
+ parseOrThrow: (raw, opts) => {
+ const parsed = schema.parse(raw, opts);
+ if (parsed.ok) {
+ return parsed.value;
+ }
+ throw new ParseError_1.ParseError(parsed.errors);
+ },
+ jsonOrThrow: (parsed, opts) => {
+ const raw = schema.json(parsed, opts);
+ if (raw.ok) {
+ return raw.value;
+ }
+ throw new JsonError_1.JsonError(raw.errors);
+ },
+ };
+}
+exports.getSchemaUtils = getSchemaUtils;
+/**
+ * schema utils are defined in one file to resolve issues with circular imports
+ */
+function optional(schema) {
+ const baseSchema = {
+ parse: (raw, opts) => {
+ if (raw == null) {
+ return {
+ ok: true,
+ value: undefined,
+ };
+ }
+ return schema.parse(raw, opts);
+ },
+ json: (parsed, opts) => {
+ if ((opts === null || opts === void 0 ? void 0 : opts.omitUndefined) && parsed === undefined) {
+ return {
+ ok: true,
+ value: undefined,
+ };
+ }
+ if (parsed == null) {
+ return {
+ ok: true,
+ value: null,
+ };
+ }
+ return schema.json(parsed, opts);
+ },
+ getType: () => Schema_1.SchemaType.OPTIONAL,
+ };
+ return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
+}
+exports.optional = optional;
+function transform(schema, transformer) {
+ const baseSchema = {
+ parse: (raw, opts) => {
+ const parsed = schema.parse(raw, opts);
+ if (!parsed.ok) {
+ return parsed;
+ }
+ return {
+ ok: true,
+ value: transformer.transform(parsed.value),
+ };
+ },
+ json: (transformed, opts) => {
+ const parsed = transformer.untransform(transformed);
+ return schema.json(parsed, opts);
+ },
+ getType: () => schema.getType(),
+ };
+ return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
+}
+exports.transform = transform;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/index.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/index.d.ts
new file mode 100644
index 00000000000..aa04e051dfa
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/index.d.ts
@@ -0,0 +1,4 @@
+export { getSchemaUtils, optional, transform } from "./getSchemaUtils";
+export type { SchemaUtils } from "./getSchemaUtils";
+export { JsonError } from "./JsonError";
+export { ParseError } from "./ParseError";
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/index.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/index.js
new file mode 100644
index 00000000000..e0260b1a5dd
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/index.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ParseError = exports.JsonError = exports.transform = exports.optional = exports.getSchemaUtils = void 0;
+var getSchemaUtils_1 = require("./getSchemaUtils");
+Object.defineProperty(exports, "getSchemaUtils", { enumerable: true, get: function () { return getSchemaUtils_1.getSchemaUtils; } });
+Object.defineProperty(exports, "optional", { enumerable: true, get: function () { return getSchemaUtils_1.optional; } });
+Object.defineProperty(exports, "transform", { enumerable: true, get: function () { return getSchemaUtils_1.transform; } });
+var JsonError_1 = require("./JsonError");
+Object.defineProperty(exports, "JsonError", { enumerable: true, get: function () { return JsonError_1.JsonError; } });
+var ParseError_1 = require("./ParseError");
+Object.defineProperty(exports, "ParseError", { enumerable: true, get: function () { return ParseError_1.ParseError; } });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts
new file mode 100644
index 00000000000..e24cad9c2e8
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts
@@ -0,0 +1,2 @@
+import { ValidationError } from "../../Schema";
+export declare function stringifyValidationError(error: ValidationError): string;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js
new file mode 100644
index 00000000000..93b543cfcc5
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.stringifyValidationError = void 0;
+function stringifyValidationError(error) {
+ if (error.path.length === 0) {
+ return error.message;
+ }
+ return `${error.path.join(" -> ")}: ${error.message}`;
+}
+exports.stringifyValidationError = stringifyValidationError;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/index.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/index.d.ts
new file mode 100644
index 00000000000..f3310e8bdad
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/index.d.ts
@@ -0,0 +1 @@
+export { set } from "./set";
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/index.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/index.js
new file mode 100644
index 00000000000..9f2833249c1
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/index.js
@@ -0,0 +1,5 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.set = void 0;
+var set_1 = require("./set");
+Object.defineProperty(exports, "set", { enumerable: true, get: function () { return set_1.set; } });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/set.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/set.d.ts
new file mode 100644
index 00000000000..d96a62c5239
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/set.d.ts
@@ -0,0 +1,2 @@
+import { Schema } from "../../Schema";
+export declare function set(schema: Schema): Schema>;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/set.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/set.js
new file mode 100644
index 00000000000..326dac1ae7a
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/set/set.js
@@ -0,0 +1,44 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.set = void 0;
+const Schema_1 = require("../../Schema");
+const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
+const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
+const list_1 = require("../list");
+const schema_utils_1 = require("../schema-utils");
+function set(schema) {
+ const listSchema = (0, list_1.list)(schema);
+ const baseSchema = {
+ parse: (raw, opts) => {
+ const parsedList = listSchema.parse(raw, opts);
+ if (parsedList.ok) {
+ return {
+ ok: true,
+ value: new Set(parsedList.value),
+ };
+ }
+ else {
+ return parsedList;
+ }
+ },
+ json: (parsed, opts) => {
+ var _a;
+ if (!(parsed instanceof Set)) {
+ return {
+ ok: false,
+ errors: [
+ {
+ path: (_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : [],
+ message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(parsed, "Set"),
+ },
+ ],
+ };
+ }
+ const jsonList = listSchema.json([...parsed], opts);
+ return jsonList;
+ },
+ getType: () => Schema_1.SchemaType.SET,
+ };
+ return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
+}
+exports.set = set;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/index.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/index.d.ts
new file mode 100644
index 00000000000..70dc2108ed4
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/index.d.ts
@@ -0,0 +1,2 @@
+export type { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema, UndiscriminatedUnionSchema, } from "./types";
+export { undiscriminatedUnion } from "./undiscriminatedUnion";
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/index.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/index.js
new file mode 100644
index 00000000000..7003b2d0baf
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/index.js
@@ -0,0 +1,5 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.undiscriminatedUnion = void 0;
+var undiscriminatedUnion_1 = require("./undiscriminatedUnion");
+Object.defineProperty(exports, "undiscriminatedUnion", { enumerable: true, get: function () { return undiscriminatedUnion_1.undiscriminatedUnion; } });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/types.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/types.d.ts
new file mode 100644
index 00000000000..9ec34a7a32d
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/types.d.ts
@@ -0,0 +1,4 @@
+import { inferParsed, inferRaw, Schema } from "../../Schema";
+export declare type UndiscriminatedUnionSchema = Schema, inferParsedUnidiscriminatedUnionSchema>;
+export declare type inferRawUnidiscriminatedUnionSchema = inferRaw;
+export declare type inferParsedUnidiscriminatedUnionSchema = inferParsed;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/types.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/types.js
new file mode 100644
index 00000000000..c8ad2e549bd
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/types.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts
new file mode 100644
index 00000000000..c7c0e8b4c93
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts
@@ -0,0 +1,3 @@
+import { Schema } from "../../Schema";
+import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types";
+export declare function undiscriminatedUnion, ...Schema[]]>(schemas: Schemas): Schema, inferParsedUnidiscriminatedUnionSchema>;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js
new file mode 100644
index 00000000000..eedb88f1b0b
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js
@@ -0,0 +1,40 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.undiscriminatedUnion = void 0;
+const Schema_1 = require("../../Schema");
+const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
+const schema_utils_1 = require("../schema-utils");
+function undiscriminatedUnion(schemas) {
+ const baseSchema = {
+ parse: (raw, opts) => {
+ return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.parse(raw, opts), schemas, opts);
+ },
+ json: (parsed, opts) => {
+ return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.json(parsed, opts), schemas, opts);
+ },
+ getType: () => Schema_1.SchemaType.UNDISCRIMINATED_UNION,
+ };
+ return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
+}
+exports.undiscriminatedUnion = undiscriminatedUnion;
+function validateAndTransformUndiscriminatedUnion(transform, schemas, opts) {
+ const errors = [];
+ for (const [index, schema] of schemas.entries()) {
+ const transformed = transform(schema, Object.assign(Object.assign({}, opts), { skipValidation: false }));
+ if (transformed.ok) {
+ return transformed;
+ }
+ else {
+ for (const error of transformed.errors) {
+ errors.push({
+ path: error.path,
+ message: `[Variant ${index}] ${error.message}`,
+ });
+ }
+ }
+ }
+ return {
+ ok: false,
+ errors,
+ };
+}
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/discriminant.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/discriminant.d.ts
new file mode 100644
index 00000000000..656c7d0ff57
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/discriminant.d.ts
@@ -0,0 +1,5 @@
+export declare function discriminant(parsedDiscriminant: ParsedDiscriminant, rawDiscriminant: RawDiscriminant): Discriminant;
+export interface Discriminant {
+ parsedDiscriminant: ParsedDiscriminant;
+ rawDiscriminant: RawDiscriminant;
+}
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/discriminant.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/discriminant.js
new file mode 100644
index 00000000000..9f033e93718
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/discriminant.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.discriminant = void 0;
+function discriminant(parsedDiscriminant, rawDiscriminant) {
+ return {
+ parsedDiscriminant,
+ rawDiscriminant,
+ };
+}
+exports.discriminant = discriminant;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/index.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/index.d.ts
new file mode 100644
index 00000000000..626d9af4b48
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/index.d.ts
@@ -0,0 +1,4 @@
+export { discriminant } from "./discriminant";
+export type { Discriminant } from "./discriminant";
+export type { inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion, UnionSubtypes, } from "./types";
+export { union } from "./union";
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/index.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/index.js
new file mode 100644
index 00000000000..54416d3192d
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/index.js
@@ -0,0 +1,7 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.union = exports.discriminant = void 0;
+var discriminant_1 = require("./discriminant");
+Object.defineProperty(exports, "discriminant", { enumerable: true, get: function () { return discriminant_1.discriminant; } });
+var union_1 = require("./union");
+Object.defineProperty(exports, "union", { enumerable: true, get: function () { return union_1.union; } });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/types.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/types.d.ts
new file mode 100644
index 00000000000..4c0016aa987
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/types.d.ts
@@ -0,0 +1,13 @@
+import { inferParsedObject, inferRawObject, ObjectSchema } from "../object";
+import { Discriminant } from "./discriminant";
+export declare type UnionSubtypes = {
+ [K in DiscriminantValues]: ObjectSchema;
+};
+export declare type inferRawUnion, U extends UnionSubtypes> = {
+ [K in keyof U]: Record, K> & inferRawObject;
+}[keyof U];
+export declare type inferParsedUnion, U extends UnionSubtypes> = {
+ [K in keyof U]: Record, K> & inferParsedObject;
+}[keyof U];
+export declare type inferRawDiscriminant> = D extends string ? D : D extends Discriminant ? Raw : never;
+export declare type inferParsedDiscriminant> = D extends string ? D : D extends Discriminant ? Parsed : never;
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/types.js b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/types.js
new file mode 100644
index 00000000000..c8ad2e549bd
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/types.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/union.d.ts b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/union.d.ts
new file mode 100644
index 00000000000..6ebd091ab3a
--- /dev/null
+++ b/seed/ts-sdk/streaming/no-serde-layer/dist/core/schemas/builders/union/union.d.ts
@@ -0,0 +1,4 @@
+import { ObjectLikeSchema } from "../object-like";
+import { Discriminant } from "./discriminant";
+import { inferParsedUnion, inferRawUnion, UnionSubtypes } from "./types";
+export declare function union