attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
621 lines • 27 kB
JavaScript
"use strict";
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Config$outboundSchema = exports.Config$inboundSchema = exports.RecordReference$ = exports.RecordReference$outboundSchema = exports.RecordReference$inboundSchema = exports.Currency$ = exports.Currency$outboundSchema = exports.Currency$inboundSchema = exports.DisplayType$ = exports.DisplayType$outboundSchema = exports.DisplayType$inboundSchema = exports.DefaultCurrencyCode$ = exports.DefaultCurrencyCode$outboundSchema = exports.DefaultCurrencyCode$inboundSchema = exports.Relationship$ = exports.Relationship$outboundSchema = exports.Relationship$inboundSchema = exports.RelationshipId$ = exports.RelationshipId$outboundSchema = exports.RelationshipId$inboundSchema = exports.DefaultValue$ = exports.DefaultValue$outboundSchema = exports.DefaultValue$inboundSchema = exports.DefaultValueDynamic$ = exports.DefaultValueDynamic$outboundSchema = exports.DefaultValueDynamic$inboundSchema = exports.Template$ = exports.Template$outboundSchema = exports.Template$inboundSchema = exports.TypeDynamic$ = exports.TypeDynamic$outboundSchema = exports.TypeDynamic$inboundSchema = exports.DefaultValueStatic$ = exports.DefaultValueStatic$outboundSchema = exports.DefaultValueStatic$inboundSchema = exports.TypeStatic$ = exports.TypeStatic$outboundSchema = exports.TypeStatic$inboundSchema = exports.AttributeType$ = exports.AttributeType$outboundSchema = exports.AttributeType$inboundSchema = exports.AttributeId$ = exports.AttributeId$outboundSchema = exports.AttributeId$inboundSchema = exports.DisplayType = exports.DefaultCurrencyCode = exports.Template = exports.TypeDynamic = exports.TypeStatic = exports.AttributeType = void 0;
exports.Attribute$ = exports.Attribute$outboundSchema = exports.Attribute$inboundSchema = exports.Config$ = void 0;
exports.attributeIdToJSON = attributeIdToJSON;
exports.attributeIdFromJSON = attributeIdFromJSON;
exports.defaultValueStaticToJSON = defaultValueStaticToJSON;
exports.defaultValueStaticFromJSON = defaultValueStaticFromJSON;
exports.defaultValueDynamicToJSON = defaultValueDynamicToJSON;
exports.defaultValueDynamicFromJSON = defaultValueDynamicFromJSON;
exports.defaultValueToJSON = defaultValueToJSON;
exports.defaultValueFromJSON = defaultValueFromJSON;
exports.relationshipIdToJSON = relationshipIdToJSON;
exports.relationshipIdFromJSON = relationshipIdFromJSON;
exports.relationshipToJSON = relationshipToJSON;
exports.relationshipFromJSON = relationshipFromJSON;
exports.currencyToJSON = currencyToJSON;
exports.currencyFromJSON = currencyFromJSON;
exports.recordReferenceToJSON = recordReferenceToJSON;
exports.recordReferenceFromJSON = recordReferenceFromJSON;
exports.configToJSON = configToJSON;
exports.configFromJSON = configFromJSON;
exports.attributeToJSON = attributeToJSON;
exports.attributeFromJSON = attributeFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const outputvalue_js_1 = require("./outputvalue.js");
/**
* The type of the attribute.
*/
exports.AttributeType = {
Text: "text",
Number: "number",
Checkbox: "checkbox",
Currency: "currency",
Date: "date",
Timestamp: "timestamp",
Rating: "rating",
Status: "status",
Select: "select",
RecordReference: "record-reference",
ActorReference: "actor-reference",
Location: "location",
Domain: "domain",
EmailAddress: "email-address",
PhoneNumber: "phone-number",
Interaction: "interaction",
PersonalName: "personal-name",
};
exports.TypeStatic = {
Static: "static",
};
exports.TypeDynamic = {
Dynamic: "dynamic",
};
/**
* For actor reference attributes, you may pass a dynamic value of `"current-user"`. When creating new records or entries, this will cause the actor reference value to be populated with either the workspace member or API token that created the record/entry.
*/
exports.Template = {
CurrentUser: "current-user",
};
/**
* The ISO4217 code representing the currency that values for this attribute should be stored in.
*/
exports.DefaultCurrencyCode = {
Aud: "AUD",
Brl: "BRL",
Bel: "BEL",
Cad: "CAD",
Cny: "CNY",
Cop: "COP",
Czk: "CZK",
Dkk: "DKK",
Eur: "EUR",
Hkd: "HKD",
Isk: "ISK",
Inr: "INR",
Ils: "ILS",
Jpy: "JPY",
Krw: "KRW",
Myr: "MYR",
Mxn: "MXN",
Ntd: "NTD",
Nzd: "NZD",
Ngn: "NGN",
Nok: "NOK",
Xpf: "XPF",
Pen: "PEN",
Php: "PHP",
Pln: "PLN",
Gbp: "GBP",
Sar: "SAR",
Sgd: "SGD",
Zar: "ZAR",
Sek: "SEK",
Chf: "CHF",
Aed: "AED",
Usd: "USD",
};
/**
* How the currency should be displayed across the app. "code" will display the ISO currency code e.g. "USD", "name" will display the localized currency name e.g. "British pound", "narrowSymbol" will display "$1" instead of "US$1" and "symbol" will display a localized currency symbol such as "$".
*/
exports.DisplayType = {
Code: "code",
Name: "name",
NarrowSymbol: "narrowSymbol",
Symbol: "symbol",
};
/** @internal */
exports.AttributeId$inboundSchema = z.object({
workspace_id: z.string(),
object_id: z.string(),
attribute_id: z.string(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"workspace_id": "workspaceId",
"object_id": "objectId",
"attribute_id": "attributeId",
});
});
/** @internal */
exports.AttributeId$outboundSchema = z.object({
workspaceId: z.string(),
objectId: z.string(),
attributeId: z.string(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
workspaceId: "workspace_id",
objectId: "object_id",
attributeId: "attribute_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var AttributeId$;
(function (AttributeId$) {
/** @deprecated use `AttributeId$inboundSchema` instead. */
AttributeId$.inboundSchema = exports.AttributeId$inboundSchema;
/** @deprecated use `AttributeId$outboundSchema` instead. */
AttributeId$.outboundSchema = exports.AttributeId$outboundSchema;
})(AttributeId$ || (exports.AttributeId$ = AttributeId$ = {}));
function attributeIdToJSON(attributeId) {
return JSON.stringify(exports.AttributeId$outboundSchema.parse(attributeId));
}
function attributeIdFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AttributeId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AttributeId' from JSON`);
}
/** @internal */
exports.AttributeType$inboundSchema = z.nativeEnum(exports.AttributeType);
/** @internal */
exports.AttributeType$outboundSchema = exports.AttributeType$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var AttributeType$;
(function (AttributeType$) {
/** @deprecated use `AttributeType$inboundSchema` instead. */
AttributeType$.inboundSchema = exports.AttributeType$inboundSchema;
/** @deprecated use `AttributeType$outboundSchema` instead. */
AttributeType$.outboundSchema = exports.AttributeType$outboundSchema;
})(AttributeType$ || (exports.AttributeType$ = AttributeType$ = {}));
/** @internal */
exports.TypeStatic$inboundSchema = z
.nativeEnum(exports.TypeStatic);
/** @internal */
exports.TypeStatic$outboundSchema = exports.TypeStatic$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var TypeStatic$;
(function (TypeStatic$) {
/** @deprecated use `TypeStatic$inboundSchema` instead. */
TypeStatic$.inboundSchema = exports.TypeStatic$inboundSchema;
/** @deprecated use `TypeStatic$outboundSchema` instead. */
TypeStatic$.outboundSchema = exports.TypeStatic$outboundSchema;
})(TypeStatic$ || (exports.TypeStatic$ = TypeStatic$ = {}));
/** @internal */
exports.DefaultValueStatic$inboundSchema = z.object({
type: exports.TypeStatic$inboundSchema,
template: z.array(outputvalue_js_1.OutputValue$inboundSchema),
});
/** @internal */
exports.DefaultValueStatic$outboundSchema = z.object({
type: exports.TypeStatic$outboundSchema,
template: z.array(outputvalue_js_1.OutputValue$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var DefaultValueStatic$;
(function (DefaultValueStatic$) {
/** @deprecated use `DefaultValueStatic$inboundSchema` instead. */
DefaultValueStatic$.inboundSchema = exports.DefaultValueStatic$inboundSchema;
/** @deprecated use `DefaultValueStatic$outboundSchema` instead. */
DefaultValueStatic$.outboundSchema = exports.DefaultValueStatic$outboundSchema;
})(DefaultValueStatic$ || (exports.DefaultValueStatic$ = DefaultValueStatic$ = {}));
function defaultValueStaticToJSON(defaultValueStatic) {
return JSON.stringify(exports.DefaultValueStatic$outboundSchema.parse(defaultValueStatic));
}
function defaultValueStaticFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DefaultValueStatic$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultValueStatic' from JSON`);
}
/** @internal */
exports.TypeDynamic$inboundSchema = z
.nativeEnum(exports.TypeDynamic);
/** @internal */
exports.TypeDynamic$outboundSchema = exports.TypeDynamic$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var TypeDynamic$;
(function (TypeDynamic$) {
/** @deprecated use `TypeDynamic$inboundSchema` instead. */
TypeDynamic$.inboundSchema = exports.TypeDynamic$inboundSchema;
/** @deprecated use `TypeDynamic$outboundSchema` instead. */
TypeDynamic$.outboundSchema = exports.TypeDynamic$outboundSchema;
})(TypeDynamic$ || (exports.TypeDynamic$ = TypeDynamic$ = {}));
/** @internal */
exports.Template$inboundSchema = z
.nativeEnum(exports.Template);
/** @internal */
exports.Template$outboundSchema = exports.Template$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var Template$;
(function (Template$) {
/** @deprecated use `Template$inboundSchema` instead. */
Template$.inboundSchema = exports.Template$inboundSchema;
/** @deprecated use `Template$outboundSchema` instead. */
Template$.outboundSchema = exports.Template$outboundSchema;
})(Template$ || (exports.Template$ = Template$ = {}));
/** @internal */
exports.DefaultValueDynamic$inboundSchema = z.object({
type: exports.TypeDynamic$inboundSchema,
template: z.any().optional(),
});
/** @internal */
exports.DefaultValueDynamic$outboundSchema = z.object({
type: exports.TypeDynamic$outboundSchema,
template: z.any().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var DefaultValueDynamic$;
(function (DefaultValueDynamic$) {
/** @deprecated use `DefaultValueDynamic$inboundSchema` instead. */
DefaultValueDynamic$.inboundSchema = exports.DefaultValueDynamic$inboundSchema;
/** @deprecated use `DefaultValueDynamic$outboundSchema` instead. */
DefaultValueDynamic$.outboundSchema = exports.DefaultValueDynamic$outboundSchema;
})(DefaultValueDynamic$ || (exports.DefaultValueDynamic$ = DefaultValueDynamic$ = {}));
function defaultValueDynamicToJSON(defaultValueDynamic) {
return JSON.stringify(exports.DefaultValueDynamic$outboundSchema.parse(defaultValueDynamic));
}
function defaultValueDynamicFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DefaultValueDynamic$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultValueDynamic' from JSON`);
}
/** @internal */
exports.DefaultValue$inboundSchema = z.union([
z.lazy(() => exports.DefaultValueDynamic$inboundSchema),
z.lazy(() => exports.DefaultValueStatic$inboundSchema),
]);
/** @internal */
exports.DefaultValue$outboundSchema = z.union([
z.lazy(() => exports.DefaultValueDynamic$outboundSchema),
z.lazy(() => exports.DefaultValueStatic$outboundSchema),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var DefaultValue$;
(function (DefaultValue$) {
/** @deprecated use `DefaultValue$inboundSchema` instead. */
DefaultValue$.inboundSchema = exports.DefaultValue$inboundSchema;
/** @deprecated use `DefaultValue$outboundSchema` instead. */
DefaultValue$.outboundSchema = exports.DefaultValue$outboundSchema;
})(DefaultValue$ || (exports.DefaultValue$ = DefaultValue$ = {}));
function defaultValueToJSON(defaultValue) {
return JSON.stringify(exports.DefaultValue$outboundSchema.parse(defaultValue));
}
function defaultValueFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DefaultValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultValue' from JSON`);
}
/** @internal */
exports.RelationshipId$inboundSchema = z.object({
workspace_id: z.string(),
object_id: z.string(),
attribute_id: z.string(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"workspace_id": "workspaceId",
"object_id": "objectId",
"attribute_id": "attributeId",
});
});
/** @internal */
exports.RelationshipId$outboundSchema = z.object({
workspaceId: z.string(),
objectId: z.string(),
attributeId: z.string(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
workspaceId: "workspace_id",
objectId: "object_id",
attributeId: "attribute_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var RelationshipId$;
(function (RelationshipId$) {
/** @deprecated use `RelationshipId$inboundSchema` instead. */
RelationshipId$.inboundSchema = exports.RelationshipId$inboundSchema;
/** @deprecated use `RelationshipId$outboundSchema` instead. */
RelationshipId$.outboundSchema = exports.RelationshipId$outboundSchema;
})(RelationshipId$ || (exports.RelationshipId$ = RelationshipId$ = {}));
function relationshipIdToJSON(relationshipId) {
return JSON.stringify(exports.RelationshipId$outboundSchema.parse(relationshipId));
}
function relationshipIdFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RelationshipId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RelationshipId' from JSON`);
}
/** @internal */
exports.Relationship$inboundSchema = z.object({
id: z.lazy(() => exports.RelationshipId$inboundSchema),
});
/** @internal */
exports.Relationship$outboundSchema = z.object({
id: z.lazy(() => exports.RelationshipId$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var Relationship$;
(function (Relationship$) {
/** @deprecated use `Relationship$inboundSchema` instead. */
Relationship$.inboundSchema = exports.Relationship$inboundSchema;
/** @deprecated use `Relationship$outboundSchema` instead. */
Relationship$.outboundSchema = exports.Relationship$outboundSchema;
})(Relationship$ || (exports.Relationship$ = Relationship$ = {}));
function relationshipToJSON(relationship) {
return JSON.stringify(exports.Relationship$outboundSchema.parse(relationship));
}
function relationshipFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Relationship$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Relationship' from JSON`);
}
/** @internal */
exports.DefaultCurrencyCode$inboundSchema = z.nativeEnum(exports.DefaultCurrencyCode);
/** @internal */
exports.DefaultCurrencyCode$outboundSchema = exports.DefaultCurrencyCode$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var DefaultCurrencyCode$;
(function (DefaultCurrencyCode$) {
/** @deprecated use `DefaultCurrencyCode$inboundSchema` instead. */
DefaultCurrencyCode$.inboundSchema = exports.DefaultCurrencyCode$inboundSchema;
/** @deprecated use `DefaultCurrencyCode$outboundSchema` instead. */
DefaultCurrencyCode$.outboundSchema = exports.DefaultCurrencyCode$outboundSchema;
})(DefaultCurrencyCode$ || (exports.DefaultCurrencyCode$ = DefaultCurrencyCode$ = {}));
/** @internal */
exports.DisplayType$inboundSchema = z
.nativeEnum(exports.DisplayType);
/** @internal */
exports.DisplayType$outboundSchema = exports.DisplayType$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var DisplayType$;
(function (DisplayType$) {
/** @deprecated use `DisplayType$inboundSchema` instead. */
DisplayType$.inboundSchema = exports.DisplayType$inboundSchema;
/** @deprecated use `DisplayType$outboundSchema` instead. */
DisplayType$.outboundSchema = exports.DisplayType$outboundSchema;
})(DisplayType$ || (exports.DisplayType$ = DisplayType$ = {}));
/** @internal */
exports.Currency$inboundSchema = z.object({
default_currency_code: z.nullable(exports.DefaultCurrencyCode$inboundSchema),
display_type: z.nullable(exports.DisplayType$inboundSchema),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"default_currency_code": "defaultCurrencyCode",
"display_type": "displayType",
});
});
/** @internal */
exports.Currency$outboundSchema = z.object({
defaultCurrencyCode: z.nullable(exports.DefaultCurrencyCode$outboundSchema),
displayType: z.nullable(exports.DisplayType$outboundSchema),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
defaultCurrencyCode: "default_currency_code",
displayType: "display_type",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var Currency$;
(function (Currency$) {
/** @deprecated use `Currency$inboundSchema` instead. */
Currency$.inboundSchema = exports.Currency$inboundSchema;
/** @deprecated use `Currency$outboundSchema` instead. */
Currency$.outboundSchema = exports.Currency$outboundSchema;
})(Currency$ || (exports.Currency$ = Currency$ = {}));
function currencyToJSON(currency) {
return JSON.stringify(exports.Currency$outboundSchema.parse(currency));
}
function currencyFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Currency$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Currency' from JSON`);
}
/** @internal */
exports.RecordReference$inboundSchema = z.object({
allowed_object_ids: z.nullable(z.array(z.string())),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"allowed_object_ids": "allowedObjectIds",
});
});
/** @internal */
exports.RecordReference$outboundSchema = z.object({
allowedObjectIds: z.nullable(z.array(z.string())),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
allowedObjectIds: "allowed_object_ids",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var RecordReference$;
(function (RecordReference$) {
/** @deprecated use `RecordReference$inboundSchema` instead. */
RecordReference$.inboundSchema = exports.RecordReference$inboundSchema;
/** @deprecated use `RecordReference$outboundSchema` instead. */
RecordReference$.outboundSchema = exports.RecordReference$outboundSchema;
})(RecordReference$ || (exports.RecordReference$ = RecordReference$ = {}));
function recordReferenceToJSON(recordReference) {
return JSON.stringify(exports.RecordReference$outboundSchema.parse(recordReference));
}
function recordReferenceFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RecordReference$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RecordReference' from JSON`);
}
/** @internal */
exports.Config$inboundSchema = z
.object({
currency: z.lazy(() => exports.Currency$inboundSchema),
record_reference: z.lazy(() => exports.RecordReference$inboundSchema),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"record_reference": "recordReference",
});
});
/** @internal */
exports.Config$outboundSchema = z.object({
currency: z.lazy(() => exports.Currency$outboundSchema),
recordReference: z.lazy(() => exports.RecordReference$outboundSchema),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
recordReference: "record_reference",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var Config$;
(function (Config$) {
/** @deprecated use `Config$inboundSchema` instead. */
Config$.inboundSchema = exports.Config$inboundSchema;
/** @deprecated use `Config$outboundSchema` instead. */
Config$.outboundSchema = exports.Config$outboundSchema;
})(Config$ || (exports.Config$ = Config$ = {}));
function configToJSON(config) {
return JSON.stringify(exports.Config$outboundSchema.parse(config));
}
function configFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Config$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Config' from JSON`);
}
/** @internal */
exports.Attribute$inboundSchema = z.object({
id: z.lazy(() => exports.AttributeId$inboundSchema),
title: z.string(),
description: z.nullable(z.string()),
api_slug: z.string(),
type: exports.AttributeType$inboundSchema,
is_system_attribute: z.boolean(),
is_writable: z.boolean(),
is_required: z.boolean(),
is_unique: z.boolean(),
is_multiselect: z.boolean(),
is_default_value_enabled: z.boolean(),
is_archived: z.boolean(),
default_value: z.nullable(z.union([
z.lazy(() => exports.DefaultValueDynamic$inboundSchema),
z.lazy(() => exports.DefaultValueStatic$inboundSchema),
])),
relationship: z.nullable(z.lazy(() => exports.Relationship$inboundSchema)),
created_at: z.string(),
config: z.lazy(() => exports.Config$inboundSchema),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"api_slug": "apiSlug",
"is_system_attribute": "isSystemAttribute",
"is_writable": "isWritable",
"is_required": "isRequired",
"is_unique": "isUnique",
"is_multiselect": "isMultiselect",
"is_default_value_enabled": "isDefaultValueEnabled",
"is_archived": "isArchived",
"default_value": "defaultValue",
"created_at": "createdAt",
});
});
/** @internal */
exports.Attribute$outboundSchema = z.object({
id: z.lazy(() => exports.AttributeId$outboundSchema),
title: z.string(),
description: z.nullable(z.string()),
apiSlug: z.string(),
type: exports.AttributeType$outboundSchema,
isSystemAttribute: z.boolean(),
isWritable: z.boolean(),
isRequired: z.boolean(),
isUnique: z.boolean(),
isMultiselect: z.boolean(),
isDefaultValueEnabled: z.boolean(),
isArchived: z.boolean(),
defaultValue: z.nullable(z.union([
z.lazy(() => exports.DefaultValueDynamic$outboundSchema),
z.lazy(() => exports.DefaultValueStatic$outboundSchema),
])),
relationship: z.nullable(z.lazy(() => exports.Relationship$outboundSchema)),
createdAt: z.string(),
config: z.lazy(() => exports.Config$outboundSchema),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
apiSlug: "api_slug",
isSystemAttribute: "is_system_attribute",
isWritable: "is_writable",
isRequired: "is_required",
isUnique: "is_unique",
isMultiselect: "is_multiselect",
isDefaultValueEnabled: "is_default_value_enabled",
isArchived: "is_archived",
defaultValue: "default_value",
createdAt: "created_at",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var Attribute$;
(function (Attribute$) {
/** @deprecated use `Attribute$inboundSchema` instead. */
Attribute$.inboundSchema = exports.Attribute$inboundSchema;
/** @deprecated use `Attribute$outboundSchema` instead. */
Attribute$.outboundSchema = exports.Attribute$outboundSchema;
})(Attribute$ || (exports.Attribute$ = Attribute$ = {}));
function attributeToJSON(attribute) {
return JSON.stringify(exports.Attribute$outboundSchema.parse(attribute));
}
function attributeFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Attribute$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Attribute' from JSON`);
}
//# sourceMappingURL=attribute.js.map