UNPKG

@datocms/cma-client

Version:
426 lines 15.3 kB
"use strict"; 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 (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Utils = __importStar(require("@datocms/rest-client-utils")); const BaseResource_1 = __importDefault(require("../../BaseResource")); class Site extends BaseResource_1.default { /** * Retrieve the site * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/self * * @throws {ApiError} * @throws {TimeoutError} */ find(queryParams) { return this.rawFind(queryParams).then((body) => Utils.deserializeResponseBody(body)); } /** * Retrieve the site * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/self * * @throws {ApiError} * @throws {TimeoutError} */ rawFind(queryParams) { return this.client.request({ method: 'GET', url: '/site', queryParams, }); } /** * Update the site's settings * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/update * * @throws {ApiError} * @throws {TimeoutError} */ update(body) { return this.rawUpdate(Utils.serializeRequestBody(body, { type: 'site', attributes: [ 'no_index', 'favicon', 'global_seo', 'name', 'theme', 'locales', 'timezone', 'require_2fa', 'ip_tracking_enabled', 'force_use_of_sandbox_environments', ], relationships: ['sso_default_role'], })).then((body) => Utils.deserializeResponseBody(body)); } /** * Update the site's settings * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/update * * @throws {ApiError} * @throws {TimeoutError} */ rawUpdate(body) { return this.client.request({ method: 'PUT', url: '/site', body, }); } /** * Activate improved timezone management * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_timezone_management * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateImprovedTimezoneManagement() { return this.rawActivateImprovedTimezoneManagement().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate improved timezone management * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_timezone_management * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateImprovedTimezoneManagement() { return this.client.request({ method: 'PUT', url: '/site/activate-improved-timezone-management', }); } /** * Activate improved hex management * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_hex_management * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateImprovedHexManagement() { return this.rawActivateImprovedHexManagement().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate improved hex management * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_hex_management * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateImprovedHexManagement() { return this.client.request({ method: 'PUT', url: '/site/activate-improved-hex-management', }); } /** * Activate improved GraphQL multi-locale fields option * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_gql_multilocale_fields * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateImprovedGqlMultilocaleFields() { return this.rawActivateImprovedGqlMultilocaleFields().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate improved GraphQL multi-locale fields option * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_gql_multilocale_fields * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateImprovedGqlMultilocaleFields() { return this.client.request({ method: 'PUT', url: '/site/activate-improved-gql-multilocale-fields', }); } /** * Activate improved GraphQL visibility control option * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_gql_visibility_control * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateImprovedGqlVisibilityControl() { return this.rawActivateImprovedGqlVisibilityControl().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate improved GraphQL visibility control option * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_gql_visibility_control * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateImprovedGqlVisibilityControl() { return this.client.request({ method: 'PUT', url: '/site/activate-improved-gql-visibility-control', }); } /** * Activate improved Boolean fields option * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_boolean_fields * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateImprovedBooleanFields() { return this.rawActivateImprovedBooleanFields().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate improved Boolean fields option * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_boolean_fields * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateImprovedBooleanFields() { return this.client.request({ method: 'PUT', url: '/site/activate-improved-boolean-fields', }); } /** * Set draft mode default to true for all environment's models * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_draft_mode_as_default * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateDraftModeAsDefault() { return this.rawActivateDraftModeAsDefault().then((body) => Utils.deserializeResponseBody(body)); } /** * Set draft mode default to true for all environment's models * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_draft_mode_as_default * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateDraftModeAsDefault() { return this.client.request({ method: 'PUT', url: '/site/activate-draft-mode-as-default', }); } /** * Activate improved validation at publishing option * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_validation_at_publishing * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateImprovedValidationAtPublishing() { return this.rawActivateImprovedValidationAtPublishing().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate improved validation at publishing option * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_validation_at_publishing * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateImprovedValidationAtPublishing() { return this.client.request({ method: 'PUT', url: '/site/activate-improved-validation-at-publishing', }); } /** * Activate having two different GraphQL fields for regular blocks and inline blocks * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_exposure_of_inline_blocks_in_cda * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateImprovedExposureOfInlineBlocksInCda() { return this.rawActivateImprovedExposureOfInlineBlocksInCda().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate having two different GraphQL fields for regular blocks and inline blocks * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_exposure_of_inline_blocks_in_cda * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateImprovedExposureOfInlineBlocksInCda() { return this.client.request({ method: 'PUT', url: '/site/activate-improved-exposure-of-inline-blocks-in-cda', }); } /** * Activate improved items listing * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_items_listing * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateImprovedItemsListing() { return this.rawActivateImprovedItemsListing().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate improved items listing * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_improved_items_listing * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateImprovedItemsListing() { return this.client.request({ method: 'PUT', url: '/site/activate-improved-items-listing', }); } /** * Activate milliseconds in datetime * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_milliseconds_in_datetime * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ activateMillisecondsInDatetime() { return this.rawActivateMillisecondsInDatetime().then((body) => Utils.deserializeResponseBody(body)); } /** * Activate milliseconds in datetime * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/activate_milliseconds_in_datetime * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawActivateMillisecondsInDatetime() { return this.client.request({ method: 'PUT', url: '/site/activate-milliseconds-in-datetime', }); } /** * Update CDN settings default assets * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/update_assets_cdn_default_settings * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ updateAssetsCdnDefaultSettings(body) { return this.rawUpdateAssetsCdnDefaultSettings(Utils.serializeRequestBody(body, { type: 'assets-cdn-default-settings', attributes: ['assets_cdn_default_settings'], relationships: [], })).then((body) => Utils.deserializeResponseBody(body)); } /** * Update CDN settings default assets * * Read more: https://www.datocms.com/docs/content-management-api/resources/site/update_assets_cdn_default_settings * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawUpdateAssetsCdnDefaultSettings(body) { return this.client.request({ method: 'PUT', url: '/site/assets-cdn-default-settings', body, }); } } exports.default = Site; Site.TYPE = 'site'; //# sourceMappingURL=Site.js.map