attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
280 lines • 12.2 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.List$ = exports.List$outboundSchema = exports.List$inboundSchema = exports.ListCreatedByActor$ = exports.ListCreatedByActor$outboundSchema = exports.ListCreatedByActor$inboundSchema = exports.ListType$ = exports.ListType$outboundSchema = exports.ListType$inboundSchema = exports.WorkspaceMemberAccess$ = exports.WorkspaceMemberAccess$outboundSchema = exports.WorkspaceMemberAccess$inboundSchema = exports.Level$ = exports.Level$outboundSchema = exports.Level$inboundSchema = exports.WorkspaceAccess$ = exports.WorkspaceAccess$outboundSchema = exports.WorkspaceAccess$inboundSchema = exports.ListId$ = exports.ListId$outboundSchema = exports.ListId$inboundSchema = exports.ListType = exports.Level = exports.WorkspaceAccess = void 0;
exports.listIdToJSON = listIdToJSON;
exports.listIdFromJSON = listIdFromJSON;
exports.workspaceMemberAccessToJSON = workspaceMemberAccessToJSON;
exports.workspaceMemberAccessFromJSON = workspaceMemberAccessFromJSON;
exports.listCreatedByActorToJSON = listCreatedByActorToJSON;
exports.listCreatedByActorFromJSON = listCreatedByActorFromJSON;
exports.listToJSON = listToJSON;
exports.listFromJSON = listFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
* The level of access granted to all members of the workspace for this list. `null` values represent a private list that only grants access to specific workspace members via the `workspace_member_access` property.
*/
exports.WorkspaceAccess = {
FullAccess: "full-access",
ReadAndWrite: "read-and-write",
ReadOnly: "read-only",
};
/**
* The level of access to the list.
*/
exports.Level = {
FullAccess: "full-access",
ReadAndWrite: "read-and-write",
ReadOnly: "read-only",
};
/**
* The type of actor. [Read more information on actor types here](/docs/actors).
*/
exports.ListType = {
ApiToken: "api-token",
WorkspaceMember: "workspace-member",
System: "system",
App: "app",
};
/** @internal */
exports.ListId$inboundSchema = z
.object({
workspace_id: z.string(),
list_id: z.string(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"workspace_id": "workspaceId",
"list_id": "listId",
});
});
/** @internal */
exports.ListId$outboundSchema = z.object({
workspaceId: z.string(),
listId: z.string(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
workspaceId: "workspace_id",
listId: "list_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var ListId$;
(function (ListId$) {
/** @deprecated use `ListId$inboundSchema` instead. */
ListId$.inboundSchema = exports.ListId$inboundSchema;
/** @deprecated use `ListId$outboundSchema` instead. */
ListId$.outboundSchema = exports.ListId$outboundSchema;
})(ListId$ || (exports.ListId$ = ListId$ = {}));
function listIdToJSON(listId) {
return JSON.stringify(exports.ListId$outboundSchema.parse(listId));
}
function listIdFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListId' from JSON`);
}
/** @internal */
exports.WorkspaceAccess$inboundSchema = z.nativeEnum(exports.WorkspaceAccess);
/** @internal */
exports.WorkspaceAccess$outboundSchema = exports.WorkspaceAccess$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var WorkspaceAccess$;
(function (WorkspaceAccess$) {
/** @deprecated use `WorkspaceAccess$inboundSchema` instead. */
WorkspaceAccess$.inboundSchema = exports.WorkspaceAccess$inboundSchema;
/** @deprecated use `WorkspaceAccess$outboundSchema` instead. */
WorkspaceAccess$.outboundSchema = exports.WorkspaceAccess$outboundSchema;
})(WorkspaceAccess$ || (exports.WorkspaceAccess$ = WorkspaceAccess$ = {}));
/** @internal */
exports.Level$inboundSchema = z.nativeEnum(exports.Level);
/** @internal */
exports.Level$outboundSchema = exports.Level$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var Level$;
(function (Level$) {
/** @deprecated use `Level$inboundSchema` instead. */
Level$.inboundSchema = exports.Level$inboundSchema;
/** @deprecated use `Level$outboundSchema` instead. */
Level$.outboundSchema = exports.Level$outboundSchema;
})(Level$ || (exports.Level$ = Level$ = {}));
/** @internal */
exports.WorkspaceMemberAccess$inboundSchema = z.object({
workspace_member_id: z.string(),
level: exports.Level$inboundSchema,
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"workspace_member_id": "workspaceMemberId",
});
});
/** @internal */
exports.WorkspaceMemberAccess$outboundSchema = z.object({
workspaceMemberId: z.string(),
level: exports.Level$outboundSchema,
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
workspaceMemberId: "workspace_member_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var WorkspaceMemberAccess$;
(function (WorkspaceMemberAccess$) {
/** @deprecated use `WorkspaceMemberAccess$inboundSchema` instead. */
WorkspaceMemberAccess$.inboundSchema = exports.WorkspaceMemberAccess$inboundSchema;
/** @deprecated use `WorkspaceMemberAccess$outboundSchema` instead. */
WorkspaceMemberAccess$.outboundSchema = exports.WorkspaceMemberAccess$outboundSchema;
})(WorkspaceMemberAccess$ || (exports.WorkspaceMemberAccess$ = WorkspaceMemberAccess$ = {}));
function workspaceMemberAccessToJSON(workspaceMemberAccess) {
return JSON.stringify(exports.WorkspaceMemberAccess$outboundSchema.parse(workspaceMemberAccess));
}
function workspaceMemberAccessFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.WorkspaceMemberAccess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkspaceMemberAccess' from JSON`);
}
/** @internal */
exports.ListType$inboundSchema = z
.nativeEnum(exports.ListType);
/** @internal */
exports.ListType$outboundSchema = exports.ListType$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var ListType$;
(function (ListType$) {
/** @deprecated use `ListType$inboundSchema` instead. */
ListType$.inboundSchema = exports.ListType$inboundSchema;
/** @deprecated use `ListType$outboundSchema` instead. */
ListType$.outboundSchema = exports.ListType$outboundSchema;
})(ListType$ || (exports.ListType$ = ListType$ = {}));
/** @internal */
exports.ListCreatedByActor$inboundSchema = z.object({
id: z.nullable(z.string()).optional(),
type: z.nullable(exports.ListType$inboundSchema).optional(),
});
/** @internal */
exports.ListCreatedByActor$outboundSchema = z.object({
id: z.nullable(z.string()).optional(),
type: z.nullable(exports.ListType$outboundSchema).optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var ListCreatedByActor$;
(function (ListCreatedByActor$) {
/** @deprecated use `ListCreatedByActor$inboundSchema` instead. */
ListCreatedByActor$.inboundSchema = exports.ListCreatedByActor$inboundSchema;
/** @deprecated use `ListCreatedByActor$outboundSchema` instead. */
ListCreatedByActor$.outboundSchema = exports.ListCreatedByActor$outboundSchema;
})(ListCreatedByActor$ || (exports.ListCreatedByActor$ = ListCreatedByActor$ = {}));
function listCreatedByActorToJSON(listCreatedByActor) {
return JSON.stringify(exports.ListCreatedByActor$outboundSchema.parse(listCreatedByActor));
}
function listCreatedByActorFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListCreatedByActor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListCreatedByActor' from JSON`);
}
/** @internal */
exports.List$inboundSchema = z
.object({
id: z.lazy(() => exports.ListId$inboundSchema),
api_slug: z.string(),
name: z.string(),
parent_object: z.array(z.string()),
workspace_access: z.nullable(exports.WorkspaceAccess$inboundSchema),
workspace_member_access: z.array(z.lazy(() => exports.WorkspaceMemberAccess$inboundSchema)),
created_by_actor: z.lazy(() => exports.ListCreatedByActor$inboundSchema),
created_at: z.string(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"api_slug": "apiSlug",
"parent_object": "parentObject",
"workspace_access": "workspaceAccess",
"workspace_member_access": "workspaceMemberAccess",
"created_by_actor": "createdByActor",
"created_at": "createdAt",
});
});
/** @internal */
exports.List$outboundSchema = z.object({
id: z.lazy(() => exports.ListId$outboundSchema),
apiSlug: z.string(),
name: z.string(),
parentObject: z.array(z.string()),
workspaceAccess: z.nullable(exports.WorkspaceAccess$outboundSchema),
workspaceMemberAccess: z.array(z.lazy(() => exports.WorkspaceMemberAccess$outboundSchema)),
createdByActor: z.lazy(() => exports.ListCreatedByActor$outboundSchema),
createdAt: z.string(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
apiSlug: "api_slug",
parentObject: "parent_object",
workspaceAccess: "workspace_access",
workspaceMemberAccess: "workspace_member_access",
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 List$;
(function (List$) {
/** @deprecated use `List$inboundSchema` instead. */
List$.inboundSchema = exports.List$inboundSchema;
/** @deprecated use `List$outboundSchema` instead. */
List$.outboundSchema = exports.List$outboundSchema;
})(List$ || (exports.List$ = List$ = {}));
function listToJSON(list) {
return JSON.stringify(exports.List$outboundSchema.parse(list));
}
function listFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.List$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'List' from JSON`);
}
//# sourceMappingURL=list.js.map