contentful-management 12.0.0-beta.12 → 12.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contentful-management.bundle.browser.js +561 -499
- package/dist/contentful-management.bundle.browser.js.map +1 -1
- package/dist/contentful-management.bundle.browser.min.js +1 -1
- package/dist/contentful-management.bundle.browser.min.js.map +1 -1
- package/dist/contentful-management.bundle.node.cjs +350 -175
- package/dist/contentful-management.bundle.node.cjs.map +1 -1
- package/dist/esm/adapters/REST/endpoints/environment-template-installation.js +2 -2
- package/dist/esm/adapters/REST/endpoints/environment-template-installation.js.map +1 -1
- package/dist/esm/common-types.js.map +1 -1
- package/dist/esm/create-contentful-api.js +1 -1
- package/dist/esm/create-environment-template-api.js +3 -1
- package/dist/esm/create-environment-template-api.js.map +1 -1
- package/dist/esm/entities/environment-template-installation.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/plain/plain-client.js +1 -1
- package/dist/stats-browser-min.html +1 -1
- package/dist/types/adapters/REST/endpoints/environment-template-installation.js +2 -2
- package/dist/types/adapters/REST/endpoints/environment-template-installation.js.map +1 -1
- package/dist/types/common-types.d.ts +2 -0
- package/dist/types/common-types.js.map +1 -1
- package/dist/types/create-environment-template-api.d.ts +3 -1
- package/dist/types/create-environment-template-api.js +3 -1
- package/dist/types/create-environment-template-api.js.map +1 -1
- package/dist/types/entities/environment-template-installation.d.ts +1 -0
- package/dist/types/entities/environment-template-installation.js.map +1 -1
- package/dist/types/plain/common-types.d.ts +2 -0
- package/package.json +22 -26
|
@@ -89,6 +89,7 @@ export declare function createEnvironmentTemplateApi(makeRequest: MakeRequest, o
|
|
|
89
89
|
* Gets a collection of all installations for the environment template
|
|
90
90
|
* @param [installationParams.spaceId] - Space ID to filter installations by space and environment
|
|
91
91
|
* @param [installationParams.environmentId] - Environment ID to filter installations by space and environment
|
|
92
|
+
* @param [installationParams.latestOnly] - Boolean flag to only return the latest installation per environment
|
|
92
93
|
* @return Promise for a collection of EnvironmentTemplateInstallations
|
|
93
94
|
* ```javascript
|
|
94
95
|
* const contentful = require('contentful-management')
|
|
@@ -105,9 +106,10 @@ export declare function createEnvironmentTemplateApi(makeRequest: MakeRequest, o
|
|
|
105
106
|
* .catch(console.error)
|
|
106
107
|
* ```
|
|
107
108
|
*/
|
|
108
|
-
getInstallations: ({ spaceId, environmentId, ...query }?: {
|
|
109
|
+
getInstallations: ({ spaceId, environmentId, latestOnly, ...query }?: {
|
|
109
110
|
spaceId?: string;
|
|
110
111
|
environmentId?: string;
|
|
112
|
+
latestOnly?: boolean;
|
|
111
113
|
} & BasicCursorPaginationOptions) => Promise<import("./common-types.js").CursorPaginatedCollection<import("./entities/environment-template-installation.js").EnvironmentTemplateInstallation, import("./entities/environment-template-installation.js").EnvironmentTemplateInstallationProps>>;
|
|
112
114
|
/**
|
|
113
115
|
* Validates an environment template against a given space and environment
|
|
@@ -120,6 +120,7 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
|
|
|
120
120
|
* Gets a collection of all installations for the environment template
|
|
121
121
|
* @param [installationParams.spaceId] - Space ID to filter installations by space and environment
|
|
122
122
|
* @param [installationParams.environmentId] - Environment ID to filter installations by space and environment
|
|
123
|
+
* @param [installationParams.latestOnly] - Boolean flag to only return the latest installation per environment
|
|
123
124
|
* @return Promise for a collection of EnvironmentTemplateInstallations
|
|
124
125
|
* ```javascript
|
|
125
126
|
* const contentful = require('contentful-management')
|
|
@@ -136,7 +137,7 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
|
|
|
136
137
|
* .catch(console.error)
|
|
137
138
|
* ```
|
|
138
139
|
*/
|
|
139
|
-
getInstallations: function getEnvironmentTemplateInstallations({ spaceId, environmentId, ...query } = {}) {
|
|
140
|
+
getInstallations: function getEnvironmentTemplateInstallations({ spaceId, environmentId, latestOnly, ...query } = {}) {
|
|
140
141
|
const raw = this.toPlainObject();
|
|
141
142
|
return makeRequest({
|
|
142
143
|
entityType: 'EnvironmentTemplateInstallation',
|
|
@@ -147,6 +148,7 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
|
|
|
147
148
|
query: { ...createRequestConfig({ query }).params },
|
|
148
149
|
spaceId,
|
|
149
150
|
environmentId,
|
|
151
|
+
latestOnly,
|
|
150
152
|
},
|
|
151
153
|
}).then((data) => wrapEnvironmentTemplateInstallationCollection(makeRequest, data));
|
|
152
154
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-environment-template-api.js","sources":["../../../lib/create-environment-template-api.ts"],"sourcesContent":["import { createRequestConfig } from 'contentful-sdk-core'\nimport type { BasicCursorPaginationOptions, MakeRequest } from './common-types.js'\nimport {\n wrapEnvironmentTemplate,\n wrapEnvironmentTemplateCollection,\n type EnvironmentTemplateProps,\n} from './entities/environment-template.js'\nimport {\n wrapEnvironmentTemplateInstallationCollection,\n type CreateEnvironmentTemplateInstallationProps,\n type ValidateEnvironmentTemplateInstallationProps,\n} from './entities/environment-template-installation.js'\n\nexport type ContentfulEnvironmentTemplateApi = ReturnType<typeof createEnvironmentTemplateApi>\n\nexport function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizationId: string) {\n return {\n /**\n * Updates a environment template\n * @return Promise for new version of the template\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => {\n * environmentTemplate.name = 'New name'\n * return environmentTemplate.update()\n * })\n * .then((environmentTemplate) =>\n * console.log(`Environment template ${environmentTemplate.sys.id} renamed.`)\n * ).catch(console.error)\n * ```\n */\n update: function updateEnvironmentTemplate() {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'update',\n params: { organizationId, environmentTemplateId: raw.sys.id },\n payload: raw,\n }).then((data) => wrapEnvironmentTemplate(makeRequest, data, organizationId))\n },\n /**\n * Updates environment template version data\n * @param version.versionName - Name of the environment template version\n * @param version.versionDescription - Description of the environment template version\n * @return Promise for an updated EnvironmentTemplate\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => {\n * return environmentTemplate.updateVersion({\n * versionName: 'New Name',\n * versionDescription: 'New Description',\n * })\n * })\n * .then((environmentTemplate) =>\n * console.log(`Environment template version ${environmentTemplate.sys.id} renamed.`)\n * ).catch(console.error)\n * ```\n */\n updateVersion: function updateEnvironmentTemplateVersion({\n versionName,\n versionDescription,\n }: {\n versionName: string\n versionDescription: string\n }) {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'versionUpdate',\n params: { organizationId, environmentTemplateId: raw.sys.id, version: raw.sys.version },\n payload: { versionName, versionDescription },\n }).then((data) => wrapEnvironmentTemplate(makeRequest, data, organizationId))\n },\n /**\n * Deletes the environment template\n * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.\n * @example ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.delete())\n * .then(() => console.log('Environment template deleted.'))\n * .catch(console.error)\n * ```\n */\n delete: function deleteEnvironmentTemplate() {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'delete',\n params: { organizationId, environmentTemplateId: raw.sys.id },\n })\n },\n /**\n * Gets a collection of all versions for the environment template\n * @return Promise for a EnvironmentTemplate\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.getVersions())\n * .then((environmentTemplateVersions) => console.log(environmentTemplateVersions.items))\n * .catch(console.error)\n * ```\n */\n getVersions: function getEnvironmentTemplateVersions() {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'versions',\n params: {\n organizationId,\n environmentTemplateId: raw.sys.id,\n },\n }).then((data) => wrapEnvironmentTemplateCollection(makeRequest, data, organizationId))\n },\n /**\n * Gets a collection of all installations for the environment template\n * @param [installationParams.spaceId] - Space ID to filter installations by space and environment\n * @param [installationParams.environmentId] - Environment ID to filter installations by space and environment\n * @return Promise for a collection of EnvironmentTemplateInstallations\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.getInstallations())\n * .then((environmentTemplateInstallations) =>\n * console.log(environmentTemplateInstallations.items)\n * )\n * .catch(console.error)\n * ```\n */\n getInstallations: function getEnvironmentTemplateInstallations({\n spaceId,\n environmentId,\n ...query\n }: {\n spaceId?: string\n environmentId?: string\n } & BasicCursorPaginationOptions = {}) {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplateInstallation',\n action: 'getMany',\n params: {\n organizationId,\n environmentTemplateId: raw.sys.id,\n query: { ...createRequestConfig({ query }).params },\n spaceId,\n environmentId,\n },\n }).then((data) => wrapEnvironmentTemplateInstallationCollection(makeRequest, data))\n },\n /**\n * Validates an environment template against a given space and environment\n * @param params.spaceId - Space ID where the template should be installed into\n * @param params.environmentId - Environment ID where the template should be installed into\n * @param [params.version] - Version of the template\n * @param [params.installation.takeover] - Already existing Content types to takeover in the target environment\n * @param [params.changeSet] - Change set which should be applied\n * @return Promise for a EnvironmentTemplateValidation\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.validate({\n * spaceId: '<space_id>',\n * environmentId: '<environment_id>',\n * version: <version>,\n * }))\n * .then((validationResult) => console.log(validationResult))\n * .catch(console.error)\n * ```\n */\n validate: function validateEnvironmentTemplate({\n spaceId,\n environmentId,\n version,\n takeover,\n changeSet,\n }: {\n spaceId: string\n environmentId: string\n version?: number\n } & ValidateEnvironmentTemplateInstallationProps) {\n const raw: EnvironmentTemplateProps = this.toPlainObject()\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'validate',\n params: {\n spaceId,\n version,\n environmentId,\n environmentTemplateId: raw.sys.id,\n },\n payload: {\n ...(takeover && { takeover }),\n ...(changeSet && { changeSet }),\n },\n })\n },\n /**\n * Installs a template against a given space and environment\n * @param params.spaceId - Space ID where the template should be installed into\n * @param params.environmentId - Environment ID where the template should be installed into\n * @param params.installation.version- Template version which should be installed\n * @param [params.installation.takeover] - Already existing Content types tp takeover in the target environment\n * @param [params.changeSet] - Change set which should be applied\n * @return Promise for a EnvironmentTemplateInstallation\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.validate({\n * spaceId: '<space_id>',\n * environmentId: '<environment_id>',\n * installation: {\n * version: <version>,\n * }\n * }))\n * .then((installation) => console.log(installation))\n * .catch(console.error)\n * ```\n */\n install: function installEnvironmentTemplate({\n spaceId,\n environmentId,\n installation,\n }: {\n spaceId: string\n environmentId: string\n installation: CreateEnvironmentTemplateInstallationProps\n }) {\n const raw: EnvironmentTemplateProps = this.toPlainObject()\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'install',\n params: {\n spaceId,\n environmentId,\n environmentTemplateId: raw.sys.id,\n },\n payload: installation,\n })\n },\n /**\n * Disconnects the template from a given environment\n * @param params.spaceId - Space ID where the template should be installed into\n * @param params.environmentId - Environment ID where the template should be installed into\n * @return Promise for the disconnection with no data\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then(environmentTemplate) => environmentTemplate.disconnected())\n * .then(() => console.log('Template disconnected'))\n * .catch(console.error)\n * ```\n */\n disconnect: function disconnectEnvironmentTemplate({\n spaceId,\n environmentId,\n }: {\n spaceId: string\n environmentId: string\n }) {\n const raw: EnvironmentTemplateProps = this.toPlainObject()\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'disconnect',\n params: {\n spaceId,\n environmentId,\n environmentTemplateId: raw.sys.id,\n },\n })\n },\n }\n}\n"],"names":[],"mappings":";;;;AAeM,SAAU,4BAA4B,CAAC,WAAwB,EAAE,cAAsB,EAAA;IAC3F,OAAO;AACL;;;;;;;;;;;;;;;;;;;AAmBG;QACH,MAAM,EAAE,SAAS,yBAAyB,GAAA;AACxC,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,EAA8B;AAC5D,YAAA,OAAO,WAAW,CAAC;AACjB,gBAAA,UAAU,EAAE,qBAAqB;AACjC,gBAAA,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,EAAE,cAAc,EAAE,qBAAqB,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE;AAC7D,gBAAA,OAAO,EAAE,GAAG;AACb,aAAA,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,uBAAuB,CAAC,WAAW,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QAC/E,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;AAuBG;QACH,aAAa,EAAE,SAAS,gCAAgC,CAAC,EACvD,WAAW,EACX,kBAAkB,GAInB,EAAA;AACC,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,E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;;;;;;;;;;;;;;;;;;;;AA0BG;QACH,OAAO,EAAE,SAAS,0BAA0B,CAAC,EAC3C,OAAO,EACP,aAAa,EACb,YAAY,GAKb,EAAA;AACC,YAAA,MAAM,GAAG,GAA6B,IAAI,CAAC,aAAa,EAAE;AAC1D,YAAA,OAAO,WAAW,CAAC;AACjB,gBAAA,UAAU,EAAE,qBAAqB;AACjC,gBAAA,MAAM,EAAE,SAAS;AACjB,gBAAA,MAAM,EAAE;oBACN,OAAO;oBACP,aAAa;AACb,oBAAA,qBAAqB,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;AAClC,iBAAA;AACD,gBAAA,OAAO,EAAE,YAAY;AACtB,aAAA,CAAC;QACJ,CAAC;AACD;;;;;;;;;;;;;;;;;AAiBG;QACH,UAAU,EAAE,SAAS,6BAA6B,CAAC,EACjD,OAAO,EACP,aAAa,GAId,EAAA;AACC,YAAA,MAAM,GAAG,GAA6B,IAAI,CAAC,aAAa,EAAE;AAC1D,YAAA,OAAO,WAAW,CAAC;AACjB,gBAAA,UAAU,EAAE,qBAAqB;AACjC,gBAAA,MAAM,EAAE,YAAY;AACpB,gBAAA,MAAM,EAAE;oBACN,OAAO;oBACP,aAAa;AACb,oBAAA,qBAAqB,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;AAClC,iBAAA;AACF,aAAA,CAAC;QACJ,CAAC;KACF;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"create-environment-template-api.js","sources":["../../../lib/create-environment-template-api.ts"],"sourcesContent":["import { createRequestConfig } from 'contentful-sdk-core'\nimport type { BasicCursorPaginationOptions, MakeRequest } from './common-types.js'\nimport {\n wrapEnvironmentTemplate,\n wrapEnvironmentTemplateCollection,\n type EnvironmentTemplateProps,\n} from './entities/environment-template.js'\nimport {\n wrapEnvironmentTemplateInstallationCollection,\n type CreateEnvironmentTemplateInstallationProps,\n type ValidateEnvironmentTemplateInstallationProps,\n} from './entities/environment-template-installation.js'\n\nexport type ContentfulEnvironmentTemplateApi = ReturnType<typeof createEnvironmentTemplateApi>\n\nexport function createEnvironmentTemplateApi(makeRequest: MakeRequest, organizationId: string) {\n return {\n /**\n * Updates a environment template\n * @return Promise for new version of the template\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => {\n * environmentTemplate.name = 'New name'\n * return environmentTemplate.update()\n * })\n * .then((environmentTemplate) =>\n * console.log(`Environment template ${environmentTemplate.sys.id} renamed.`)\n * ).catch(console.error)\n * ```\n */\n update: function updateEnvironmentTemplate() {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'update',\n params: { organizationId, environmentTemplateId: raw.sys.id },\n payload: raw,\n }).then((data) => wrapEnvironmentTemplate(makeRequest, data, organizationId))\n },\n /**\n * Updates environment template version data\n * @param version.versionName - Name of the environment template version\n * @param version.versionDescription - Description of the environment template version\n * @return Promise for an updated EnvironmentTemplate\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => {\n * return environmentTemplate.updateVersion({\n * versionName: 'New Name',\n * versionDescription: 'New Description',\n * })\n * })\n * .then((environmentTemplate) =>\n * console.log(`Environment template version ${environmentTemplate.sys.id} renamed.`)\n * ).catch(console.error)\n * ```\n */\n updateVersion: function updateEnvironmentTemplateVersion({\n versionName,\n versionDescription,\n }: {\n versionName: string\n versionDescription: string\n }) {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'versionUpdate',\n params: { organizationId, environmentTemplateId: raw.sys.id, version: raw.sys.version },\n payload: { versionName, versionDescription },\n }).then((data) => wrapEnvironmentTemplate(makeRequest, data, organizationId))\n },\n /**\n * Deletes the environment template\n * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.\n * @example ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.delete())\n * .then(() => console.log('Environment template deleted.'))\n * .catch(console.error)\n * ```\n */\n delete: function deleteEnvironmentTemplate() {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'delete',\n params: { organizationId, environmentTemplateId: raw.sys.id },\n })\n },\n /**\n * Gets a collection of all versions for the environment template\n * @return Promise for a EnvironmentTemplate\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.getVersions())\n * .then((environmentTemplateVersions) => console.log(environmentTemplateVersions.items))\n * .catch(console.error)\n * ```\n */\n getVersions: function getEnvironmentTemplateVersions() {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'versions',\n params: {\n organizationId,\n environmentTemplateId: raw.sys.id,\n },\n }).then((data) => wrapEnvironmentTemplateCollection(makeRequest, data, organizationId))\n },\n /**\n * Gets a collection of all installations for the environment template\n * @param [installationParams.spaceId] - Space ID to filter installations by space and environment\n * @param [installationParams.environmentId] - Environment ID to filter installations by space and environment\n * @param [installationParams.latestOnly] - Boolean flag to only return the latest installation per environment\n * @return Promise for a collection of EnvironmentTemplateInstallations\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.getInstallations())\n * .then((environmentTemplateInstallations) =>\n * console.log(environmentTemplateInstallations.items)\n * )\n * .catch(console.error)\n * ```\n */\n getInstallations: function getEnvironmentTemplateInstallations({\n spaceId,\n environmentId,\n latestOnly,\n ...query\n }: {\n spaceId?: string\n environmentId?: string\n latestOnly?: boolean\n } & BasicCursorPaginationOptions = {}) {\n const raw = this.toPlainObject() as EnvironmentTemplateProps\n return makeRequest({\n entityType: 'EnvironmentTemplateInstallation',\n action: 'getMany',\n params: {\n organizationId,\n environmentTemplateId: raw.sys.id,\n query: { ...createRequestConfig({ query }).params },\n spaceId,\n environmentId,\n latestOnly,\n },\n }).then((data) => wrapEnvironmentTemplateInstallationCollection(makeRequest, data))\n },\n /**\n * Validates an environment template against a given space and environment\n * @param params.spaceId - Space ID where the template should be installed into\n * @param params.environmentId - Environment ID where the template should be installed into\n * @param [params.version] - Version of the template\n * @param [params.installation.takeover] - Already existing Content types to takeover in the target environment\n * @param [params.changeSet] - Change set which should be applied\n * @return Promise for a EnvironmentTemplateValidation\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.validate({\n * spaceId: '<space_id>',\n * environmentId: '<environment_id>',\n * version: <version>,\n * }))\n * .then((validationResult) => console.log(validationResult))\n * .catch(console.error)\n * ```\n */\n validate: function validateEnvironmentTemplate({\n spaceId,\n environmentId,\n version,\n takeover,\n changeSet,\n }: {\n spaceId: string\n environmentId: string\n version?: number\n } & ValidateEnvironmentTemplateInstallationProps) {\n const raw: EnvironmentTemplateProps = this.toPlainObject()\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'validate',\n params: {\n spaceId,\n version,\n environmentId,\n environmentTemplateId: raw.sys.id,\n },\n payload: {\n ...(takeover && { takeover }),\n ...(changeSet && { changeSet }),\n },\n })\n },\n /**\n * Installs a template against a given space and environment\n * @param params.spaceId - Space ID where the template should be installed into\n * @param params.environmentId - Environment ID where the template should be installed into\n * @param params.installation.version- Template version which should be installed\n * @param [params.installation.takeover] - Already existing Content types tp takeover in the target environment\n * @param [params.changeSet] - Change set which should be applied\n * @return Promise for a EnvironmentTemplateInstallation\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then((environmentTemplate) => environmentTemplate.validate({\n * spaceId: '<space_id>',\n * environmentId: '<environment_id>',\n * installation: {\n * version: <version>,\n * }\n * }))\n * .then((installation) => console.log(installation))\n * .catch(console.error)\n * ```\n */\n install: function installEnvironmentTemplate({\n spaceId,\n environmentId,\n installation,\n }: {\n spaceId: string\n environmentId: string\n installation: CreateEnvironmentTemplateInstallationProps\n }) {\n const raw: EnvironmentTemplateProps = this.toPlainObject()\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'install',\n params: {\n spaceId,\n environmentId,\n environmentTemplateId: raw.sys.id,\n },\n payload: installation,\n })\n },\n /**\n * Disconnects the template from a given environment\n * @param params.spaceId - Space ID where the template should be installed into\n * @param params.environmentId - Environment ID where the template should be installed into\n * @return Promise for the disconnection with no data\n * ```javascript\n * const contentful = require('contentful-management')\n *\n * const client = contentful.createClient({\n * accessToken: '<content_management_api_key>'\n * })\n *\n * client.getEnvironmentTemplate('<organization_id>', '<environment_template_id>')\n * .then(environmentTemplate) => environmentTemplate.disconnected())\n * .then(() => console.log('Template disconnected'))\n * .catch(console.error)\n * ```\n */\n disconnect: function disconnectEnvironmentTemplate({\n spaceId,\n environmentId,\n }: {\n spaceId: string\n environmentId: string\n }) {\n const raw: EnvironmentTemplateProps = this.toPlainObject()\n return makeRequest({\n entityType: 'EnvironmentTemplate',\n action: 'disconnect',\n params: {\n spaceId,\n environmentId,\n environmentTemplateId: raw.sys.id,\n },\n })\n },\n }\n}\n"],"names":[],"mappings":";;;;AAeM,SAAU,4BAA4B,CAAC,WAAwB,EAAE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MAAM,GAAG,GAA6B,IAAI,CAAC,aAAa,EAAE;AAC1D,YAAA,OAAO,WAAW,CAAC;AACjB,gBAAA,UAAU,EAAE,qBAAqB;AACjC,gBAAA,MAAM,EAAE,YAAY;AACpB,gBAAA,MAAM,EAAE;oBACN,OAAO;oBACP,aAAa;AACb,oBAAA,qBAAqB,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;AAClC,iBAAA;AACF,aAAA,CAAC;QACJ,CAAC;KACF;AACH;;;;"}
|
|
@@ -35,6 +35,7 @@ export type CreateEnvironmentTemplateInstallationProps = {
|
|
|
35
35
|
items: Link<'ContentType'>[];
|
|
36
36
|
};
|
|
37
37
|
changeSet?: Link<'ChangeSet'>;
|
|
38
|
+
deleteDeletedFields?: boolean;
|
|
38
39
|
};
|
|
39
40
|
export type ValidateEnvironmentTemplateInstallationProps = Omit<CreateEnvironmentTemplateInstallationProps, 'version'>;
|
|
40
41
|
export type ValidationFinding = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-template-installation.js","sources":["../../../../lib/entities/environment-template-installation.ts"],"sourcesContent":["import { freezeSys, toPlainObject } from 'contentful-sdk-core'\nimport copy from 'fast-copy'\nimport type {\n BasicMetaSysProps,\n DefaultElements,\n ISO8601Timestamp,\n Link,\n MakeRequest,\n VersionedLink,\n} from '../common-types.js'\nimport { wrapCursorPaginatedCollection } from '../common-utils.js'\n\ntype JsonObject = { [Key in string]?: JsonValue }\ntype JsonArray = Array<JsonValue>\ntype JsonValue = string | number | boolean | JsonObject | JsonArray | null\n\nenum EnvironmentTemplateInstallationStatuses {\n created = 'created',\n inProgress = 'inProgress',\n failed = 'failed',\n succeeded = 'succeeded',\n disconnected = 'disconnected',\n inRetry = 'inRetry',\n}\n\nexport type EnvironmentTemplateInstallationStatus =\n keyof typeof EnvironmentTemplateInstallationStatuses\n\nexport type EnvironmentTemplateInstallationProps = {\n sys: BasicMetaSysProps & {\n type: 'EnvironmentTemplateInstallation'\n space: Link<'Space'>\n template: VersionedLink<'Template'>\n status: EnvironmentTemplateInstallationStatus\n createdAt: ISO8601Timestamp\n updatedAt: ISO8601Timestamp\n createdBy: Link<'User' | 'AppDefinition'>\n updatedBy: Link<'User' | 'AppDefinition'>\n completedAt?: ISO8601Timestamp\n errors?: JsonArray\n environment: Link<'Environment'>\n version: number\n }\n}\n\nexport type CreateEnvironmentTemplateInstallationProps = {\n version: number\n takeover?: {\n items: Link<'ContentType'>[]\n }\n changeSet?: Link<'ChangeSet'>\n}\n\nexport type ValidateEnvironmentTemplateInstallationProps = Omit<\n CreateEnvironmentTemplateInstallationProps,\n 'version'\n>\n\nexport type ValidationFinding = {\n message: string\n details: Record<string, unknown>\n}\n\nexport type EnvironmentTemplateValidationProps<T = ValidationFinding> = {\n sys: {\n type: 'Array'\n environment: Link<'Environment'>\n space: Link<'Space'>\n changeSet: Link<'ChangeSet'>\n }\n items: T[]\n}\n\nexport type EnvironmentTemplateInstallation = EnvironmentTemplateInstallationProps &\n DefaultElements<EnvironmentTemplateInstallationProps>\n\nexport function wrapEnvironmentTemplateInstallation(\n makeRequest: MakeRequest,\n data: EnvironmentTemplateInstallationProps,\n): EnvironmentTemplateInstallation {\n const environmentTemplate = toPlainObject(copy(data))\n return freezeSys(environmentTemplate)\n}\n\nexport const wrapEnvironmentTemplateInstallationCollection = wrapCursorPaginatedCollection(\n wrapEnvironmentTemplateInstallation,\n)\n"],"names":[],"mappings":";;;;AAgBA,IAAK,uCAOJ;AAPD,CAAA,UAAK,uCAAuC,EAAA;AAC1C,IAAA,uCAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,uCAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,uCAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,uCAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,uCAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7B,IAAA,uCAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAPI,uCAAuC,KAAvC,uCAAuC,GAAA,EAAA,CAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"environment-template-installation.js","sources":["../../../../lib/entities/environment-template-installation.ts"],"sourcesContent":["import { freezeSys, toPlainObject } from 'contentful-sdk-core'\nimport copy from 'fast-copy'\nimport type {\n BasicMetaSysProps,\n DefaultElements,\n ISO8601Timestamp,\n Link,\n MakeRequest,\n VersionedLink,\n} from '../common-types.js'\nimport { wrapCursorPaginatedCollection } from '../common-utils.js'\n\ntype JsonObject = { [Key in string]?: JsonValue }\ntype JsonArray = Array<JsonValue>\ntype JsonValue = string | number | boolean | JsonObject | JsonArray | null\n\nenum EnvironmentTemplateInstallationStatuses {\n created = 'created',\n inProgress = 'inProgress',\n failed = 'failed',\n succeeded = 'succeeded',\n disconnected = 'disconnected',\n inRetry = 'inRetry',\n}\n\nexport type EnvironmentTemplateInstallationStatus =\n keyof typeof EnvironmentTemplateInstallationStatuses\n\nexport type EnvironmentTemplateInstallationProps = {\n sys: BasicMetaSysProps & {\n type: 'EnvironmentTemplateInstallation'\n space: Link<'Space'>\n template: VersionedLink<'Template'>\n status: EnvironmentTemplateInstallationStatus\n createdAt: ISO8601Timestamp\n updatedAt: ISO8601Timestamp\n createdBy: Link<'User' | 'AppDefinition'>\n updatedBy: Link<'User' | 'AppDefinition'>\n completedAt?: ISO8601Timestamp\n errors?: JsonArray\n environment: Link<'Environment'>\n version: number\n }\n}\n\nexport type CreateEnvironmentTemplateInstallationProps = {\n version: number\n takeover?: {\n items: Link<'ContentType'>[]\n }\n changeSet?: Link<'ChangeSet'>\n deleteDeletedFields?: boolean\n}\n\nexport type ValidateEnvironmentTemplateInstallationProps = Omit<\n CreateEnvironmentTemplateInstallationProps,\n 'version'\n>\n\nexport type ValidationFinding = {\n message: string\n details: Record<string, unknown>\n}\n\nexport type EnvironmentTemplateValidationProps<T = ValidationFinding> = {\n sys: {\n type: 'Array'\n environment: Link<'Environment'>\n space: Link<'Space'>\n changeSet: Link<'ChangeSet'>\n }\n items: T[]\n}\n\nexport type EnvironmentTemplateInstallation = EnvironmentTemplateInstallationProps &\n DefaultElements<EnvironmentTemplateInstallationProps>\n\nexport function wrapEnvironmentTemplateInstallation(\n makeRequest: MakeRequest,\n data: EnvironmentTemplateInstallationProps,\n): EnvironmentTemplateInstallation {\n const environmentTemplate = toPlainObject(copy(data))\n return freezeSys(environmentTemplate)\n}\n\nexport const wrapEnvironmentTemplateInstallationCollection = wrapCursorPaginatedCollection(\n wrapEnvironmentTemplateInstallation,\n)\n"],"names":[],"mappings":";;;;AAgBA,IAAK,uCAOJ;AAPD,CAAA,UAAK,uCAAuC,EAAA;AAC1C,IAAA,uCAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,uCAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,uCAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,uCAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,uCAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7B,IAAA,uCAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAPI,uCAAuC,KAAvC,uCAAuC,GAAA,EAAA,CAAA,CAAA;AA6DtC,SAAU,mCAAmC,CACjD,WAAwB,EACxB,IAA0C,EAAA;IAE1C,MAAM,mBAAmB,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,IAAA,OAAO,SAAS,CAAC,mBAAmB,CAAC;AACvC;MAEa,6CAA6C,GAAG,6BAA6B,CACxF,mCAAmC;;;;"}
|
|
@@ -120,6 +120,7 @@ export type PlainClientAPI = {
|
|
|
120
120
|
versions(params: GetEnvironmentTemplateParams & {
|
|
121
121
|
query?: BasicCursorPaginationOptions & {
|
|
122
122
|
select?: string;
|
|
123
|
+
installable?: boolean;
|
|
123
124
|
};
|
|
124
125
|
}, headers?: RawAxiosRequestHeaders): Promise<CursorPaginatedCollectionProp<EnvironmentTemplateProps>>;
|
|
125
126
|
validate(params: EnvironmentTemplateParams & {
|
|
@@ -134,6 +135,7 @@ export type PlainClientAPI = {
|
|
|
134
135
|
environmentTemplateId: string;
|
|
135
136
|
organizationId: string;
|
|
136
137
|
spaceId?: string;
|
|
138
|
+
latestOnly?: boolean;
|
|
137
139
|
}, headers?: RawAxiosRequestHeaders): Promise<CursorPaginatedCollectionProp<EnvironmentTemplateInstallationProps>>;
|
|
138
140
|
getForEnvironment(params: BasicCursorPaginationOptions & EnvironmentTemplateParams & {
|
|
139
141
|
installationId?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentful-management",
|
|
3
|
-
"version": "12.0.0-beta.
|
|
3
|
+
"version": "12.0.0-beta.13",
|
|
4
4
|
"description": "Client for Contentful's Content Management API",
|
|
5
5
|
"homepage": "https://www.contentful.com/developers/documentation/content-management-api/",
|
|
6
6
|
"type": "module",
|
|
@@ -76,58 +76,54 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@contentful/rich-text-types": "^16.6.1",
|
|
78
78
|
"axios": "^1.12.2",
|
|
79
|
-
"contentful-sdk-core": "10.0.0-beta.
|
|
80
|
-
"fast-copy": "^3.0.
|
|
79
|
+
"contentful-sdk-core": "10.0.0-beta.6",
|
|
80
|
+
"fast-copy": "^3.0.2",
|
|
81
81
|
"json-patch": "^0.7.0",
|
|
82
82
|
"type-fest": "^5.1.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
86
|
-
"@babel/preset-env": "^7.
|
|
85
|
+
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
86
|
+
"@babel/preset-env": "^7.28.5",
|
|
87
87
|
"@contentful/integration-test-utils": "^2.0.1",
|
|
88
|
-
"@eslint/js": "^9.
|
|
89
|
-
"@playwright/test": "^1.
|
|
88
|
+
"@eslint/js": "^9.38.0",
|
|
89
|
+
"@playwright/test": "^1.56.1",
|
|
90
90
|
"@rollup/plugin-alias": "^5.1.1",
|
|
91
91
|
"@rollup/plugin-babel": "^6.1.0",
|
|
92
|
-
"@rollup/plugin-commonjs": "^28.0.
|
|
92
|
+
"@rollup/plugin-commonjs": "^28.0.9",
|
|
93
93
|
"@rollup/plugin-json": "^6.1.0",
|
|
94
94
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
95
95
|
"@rollup/plugin-replace": "^6.0.2",
|
|
96
96
|
"@rollup/plugin-terser": "^0.4.4",
|
|
97
|
-
"@rollup/plugin-typescript": "^12.
|
|
98
|
-
"@semantic-release/changelog": "^6.0.
|
|
99
|
-
"@size-limit/file": "^11.
|
|
97
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
98
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
99
|
+
"@size-limit/file": "^11.2.0",
|
|
100
100
|
"@types/json-patch": "^0.0.33",
|
|
101
|
-
"@types/lodash": "^4.
|
|
101
|
+
"@types/lodash-es": "^4.17.12",
|
|
102
102
|
"@types/node": "^20.12.13",
|
|
103
103
|
"@vitest/browser": "^2.1.8",
|
|
104
104
|
"@vitest/coverage-v8": "^2.1.8",
|
|
105
|
-
"
|
|
106
|
-
"babel-plugin-inline-replace-variables": "^1.3.1",
|
|
107
|
-
"contentful-sdk-jsdoc": "3.1.0",
|
|
105
|
+
"contentful-sdk-jsdoc": "3.1.5",
|
|
108
106
|
"cz-conventional-changelog": "^3.3.0",
|
|
109
107
|
"es-check": "^7.2.1",
|
|
110
|
-
"eslint": "^9.
|
|
108
|
+
"eslint": "^9.38.0",
|
|
111
109
|
"globals": "^16.4.0",
|
|
112
110
|
"husky": "^9.1.7",
|
|
113
|
-
"in-publish": "^2.0.1",
|
|
114
111
|
"jsonwebtoken": "^9.0.2",
|
|
115
112
|
"lint-staged": "^15.2.5",
|
|
116
|
-
"lodash": "^4.17.21",
|
|
117
|
-
"nodemon": "^3.1.
|
|
118
|
-
"playwright": "^1.
|
|
113
|
+
"lodash-es": "^4.17.21",
|
|
114
|
+
"nodemon": "^3.1.10",
|
|
115
|
+
"playwright": "^1.56.1",
|
|
119
116
|
"prettier": "^3.6.2",
|
|
120
117
|
"process": "^0.11.10",
|
|
121
|
-
"puppeteer": "^24.4.0",
|
|
122
118
|
"rimraf": "^5.0.0",
|
|
123
|
-
"rollup": "^4.52.
|
|
119
|
+
"rollup": "^4.52.5",
|
|
124
120
|
"rollup-plugin-sourcemaps2": "^0.5.4",
|
|
125
121
|
"rollup-plugin-visualizer": "^5.14.0",
|
|
126
122
|
"semantic-release": "^22.0.12",
|
|
127
|
-
"size-limit": "^11.
|
|
128
|
-
"typedoc": "^0.
|
|
129
|
-
"typescript": "^5.
|
|
130
|
-
"typescript-eslint": "^8.
|
|
123
|
+
"size-limit": "^11.2.0",
|
|
124
|
+
"typedoc": "^0.28.14",
|
|
125
|
+
"typescript": "^5.9.3",
|
|
126
|
+
"typescript-eslint": "^8.46.2",
|
|
131
127
|
"vitest": "^2.1.8"
|
|
132
128
|
},
|
|
133
129
|
"config": {
|