attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
169 lines • 8.1 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.PostV2NotesResponse$ = exports.PostV2NotesResponse$outboundSchema = exports.PostV2NotesResponse$inboundSchema = exports.PostV2NotesRequest$ = exports.PostV2NotesRequest$outboundSchema = exports.PostV2NotesRequest$inboundSchema = exports.PostV2NotesData$ = exports.PostV2NotesData$outboundSchema = exports.PostV2NotesData$inboundSchema = exports.PostV2NotesFormat$ = exports.PostV2NotesFormat$outboundSchema = exports.PostV2NotesFormat$inboundSchema = exports.PostV2NotesFormat = void 0;
exports.postV2NotesDataToJSON = postV2NotesDataToJSON;
exports.postV2NotesDataFromJSON = postV2NotesDataFromJSON;
exports.postV2NotesRequestToJSON = postV2NotesRequestToJSON;
exports.postV2NotesRequestFromJSON = postV2NotesRequestFromJSON;
exports.postV2NotesResponseToJSON = postV2NotesResponseToJSON;
exports.postV2NotesResponseFromJSON = postV2NotesResponseFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const note_js_1 = require("../components/note.js");
/**
* The format of the note content to be created. The `plaintext` format uses the line feed character `\n` to create new lines within the note content. The `markdown` format supports rich text formatting, and links.
*/
exports.PostV2NotesFormat = {
Plaintext: "plaintext",
Markdown: "markdown",
};
/** @internal */
exports.PostV2NotesFormat$inboundSchema = z.nativeEnum(exports.PostV2NotesFormat);
/** @internal */
exports.PostV2NotesFormat$outboundSchema = exports.PostV2NotesFormat$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var PostV2NotesFormat$;
(function (PostV2NotesFormat$) {
/** @deprecated use `PostV2NotesFormat$inboundSchema` instead. */
PostV2NotesFormat$.inboundSchema = exports.PostV2NotesFormat$inboundSchema;
/** @deprecated use `PostV2NotesFormat$outboundSchema` instead. */
PostV2NotesFormat$.outboundSchema = exports.PostV2NotesFormat$outboundSchema;
})(PostV2NotesFormat$ || (exports.PostV2NotesFormat$ = PostV2NotesFormat$ = {}));
/** @internal */
exports.PostV2NotesData$inboundSchema = z.object({
parent_object: z.string(),
parent_record_id: z.string(),
title: z.string(),
format: exports.PostV2NotesFormat$inboundSchema,
content: z.string(),
created_at: z.string().optional(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"parent_object": "parentObject",
"parent_record_id": "parentRecordId",
"created_at": "createdAt",
});
});
/** @internal */
exports.PostV2NotesData$outboundSchema = z.object({
parentObject: z.string(),
parentRecordId: z.string(),
title: z.string(),
format: exports.PostV2NotesFormat$outboundSchema,
content: z.string(),
createdAt: z.string().optional(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
parentObject: "parent_object",
parentRecordId: "parent_record_id",
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 PostV2NotesData$;
(function (PostV2NotesData$) {
/** @deprecated use `PostV2NotesData$inboundSchema` instead. */
PostV2NotesData$.inboundSchema = exports.PostV2NotesData$inboundSchema;
/** @deprecated use `PostV2NotesData$outboundSchema` instead. */
PostV2NotesData$.outboundSchema = exports.PostV2NotesData$outboundSchema;
})(PostV2NotesData$ || (exports.PostV2NotesData$ = PostV2NotesData$ = {}));
function postV2NotesDataToJSON(postV2NotesData) {
return JSON.stringify(exports.PostV2NotesData$outboundSchema.parse(postV2NotesData));
}
function postV2NotesDataFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PostV2NotesData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2NotesData' from JSON`);
}
/** @internal */
exports.PostV2NotesRequest$inboundSchema = z.object({
data: z.lazy(() => exports.PostV2NotesData$inboundSchema),
});
/** @internal */
exports.PostV2NotesRequest$outboundSchema = z.object({
data: z.lazy(() => exports.PostV2NotesData$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var PostV2NotesRequest$;
(function (PostV2NotesRequest$) {
/** @deprecated use `PostV2NotesRequest$inboundSchema` instead. */
PostV2NotesRequest$.inboundSchema = exports.PostV2NotesRequest$inboundSchema;
/** @deprecated use `PostV2NotesRequest$outboundSchema` instead. */
PostV2NotesRequest$.outboundSchema = exports.PostV2NotesRequest$outboundSchema;
})(PostV2NotesRequest$ || (exports.PostV2NotesRequest$ = PostV2NotesRequest$ = {}));
function postV2NotesRequestToJSON(postV2NotesRequest) {
return JSON.stringify(exports.PostV2NotesRequest$outboundSchema.parse(postV2NotesRequest));
}
function postV2NotesRequestFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PostV2NotesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2NotesRequest' from JSON`);
}
/** @internal */
exports.PostV2NotesResponse$inboundSchema = z.object({
data: note_js_1.Note$inboundSchema,
});
/** @internal */
exports.PostV2NotesResponse$outboundSchema = z.object({
data: note_js_1.Note$outboundSchema,
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var PostV2NotesResponse$;
(function (PostV2NotesResponse$) {
/** @deprecated use `PostV2NotesResponse$inboundSchema` instead. */
PostV2NotesResponse$.inboundSchema = exports.PostV2NotesResponse$inboundSchema;
/** @deprecated use `PostV2NotesResponse$outboundSchema` instead. */
PostV2NotesResponse$.outboundSchema = exports.PostV2NotesResponse$outboundSchema;
})(PostV2NotesResponse$ || (exports.PostV2NotesResponse$ = PostV2NotesResponse$ = {}));
function postV2NotesResponseToJSON(postV2NotesResponse) {
return JSON.stringify(exports.PostV2NotesResponse$outboundSchema.parse(postV2NotesResponse));
}
function postV2NotesResponseFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PostV2NotesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2NotesResponse' from JSON`);
}
//# sourceMappingURL=postv2notes.js.map