attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
313 lines • 17.3 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
/**
* The direction to sort the results by.
*/
export const PostV2ObjectsObjectRecordsQueryDirection2 = {
Asc: "asc",
Desc: "desc",
};
/**
* The direction to sort the results by.
*/
export const PostV2ObjectsObjectRecordsQueryDirection1 = {
Asc: "asc",
Desc: "desc",
};
/** @internal */
export const PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema = z
.nativeEnum(PostV2ObjectsObjectRecordsQueryDirection2);
/** @internal */
export const PostV2ObjectsObjectRecordsQueryDirection2$outboundSchema = PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQueryDirection2$;
(function (PostV2ObjectsObjectRecordsQueryDirection2$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryDirection2$.inboundSchema = PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryDirection2$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryDirection2$.outboundSchema = PostV2ObjectsObjectRecordsQueryDirection2$outboundSchema;
})(PostV2ObjectsObjectRecordsQueryDirection2$ || (PostV2ObjectsObjectRecordsQueryDirection2$ = {}));
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySort2$inboundSchema = z.object({
direction: PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema,
path: z.array(z.array(z.string())),
field: z.string().optional(),
});
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySort2$outboundSchema = z.object({
direction: PostV2ObjectsObjectRecordsQueryDirection2$outboundSchema,
path: z.array(z.array(z.string())),
field: z.string().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQuerySort2$;
(function (PostV2ObjectsObjectRecordsQuerySort2$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort2$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQuerySort2$.inboundSchema = PostV2ObjectsObjectRecordsQuerySort2$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort2$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQuerySort2$.outboundSchema = PostV2ObjectsObjectRecordsQuerySort2$outboundSchema;
})(PostV2ObjectsObjectRecordsQuerySort2$ || (PostV2ObjectsObjectRecordsQuerySort2$ = {}));
export function postV2ObjectsObjectRecordsQuerySort2ToJSON(postV2ObjectsObjectRecordsQuerySort2) {
return JSON.stringify(PostV2ObjectsObjectRecordsQuerySort2$outboundSchema.parse(postV2ObjectsObjectRecordsQuerySort2));
}
export function postV2ObjectsObjectRecordsQuerySort2FromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsObjectRecordsQuerySort2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsObjectRecordsQuerySort2' from JSON`);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema = z
.nativeEnum(PostV2ObjectsObjectRecordsQueryDirection1);
/** @internal */
export const PostV2ObjectsObjectRecordsQueryDirection1$outboundSchema = PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQueryDirection1$;
(function (PostV2ObjectsObjectRecordsQueryDirection1$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryDirection1$.inboundSchema = PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryDirection1$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryDirection1$.outboundSchema = PostV2ObjectsObjectRecordsQueryDirection1$outboundSchema;
})(PostV2ObjectsObjectRecordsQueryDirection1$ || (PostV2ObjectsObjectRecordsQueryDirection1$ = {}));
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySort1$inboundSchema = z.object({
direction: PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema,
attribute: z.string(),
field: z.string().optional(),
});
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySort1$outboundSchema = z.object({
direction: PostV2ObjectsObjectRecordsQueryDirection1$outboundSchema,
attribute: z.string(),
field: z.string().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQuerySort1$;
(function (PostV2ObjectsObjectRecordsQuerySort1$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort1$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQuerySort1$.inboundSchema = PostV2ObjectsObjectRecordsQuerySort1$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort1$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQuerySort1$.outboundSchema = PostV2ObjectsObjectRecordsQuerySort1$outboundSchema;
})(PostV2ObjectsObjectRecordsQuerySort1$ || (PostV2ObjectsObjectRecordsQuerySort1$ = {}));
export function postV2ObjectsObjectRecordsQuerySort1ToJSON(postV2ObjectsObjectRecordsQuerySort1) {
return JSON.stringify(PostV2ObjectsObjectRecordsQuerySort1$outboundSchema.parse(postV2ObjectsObjectRecordsQuerySort1));
}
export function postV2ObjectsObjectRecordsQuerySort1FromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsObjectRecordsQuerySort1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsObjectRecordsQuerySort1' from JSON`);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySortUnion$inboundSchema = z.union([
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort1$inboundSchema),
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort2$inboundSchema),
]);
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySortUnion$outboundSchema = z.union([
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort1$outboundSchema),
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort2$outboundSchema),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQuerySortUnion$;
(function (PostV2ObjectsObjectRecordsQuerySortUnion$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySortUnion$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQuerySortUnion$.inboundSchema = PostV2ObjectsObjectRecordsQuerySortUnion$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySortUnion$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQuerySortUnion$.outboundSchema = PostV2ObjectsObjectRecordsQuerySortUnion$outboundSchema;
})(PostV2ObjectsObjectRecordsQuerySortUnion$ || (PostV2ObjectsObjectRecordsQuerySortUnion$ = {}));
export function postV2ObjectsObjectRecordsQuerySortUnionToJSON(postV2ObjectsObjectRecordsQuerySortUnion) {
return JSON.stringify(PostV2ObjectsObjectRecordsQuerySortUnion$outboundSchema.parse(postV2ObjectsObjectRecordsQuerySortUnion));
}
export function postV2ObjectsObjectRecordsQuerySortUnionFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsObjectRecordsQuerySortUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsObjectRecordsQuerySortUnion' from JSON`);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema = z.object({
filter: z.record(z.any()).optional(),
sorts: z.array(z.union([
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort1$inboundSchema),
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort2$inboundSchema),
])).optional(),
limit: z.number().optional(),
offset: z.number().optional(),
});
/** @internal */
export const PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema = z.object({
filter: z.record(z.any()).optional(),
sorts: z.array(z.union([
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort1$outboundSchema),
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort2$outboundSchema),
])).optional(),
limit: z.number().optional(),
offset: z.number().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQueryRequestBody$;
(function (PostV2ObjectsObjectRecordsQueryRequestBody$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryRequestBody$.inboundSchema = PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryRequestBody$.outboundSchema = PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema;
})(PostV2ObjectsObjectRecordsQueryRequestBody$ || (PostV2ObjectsObjectRecordsQueryRequestBody$ = {}));
export function postV2ObjectsObjectRecordsQueryRequestBodyToJSON(postV2ObjectsObjectRecordsQueryRequestBody) {
return JSON.stringify(PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema.parse(postV2ObjectsObjectRecordsQueryRequestBody));
}
export function postV2ObjectsObjectRecordsQueryRequestBodyFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsObjectRecordsQueryRequestBody' from JSON`);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryRequest$inboundSchema = z.object({
object: z.string(),
RequestBody: z.lazy(() => PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema),
}).transform((v) => {
return remap$(v, {
"RequestBody": "requestBody",
});
});
/** @internal */
export const PostV2ObjectsObjectRecordsQueryRequest$outboundSchema = z.object({
object: z.string(),
requestBody: z.lazy(() => PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQueryRequest$;
(function (PostV2ObjectsObjectRecordsQueryRequest$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequest$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryRequest$.inboundSchema = PostV2ObjectsObjectRecordsQueryRequest$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequest$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryRequest$.outboundSchema = PostV2ObjectsObjectRecordsQueryRequest$outboundSchema;
})(PostV2ObjectsObjectRecordsQueryRequest$ || (PostV2ObjectsObjectRecordsQueryRequest$ = {}));
export function postV2ObjectsObjectRecordsQueryRequestToJSON(postV2ObjectsObjectRecordsQueryRequest) {
return JSON.stringify(PostV2ObjectsObjectRecordsQueryRequest$outboundSchema.parse(postV2ObjectsObjectRecordsQueryRequest));
}
export function postV2ObjectsObjectRecordsQueryRequestFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsObjectRecordsQueryRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsObjectRecordsQueryRequest' from JSON`);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryId$inboundSchema = z.object({
workspace_id: z.string(),
object_id: z.string(),
record_id: z.string(),
}).transform((v) => {
return remap$(v, {
"workspace_id": "workspaceId",
"object_id": "objectId",
"record_id": "recordId",
});
});
/** @internal */
export const PostV2ObjectsObjectRecordsQueryId$outboundSchema = z.object({
workspaceId: z.string(),
objectId: z.string(),
recordId: z.string(),
}).transform((v) => {
return remap$(v, {
workspaceId: "workspace_id",
objectId: "object_id",
recordId: "record_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQueryId$;
(function (PostV2ObjectsObjectRecordsQueryId$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryId$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryId$.inboundSchema = PostV2ObjectsObjectRecordsQueryId$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryId$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryId$.outboundSchema = PostV2ObjectsObjectRecordsQueryId$outboundSchema;
})(PostV2ObjectsObjectRecordsQueryId$ || (PostV2ObjectsObjectRecordsQueryId$ = {}));
export function postV2ObjectsObjectRecordsQueryIdToJSON(postV2ObjectsObjectRecordsQueryId) {
return JSON.stringify(PostV2ObjectsObjectRecordsQueryId$outboundSchema.parse(postV2ObjectsObjectRecordsQueryId));
}
export function postV2ObjectsObjectRecordsQueryIdFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsObjectRecordsQueryId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsObjectRecordsQueryId' from JSON`);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryData$inboundSchema = z.object({
id: z.lazy(() => PostV2ObjectsObjectRecordsQueryId$inboundSchema),
created_at: z.string(),
values: z.record(z.any()),
}).transform((v) => {
return remap$(v, {
"created_at": "createdAt",
});
});
/** @internal */
export const PostV2ObjectsObjectRecordsQueryData$outboundSchema = z.object({
id: z.lazy(() => PostV2ObjectsObjectRecordsQueryId$outboundSchema),
createdAt: z.string(),
values: z.record(z.any()),
}).transform((v) => {
return remap$(v, {
createdAt: "created_at",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQueryData$;
(function (PostV2ObjectsObjectRecordsQueryData$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryData$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryData$.inboundSchema = PostV2ObjectsObjectRecordsQueryData$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryData$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryData$.outboundSchema = PostV2ObjectsObjectRecordsQueryData$outboundSchema;
})(PostV2ObjectsObjectRecordsQueryData$ || (PostV2ObjectsObjectRecordsQueryData$ = {}));
export function postV2ObjectsObjectRecordsQueryDataToJSON(postV2ObjectsObjectRecordsQueryData) {
return JSON.stringify(PostV2ObjectsObjectRecordsQueryData$outboundSchema.parse(postV2ObjectsObjectRecordsQueryData));
}
export function postV2ObjectsObjectRecordsQueryDataFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsObjectRecordsQueryData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsObjectRecordsQueryData' from JSON`);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryResponse$inboundSchema = z.object({
data: z.array(z.lazy(() => PostV2ObjectsObjectRecordsQueryData$inboundSchema)),
});
/** @internal */
export const PostV2ObjectsObjectRecordsQueryResponse$outboundSchema = z.object({
data: z.array(z.lazy(() => PostV2ObjectsObjectRecordsQueryData$outboundSchema)),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsObjectRecordsQueryResponse$;
(function (PostV2ObjectsObjectRecordsQueryResponse$) {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryResponse$inboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryResponse$.inboundSchema = PostV2ObjectsObjectRecordsQueryResponse$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryResponse$outboundSchema` instead. */
PostV2ObjectsObjectRecordsQueryResponse$.outboundSchema = PostV2ObjectsObjectRecordsQueryResponse$outboundSchema;
})(PostV2ObjectsObjectRecordsQueryResponse$ || (PostV2ObjectsObjectRecordsQueryResponse$ = {}));
export function postV2ObjectsObjectRecordsQueryResponseToJSON(postV2ObjectsObjectRecordsQueryResponse) {
return JSON.stringify(PostV2ObjectsObjectRecordsQueryResponse$outboundSchema.parse(postV2ObjectsObjectRecordsQueryResponse));
}
export function postV2ObjectsObjectRecordsQueryResponseFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsObjectRecordsQueryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsObjectRecordsQueryResponse' from JSON`);
}
//# sourceMappingURL=postv2objectsobjectrecordsquery.js.map