UNPKG

attio-js

Version:

Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.

197 lines 8.03 kB
"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.Note$ = exports.Note$outboundSchema = exports.Note$inboundSchema = exports.NoteCreatedByActor$ = exports.NoteCreatedByActor$outboundSchema = exports.NoteCreatedByActor$inboundSchema = exports.NoteType$ = exports.NoteType$outboundSchema = exports.NoteType$inboundSchema = exports.NoteId$ = exports.NoteId$outboundSchema = exports.NoteId$inboundSchema = exports.NoteType = void 0; exports.noteIdToJSON = noteIdToJSON; exports.noteIdFromJSON = noteIdFromJSON; exports.noteCreatedByActorToJSON = noteCreatedByActorToJSON; exports.noteCreatedByActorFromJSON = noteCreatedByActorFromJSON; exports.noteToJSON = noteToJSON; exports.noteFromJSON = noteFromJSON; const z = __importStar(require("zod")); const primitives_js_1 = require("../../lib/primitives.js"); const schemas_js_1 = require("../../lib/schemas.js"); /** * The type of actor. [Read more information on actor types here](/docs/actors). */ exports.NoteType = { ApiToken: "api-token", WorkspaceMember: "workspace-member", System: "system", App: "app", }; /** @internal */ exports.NoteId$inboundSchema = z .object({ workspace_id: z.string(), note_id: z.string(), }).transform((v) => { return (0, primitives_js_1.remap)(v, { "workspace_id": "workspaceId", "note_id": "noteId", }); }); /** @internal */ exports.NoteId$outboundSchema = z.object({ workspaceId: z.string(), noteId: z.string(), }).transform((v) => { return (0, primitives_js_1.remap)(v, { workspaceId: "workspace_id", noteId: "note_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ var NoteId$; (function (NoteId$) { /** @deprecated use `NoteId$inboundSchema` instead. */ NoteId$.inboundSchema = exports.NoteId$inboundSchema; /** @deprecated use `NoteId$outboundSchema` instead. */ NoteId$.outboundSchema = exports.NoteId$outboundSchema; })(NoteId$ || (exports.NoteId$ = NoteId$ = {})); function noteIdToJSON(noteId) { return JSON.stringify(exports.NoteId$outboundSchema.parse(noteId)); } function noteIdFromJSON(jsonString) { return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.NoteId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NoteId' from JSON`); } /** @internal */ exports.NoteType$inboundSchema = z .nativeEnum(exports.NoteType); /** @internal */ exports.NoteType$outboundSchema = exports.NoteType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ var NoteType$; (function (NoteType$) { /** @deprecated use `NoteType$inboundSchema` instead. */ NoteType$.inboundSchema = exports.NoteType$inboundSchema; /** @deprecated use `NoteType$outboundSchema` instead. */ NoteType$.outboundSchema = exports.NoteType$outboundSchema; })(NoteType$ || (exports.NoteType$ = NoteType$ = {})); /** @internal */ exports.NoteCreatedByActor$inboundSchema = z.object({ id: z.nullable(z.string()).optional(), type: z.nullable(exports.NoteType$inboundSchema).optional(), }); /** @internal */ exports.NoteCreatedByActor$outboundSchema = z.object({ id: z.nullable(z.string()).optional(), type: z.nullable(exports.NoteType$outboundSchema).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ var NoteCreatedByActor$; (function (NoteCreatedByActor$) { /** @deprecated use `NoteCreatedByActor$inboundSchema` instead. */ NoteCreatedByActor$.inboundSchema = exports.NoteCreatedByActor$inboundSchema; /** @deprecated use `NoteCreatedByActor$outboundSchema` instead. */ NoteCreatedByActor$.outboundSchema = exports.NoteCreatedByActor$outboundSchema; })(NoteCreatedByActor$ || (exports.NoteCreatedByActor$ = NoteCreatedByActor$ = {})); function noteCreatedByActorToJSON(noteCreatedByActor) { return JSON.stringify(exports.NoteCreatedByActor$outboundSchema.parse(noteCreatedByActor)); } function noteCreatedByActorFromJSON(jsonString) { return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.NoteCreatedByActor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NoteCreatedByActor' from JSON`); } /** @internal */ exports.Note$inboundSchema = z .object({ id: z.lazy(() => exports.NoteId$inboundSchema), parent_object: z.string(), parent_record_id: z.string(), title: z.string(), content_plaintext: z.string(), content_markdown: z.string(), created_by_actor: z.lazy(() => exports.NoteCreatedByActor$inboundSchema), created_at: z.string(), }).transform((v) => { return (0, primitives_js_1.remap)(v, { "parent_object": "parentObject", "parent_record_id": "parentRecordId", "content_plaintext": "contentPlaintext", "content_markdown": "contentMarkdown", "created_by_actor": "createdByActor", "created_at": "createdAt", }); }); /** @internal */ exports.Note$outboundSchema = z.object({ id: z.lazy(() => exports.NoteId$outboundSchema), parentObject: z.string(), parentRecordId: z.string(), title: z.string(), contentPlaintext: z.string(), contentMarkdown: z.string(), createdByActor: z.lazy(() => exports.NoteCreatedByActor$outboundSchema), createdAt: z.string(), }).transform((v) => { return (0, primitives_js_1.remap)(v, { parentObject: "parent_object", parentRecordId: "parent_record_id", contentPlaintext: "content_plaintext", contentMarkdown: "content_markdown", createdByActor: "created_by_actor", 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 Note$; (function (Note$) { /** @deprecated use `Note$inboundSchema` instead. */ Note$.inboundSchema = exports.Note$inboundSchema; /** @deprecated use `Note$outboundSchema` instead. */ Note$.outboundSchema = exports.Note$outboundSchema; })(Note$ || (exports.Note$ = Note$ = {})); function noteToJSON(note) { return JSON.stringify(exports.Note$outboundSchema.parse(note)); } function noteFromJSON(jsonString) { return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Note$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Note' from JSON`); } //# sourceMappingURL=note.js.map