contensis-management-api
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -14,3 +14,3 @@ import { Entry, EntryGetOptions, EntryListOptions, IEntryOperations, ContensisClient, WorkflowTrigger } from '../models'; | ||
updateAsset(asset: Entry, assetFilePath: string): Promise<Entry>; | ||
delete(id: string, languages?: string[]): Promise<void>; | ||
delete(id: string, languages?: string[], permanent?: boolean): Promise<void>; | ||
invokeWorkflow(entry: Entry, event: string, data?: any): Promise<Entry>; | ||
@@ -17,0 +17,0 @@ invokeWorkflowByTrigger(entry: Entry, workflowTrigger: WorkflowTrigger): Promise<Entry>; |
@@ -47,2 +47,3 @@ import { defaultMapperForLanguage, defaultMapperForLatestVersionStatus, UrlBuilder, isString, isBrowser, isIE } from 'contensis-core-api'; | ||
} | ||
// TODO: should query arg use ManagementQuery type from contensis-core-api? | ||
search(query) { | ||
@@ -56,5 +57,9 @@ if (!query) { | ||
let orderBy = (query.orderBy && (query.orderBy._items || query.orderBy)); | ||
let includeArchived = query.includeArchived ? true : null; | ||
let includeDeleted = query.includeDeleted ? true : null; | ||
let { clientType, clientDetails, projectId, language, responseHandler, rootUrl, versionStatus, ...requestParams } = params; | ||
let payload = { | ||
...requestParams, | ||
includeArchived, | ||
includeDeleted, | ||
pageSize, | ||
@@ -124,9 +129,13 @@ pageIndex, | ||
} | ||
delete(id, languages = null) { | ||
delete(id, languages = null, permanent = false) { | ||
if (!id) { | ||
throw new Error('A valid id needs to be specified.'); | ||
} | ||
let url = UrlBuilder.create('/api/management/projects/:projectId/entries/:id', { language: null }) | ||
let url = UrlBuilder.create('/api/management/projects/:projectId/entries/:id', { | ||
language: null, | ||
permanent: null, | ||
}) | ||
.addOptions(id, 'id') | ||
.addOptions(!!languages && languages.length > 0 ? languages.join(',') : null, 'language') | ||
.addOptions(permanent ? 'true' : null, 'permanent') | ||
.setParams(this.contensisClient.getParams()) | ||
@@ -133,0 +142,0 @@ .toUrl(); |
@@ -14,5 +14,5 @@ import { PagedList } from 'contensis-core-api'; | ||
updateAsset(asset: Entry, assetFilePath?: string): Promise<Entry>; | ||
delete(id: string, languages?: string[]): Promise<void>; | ||
delete(id: string, languages?: string[], permanent?: boolean): Promise<void>; | ||
invokeWorkflow(entry: Entry, event: string, data?: any): Promise<Entry>; | ||
invokeWorkflowByTrigger(entry: Entry, workflowTrigger: WorkflowTrigger): Promise<Entry>; | ||
} |
@@ -8,2 +8,10 @@ # Changelog | ||
## [2.0.5] - 2022-04-14 | ||
### Added | ||
- add new options for handling entries in recycle bin supported in Contensis 15.2 onwards | ||
- search query accepts new parameters *includeDeleted* and *includeArchived* | ||
- add new optional argument to delete entries *permanent* - default is false | ||
### Changed | ||
- updated @types/node package to be compatible with the installed TypeScript version | ||
## [2.0.4] - 2022-01-28 | ||
@@ -17,3 +25,3 @@ ### Added | ||
### Added | ||
- added aditional parameters to *freeText* | ||
- added additional parameters to *freeText* | ||
@@ -20,0 +28,0 @@ ## [2.0.2] - 2021-08-19 |
@@ -14,3 +14,3 @@ import { Entry, EntryGetOptions, EntryListOptions, IEntryOperations, ContensisClient, WorkflowTrigger } from '../models'; | ||
updateAsset(asset: Entry, assetFilePath: string): Promise<Entry>; | ||
delete(id: string, languages?: string[]): Promise<void>; | ||
delete(id: string, languages?: string[], permanent?: boolean): Promise<void>; | ||
invokeWorkflow(entry: Entry, event: string, data?: any): Promise<Entry>; | ||
@@ -17,0 +17,0 @@ invokeWorkflowByTrigger(entry: Entry, workflowTrigger: WorkflowTrigger): Promise<Entry>; |
@@ -50,2 +50,3 @@ "use strict"; | ||
} | ||
// TODO: should query arg use ManagementQuery type from contensis-core-api? | ||
search(query) { | ||
@@ -59,4 +60,8 @@ if (!query) { | ||
let orderBy = (query.orderBy && (query.orderBy._items || query.orderBy)); | ||
let includeArchived = query.includeArchived ? true : null; | ||
let includeDeleted = query.includeDeleted ? true : null; | ||
let { clientType, clientDetails, projectId, language, responseHandler, rootUrl, versionStatus } = params, requestParams = tslib_1.__rest(params, ["clientType", "clientDetails", "projectId", "language", "responseHandler", "rootUrl", "versionStatus"]); | ||
let payload = Object.assign({}, requestParams, { pageSize, | ||
let payload = Object.assign({}, requestParams, { includeArchived, | ||
includeDeleted, | ||
pageSize, | ||
pageIndex, where: JSON.stringify(query.where) }); | ||
@@ -123,9 +128,13 @@ if (orderBy && orderBy.length > 0) { | ||
} | ||
delete(id, languages = null) { | ||
delete(id, languages = null, permanent = false) { | ||
if (!id) { | ||
throw new Error('A valid id needs to be specified.'); | ||
} | ||
let url = contensis_core_api_1.UrlBuilder.create('/api/management/projects/:projectId/entries/:id', { language: null }) | ||
let url = contensis_core_api_1.UrlBuilder.create('/api/management/projects/:projectId/entries/:id', { | ||
language: null, | ||
permanent: null, | ||
}) | ||
.addOptions(id, 'id') | ||
.addOptions(!!languages && languages.length > 0 ? languages.join(',') : null, 'language') | ||
.addOptions(permanent ? 'true' : null, 'permanent') | ||
.setParams(this.contensisClient.getParams()) | ||
@@ -132,0 +141,0 @@ .toUrl(); |
@@ -14,5 +14,5 @@ import { PagedList } from 'contensis-core-api'; | ||
updateAsset(asset: Entry, assetFilePath?: string): Promise<Entry>; | ||
delete(id: string, languages?: string[]): Promise<void>; | ||
delete(id: string, languages?: string[], permanent?: boolean): Promise<void>; | ||
invokeWorkflow(entry: Entry, event: string, data?: any): Promise<Entry>; | ||
invokeWorkflowByTrigger(entry: Entry, workflowTrigger: WorkflowTrigger): Promise<Entry>; | ||
} |
{ | ||
"name": "contensis-management-api", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Contensis Javascript Management API", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=12" | ||
}, | ||
@@ -32,4 +32,4 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@types/jasmine": "^3.5.14", | ||
"@types/node": "^12.12.54", | ||
"@types/jasmine": "3.6.2", | ||
"@types/node": "14.14.20", | ||
"copy-webpack-plugin": "^6.4.0", | ||
@@ -73,2 +73,2 @@ "istanbul-instrumenter-loader": "^3.0.1", | ||
] | ||
} | ||
} |
@@ -62,2 +62,3 @@ import { | ||
// TODO: should query arg use ManagementQuery type from contensis-core-api? | ||
search(query: any): Promise<PagedList<Entry>> { | ||
@@ -74,2 +75,5 @@ if (!query) { | ||
let includeArchived = query.includeArchived ? true : null; | ||
let includeDeleted = query.includeDeleted ? true : null; | ||
let { clientType, clientDetails, projectId, language, responseHandler, rootUrl, versionStatus, ...requestParams } = params; | ||
@@ -79,2 +83,4 @@ | ||
...requestParams, | ||
includeArchived, | ||
includeDeleted, | ||
pageSize, | ||
@@ -160,3 +166,3 @@ pageIndex, | ||
delete(id: string, languages: string[] = null): Promise<void> { | ||
delete(id: string, languages: string[] = null, permanent = false): Promise<void> { | ||
if (!id) { | ||
@@ -167,5 +173,9 @@ throw new Error('A valid id needs to be specified.'); | ||
let url = UrlBuilder.create('/api/management/projects/:projectId/entries/:id', | ||
{ language: null }) | ||
{ | ||
language: null, | ||
permanent: null, | ||
}) | ||
.addOptions(id, 'id') | ||
.addOptions(!!languages && languages.length > 0 ? languages.join(',') : null, 'language') | ||
.addOptions(permanent ? 'true' : null, 'permanent') | ||
.setParams(this.contensisClient.getParams()) | ||
@@ -172,0 +182,0 @@ .toUrl(); |
@@ -10,2 +10,3 @@ import { PagedList } from 'contensis-core-api'; | ||
list(contentTypeIdOrOptions?: string | EntryListOptions): Promise<PagedList<Entry>>; | ||
// TODO: should query arg use ManagementQuery type from contensis-core-api? | ||
search(query: any): Promise<PagedList<Entry>>; | ||
@@ -16,5 +17,5 @@ create(entry: Entry): Promise<Entry>; | ||
updateAsset(asset: Entry, assetFilePath?: string): Promise<Entry>; | ||
delete(id: string, languages?: string[]): Promise<void>; | ||
delete(id: string, languages?: string[], permanent?: boolean): Promise<void>; | ||
invokeWorkflow(entry: Entry, event: string, data?: any): Promise<Entry>; | ||
invokeWorkflowByTrigger(entry: Entry, workflowTrigger: WorkflowTrigger): Promise<Entry>; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
706711
15213