From ea2c0ce229c04aafd205f02907bb6d26a3ce3c53 Mon Sep 17 00:00:00 2001 From: Denys Vuika <denys.vuika@gmail.com> Date: Tue, 21 Nov 2023 10:27:51 +0000 Subject: [PATCH] [PRODENG-211] integrate JS-API with monorepo (part 1) (#9081) * integrate JS-API with monorepo * [ci:force] fix token issue [ci:force] migrate docs folder [ci:force] clean personal tokens * [ci:force] gha workflow support * [ci:force] npm publish target * fix js-api test linting * [ci:force] fix test linting, mocks, https scheme * [ci:force] fix https scheme * [ci:force] typescript mappings * [ci:force] update scripts * lint fixes * linting fixes * fix linting * [ci:force] linting fixes * linting fixes * [ci:force] remove js-api upstream and corresponding scripts * [ci:force] jsdoc fixes * fix jsdoc linting * [ci:force] jsdoc fixes * [ci:force] jsdoc fixes * jsdoc fixes * jsdoc fixes * jsdoc fixes * [ci:force] fix jsdoc * [ci:force] reduce code duplication * replace 'chai' expect with node.js assert * replace 'chai' expect with node.js assert * [ci:force] remove chai and chai-spies for js-api testing * [ci:force] cleanup and fix imports * [ci:force] fix linting * [ci:force] fix unit test * [ci:force] fix sonar linting findings * [ci:force] switch activiti api models to interfaces (-2.5% reduction of bundle) * [ci:force] switch activiti api models to interfaces * [ci:force] switch AGS api models to interfaces * [ci:force] switch AGS api models to interfaces * [ci:force] switch search api models to interfaces * [ci:force] switch content api models to interfaces where applicable --- .eslintignore | 11 + .eslintrc.json | 188 --- .github/workflows/pull-request.yml | 12 +- .github/workflows/upstream-js.yml | 214 --- angular.json | 53 + cspell.json | 2 +- .../tasks/task-filters-sorting.e2e.ts | 33 +- .../src/lib/audit/audit.service.ts | 4 +- .../services/category.service.spec.ts | 34 +- .../lib/category/services/category.service.ts | 43 +- ...tent-node-selector-panel.component.spec.ts | 13 +- .../download-zip/download-zip.dialog.ts | 10 +- .../mock/download-zip-service.mock.ts | 17 +- .../src/lib/dialogs/node-lock.dialog.ts | 12 +- .../services/custom-resources.service.ts | 233 ++- .../search-config-permission.service.ts | 4 +- .../user-name-column.component.ts | 6 +- .../permission-manager/models/member.model.ts | 6 +- .../models/permission.model.ts | 3 +- .../services/node-permission.service.ts | 31 +- .../services/base-query-builder.service.ts | 13 +- .../services/search-configuration.service.ts | 4 +- ...rols-groups-marks-security.service.spec.ts | 122 +- ...-controls-groups-marks-security.service.ts | 97 +- .../src/lib/social/services/rating.service.ts | 8 +- lib/content-services/tsconfig.lib.json | 4 +- lib/core/tsconfig.lib.json | 3 +- lib/insights/tsconfig.lib.json | 4 +- lib/js-api/.eslintrc.json | 52 + lib/js-api/.mocharc.json | 7 + lib/js-api/docs/audit/.gitkeep | 0 lib/js-api/docs/audit/audit-info-4.10.0.md | 22 + lib/js-api/docs/audit/audit-info-4.11.0.md | 22 + lib/js-api/docs/audit/audit-info-4.7.0.md | 22 + lib/js-api/docs/audit/audit-info-4.8.0.md | 22 + lib/js-api/docs/audit/audit-info-4.9.0.md | 22 + lib/js-api/docs/audit/audit-info-5.0.0.md | 22 + lib/js-api/docs/audit/audit-info-5.1.0.md | 22 + lib/js-api/docs/audit/audit-info-5.2.0.md | 22 + lib/js-api/docs/audit/audit-info-5.3.0.md | 22 + lib/js-api/docs/audit/audit-info-5.4.0.md | 22 + lib/js-api/docs/audit/audit-info-5.5.0.md | 22 + lib/js-api/docs/audit/audit-info-6.0.0.md | 22 + lib/js-api/docs/audit/audit-info-6.1.0.md | 22 + lib/js-api/docs/audit/audit-info-6.2.0.md | 24 + lib/js-api/docs/audit/audit-info-7.0.0.md | 23 + lib/js-api/docs/audit/audit-info-7.1.0.md | 23 + lib/js-api/docs/audit/audit-info-7.2.0.md | 23 + lib/js-api/docs/authentication.md | 320 ++++ lib/js-api/docs/bpm-example.md | 563 +++++++ lib/js-api/docs/calling-custom-endpoints.md | 36 + lib/js-api/docs/changelog/.gitkeep | 0 lib/js-api/docs/changelog/changelog-4.10.0.md | 18 + lib/js-api/docs/changelog/changelog-4.11.0.md | 15 + lib/js-api/docs/changelog/changelog-4.7.0.md | 8 + lib/js-api/docs/changelog/changelog-4.8.0.md | 8 + lib/js-api/docs/changelog/changelog-4.9.0.md | 9 + lib/js-api/docs/changelog/changelog-5.0.0.md | 11 + lib/js-api/docs/changelog/changelog-5.1.0.md | 10 + lib/js-api/docs/changelog/changelog-5.2.0.md | 9 + lib/js-api/docs/changelog/changelog-5.3.0.md | 20 + lib/js-api/docs/changelog/changelog-5.4.0.md | 16 + lib/js-api/docs/changelog/changelog-5.5.0.md | 17 + lib/js-api/docs/changelog/changelog-6.0.0.md | 11 + lib/js-api/docs/changelog/changelog-6.1.0.md | 8 + lib/js-api/docs/changelog/changelog-6.2.0.md | 11 + lib/js-api/docs/changelog/changelog-7.0.0.md | 31 + lib/js-api/docs/changelog/changelog-7.1.0.md | 12 + lib/js-api/docs/changelog/changelog-7.2.0.md | 10 + lib/js-api/docs/ecm-example.md | 494 ++++++ lib/js-api/docs/error-events.md | 11 + lib/js-api/docs/licences/.gitkeep | 0 .../docs/licences/license-info-4.10.0.md | 55 + .../docs/licences/license-info-4.11.0.md | 55 + .../docs/licences/license-info-4.7.0.md | 47 + .../docs/licences/license-info-4.8.0.md | 47 + .../docs/licences/license-info-4.9.0.md | 55 + .../docs/licences/license-info-5.0.0.md | 55 + .../docs/licences/license-info-5.1.0.md | 55 + .../docs/licences/license-info-5.2.0.md | 56 + .../docs/licences/license-info-5.3.0.md | 56 + .../docs/licences/license-info-5.4.0.md | 56 + .../docs/licences/license-info-5.5.0.md | 53 + .../docs/licences/license-info-6.0.0.md | 53 + .../docs/licences/license-info-6.1.0.md | 53 + .../docs/licences/license-info-6.2.0.md | 53 + .../docs/licences/license-info-7.0.0.md | 53 + .../docs/licences/license-info-7.1.0.md | 90 ++ .../docs/licences/license-info-7.2.0.md | 54 + lib/js-api/src/LICENSE.txt | 177 +++ lib/js-api/src/README.md | 52 + lib/js-api/src/alfrescoApi.ts | 576 +++++++ lib/js-api/src/alfrescoApiClient.ts | 396 +++++ lib/js-api/src/alfrescoApiConfig.ts | 54 + lib/js-api/src/api-clients/api-client.ts | 59 + .../src/api-clients/http-client.interface.ts | 106 ++ .../src/api/activiti-rest-api/README.md | 55 + .../api/activiti-rest-api/api/about.api.ts | 35 + .../api/accountIntegration.api.ts | 36 + .../api/adminEndpoints.api.ts | 251 +++ .../activiti-rest-api/api/adminGroups.api.ts | 362 +++++ .../activiti-rest-api/api/adminTenants.api.ts | 182 +++ .../activiti-rest-api/api/adminUsers.api.ts | 131 ++ .../api/appDefinitions.api.ts | 207 +++ .../src/api/activiti-rest-api/api/base.api.ts | 25 + .../activiti-rest-api/api/checklists.api.ts | 92 ++ .../api/activiti-rest-api/api/comments.api.ts | 119 ++ .../api/activiti-rest-api/api/content.api.ts | 321 ++++ .../activiti-rest-api/api/dataSources.api.ts | 37 + .../api/decisionAudits.api.ts | 69 + .../api/decisionTables.api.ts | 87 + .../activiti-rest-api/api/endpoints.api.ts | 55 + .../activiti-rest-api/api/formModels.api.ts | 184 +++ .../api/activiti-rest-api/api/groups.api.ts | 65 + .../api/activiti-rest-api/api/iDMSync.api.ts | 62 + .../src/api/activiti-rest-api/api/index.ts | 62 + .../api/integrationAlfrescoCloud.api.ts | 151 ++ .../api/integrationAlfrescoOnPremise.api.ts | 140 ++ .../api/integrationBox.api.ts | 155 ++ .../api/integrationDrive.api.ts | 53 + .../api/modelJsonBpmn.api.ts | 96 ++ .../api/activiti-rest-api/api/models.api.ts | 314 ++++ .../activiti-rest-api/api/modelsBpmn.api.ts | 71 + .../api/modelsHistory.api.ts | 76 + .../api/processDefinitions.api.ts | 259 +++ .../api/processInstanceVariables.api.ts | 135 ++ .../api/processInstances.api.ts | 453 ++++++ .../api/processScopes.api.ts | 40 + .../api/activiti-rest-api/api/report.api.ts | 172 ++ .../api/runtimeAppDefinitions.api.ts | 78 + .../api/runtimeAppDeployments.api.ts | 124 ++ .../activiti-rest-api/api/scriptFiles.api.ts | 51 + .../api/submittedForms.api.ts | 111 ++ .../api/systemProperties.api.ts | 95 ++ .../activiti-rest-api/api/taskActions.api.ts | 269 ++++ .../activiti-rest-api/api/taskForms.api.ts | 194 +++ .../api/taskVariables.api.ts | 160 ++ .../api/activiti-rest-api/api/tasks.api.ts | 323 ++++ .../activiti-rest-api/api/temporary.api.ts | 97 ++ .../src/api/activiti-rest-api/api/types.ts | 19 + .../activiti-rest-api/api/userFilters.api.ts | 251 +++ .../activiti-rest-api/api/userProfile.api.ts | 114 ++ .../api/activiti-rest-api/api/users.api.ts | 159 ++ .../api/activiti-rest-api/docs/AboutApi.md | 30 + .../docs/AbstractGroupRepresentation.md | 11 + .../docs/AbstractUserRepresentation.md | 14 + .../docs/AccountIntegrationApi.md | 56 + .../AddGroupCapabilitiesRepresentation.md | 8 + .../docs/AdminEndpointsApi.md | 313 ++++ .../activiti-rest-api/docs/AdminGroupsApi.md | 661 ++++++++ .../activiti-rest-api/docs/AdminTenantsApi.md | 322 ++++ .../activiti-rest-api/docs/AdminUsersApi.md | 231 +++ .../docs/AlfrescoContentRepresentation.md | 11 + .../docs/AlfrescoEndpointRepresentation.md | 19 + .../docs/AlfrescoNetworkRepresenation.md | 8 + .../docs/AlfrescoSiteRepresenation.md | 9 + .../activiti-rest-api/docs/AppDefinition.md | 11 + .../AppDefinitionPublishRepresentation.md | 9 + .../docs/AppDefinitionRepresentation.md | 16 + .../docs/AppDefinitionSaveRepresentation.md | 10 + ...AppDefinitionUpdateResultRepresentation.md | 14 + .../docs/AppDefinitionsApi.md | 375 +++++ .../docs/AppDeploymentRepresentation.md | 13 + .../docs/AppModelDefinition.md | 18 + .../docs/AssigneeIdentifierRepresentation.md | 9 + .../AuditCalculatedValueRepresentation.md | 9 + ...ditDecisionExpressionInfoRepresentation.md | 10 + .../docs/AuditDecisionInfoRepresentation.md | 9 + .../AuditDecisionRuleInfoRepresentation.md | 9 + .../docs/AuditLogEntryRepresentation.md | 19 + .../docs/AuditLogFormDataRepresentation.md | 10 + .../api/activiti-rest-api/docs/BoxContent.md | 12 + ...BoxUserAccountCredentialsRepresentation.md | 10 + .../docs/BulkUserUpdateRepresentation.md | 14 + .../docs/ChangePasswordRepresentation.md | 9 + .../docs/ChecklistOrderRepresentation.md | 8 + .../activiti-rest-api/docs/ChecklistsApi.md | 124 ++ .../docs/CommentAuditInfo.md | 9 + .../docs/CommentRepresentation.md | 11 + .../api/activiti-rest-api/docs/CommentsApi.md | 170 ++ .../docs/CompleteFormRepresentation.md | 9 + .../docs/ConditionRepresentation.md | 16 + .../api/activiti-rest-api/docs/ContentApi.md | 534 +++++++ .../CreateProcessInstanceRepresentation.md | 14 + .../docs/CreateTenantRepresentation.md | 12 + .../activiti-rest-api/docs/DataSourcesApi.md | 75 + .../docs/DecisionAuditRepresentation.md | 21 + .../docs/DecisionAuditsApi.md | 97 ++ .../docs/DecisionTablesApi.md | 136 ++ .../docs/DecisionTaskRepresentation.md | 19 + .../EndpointConfigurationRepresentation.md | 17 + .../EndpointRequestHeaderRepresentation.md | 9 + .../activiti-rest-api/docs/EndpointsApi.md | 80 + .../EntityAttributeScopeRepresentation.md | 9 + .../docs/EntityVariableScopeRepresentation.md | 11 + .../activiti-rest-api/docs/FieldValueInfo.md | 9 + .../src/api/activiti-rest-api/docs/File.md | 22 + .../docs/FormDefinitionRepresentation.md | 29 + .../docs/FormFieldRepresentation.md | 38 + .../docs/FormIdentifierRepresentation.md | 8 + .../docs/FormJavascriptEventRepresentation.md | 9 + .../activiti-rest-api/docs/FormModelsApi.md | 223 +++ .../docs/FormOutcomeRepresentation.md | 9 + .../docs/FormRepresentation.md | 17 + .../docs/FormSaveRepresentation.md | 13 + .../docs/FormScopeRepresentation.md | 13 + .../docs/FormTabRepresentation.md | 10 + .../docs/FormValueRepresentation.md | 9 + .../docs/FormVariableRepresentation.md | 10 + .../docs/GlobalDateFormatRepresentation.md | 8 + .../docs/GoogleDriveContent.md | 12 + .../docs/GroupCapabilityRepresentation.md | 9 + .../docs/GroupRepresentation.md | 20 + .../api/activiti-rest-api/docs/GroupsApi.md | 95 ++ ...toricProcessInstanceQueryRepresentation.md | 30 + ...HistoricTaskInstanceQueryRepresentation.md | 58 + .../api/activiti-rest-api/docs/IDMSyncApi.md | 95 ++ .../docs/IdentityLinkRepresentation.md | 10 + .../docs/ImageUploadRepresentation.md | 11 + .../docs/IntegrationAlfrescoCloudApi.md | 250 +++ .../docs/IntegrationAlfrescoOnPremiseApi.md | 216 +++ .../docs/IntegrationBoxApi.md | 282 ++++ .../docs/IntegrationDriveApi.md | 91 ++ .../docs/LayoutRepresentation.md | 10 + .../docs/LightAppRepresentation.md | 12 + .../docs/LightGroupRepresentation.md | 12 + .../docs/LightTenantRepresentation.md | 9 + .../docs/LightUserRepresentation.md | 14 + .../docs/ModelJsonBpmnApi.md | 147 ++ .../docs/ModelRepresentation.md | 24 + .../api/activiti-rest-api/docs/ModelsApi.md | 529 ++++++ .../activiti-rest-api/docs/ModelsBpmnApi.md | 87 + .../docs/ModelsHistoryApi.md | 91 ++ .../api/activiti-rest-api/docs/NamedObject.md | 9 + .../api/activiti-rest-api/docs/ObjectNode.md | 53 + .../docs/OptionRepresentation.md | 9 + .../docs/PasswordValidationConstraints.md | 10 + .../docs/ProcessContentRepresentation.md | 9 + ...ProcessDefinitionMetaDataRepresentation.md | 9 + .../docs/ProcessDefinitionRepresentation.md | 17 + .../docs/ProcessDefinitionsApi.md | 440 +++++ .../ProcessInstanceAuditInfoRepresentation.md | 17 + .../ProcessInstanceFilterRepresentation.md | 13 + ...cessInstanceFilterRequestRepresentation.md | 12 + .../ProcessInstanceQueryRepresentation.md | 43 + .../docs/ProcessInstanceRepresentation.md | 25 + .../ProcessInstanceVariableRepresentation.md | 10 + .../docs/ProcessInstanceVariablesApi.md | 208 +++ .../docs/ProcessInstancesApi.md | 725 +++++++++ .../ProcessScopeIdentifierRepresentation.md | 9 + .../docs/ProcessScopeRepresentation.md | 23 + .../docs/ProcessScopesApi.md | 47 + .../ProcessScopesRequestRepresentation.md | 9 + .../docs/PublishIdentityInfoRepresentation.md | 10 + .../activiti-rest-api/docs/QueryVariable.md | 39 + .../docs/RelatedContentRepresentation.md | 21 + .../docs/RelatedProcessTask.md | 7 + .../api/activiti-rest-api/docs/ReportApi.md | 360 +++++ .../docs/ResetPasswordRepresentation.md | 8 + .../activiti-rest-api/docs/RestVariable.md | 11 + ...istDataRepresentationRelatedProcessTask.md | 11 + ...resentation«AbstractUserRepresentation».md | 11 + ...entation«AlfrescoContentRepresentation».md | 11 + ...ntation«AlfrescoEndpointRepresentation».md | 11 + ...sentation«AlfrescoNetworkRepresenation».md | 11 + ...presentation«AlfrescoSiteRepresenation».md | 11 + ...esentation«AppDefinitionRepresentation».md | 11 + ...esentation«AppDeploymentRepresentation».md | 11 + ...esultListDataRepresentation«BoxContent».md | 11 + ...taRepresentation«CommentRepresentation».md | 11 + ...resentation«DecisionTaskRepresentation».md | 11 + ...tDataRepresentation«FormRepresentation».md | 11 + ...tDataRepresentation«GoogleDriveContent».md | 11 + ...epresentation«LightGroupRepresentation».md | 11 + ...Representation«LightUserRepresentation».md | 11 + ...DataRepresentation«ModelRepresentation».md | 11 + ...sentation«ProcessContentRepresentation».md | 11 + ...tation«ProcessDefinitionRepresentation».md | 11 + ...entation«ProcessInstanceRepresentation».md | 11 + ...sentation«RelatedContentRepresentation».md | 11 + ...ion«RuntimeDecisionTableRepresentation».md | 11 + ...presentation«RuntimeFormRepresentation».md | 11 + ...esentation«SubmittedFormRepresentation».md | 11 + ...tDataRepresentation«TaskRepresentation».md | 11 + ...UserProcessInstanceFilterRepresentation».md | 11 + ...sentation«UserTaskFilterRepresentation».md | 11 + .../RuntimeAppDefinitionSaveRepresentation.md | 8 + .../docs/RuntimeAppDefinitionsApi.md | 125 ++ .../docs/RuntimeAppDeploymentsApi.md | 225 +++ .../RuntimeDecisionTableRepresentation.md | 16 + .../docs/RuntimeFormRepresentation.md | 14 + .../docs/SaveFormRepresentation.md | 8 + .../activiti-rest-api/docs/ScriptFilesApi.md | 78 + .../docs/SubmittedFormRepresentation.md | 15 + .../docs/SubmittedFormsApi.md | 172 ++ .../docs/SyncLogEntryRepresentation.md | 10 + .../docs/SystemPropertiesApi.md | 162 ++ .../docs/SystemPropertiesRepresentation.md | 9 + .../activiti-rest-api/docs/TaskActionsApi.md | 489 ++++++ .../docs/TaskAuditInfoRepresentation.md | 18 + .../docs/TaskFilterRepresentation.md | 29 + .../docs/TaskFilterRequestRepresentation.md | 12 + .../activiti-rest-api/docs/TaskFormsApi.md | 251 +++ .../docs/TaskQueryRepresentation.md | 49 + .../docs/TaskRepresentation.md | 40 + .../docs/TaskUpdateRepresentation.md | 21 + .../docs/TaskVariablesApi.md | 259 +++ .../api/activiti-rest-api/docs/TasksApi.md | 515 ++++++ .../activiti-rest-api/docs/TemporaryApi.md | 140 ++ .../api/activiti-rest-api/docs/TenantEvent.md | 14 + .../docs/TenantRepresentation.md | 15 + .../UserAccountCredentialsRepresentation.md | 9 + .../docs/UserActionRepresentation.md | 10 + .../docs/UserFilterOrderRepresentation.md | 9 + .../activiti-rest-api/docs/UserFiltersApi.md | 488 ++++++ .../docs/UserIdentifierRepresentation.md | 9 + ...UserProcessInstanceFilterRepresentation.md | 14 + .../activiti-rest-api/docs/UserProfileApi.md | 243 +++ .../docs/UserRepresentation.md | 28 + .../docs/UserTaskFilterRepresentation.md | 14 + .../api/activiti-rest-api/docs/UsersApi.md | 259 +++ .../docs/ValidationErrorRepresentation.md | 14 + .../docs/VariableMappingRepresentation.md | 13 + .../docs/VariableScopeRepresentation.md | 14 + lib/js-api/src/api/activiti-rest-api/index.ts | 19 + .../model/abstractGroupRepresentation.ts | 23 + .../model/abstractUserRepresentation.ts | 26 + .../model/accountRepresentation.ts | 24 + .../addGroupCapabilitiesRepresentation.ts | 20 + .../model/alfrescoContentRepresentation.ts | 23 + .../model/alfrescoEndpointRepresentation.ts | 41 + .../model/alfrescoNetworkRepresenation.ts | 20 + .../model/alfrescoSiteRepresenation.ts | 21 + .../activiti-rest-api/model/appDefinition.ts | 35 + .../appDefinitionPublishRepresentation.ts | 21 + .../model/appDefinitionRepresentation.ts | 28 + .../model/appDefinitionSaveRepresentation.ts | 24 + ...appDefinitionUpdateResultRepresentation.ts | 28 + .../model/appDeploymentRepresentation.ts | 36 + .../model/appModelDefinition.ts | 39 + .../model/assigneeIdentifierRepresentation.ts | 21 + .../auditCalculatedValueRepresentation.ts | 21 + ...ditDecisionExpressionInfoRepresentation.ts | 22 + .../model/auditDecisionInfoRepresentation.ts | 24 + .../auditDecisionRuleInfoRepresentation.ts | 23 + .../model/auditLogEntryRepresentation.ts | 33 + .../model/auditLogFormDataRepresentation.ts | 22 + .../api/activiti-rest-api/model/boxContent.ts | 24 + ...boxUserAccountCredentialsRepresentation.ts | 31 + .../model/bulkUserUpdateRepresentation.ts | 26 + .../model/changePasswordRepresentation.ts | 21 + .../model/checklistOrderRepresentation.ts | 20 + .../model/commentAuditInfo.ts | 21 + .../model/commentRepresentation.ts | 33 + .../model/completeFormRepresentation.ts | 21 + .../model/conditionRepresentation.ts | 28 + .../createEndpointBasicAuthRepresentation.ts | 23 + .../createProcessInstanceRepresentation.ts | 28 + .../model/createTenantRepresentation.ts | 24 + .../model/dataSourceConfigRepresentation.ts | 23 + .../model/dataSourceRepresentation.ts | 25 + .../model/decisionAuditRepresentation.ts | 42 + .../model/decisionTaskRepresentation.ts | 40 + .../model/endpointBasicAuthRepresentation.ts | 35 + .../endpointConfigurationRepresentation.ts | 31 + .../endpointRequestHeaderRepresentation.ts | 21 + .../entityAttributeScopeRepresentation.ts | 21 + .../entityVariableScopeRepresentation.ts | 25 + .../activiti-rest-api/model/fieldValueInfo.ts | 21 + .../src/api/activiti-rest-api/model/file.ts | 34 + .../model/formDefinitionRepresentation.ts | 48 + .../model/formFieldRepresentation.ts | 57 + .../model/formIdentifierRepresentation.ts | 20 + .../formJavascriptEventRepresentation.ts | 21 + .../model/formOutcomeRepresentation.ts | 21 + .../model/formRepresentation.ts | 39 + .../model/formSaveRepresentation.ts | 35 + .../model/formScopeRepresentation.ts | 28 + .../model/formTabRepresentation.ts | 24 + .../model/formValueRepresentation.ts | 21 + .../model/formVariableRepresentation.ts | 22 + .../model/globalDateFormatRepresentation.ts | 20 + .../model/googleDriveContent.ts | 24 + .../model/groupCapabilityRepresentation.ts | 21 + .../model/groupRepresentation.ts | 51 + ...toricProcessInstanceQueryRepresentation.ts | 55 + ...historicTaskInstanceQueryRepresentation.ts | 88 + .../model/identityLinkRepresentation.ts | 22 + .../model/imageUploadRepresentation.ts | 32 + .../src/api/activiti-rest-api/model/index.ts | 164 ++ .../api/activiti-rest-api/model/jsonNode.ts | 42 + .../model/layoutRepresentation.ts | 22 + .../model/lightAppRepresentation.ts | 24 + .../model/lightGroupRepresentation.ts | 24 + .../model/lightTenantRepresentation.ts | 21 + .../model/lightUserRepresentation.ts | 26 + .../model/modelRepresentation.ts | 45 + .../activiti-rest-api/model/namedObject.ts | 21 + .../api/activiti-rest-api/model/objectNode.ts | 42 + .../model/optionRepresentation.ts | 21 + .../model/passwordValidationConstraints.ts | 22 + .../model/processContentRepresentation.ts | 33 + ...processDefinitionMetaDataRepresentation.ts | 21 + .../model/processDefinitionRepresentation.ts | 31 + .../processInstanceAuditInfoRepresentation.ts | 32 + .../processInstanceFilterRepresentation.ts | 25 + ...cessInstanceFilterRequestRepresentation.ts | 26 + .../processInstanceQueryRepresentation.ts | 27 + .../model/processInstanceRepresentation.ts | 49 + .../processInstanceVariableRepresentation.ts | 22 + .../processScopeIdentifierRepresentation.ts | 21 + .../model/processScopeRepresentation.ts | 40 + .../processScopesRequestRepresentation.ts | 23 + .../publishIdentityInfoRepresentation.ts | 25 + .../activiti-rest-api/model/queryVariable.ts | 34 + .../model/relatedContentRepresentation.ts | 44 + .../model/relatedProcessTask.ts | 21 + .../model/resetPasswordRepresentation.ts | 20 + .../activiti-rest-api/model/restVariable.ts | 23 + ...epresentationAbstractUserRepresentation.ts | 25 + ...DataRepresentationAccountRepresentation.ts | 25 + ...esentationAlfrescoContentRepresentation.ts | 25 + ...sentationAlfrescoEndpointRepresentation.ts | 35 + ...resentationAlfrescoNetworkRepresenation.ts | 25 + ...RepresentationAlfrescoSiteRepresenation.ts | 25 + ...presentationAppDefinitionRepresentation.ts | 25 + ...presentationAppDeploymentRepresentation.ts | 35 + .../resultListDataRepresentationBoxContent.ts | 25 + ...DataRepresentationCommentRepresentation.ts | 34 + ...aRepresentationDataSourceRepresentation.ts | 25 + ...presentationDecisionAuditRepresentation.ts | 35 + ...epresentationDecisionTaskRepresentation.ts | 35 + ...istDataRepresentationFormRepresentation.ts | 35 + ...istDataRepresentationGoogleDriveContent.ts | 25 + ...aRepresentationLightGroupRepresentation.ts | 25 + ...taRepresentationLightUserRepresentation.ts | 25 + ...stDataRepresentationModelRepresentation.ts | 35 + ...resentationProcessContentRepresentation.ts | 35 + ...entationProcessDefinitionRepresentation.ts | 25 + ...esentationProcessInstanceRepresentation.ts | 35 + ...resentationRelatedContentRepresentation.ts | 35 + ...istDataRepresentationRelatedProcessTask.ts | 25 + ...ationRuntimeDecisionTableRepresentation.ts | 25 + ...RepresentationRuntimeFormRepresentation.ts | 25 + ...presentationSubmittedFormRepresentation.ts | 35 + ...istDataRepresentationTaskRepresentation.ts | 36 + ...UserProcessInstanceFilterRepresentation.ts | 25 + ...resentationUserTaskFilterRepresentation.ts | 35 + .../runtimeAppDefinitionSaveRepresentation.ts | 22 + .../runtimeDecisionTableRepresentation.ts | 28 + .../model/runtimeFormRepresentation.ts | 26 + .../model/saveFormRepresentation.ts | 20 + .../model/submittedFormRepresentation.ts | 38 + .../model/syncLogEntryRepresentation.ts | 31 + .../model/systemPropertiesRepresentation.ts | 23 + .../model/taskAuditInfoRepresentation.ts | 33 + .../model/taskFilterRepresentation.ts | 38 + .../model/taskFilterRequestRepresentation.ts | 34 + .../model/taskQueryRepresentation.ts | 43 + .../model/taskRepresentation.ts | 83 + .../model/taskUpdateRepresentation.ts | 42 + .../activiti-rest-api/model/tenantEvent.ts | 35 + .../model/tenantRepresentation.ts | 37 + .../userAccountCredentialsRepresentation.ts | 21 + .../model/userActionRepresentation.ts | 22 + .../model/userFilterOrderRepresentation.ts | 21 + .../model/userIdentifierRepresentation.ts | 21 + ...userProcessInstanceFilterRepresentation.ts | 28 + .../model/userRepresentation.ts | 57 + .../model/userRepresentationGroup.ts | 52 + .../model/userTaskFilterRepresentation.ts | 35 + .../model/validationErrorRepresentation.ts | 26 + .../model/variableMappingRepresentation.ts | 25 + .../model/variableScopeRepresentation.ts | 26 + lib/js-api/src/api/auth-rest-api/README.md | 29 + .../auth-rest-api/api/authentication.api.ts | 89 ++ .../src/api/auth-rest-api/api/base.api.ts | 25 + lib/js-api/src/api/auth-rest-api/api/index.ts | 18 + .../auth-rest-api/docs/AuthenticationApi.md | 141 ++ .../src/api/auth-rest-api/docs/Error.md | 8 + .../src/api/auth-rest-api/docs/Error_error.md | 13 + .../src/api/auth-rest-api/docs/Ticket.md | 9 + .../src/api/auth-rest-api/docs/TicketBody.md | 9 + .../src/api/auth-rest-api/docs/TicketEntry.md | 8 + .../src/api/auth-rest-api/docs/ValidTicket.md | 8 + .../auth-rest-api/docs/ValidTicketEntry.md | 8 + lib/js-api/src/api/auth-rest-api/index.ts | 19 + .../src/api/auth-rest-api/model/index.ts | 22 + .../src/api/auth-rest-api/model/ticket.ts | 27 + .../src/api/auth-rest-api/model/ticketBody.ts | 27 + .../api/auth-rest-api/model/ticketEntry.ts | 29 + .../api/auth-rest-api/model/validTicket.ts | 26 + .../auth-rest-api/model/validTicketEntry.ts | 29 + .../api/content-custom-api/api/base.api.ts | 56 + .../api/content-custom-api/api/classes.api.ts | 58 + .../api/content-custom-api/api/content.api.ts | 142 ++ .../content-custom-api/api/customModel.api.ts | 577 +++++++ .../src/api/content-custom-api/api/index.ts | 22 + .../api/content-custom-api/api/upload.api.ts | 50 + .../content-custom-api/api/webscript.api.ts | 76 + .../api/content-custom-api/docs/UploadApi.md | 31 + .../content-custom-api/docs/WebscriptApi.md | 58 + .../src/api/content-custom-api/index.ts | 19 + .../model/classDescription.ts | 41 + .../model/classPropertyDescription.ts | 37 + .../content-custom-api/model/dateAlfresco.ts | 83 + .../src/api/content-custom-api/model/index.ts | 21 + .../content-custom-api/model/pagination.ts | 30 + lib/js-api/src/api/content-rest-api/README.md | 32 + .../api/content-rest-api/api/actions.api.ts | 149 ++ .../content-rest-api/api/activities.api.ts | 67 + .../src/api/content-rest-api/api/audit.api.ts | 347 ++++ .../src/api/content-rest-api/api/base.api.ts | 25 + .../content-rest-api/api/categories.api.ts | 263 +++ .../api/content-rest-api/api/comments.api.ts | 142 ++ .../api/content-rest-api/api/downloads.api.ts | 116 ++ .../api/content-rest-api/api/favorites.api.ts | 311 ++++ .../api/content-rest-api/api/groups.api.ts | 382 +++++ .../src/api/content-rest-api/api/index.ts | 39 + .../api/content-rest-api/api/networks.api.ts | 116 ++ .../src/api/content-rest-api/api/nodes.api.ts | 974 ++++++++++++ .../api/content-rest-api/api/people.api.ts | 333 ++++ .../content-rest-api/api/preferences.api.ts | 89 ++ .../api/content-rest-api/api/probes.api.ts | 53 + .../api/content-rest-api/api/queries.api.ts | 189 +++ .../api/content-rest-api/api/ratings.api.ts | 150 ++ .../content-rest-api/api/renditions.api.ts | 191 +++ .../content-rest-api/api/sharedlinks.api.ts | 336 ++++ .../src/api/content-rest-api/api/sites.api.ts | 1013 ++++++++++++ .../src/api/content-rest-api/api/tags.api.ts | 262 +++ .../api/content-rest-api/api/trashcan.api.ts | 381 +++++ .../src/api/content-rest-api/api/types.ts | 52 + .../api/content-rest-api/api/versions.api.ts | 406 +++++ .../api/content-rest-api/docs/ActionsApi.md | 272 ++++ .../content-rest-api/docs/ActivitiesApi.md | 86 + .../api/content-rest-api/docs/Association.md | 9 + .../content-rest-api/docs/AssociationEntry.md | 8 + .../content-rest-api/docs/AssociationInfo.md | 8 + .../src/api/content-rest-api/docs/AuditApi.md | 427 +++++ .../content-rest-api/docs/CategoriesApi.md | 73 + .../content-rest-api/docs/ChildAssociation.md | 10 + .../docs/ChildAssociationEntry.md | 9 + .../docs/ChildAssociationInfo.md | 10 + .../api/content-rest-api/docs/CommentsApi.md | 220 +++ .../src/api/content-rest-api/docs/Company.md | 16 + .../api/content-rest-api/docs/ContentInfo.md | 12 + .../api/content-rest-api/docs/Definition.md | 8 + .../content-rest-api/docs/DirectAccessUrl.md | 9 + .../docs/DirectAccessUrlEntry.md | 9 + .../api/content-rest-api/docs/DownloadsApi.md | 156 ++ .../src/api/content-rest-api/docs/Error.md | 8 + .../api/content-rest-api/docs/ErrorError.md | 13 + .../api/content-rest-api/docs/FavoritesApi.md | 465 ++++++ .../src/api/content-rest-api/docs/Group.md | 12 + .../api/content-rest-api/docs/GroupMember.md | 18 + .../api/content-rest-api/docs/GroupsApi.md | 512 ++++++ .../api/content-rest-api/docs/NetworksApi.md | 158 ++ .../src/api/content-rest-api/docs/Node.md | 29 + .../api/content-rest-api/docs/NodeEntry.md | 8 + .../src/api/content-rest-api/docs/NodesApi.md | 1414 +++++++++++++++++ .../api/content-rest-api/docs/Pagination.md | 13 + .../api/content-rest-api/docs/PathElement.md | 12 + .../src/api/content-rest-api/docs/PathInfo.md | 11 + .../api/content-rest-api/docs/PeopleApi.md | 457 ++++++ .../docs/PermissionElement.md | 14 + .../content-rest-api/docs/PermissionsInfo.md | 12 + .../src/api/content-rest-api/docs/Person.md | 39 + .../api/content-rest-api/docs/PersonEntry.md | 9 + .../api/content-rest-api/docs/PersonPaging.md | 18 + .../content-rest-api/docs/PreferencesApi.md | 108 ++ .../api/content-rest-api/docs/ProbesApi.md | 61 + .../src/api/content-rest-api/docs/Property.md | 31 + .../api/content-rest-api/docs/QueriesApi.md | 182 +++ .../api/content-rest-api/docs/RatingsApi.md | 181 +++ .../api/content-rest-api/docs/Rendition.md | 21 + .../docs/RenditionBodyCreate.md | 9 + .../content-rest-api/docs/RenditionEntry.md | 9 + .../content-rest-api/docs/RenditionPaging.md | 18 + .../content-rest-api/docs/RenditionsApi.md | 192 +++ .../content-rest-api/docs/SharedlinksApi.md | 457 ++++++ .../src/api/content-rest-api/docs/Site.md | 42 + .../api/content-rest-api/docs/SiteEntry.md | 7 + .../docs/SiteEntryRelations.md | 7 + .../api/content-rest-api/docs/SitePaging.md | 18 + .../src/api/content-rest-api/docs/SitesApi.md | 1290 +++++++++++++++ .../src/api/content-rest-api/docs/TagsApi.md | 361 +++++ .../api/content-rest-api/docs/TrashcanApi.md | 403 +++++ .../src/api/content-rest-api/docs/UserInfo.md | 10 + .../api/content-rest-api/docs/VersionsApi.md | 434 +++++ lib/js-api/src/api/content-rest-api/index.ts | 19 + .../model/CategoryLinkBody.ts | 26 + .../content-rest-api/model/actionBodyExec.ts | 25 + .../model/actionDefinition.ts | 46 + .../model/actionDefinitionEntry.ts | 22 + .../model/actionDefinitionList.ts | 30 + .../model/actionDefinitionListList.ts | 31 + .../model/actionExecResult.ts | 23 + .../model/actionExecResultEntry.ts | 22 + .../model/actionParameterDefinition.ts | 24 + .../api/content-rest-api/model/activity.ts | 61 + .../content-rest-api/model/activityEntry.ts | 30 + .../content-rest-api/model/activityPaging.ts | 30 + .../model/activityPagingList.ts | 35 + .../api/content-rest-api/model/association.ts | 21 + .../content-rest-api/model/associationBody.ts | 27 + .../model/associationEntry.ts | 22 + .../content-rest-api/model/associationInfo.ts | 20 + .../api/content-rest-api/model/auditApp.ts | 24 + .../content-rest-api/model/auditAppEntry.ts | 22 + .../content-rest-api/model/auditAppPaging.ts | 30 + .../model/auditAppPagingList.ts | 31 + .../content-rest-api/model/auditBodyUpdate.ts | 20 + .../api/content-rest-api/model/auditEntry.ts | 36 + .../content-rest-api/model/auditEntryEntry.ts | 30 + .../model/auditEntryPaging.ts | 30 + .../model/auditEntryPagingList.ts | 35 + .../content-rest-api/model/capabilities.ts | 22 + .../api/content-rest-api/model/category.ts | 31 + .../content-rest-api/model/categoryBody.ts | 20 + .../content-rest-api/model/categoryEntry.ts | 29 + .../content-rest-api/model/categoryPaging.ts | 29 + .../model/categoryPagingList.ts | 34 + .../model/childAssociation.ts | 28 + .../model/childAssociationBody.ts | 27 + .../model/childAssociationEntry.ts | 30 + .../model/childAssociationInfo.ts | 28 + .../api/content-rest-api/model/clientBody.ts | 30 + .../src/api/content-rest-api/model/comment.ts | 43 + .../api/content-rest-api/model/commentBody.ts | 20 + .../content-rest-api/model/commentEntry.ts | 30 + .../content-rest-api/model/commentPaging.ts | 30 + .../model/commentPagingList.ts | 35 + .../src/api/content-rest-api/model/company.ts | 27 + .../api/content-rest-api/model/constraint.ts | 33 + .../api/content-rest-api/model/contentInfo.ts | 30 + .../api/content-rest-api/model/definition.ts | 25 + .../api/content-rest-api/model/deletedNode.ts | 67 + .../model/deletedNodeBodyRestore.ts | 21 + .../model/deletedNodeEntry.ts | 30 + .../model/deletedNodesPaging.ts | 30 + .../model/deletedNodesPagingList.ts | 35 + .../content-rest-api/model/directAccessUrl.ts | 41 + .../model/directAccessUrlEntry.ts | 30 + .../api/content-rest-api/model/download.ts | 43 + .../model/downloadBodyCreate.ts | 20 + .../content-rest-api/model/downloadEntry.ts | 22 + .../api/content-rest-api/model/errorError.ts | 25 + .../api/content-rest-api/model/favorite.ts | 45 + .../model/favoriteBodyCreate.ts | 20 + .../content-rest-api/model/favoriteEntry.ts | 30 + .../content-rest-api/model/favoritePaging.ts | 30 + .../model/favoritePagingList.ts | 35 + .../content-rest-api/model/favoriteSite.ts | 20 + .../model/favoriteSiteBodyCreate.ts | 20 + .../model/favoriteSiteEntry.ts | 22 + .../src/api/content-rest-api/model/group.ts | 24 + .../content-rest-api/model/groupBodyCreate.ts | 22 + .../content-rest-api/model/groupBodyUpdate.ts | 20 + .../api/content-rest-api/model/groupEntry.ts | 22 + .../api/content-rest-api/model/groupMember.ts | 22 + .../model/groupMemberEntry.ts | 22 + .../model/groupMemberPaging.ts | 30 + .../model/groupMemberPagingList.ts | 31 + .../model/groupMembershipBodyCreate.ts | 35 + .../api/content-rest-api/model/groupPaging.ts | 30 + .../content-rest-api/model/groupPagingList.ts | 31 + .../src/api/content-rest-api/model/index.ts | 201 +++ .../api/content-rest-api/model/modelError.ts | 22 + .../content-rest-api/model/networkQuota.ts | 27 + .../src/api/content-rest-api/model/node.ts | 63 + .../content-rest-api/model/nodeAssociation.ts | 65 + .../model/nodeAssociationEntry.ts | 30 + .../model/nodeAssociationPaging.ts | 30 + .../model/nodeAssociationPagingList.ts | 38 + .../content-rest-api/model/nodeBodyCopy.ts | 25 + .../content-rest-api/model/nodeBodyCreate.ts | 52 + .../model/nodeBodyCreateAssociation.ts | 20 + .../content-rest-api/model/nodeBodyLock.ts | 22 + .../content-rest-api/model/nodeBodyMove.ts | 25 + .../content-rest-api/model/nodeBodyUpdate.ts | 37 + .../model/nodeChildAssociation.ts | 66 + .../model/nodeChildAssociationEntry.ts | 30 + .../model/nodeChildAssociationPaging.ts | 30 + .../model/nodeChildAssociationPagingList.ts | 37 + .../api/content-rest-api/model/nodeEntry.ts | 30 + .../api/content-rest-api/model/nodePaging.ts | 30 + .../content-rest-api/model/nodePagingList.ts | 38 + .../api/content-rest-api/model/pagination.ts | 52 + .../model/passwordResetBody.ts | 31 + .../api/content-rest-api/model/pathElement.ts | 23 + .../api/content-rest-api/model/pathInfo.ts | 30 + .../model/permissionElement.ts | 28 + .../content-rest-api/model/permissionsBody.ts | 33 + .../content-rest-api/model/permissionsInfo.ts | 38 + .../src/api/content-rest-api/model/person.ts | 52 + .../model/personBodyCreate.ts | 40 + .../model/personBodyUpdate.ts | 40 + .../api/content-rest-api/model/personEntry.ts | 30 + .../content-rest-api/model/personNetwork.ts | 47 + .../model/personNetworkEntry.ts | 30 + .../model/personNetworkPaging.ts | 30 + .../model/personNetworkPagingList.ts | 35 + .../content-rest-api/model/personPaging.ts | 30 + .../model/personPagingList.ts | 35 + .../api/content-rest-api/model/preference.ts | 30 + .../content-rest-api/model/preferenceEntry.ts | 22 + .../model/preferencePaging.ts | 30 + .../model/preferencePagingList.ts | 31 + .../api/content-rest-api/model/probeEntry.ts | 22 + .../content-rest-api/model/probeEntryEntry.ts | 20 + .../api/content-rest-api/model/property.ts | 58 + .../src/api/content-rest-api/model/rating.ts | 41 + .../content-rest-api/model/ratingAggregate.ts | 21 + .../api/content-rest-api/model/ratingBody.ts | 27 + .../api/content-rest-api/model/ratingEntry.ts | 30 + .../content-rest-api/model/ratingPaging.ts | 30 + .../model/ratingPagingList.ts | 35 + .../api/content-rest-api/model/rendition.ts | 39 + .../model/renditionBodyCreate.ts | 20 + .../content-rest-api/model/renditionEntry.ts | 30 + .../content-rest-api/model/renditionPaging.ts | 30 + .../model/renditionPagingList.ts | 35 + .../api/content-rest-api/model/revertBody.ts | 21 + .../api/content-rest-api/model/sharedLink.ts | 63 + .../model/sharedLinkBodyCreate.ts | 31 + .../model/sharedLinkBodyEmail.ts | 23 + .../content-rest-api/model/sharedLinkEntry.ts | 30 + .../model/sharedLinkPaging.ts | 30 + .../model/sharedLinkPagingList.ts | 35 + .../src/api/content-rest-api/model/site.ts | 48 + .../content-rest-api/model/siteBodyCreate.ts | 38 + .../content-rest-api/model/siteBodyUpdate.ts | 37 + .../content-rest-api/model/siteContainer.ts | 21 + .../model/siteContainerEntry.ts | 22 + .../model/siteContainerPaging.ts | 30 + .../model/siteContainerPagingList.ts | 31 + .../api/content-rest-api/model/siteEntry.ts | 33 + .../model/siteEntryRelations.ts | 30 + .../api/content-rest-api/model/siteGroup.ts | 39 + .../content-rest-api/model/siteGroupEntry.ts | 30 + .../content-rest-api/model/siteGroupPaging.ts | 30 + .../model/siteGroupPagingList.ts | 35 + .../api/content-rest-api/model/siteMember.ts | 42 + .../content-rest-api/model/siteMemberEntry.ts | 30 + .../model/siteMemberPaging.ts | 30 + .../model/siteMemberPagingList.ts | 35 + .../model/siteMembershipApprovalBody.ts | 20 + .../model/siteMembershipBodyCreate.ts | 37 + .../model/siteMembershipBodyUpdate.ts | 36 + .../model/siteMembershipRejectionBody.ts | 27 + .../model/siteMembershipRequest.ts | 35 + .../model/siteMembershipRequestBodyCreate.ts | 28 + .../model/siteMembershipRequestBodyUpdate.ts | 20 + .../model/siteMembershipRequestEntry.ts | 30 + .../model/siteMembershipRequestPaging.ts | 30 + .../model/siteMembershipRequestPagingList.ts | 35 + .../model/siteMembershipRequestWithPerson.ts | 38 + .../siteMembershipRequestWithPersonEntry.ts | 30 + .../siteMembershipRequestWithPersonPaging.ts | 30 + ...teMembershipRequestWithPersonPagingList.ts | 35 + .../api/content-rest-api/model/sitePaging.ts | 30 + .../content-rest-api/model/sitePagingList.ts | 35 + .../api/content-rest-api/model/siteRole.ts | 42 + .../content-rest-api/model/siteRoleEntry.ts | 30 + .../content-rest-api/model/siteRolePaging.ts | 30 + .../model/siteRolePagingList.ts | 35 + .../src/api/content-rest-api/model/tag.ts | 29 + .../src/api/content-rest-api/model/tagBody.ts | 27 + .../api/content-rest-api/model/tagEntry.ts | 30 + .../api/content-rest-api/model/tagPaging.ts | 30 + .../content-rest-api/model/tagPagingList.ts | 35 + .../api/content-rest-api/model/userInfo.ts | 28 + .../src/api/content-rest-api/model/version.ts | 47 + .../content-rest-api/model/versionEntry.ts | 30 + .../content-rest-api/model/versionPaging.ts | 30 + .../model/versionPagingList.ts | 34 + .../src/api/discovery-rest-api/README.md | 30 + .../api/discovery-rest-api/api/base.api.ts | 25 + .../discovery-rest-api/api/discovery.api.ts | 38 + .../src/api/discovery-rest-api/api/index.ts | 18 + .../discovery-rest-api/docs/DiscoveryApi.md | 42 + .../discovery-rest-api/docs/DiscoveryEntry.md | 8 + .../docs/EntitlementsInfo.md | 12 + .../src/api/discovery-rest-api/docs/Error.md | 9 + .../discovery-rest-api/docs/Error_error.md | 14 + .../discovery-rest-api/docs/LicenseInfo.md | 14 + .../api/discovery-rest-api/docs/ModuleInfo.md | 16 + .../docs/RepositoryEntry.md | 9 + .../discovery-rest-api/docs/RepositoryInfo.md | 13 + .../api/discovery-rest-api/docs/StatusInfo.md | 12 + .../discovery-rest-api/docs/VersionInfo.md | 15 + .../src/api/discovery-rest-api/index.ts | 19 + .../model/discoveryEntry.ts | 30 + .../model/entitlementsInfo.ts | 29 + .../src/api/discovery-rest-api/model/index.ts | 25 + .../discovery-rest-api/model/licenseInfo.ts | 37 + .../discovery-rest-api/model/moduleInfo.ts | 36 + .../model/repositoryEntry.ts | 29 + .../model/repositoryInfo.ts | 42 + .../discovery-rest-api/model/statusInfo.ts | 30 + .../discovery-rest-api/model/versionInfo.ts | 32 + .../api/gs-classification-rest-api/README.md | 88 + .../api/authorityClearance.api.ts | 63 + .../api/base.api.ts | 25 + .../api/classificationGuides.api.ts | 393 +++++ .../api/classificationReasons.api.ts | 126 ++ .../api/declassificationExemptions.api.ts | 118 ++ .../api/defaultClassificationValues.api.ts | 46 + .../gs-classification-rest-api/api/index.ts | 27 + .../api/nodeSecurityMarks.api.ts | 70 + .../api/securityControlSettings.api.ts | 73 + .../api/securityGroups.api.ts | 109 ++ .../api/securityMarks.api.ts | 138 ++ .../gs-classification-rest-api/api/types.ts | 60 + .../docs/AuthorityClearanceGroup.md | 10 + .../docs/AuthorityClearanceGroupEntry.md | 8 + .../docs/AuthorityClearanceGroupPaging.md | 8 + .../AuthorityClearanceGroupPaging_list.md | 9 + .../docs/AuthorityClearanceMark.md | 9 + .../docs/ClassificationGuide.md | 11 + .../docs/ClassificationGuideBody.md | 11 + .../docs/ClassificationGuideEntry.md | 8 + .../docs/ClassificationGuideInTopic.md | 11 + .../docs/ClassificationGuidePaging.md | 8 + .../docs/ClassificationGuidePaging_list.md | 9 + .../docs/ClassificationGuides.md | 12 + .../docs/ClassificationGuidesApi.md | 715 +++++++++ .../docs/ClassificationGuidesBody.md | 12 + .../docs/ClassificationGuidesEntry.md | 8 + .../docs/ClassificationGuidesInTopic.md | 12 + .../docs/ClassificationInformation.md | 16 + .../docs/ClassificationReason.md | 10 + .../docs/ClassificationReasonBody.md | 9 + .../docs/ClassificationReasonEntry.md | 8 + .../docs/ClassificationReasonsApi.md | 281 ++++ .../docs/ClassificationReasonsPaging.md | 8 + .../docs/ClassificationReasonsPaging_list.md | 9 + .../docs/CombinedInstructionBody.md | 9 + .../docs/DeclassificationDate.md | 7 + .../docs/DeclassificationExemption.md | 10 + .../docs/DeclassificationExemptionBody.md | 9 + .../docs/DeclassificationExemptionEntry.md | 8 + .../docs/DeclassificationExemptionsApi.md | 257 +++ .../docs/DeclassificationExemptionsPaging.md | 8 + .../DeclassificationExemptionsPaging_list.md | 9 + .../docs/DefaultClassificationValuesApi.md | 48 + .../gs-classification-rest-api/docs/Error.md | 8 + .../docs/Error_error.md | 12 + .../docs/Instruction.md | 9 + .../docs/InstructionBody.md | 9 + .../docs/InstructionEntry.md | 8 + .../docs/NodeSecurityMarkBody.md | 11 + .../docs/Pagination.md | 23 + .../gs-classification-rest-api/docs/Path.md | 7 + .../docs/PathElement.md | 9 + .../docs/SecurityControlSetting.md | 9 + .../docs/SecurityControlSettingBody.md | 8 + .../docs/SecurityControlSettingEntry.md | 8 + .../docs/SecurityControlSettingsApi.md | 93 ++ .../docs/SecurityGroup.md | 9 + .../docs/SecurityGroupBody.md | 9 + .../docs/SecurityGroupEntry.md | 8 + .../docs/SecurityGroupPaging.md | 8 + .../docs/SecurityGroupPaging_list.md | 9 + .../docs/SecurityMark.md | 10 + .../docs/SecurityMarkBody.md | 8 + .../docs/SecurityMarkEntry.md | 8 + .../docs/SecurityMarkInformation.md | 8 + .../docs/SecurityMarkInformationBody.md | 8 + .../docs/SecurityMarkPaging.md | 8 + .../docs/SecurityMarkPaging_list.md | 9 + .../docs/SecurityMarks.md | 7 + .../docs/SecurityMarksBody.md | 7 + .../docs/SubtopicPaging.md | 8 + .../gs-classification-rest-api/docs/Topic.md | 16 + .../docs/TopicBody.md | 10 + .../docs/TopicEntry.md | 8 + .../docs/TopicPaging.md | 8 + .../docs/TopicPaging_list.md | 9 + .../api/gs-classification-rest-api/index.ts | 19 + .../model/authorityClearanceGroup.ts | 26 + .../model/authorityClearanceGroupEntry.ts | 22 + .../model/authorityClearanceGroupPaging.ts | 22 + .../authorityClearanceGroupPagingList.ts | 24 + .../model/authorityClearanceMark.ts | 23 + .../model/classificationGuide.ts | 26 + .../model/classificationGuideBody.ts | 23 + .../model/classificationGuideEntry.ts | 22 + .../model/classificationGuideInTopic.ts | 26 + .../model/classificationGuidePaging.ts | 22 + .../model/classificationGuidePagingList.ts | 24 + .../model/classificationGuides.ts | 27 + .../model/classificationGuidesBody.ts | 24 + .../model/classificationGuidesEntry.ts | 22 + .../model/classificationGuidesInTopic.ts | 27 + .../model/classificationInformation.ts | 28 + .../model/classificationReason.ts | 22 + .../model/classificationReasonBody.ts | 21 + .../model/classificationReasonEntry.ts | 22 + .../model/classificationReasonsPaging.ts | 22 + .../model/classificationReasonsPagingList.ts | 24 + .../model/combinedInstructionBody.ts | 24 + .../model/declassificationDate.ts | 20 + .../model/declassificationExemption.ts | 22 + .../model/declassificationExemptionBody.ts | 21 + .../model/declassificationExemptionEntry.ts | 22 + .../model/declassificationExemptionsPaging.ts | 22 + .../declassificationExemptionsPagingList.ts | 24 + .../gs-classification-rest-api/model/index.ts | 73 + .../model/instruction.ts | 27 + .../model/instructionBody.ts | 24 + .../model/instructionEntry.ts | 22 + .../model/nodeSecurityMarkBody.ts | 22 + .../gs-classification-rest-api/model/path.ts | 24 + .../model/securityControlSetting.ts | 21 + .../model/securityControlSettingBody.ts | 20 + .../model/securityControlSettingEntry.ts | 22 + .../model/securityGroup.ts | 24 + .../model/securityGroupBody.ts | 21 + .../model/securityGroupEntry.ts | 22 + .../model/securityGroupPaging.ts | 22 + .../model/securityGroupPagingList.ts | 24 + .../model/securityMark.ts | 22 + .../model/securityMarkBody.ts | 20 + .../model/securityMarkEntry.ts | 22 + .../model/securityMarkInformation.ts | 22 + .../model/securityMarkInformationBody.ts | 22 + .../model/securityMarkPaging.ts | 22 + .../model/securityMarkPagingList.ts | 24 + .../model/securityMarks.ts | 20 + .../model/securityMarksBody.ts | 20 + .../model/subtopicPaging.ts | 29 + .../gs-classification-rest-api/model/topic.ts | 46 + .../model/topicBody.ts | 24 + .../model/topicEntry.ts | 29 + .../model/topicPaging.ts | 29 + .../model/topicPagingList.ts | 34 + lib/js-api/src/api/gs-core-rest-api/README.md | 125 ++ .../src/api/gs-core-rest-api/api/base.api.ts | 25 + .../api/gs-core-rest-api/api/filePlans.api.ts | 165 ++ .../src/api/gs-core-rest-api/api/files.api.ts | 67 + .../api/gs-core-rest-api/api/gsSites.api.ts | 100 ++ .../src/api/gs-core-rest-api/api/index.ts | 28 + .../api/recordCategories.api.ts | 214 +++ .../gs-core-rest-api/api/recordFolders.api.ts | 193 +++ .../api/gs-core-rest-api/api/records.api.ts | 236 +++ .../api/transferContainers.api.ts | 131 ++ .../api/gs-core-rest-api/api/transfers.api.ts | 96 ++ .../src/api/gs-core-rest-api/api/types.ts | 59 + .../api/unfiledContainers.api.ts | 186 +++ .../api/unfiledRecordFolders.api.ts | 212 +++ .../docs/ChildAssociationInfo.md | 9 + .../api/gs-core-rest-api/docs/ContentInfo.md | 11 + .../src/api/gs-core-rest-api/docs/Error.md | 8 + .../api/gs-core-rest-api/docs/Error_error.md | 13 + .../src/api/gs-core-rest-api/docs/FilePlan.md | 21 + .../docs/FilePlanBodyUpdate.md | 8 + .../docs/FilePlanComponentBodyUpdate.md | 12 + .../gs-core-rest-api/docs/FilePlanEntry.md | 8 + .../api/gs-core-rest-api/docs/FilePlansApi.md | 404 +++++ .../src/api/gs-core-rest-api/docs/FilesApi.md | 88 + .../api/gs-core-rest-api/docs/GssitesApi.md | 243 +++ .../api/gs-core-rest-api/docs/Pagination.md | 23 + .../api/gs-core-rest-api/docs/PathElement.md | 9 + .../src/api/gs-core-rest-api/docs/PathInfo.md | 10 + .../gs-core-rest-api/docs/RMNodeBodyCreate.md | 13 + .../docs/RMNodeBodyCreateWithRelativePath.md | 14 + .../src/api/gs-core-rest-api/docs/RMSite.md | 53 + .../gs-core-rest-api/docs/RMSiteBodyCreate.md | 21 + .../gs-core-rest-api/docs/RMSiteBodyUpdate.md | 9 + .../api/gs-core-rest-api/docs/RMSiteEntry.md | 8 + .../src/api/gs-core-rest-api/docs/Record.md | 23 + .../docs/RecordCategoriesApi.md | 526 ++++++ .../gs-core-rest-api/docs/RecordCategory.md | 22 + .../docs/RecordCategoryChild.md | 25 + .../docs/RecordCategoryChildEntry.md | 8 + .../docs/RecordCategoryChildPaging.md | 8 + .../docs/RecordCategoryChildPaging_list.md | 10 + .../docs/RecordCategoryEntry.md | 8 + .../docs/RecordCategoryPaging.md | 8 + .../docs/RecordCategoryPaging_list.md | 10 + .../api/gs-core-rest-api/docs/RecordEntry.md | 8 + .../api/gs-core-rest-api/docs/RecordFolder.md | 22 + .../docs/RecordFolderAssociationPaging.md | 8 + .../RecordFolderAssociationPaging_list.md | 10 + .../docs/RecordFolderChildAssociation.md | 24 + .../docs/RecordFolderChildAssociationEntry.md | 8 + .../docs/RecordFolderEntry.md | 8 + .../gs-core-rest-api/docs/RecordFoldersApi.md | 508 ++++++ .../api/gs-core-rest-api/docs/RecordsApi.md | 465 ++++++ .../gs-core-rest-api/docs/RequestBodyFile.md | 8 + .../docs/RootCategoryBodyCreate.md | 13 + .../src/api/gs-core-rest-api/docs/Transfer.md | 21 + .../docs/TransferAssociationPaging.md | 8 + .../docs/TransferAssociationPaging_list.md | 10 + .../gs-core-rest-api/docs/TransferChild.md | 24 + .../docs/TransferChildAssociation.md | 25 + .../docs/TransferChildAssociationEntry.md | 8 + .../docs/TransferContainer.md | 20 + .../TransferContainerAssociationPaging.md | 8 + ...TransferContainerAssociationPaging_list.md | 10 + .../docs/TransferContainerBodyUpdate.md | 11 + .../docs/TransferContainerChild.md | 21 + .../docs/TransferContainerChildAssociation.md | 22 + .../TransferContainerChildAssociationEntry.md | 8 + .../docs/TransferContainerEntry.md | 8 + .../docs/TransferContainersApi.md | 272 ++++ .../gs-core-rest-api/docs/TransferEntry.md | 8 + .../api/gs-core-rest-api/docs/TransfersApi.md | 186 +++ .../gs-core-rest-api/docs/UnfiledContainer.md | 21 + .../docs/UnfiledContainerAssociationPaging.md | 8 + .../UnfiledContainerAssociationPaging_list.md | 10 + .../docs/UnfiledContainerChild.md | 23 + .../docs/UnfiledContainerChildAssociation.md | 24 + .../UnfiledContainerChildAssociationEntry.md | 8 + .../docs/UnfiledContainerEntry.md | 8 + .../docs/UnfiledContainersApi.md | 467 ++++++ .../docs/UnfiledRecordContainerBodyUpdate.md | 11 + .../docs/UnfiledRecordFolder.md | 23 + .../UnfiledRecordFolderAssociationPaging.md | 8 + ...filedRecordFolderAssociationPaging_list.md | 10 + .../docs/UnfiledRecordFolderBodyUpdate.md | 11 + .../docs/UnfiledRecordFolderChild.md | 23 + .../UnfiledRecordFolderChildAssociation.md | 24 + ...nfiledRecordFolderChildAssociationEntry.md | 8 + .../docs/UnfiledRecordFolderEntry.md | 8 + .../docs/UnfiledRecordFoldersApi.md | 519 ++++++ .../src/api/gs-core-rest-api/docs/UserInfo.md | 9 + lib/js-api/src/api/gs-core-rest-api/index.ts | 19 + .../api/gs-core-rest-api/model/filePlan.ts | 49 + .../model/filePlanBodyUpdate.ts | 20 + .../model/filePlanComponentBodyUpdate.ts | 26 + .../gs-core-rest-api/model/filePlanEntry.ts | 29 + .../src/api/gs-core-rest-api/model/index.ts | 76 + .../model/rMNodeBodyCreate.ts | 27 + .../model/rMNodeBodyCreateWithRelativePath.ts | 28 + .../src/api/gs-core-rest-api/model/rMSite.ts | 26 + .../model/rMSiteBodyCreate.ts | 22 + .../model/rMSiteBodyUpdate.ts | 21 + .../api/gs-core-rest-api/model/rMSiteEntry.ts | 22 + .../src/api/gs-core-rest-api/model/record.ts | 55 + .../gs-core-rest-api/model/recordCategory.ts | 53 + .../model/recordCategoryChild.ts | 59 + .../model/recordCategoryChildEntry.ts | 29 + .../model/recordCategoryChildPaging.ts | 29 + .../model/recordCategoryChildPagingList.ts | 37 + .../model/recordCategoryEntry.ts | 29 + .../model/recordCategoryPaging.ts | 29 + .../model/recordCategoryPagingList.ts | 37 + .../api/gs-core-rest-api/model/recordEntry.ts | 29 + .../gs-core-rest-api/model/recordFolder.ts | 54 + .../model/recordFolderAssociationPaging.ts | 29 + .../recordFolderAssociationPagingList.ts | 37 + .../model/recordFolderChildAssociation.ts | 57 + .../recordFolderChildAssociationEntry.ts | 29 + .../model/recordFolderEntry.ts | 29 + .../gs-core-rest-api/model/requestBodyFile.ts | 20 + .../model/rootCategoryBodyCreate.ts | 27 + .../api/gs-core-rest-api/model/transfer.ts | 55 + .../model/transferAssociationPaging.ts | 30 + .../model/transferAssociationPagingList.ts | 37 + .../gs-core-rest-api/model/transferChild.ts | 55 + .../model/transferChildAssociation.ts | 57 + .../model/transferChildAssociationEntry.ts | 29 + .../model/transferContainer.ts | 47 + .../transferContainerAssociationPaging.ts | 30 + .../transferContainerAssociationPagingList.ts | 37 + .../model/transferContainerBodyUpdate.ts | 25 + .../model/transferContainerChild.ts | 55 + .../transferContainerChildAssociation.ts | 57 + .../transferContainerChildAssociationEntry.ts | 29 + .../model/transferContainerEntry.ts | 29 + .../gs-core-rest-api/model/transferEntry.ts | 29 + .../model/unfiledContainer.ts | 49 + .../unfiledContainerAssociationPaging.ts | 29 + .../unfiledContainerAssociationPagingList.ts | 37 + .../model/unfiledContainerChild.ts | 51 + .../model/unfiledContainerChildAssociation.ts | 53 + .../unfiledContainerChildAssociationEntry.ts | 29 + .../model/unfiledContainerEntry.ts | 29 + .../model/unfiledRecordContainerBodyUpdate.ts | 25 + .../model/unfiledRecordFolder.ts | 51 + .../unfiledRecordFolderAssociationPaging.ts | 29 + ...nfiledRecordFolderAssociationPagingList.ts | 37 + .../model/unfiledRecordFolderBodyUpdate.ts | 25 + .../model/unfiledRecordFolderChild.ts | 51 + .../unfiledRecordFolderChildAssociation.ts | 53 + ...nfiledRecordFolderChildAssociationEntry.ts | 29 + .../model/unfiledRecordFolderEntry.ts | 29 + lib/js-api/src/api/model-rest-api/README.md | 32 + .../src/api/model-rest-api/api/aspects.api.ts | 111 ++ .../src/api/model-rest-api/api/base.api.ts | 25 + .../src/api/model-rest-api/api/index.ts | 19 + .../src/api/model-rest-api/api/types.api.ts | 108 ++ .../docs/AbstractClassAssociation.md | 14 + .../docs/AbstractClassAssociationSource.md | 12 + .../src/api/model-rest-api/docs/Aspect.md | 16 + .../api/model-rest-api/docs/AspectEntry.md | 8 + .../api/model-rest-api/docs/AspectPaging.md | 8 + .../model-rest-api/docs/AspectPaging_list.md | 9 + .../src/api/model-rest-api/docs/AspectsApi.md | 151 ++ .../src/api/model-rest-api/docs/Model.md | 11 + .../src/api/model-rest-api/docs/Type.md | 17 + .../src/api/model-rest-api/docs/TypeEntry.md | 8 + .../src/api/model-rest-api/docs/TypePaging.md | 8 + .../model-rest-api/docs/TypePaging_list.md | 9 + .../src/api/model-rest-api/docs/TypesApi.md | 170 ++ lib/js-api/src/api/model-rest-api/index.ts | 19 + .../api/model-rest-api/model/abstractClass.ts | 40 + .../model/abstractClassAssociation.ts | 28 + .../model/abstractClassAssociationSource.ts | 24 + .../src/api/model-rest-api/model/aspect.ts | 22 + .../api/model-rest-api/model/aspectEntry.ts | 30 + .../api/model-rest-api/model/aspectPaging.ts | 29 + .../model-rest-api/model/aspectPagingList.ts | 34 + .../src/api/model-rest-api/model/index.ts | 28 + .../src/api/model-rest-api/model/model.ts | 24 + .../src/api/model-rest-api/model/type.ts | 22 + .../src/api/model-rest-api/model/typeEntry.ts | 29 + .../api/model-rest-api/model/typePaging.ts | 29 + .../model-rest-api/model/typePagingList.ts | 35 + lib/js-api/src/api/search-rest-api/README.md | 72 + .../src/api/search-rest-api/api/index.ts | 18 + .../src/api/search-rest-api/api/search.api.ts | 51 + .../api/search-rest-api/docs/ContentInfo.md | 12 + .../src/api/search-rest-api/docs/Error.md | 8 + .../api/search-rest-api/docs/Error_error.md | 13 + .../api/search-rest-api/docs/GenericBucket.md | 13 + .../docs/GenericBucket_bucketInfo.md | 11 + .../docs/GenericFacetResponse.md | 10 + .../api/search-rest-api/docs/GenericMetric.md | 10 + .../src/api/search-rest-api/docs/Node.md | 26 + .../api/search-rest-api/docs/Pagination.md | 23 + .../api/search-rest-api/docs/PathElement.md | 9 + .../src/api/search-rest-api/docs/PathInfo.md | 10 + .../search-rest-api/docs/RequestDefaults.md | 43 + .../search-rest-api/docs/RequestFacetField.md | 42 + .../docs/RequestFacetFields.md | 9 + .../docs/RequestFacetIntervals.md | 9 + .../docs/RequestFacetIntervals_intervals.md | 10 + .../docs/RequestFacetQueries.md | 7 + .../docs/RequestFacetQueries_inner.md | 9 + .../search-rest-api/docs/RequestFacetSet.md | 12 + .../api/search-rest-api/docs/RequestFields.md | 7 + .../docs/RequestFilterQueries.md | 7 + .../docs/RequestFilterQueries_inner.md | 11 + .../search-rest-api/docs/RequestHighlight.md | 15 + .../docs/RequestHighlight_fields.md | 13 + .../search-rest-api/docs/RequestInclude.md | 7 + .../api/search-rest-api/docs/RequestLimits.md | 9 + .../docs/RequestLocalization.md | 9 + .../search-rest-api/docs/RequestPagination.md | 9 + .../api/search-rest-api/docs/RequestPivot.md | 9 + .../api/search-rest-api/docs/RequestQuery.md | 23 + .../api/search-rest-api/docs/RequestRange.md | 16 + .../api/search-rest-api/docs/RequestScope.md | 22 + .../docs/RequestSortDefinition.md | 7 + .../docs/RequestSortDefinition_inner.md | 23 + .../search-rest-api/docs/RequestSpellcheck.md | 8 + .../api/search-rest-api/docs/RequestStats.md | 23 + .../search-rest-api/docs/RequestTemplates.md | 7 + .../docs/RequestTemplates_inner.md | 9 + .../docs/ResponseConsistency.md | 8 + .../api/search-rest-api/docs/ResultBuckets.md | 9 + .../docs/ResultBuckets_buckets.md | 11 + .../api/search-rest-api/docs/ResultNode.md | 31 + .../search-rest-api/docs/ResultSetContext.md | 18 + .../docs/ResultSetContext_facetQueries.md | 10 + .../docs/ResultSetContext_spellcheck.md | 20 + .../search-rest-api/docs/ResultSetPaging.md | 8 + .../docs/ResultSetPaging_list.md | 10 + .../search-rest-api/docs/ResultSetRowEntry.md | 8 + .../src/api/search-rest-api/docs/SearchApi.md | 359 +++++ .../api/search-rest-api/docs/SearchEntry.md | 10 + .../docs/SearchEntry_highlight.md | 9 + .../api/search-rest-api/docs/SearchRequest.md | 27 + .../src/api/search-rest-api/docs/UserInfo.md | 9 + lib/js-api/src/api/search-rest-api/index.ts | 19 + .../api/search-rest-api/model/contentInfo.ts | 24 + .../search-rest-api/model/genericBucket.ts | 46 + .../model/genericBucketBucketInfo.ts | 38 + .../model/genericFacetResponse.ts | 33 + .../search-rest-api/model/genericMetric.ts | 30 + .../src/api/search-rest-api/model/index.ts | 61 + .../search-rest-api/model/requestDefaults.ts | 45 + .../model/requestFacetField.ts | 52 + .../model/requestFacetFields.ts | 30 + .../model/requestFacetIntervals.ts | 33 + .../model/requestFacetIntervalsIntervals.ts | 33 + .../model/requestFacetQueries.ts | 23 + .../model/requestFacetQueriesInner.ts | 27 + .../search-rest-api/model/requestFacetSet.ts | 42 + .../search-rest-api/model/requestFields.ts | 24 + .../model/requestFilterQueries.ts | 23 + .../model/requestFilterQueriesInner.ts | 28 + .../search-rest-api/model/requestHighlight.ts | 57 + .../model/requestHighlightFields.ts | 28 + .../search-rest-api/model/requestInclude.ts | 27 + .../search-rest-api/model/requestLimits.ts | 30 + .../model/requestLocalization.ts | 30 + .../model/requestPagination.ts | 27 + .../api/search-rest-api/model/requestPivot.ts | 27 + .../api/search-rest-api/model/requestQuery.ts | 34 + .../api/search-rest-api/model/requestRange.ts | 58 + .../api/search-rest-api/model/requestScope.ts | 26 + .../model/requestSortDefinition.ts | 23 + .../model/requestSortDefinitionInner.ts | 31 + .../model/requestSpellcheck.ts | 24 + .../api/search-rest-api/model/requestStats.ts | 86 + .../search-rest-api/model/requestTemplates.ts | 27 + .../model/requestTemplatesInner.ts | 27 + .../model/responseConsistency.ts | 26 + .../search-rest-api/model/resultBuckets.ts | 29 + .../model/resultBucketsBuckets.ts | 35 + .../api/search-rest-api/model/resultNode.ts | 63 + .../search-rest-api/model/resultSetContext.ts | 50 + .../model/resultSetContextFacetQueries.ts | 25 + .../model/resultSetContextSpellcheck.ts | 24 + .../search-rest-api/model/resultSetPaging.ts | 32 + .../model/resultSetPagingList.ts | 36 + .../model/resultSetRowEntry.ts | 32 + .../api/search-rest-api/model/searchEntry.ts | 29 + .../model/searchEntryHighlight.ts | 27 + .../search-rest-api/model/searchRequest.ts | 62 + lib/js-api/src/assert.ts | 28 + .../src/authentication/authentication.ts | 26 + lib/js-api/src/authentication/basicAuth.ts | 22 + lib/js-api/src/authentication/contentAuth.ts | 215 +++ lib/js-api/src/authentication/oauth2.ts | 21 + lib/js-api/src/authentication/oauth2Auth.ts | 778 +++++++++ lib/js-api/src/authentication/oauth2Config.ts | 34 + lib/js-api/src/authentication/processAuth.ts | 211 +++ lib/js-api/src/contentClient.ts | 53 + lib/js-api/src/index.ts | 43 + lib/js-api/src/ng-package.json | 9 + lib/js-api/src/package.json | 20 + lib/js-api/src/processClient.ts | 51 + lib/js-api/src/storage.ts | 71 + lib/js-api/src/superagentHttpClient.ts | 381 +++++ .../src/to-deprecate/alfresco-api-type.ts | 66 + lib/js-api/src/tsconfig.json | 23 + lib/js-api/src/tsconfig.lib.json | 10 + lib/js-api/src/tsconfig.lib.prod.json | 9 + lib/js-api/src/utils/index.ts | 19 + lib/js-api/src/utils/is-browser.ts | 18 + lib/js-api/src/utils/param-to-string.ts | 32 + lib/js-api/src/utils/path-matcher.ts | 27 + lib/js-api/test/alfrescoApi.spec.ts | 309 ++++ lib/js-api/test/alfrescoApiClient.spec.ts | 79 + lib/js-api/test/alfrescoContent.spec.ts | 230 +++ lib/js-api/test/auth.spec.ts | 522 ++++++ lib/js-api/test/bpmAuth.spec.ts | 304 ++++ lib/js-api/test/changeConfig.spec.ts | 72 + .../content-services/categoriesApi.spec.ts | 263 +++ .../test/content-services/commentsApi.spec.ts | 67 + .../content-services/customModelApi.spec.ts | 80 + .../test/content-services/groupsApi.spec.ts | 133 ++ .../test/content-services/nodeApi.spec.ts | 153 ++ .../test/content-services/peopleApi.spec.ts | 68 + .../test/content-services/queriesApi.spec.ts | 77 + .../content-services/renditionApi.spec.ts | 72 + .../test/content-services/tagApi.spec.ts | 151 ++ .../test/content-services/versionsApi.spec.ts | 92 ++ .../content-services/webScriptApi.spec.ts | 111 ++ lib/js-api/test/discoveryApi.spec.ts | 54 + lib/js-api/test/ecmAuth.spec.ts | 236 +++ .../authorityClearanceApi.spec.ts | 95 ++ .../governance-services/gsSitesApi.spec.ts | 50 + .../nodeSecurityMarksApi.spec.ts | 70 + .../securityGroupApi.spec.ts | 93 ++ .../securityMarksApi.spec.ts | 130 ++ .../test/mockObjects/assets/testFile.txt | 1 + .../test/mockObjects/assets/testFile2.txt | 1 + lib/js-api/test/mockObjects/base.mock.ts | 38 + .../content-services/categories.mock.ts | 347 ++++ .../content-services/comment.mock.ts | 105 ++ .../content-services/custom-model.mock.ts | 69 + .../content-services/discovery.mock.ts | 86 + .../content-services/ecm-auth.mock.ts | 108 ++ .../content-services/find-nodes.mock.ts | 93 ++ .../content-services/groups.mock.ts | 139 ++ .../mockObjects/content-services/node.mock.ts | 233 +++ .../content-services/people.mock.ts | 115 ++ .../content-services/rendition.mock.ts | 99 ++ .../content-services/search.mock.ts | 53 + .../mockObjects/content-services/tag.mock.ts | 99 ++ .../content-services/upload.mock.ts | 104 ++ .../content-services/version.mock.ts | 122 ++ .../content-services/webscript.mock.ts | 84 + .../authority-clearance.mock.ts | 139 ++ .../goverance-services/gs-sites.mock.ts | 37 + .../node-security-marks.mock.ts | 85 + .../security-groups.mock.ts | 95 ++ .../goverance-services/security-marks.mock.ts | 129 ++ lib/js-api/test/mockObjects/index.ts | 51 + .../test/mockObjects/oauth2/oauth.mock.ts | 46 + .../process-services/bpm-auth.mock.ts | 68 + .../process-services/model-json.mock.ts | 155 ++ .../process-services/models.mock.ts | 53 + .../process-instance-variables.mock.ts | 110 ++ .../process-services/process.mock.ts | 160 ++ .../process-services/profile.mock.ts | 103 ++ .../process-services/reports.mock.ts | 212 +++ .../process-services/task-form.mock.ts | 56 + .../process-services/tasks.mock.ts | 1046 ++++++++++++ .../process-services/user-filters.mock.ts | 66 + lib/js-api/test/oauth2Auth.spec.ts | 636 ++++++++ .../test/oauth2AuthImplicitFlow.spec.ts | 188 +++ lib/js-api/test/path-matcher.spec.ts | 101 ++ lib/js-api/test/peopleApi.spec.ts | 51 + .../test/process-services/modelApi.spec.ts | 56 + .../process-services/modelJsonBpmnApi.spec.ts | 56 + .../test/process-services/processApi.spec.ts | 84 + .../processInstanceVariablesApi.spec.ts | 174 ++ .../test/process-services/profileApi.spec.ts | 62 + .../test/process-services/reportApi.spec.ts | 203 +++ .../test/process-services/taskApi.spec.ts | 169 ++ .../test/process-services/taskFormApi.spec.ts | 65 + .../process-services/userFiltersApi.spec.ts | 54 + lib/js-api/test/searchApi.spec.spec.ts | 61 + lib/js-api/test/superagentHttpClient.spec.ts | 90 ++ lib/js-api/test/tsconfig.json | 14 + lib/js-api/test/upload.spec.ts | 327 ++++ lib/process-services-cloud/tsconfig.lib.json | 4 +- lib/process-services/tsconfig.lib.json | 4 +- .../actions/user-filters.util.ts | 53 +- package-lock.json | 1003 +++++++++--- package.json | 7 +- scripts/github/build/npm-check-bundles.sh | 3 +- .../github/update/check-pr-already-exist.js | 21 - scripts/github/update/latest-version-of.js | 46 - scripts/update-version.sh | 3 +- tsconfig.e2e.json | 3 +- tsconfig.json | 2 +- 1334 files changed, 82605 insertions(+), 1068 deletions(-) create mode 100644 .eslintignore delete mode 100644 .eslintrc.json delete mode 100644 .github/workflows/upstream-js.yml create mode 100644 lib/js-api/.eslintrc.json create mode 100644 lib/js-api/.mocharc.json create mode 100644 lib/js-api/docs/audit/.gitkeep create mode 100644 lib/js-api/docs/audit/audit-info-4.10.0.md create mode 100644 lib/js-api/docs/audit/audit-info-4.11.0.md create mode 100644 lib/js-api/docs/audit/audit-info-4.7.0.md create mode 100644 lib/js-api/docs/audit/audit-info-4.8.0.md create mode 100644 lib/js-api/docs/audit/audit-info-4.9.0.md create mode 100644 lib/js-api/docs/audit/audit-info-5.0.0.md create mode 100644 lib/js-api/docs/audit/audit-info-5.1.0.md create mode 100644 lib/js-api/docs/audit/audit-info-5.2.0.md create mode 100644 lib/js-api/docs/audit/audit-info-5.3.0.md create mode 100644 lib/js-api/docs/audit/audit-info-5.4.0.md create mode 100644 lib/js-api/docs/audit/audit-info-5.5.0.md create mode 100644 lib/js-api/docs/audit/audit-info-6.0.0.md create mode 100644 lib/js-api/docs/audit/audit-info-6.1.0.md create mode 100644 lib/js-api/docs/audit/audit-info-6.2.0.md create mode 100644 lib/js-api/docs/audit/audit-info-7.0.0.md create mode 100644 lib/js-api/docs/audit/audit-info-7.1.0.md create mode 100644 lib/js-api/docs/audit/audit-info-7.2.0.md create mode 100644 lib/js-api/docs/authentication.md create mode 100644 lib/js-api/docs/bpm-example.md create mode 100644 lib/js-api/docs/calling-custom-endpoints.md create mode 100644 lib/js-api/docs/changelog/.gitkeep create mode 100644 lib/js-api/docs/changelog/changelog-4.10.0.md create mode 100644 lib/js-api/docs/changelog/changelog-4.11.0.md create mode 100644 lib/js-api/docs/changelog/changelog-4.7.0.md create mode 100644 lib/js-api/docs/changelog/changelog-4.8.0.md create mode 100644 lib/js-api/docs/changelog/changelog-4.9.0.md create mode 100644 lib/js-api/docs/changelog/changelog-5.0.0.md create mode 100644 lib/js-api/docs/changelog/changelog-5.1.0.md create mode 100644 lib/js-api/docs/changelog/changelog-5.2.0.md create mode 100644 lib/js-api/docs/changelog/changelog-5.3.0.md create mode 100644 lib/js-api/docs/changelog/changelog-5.4.0.md create mode 100644 lib/js-api/docs/changelog/changelog-5.5.0.md create mode 100644 lib/js-api/docs/changelog/changelog-6.0.0.md create mode 100644 lib/js-api/docs/changelog/changelog-6.1.0.md create mode 100644 lib/js-api/docs/changelog/changelog-6.2.0.md create mode 100644 lib/js-api/docs/changelog/changelog-7.0.0.md create mode 100644 lib/js-api/docs/changelog/changelog-7.1.0.md create mode 100644 lib/js-api/docs/changelog/changelog-7.2.0.md create mode 100644 lib/js-api/docs/ecm-example.md create mode 100644 lib/js-api/docs/error-events.md create mode 100644 lib/js-api/docs/licences/.gitkeep create mode 100644 lib/js-api/docs/licences/license-info-4.10.0.md create mode 100644 lib/js-api/docs/licences/license-info-4.11.0.md create mode 100644 lib/js-api/docs/licences/license-info-4.7.0.md create mode 100644 lib/js-api/docs/licences/license-info-4.8.0.md create mode 100644 lib/js-api/docs/licences/license-info-4.9.0.md create mode 100644 lib/js-api/docs/licences/license-info-5.0.0.md create mode 100644 lib/js-api/docs/licences/license-info-5.1.0.md create mode 100644 lib/js-api/docs/licences/license-info-5.2.0.md create mode 100644 lib/js-api/docs/licences/license-info-5.3.0.md create mode 100644 lib/js-api/docs/licences/license-info-5.4.0.md create mode 100644 lib/js-api/docs/licences/license-info-5.5.0.md create mode 100644 lib/js-api/docs/licences/license-info-6.0.0.md create mode 100644 lib/js-api/docs/licences/license-info-6.1.0.md create mode 100644 lib/js-api/docs/licences/license-info-6.2.0.md create mode 100644 lib/js-api/docs/licences/license-info-7.0.0.md create mode 100644 lib/js-api/docs/licences/license-info-7.1.0.md create mode 100644 lib/js-api/docs/licences/license-info-7.2.0.md create mode 100644 lib/js-api/src/LICENSE.txt create mode 100644 lib/js-api/src/README.md create mode 100644 lib/js-api/src/alfrescoApi.ts create mode 100644 lib/js-api/src/alfrescoApiClient.ts create mode 100644 lib/js-api/src/alfrescoApiConfig.ts create mode 100644 lib/js-api/src/api-clients/api-client.ts create mode 100644 lib/js-api/src/api-clients/http-client.interface.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/README.md create mode 100644 lib/js-api/src/api/activiti-rest-api/api/about.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/accountIntegration.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/adminEndpoints.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/adminGroups.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/adminTenants.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/adminUsers.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/appDefinitions.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/base.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/checklists.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/comments.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/content.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/dataSources.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/decisionAudits.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/decisionTables.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/endpoints.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/formModels.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/groups.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/iDMSync.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/index.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/integrationAlfrescoCloud.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/integrationAlfrescoOnPremise.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/integrationBox.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/integrationDrive.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/modelJsonBpmn.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/models.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/modelsBpmn.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/modelsHistory.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/processDefinitions.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/processInstanceVariables.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/processInstances.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/processScopes.api.ts create mode 100755 lib/js-api/src/api/activiti-rest-api/api/report.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/runtimeAppDefinitions.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/runtimeAppDeployments.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/scriptFiles.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/submittedForms.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/systemProperties.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/taskActions.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/taskForms.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/taskVariables.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/tasks.api.ts create mode 100755 lib/js-api/src/api/activiti-rest-api/api/temporary.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/types.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/userFilters.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/userProfile.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/api/users.api.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AboutApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AbstractGroupRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AbstractUserRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AccountIntegrationApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AddGroupCapabilitiesRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AdminEndpointsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AdminGroupsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AdminTenantsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AdminUsersApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AlfrescoContentRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AlfrescoEndpointRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AlfrescoNetworkRepresenation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AlfrescoSiteRepresenation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AppDefinition.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionPublishRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionSaveRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionUpdateResultRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AppDeploymentRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AppModelDefinition.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AssigneeIdentifierRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AuditCalculatedValueRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionExpressionInfoRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionInfoRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionRuleInfoRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AuditLogEntryRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/AuditLogFormDataRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/BoxContent.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/BoxUserAccountCredentialsRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/BulkUserUpdateRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ChangePasswordRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ChecklistOrderRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ChecklistsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/CommentAuditInfo.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/CommentRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/CommentsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/CompleteFormRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ConditionRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ContentApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/CreateProcessInstanceRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/CreateTenantRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/DataSourcesApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/DecisionAuditRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/DecisionAuditsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/DecisionTablesApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/DecisionTaskRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/EndpointConfigurationRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/EndpointRequestHeaderRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/EndpointsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/EntityAttributeScopeRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/EntityVariableScopeRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FieldValueInfo.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/File.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormDefinitionRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormFieldRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormIdentifierRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormJavascriptEventRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormModelsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormOutcomeRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormSaveRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormScopeRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormTabRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormValueRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/FormVariableRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/GlobalDateFormatRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/GoogleDriveContent.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/GroupCapabilityRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/GroupRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/GroupsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/HistoricProcessInstanceQueryRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/HistoricTaskInstanceQueryRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/IDMSyncApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/IdentityLinkRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ImageUploadRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/IntegrationBoxApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/IntegrationDriveApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/LayoutRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/LightAppRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/LightGroupRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/LightTenantRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/LightUserRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ModelJsonBpmnApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ModelRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ModelsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ModelsBpmnApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ModelsHistoryApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/NamedObject.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ObjectNode.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/OptionRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/PasswordValidationConstraints.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessContentRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionMetaDataRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceAuditInfoRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceFilterRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceFilterRequestRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceQueryRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceVariableRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessInstancesApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessScopeIdentifierRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessScopeRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessScopesApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ProcessScopesRequestRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/PublishIdentityInfoRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/QueryVariable.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/RelatedContentRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/RelatedProcessTask.md create mode 100755 lib/js-api/src/api/activiti-rest-api/docs/ReportApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResetPasswordRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/RestVariable.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentationRelatedProcessTask.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AbstractUserRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoContentRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoEndpointRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoNetworkRepresenation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoSiteRepresenation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AppDefinitionRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AppDeploymentRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«BoxContent».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«CommentRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«DecisionTaskRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«FormRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«GoogleDriveContent».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«LightGroupRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«LightUserRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ModelRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessContentRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessDefinitionRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessInstanceRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RelatedContentRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RuntimeDecisionTableRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RuntimeFormRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«SubmittedFormRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«TaskRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«UserProcessInstanceFilterRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«UserTaskFilterRepresentation».md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDefinitionSaveRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDefinitionsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/RuntimeDecisionTableRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/RuntimeFormRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/SaveFormRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ScriptFilesApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/SubmittedFormRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/SubmittedFormsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/SyncLogEntryRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/SystemPropertiesApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/SystemPropertiesRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskActionsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskAuditInfoRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskFilterRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskFilterRequestRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskFormsApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskQueryRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskUpdateRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TaskVariablesApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TasksApi.md create mode 100755 lib/js-api/src/api/activiti-rest-api/docs/TemporaryApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TenantEvent.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/TenantRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserAccountCredentialsRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserActionRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserFilterOrderRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserFiltersApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserIdentifierRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserProcessInstanceFilterRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserProfileApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UserTaskFilterRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/UsersApi.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/ValidationErrorRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/VariableMappingRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/docs/VariableScopeRepresentation.md create mode 100644 lib/js-api/src/api/activiti-rest-api/index.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/abstractGroupRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/abstractUserRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/accountRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/addGroupCapabilitiesRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/alfrescoContentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/alfrescoEndpointRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/alfrescoNetworkRepresenation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/alfrescoSiteRepresenation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/appDefinition.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/appDefinitionPublishRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/appDefinitionRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/appDefinitionSaveRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/appDefinitionUpdateResultRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/appDeploymentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/appModelDefinition.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/assigneeIdentifierRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/auditCalculatedValueRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/auditDecisionExpressionInfoRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/auditDecisionInfoRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/auditDecisionRuleInfoRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/auditLogEntryRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/auditLogFormDataRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/boxContent.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/boxUserAccountCredentialsRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/bulkUserUpdateRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/changePasswordRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/checklistOrderRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/commentAuditInfo.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/commentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/completeFormRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/conditionRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/createEndpointBasicAuthRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/createProcessInstanceRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/createTenantRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/dataSourceConfigRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/dataSourceRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/decisionAuditRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/decisionTaskRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/endpointBasicAuthRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/endpointConfigurationRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/endpointRequestHeaderRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/entityAttributeScopeRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/entityVariableScopeRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/fieldValueInfo.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/file.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formDefinitionRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formFieldRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formIdentifierRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formJavascriptEventRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formOutcomeRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formSaveRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formScopeRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formTabRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formValueRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/formVariableRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/globalDateFormatRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/googleDriveContent.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/groupCapabilityRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/groupRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/historicProcessInstanceQueryRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/historicTaskInstanceQueryRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/identityLinkRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/imageUploadRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/index.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/jsonNode.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/layoutRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/lightAppRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/lightGroupRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/lightTenantRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/lightUserRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/modelRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/namedObject.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/objectNode.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/optionRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/passwordValidationConstraints.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processContentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processDefinitionMetaDataRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processDefinitionRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processInstanceAuditInfoRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processInstanceFilterRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processInstanceFilterRequestRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processInstanceQueryRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processInstanceRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processInstanceVariableRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processScopeIdentifierRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processScopeRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/processScopesRequestRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/publishIdentityInfoRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/queryVariable.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/relatedContentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/relatedProcessTask.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resetPasswordRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/restVariable.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAbstractUserRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAccountRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoContentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoEndpointRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoNetworkRepresenation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoSiteRepresenation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAppDefinitionRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAppDeploymentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationBoxContent.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationCommentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDataSourceRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDecisionAuditRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDecisionTaskRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationFormRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationGoogleDriveContent.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationLightGroupRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationLightUserRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationModelRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessContentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessDefinitionRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessInstanceRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRelatedContentRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRelatedProcessTask.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRuntimeDecisionTableRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRuntimeFormRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationSubmittedFormRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationTaskRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationUserProcessInstanceFilterRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationUserTaskFilterRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/runtimeAppDefinitionSaveRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/runtimeDecisionTableRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/runtimeFormRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/saveFormRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/submittedFormRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/syncLogEntryRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/systemPropertiesRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/taskAuditInfoRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/taskFilterRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/taskFilterRequestRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/taskQueryRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/taskRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/taskUpdateRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/tenantEvent.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/tenantRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/userAccountCredentialsRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/userActionRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/userFilterOrderRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/userIdentifierRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/userProcessInstanceFilterRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/userRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/userRepresentationGroup.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/userTaskFilterRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/validationErrorRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/variableMappingRepresentation.ts create mode 100644 lib/js-api/src/api/activiti-rest-api/model/variableScopeRepresentation.ts create mode 100644 lib/js-api/src/api/auth-rest-api/README.md create mode 100644 lib/js-api/src/api/auth-rest-api/api/authentication.api.ts create mode 100644 lib/js-api/src/api/auth-rest-api/api/base.api.ts create mode 100644 lib/js-api/src/api/auth-rest-api/api/index.ts create mode 100644 lib/js-api/src/api/auth-rest-api/docs/AuthenticationApi.md create mode 100644 lib/js-api/src/api/auth-rest-api/docs/Error.md create mode 100644 lib/js-api/src/api/auth-rest-api/docs/Error_error.md create mode 100644 lib/js-api/src/api/auth-rest-api/docs/Ticket.md create mode 100644 lib/js-api/src/api/auth-rest-api/docs/TicketBody.md create mode 100644 lib/js-api/src/api/auth-rest-api/docs/TicketEntry.md create mode 100644 lib/js-api/src/api/auth-rest-api/docs/ValidTicket.md create mode 100644 lib/js-api/src/api/auth-rest-api/docs/ValidTicketEntry.md create mode 100644 lib/js-api/src/api/auth-rest-api/index.ts create mode 100644 lib/js-api/src/api/auth-rest-api/model/index.ts create mode 100644 lib/js-api/src/api/auth-rest-api/model/ticket.ts create mode 100644 lib/js-api/src/api/auth-rest-api/model/ticketBody.ts create mode 100644 lib/js-api/src/api/auth-rest-api/model/ticketEntry.ts create mode 100644 lib/js-api/src/api/auth-rest-api/model/validTicket.ts create mode 100644 lib/js-api/src/api/auth-rest-api/model/validTicketEntry.ts create mode 100644 lib/js-api/src/api/content-custom-api/api/base.api.ts create mode 100755 lib/js-api/src/api/content-custom-api/api/classes.api.ts create mode 100644 lib/js-api/src/api/content-custom-api/api/content.api.ts create mode 100644 lib/js-api/src/api/content-custom-api/api/customModel.api.ts create mode 100644 lib/js-api/src/api/content-custom-api/api/index.ts create mode 100644 lib/js-api/src/api/content-custom-api/api/upload.api.ts create mode 100644 lib/js-api/src/api/content-custom-api/api/webscript.api.ts create mode 100644 lib/js-api/src/api/content-custom-api/docs/UploadApi.md create mode 100644 lib/js-api/src/api/content-custom-api/docs/WebscriptApi.md create mode 100644 lib/js-api/src/api/content-custom-api/index.ts create mode 100644 lib/js-api/src/api/content-custom-api/model/classDescription.ts create mode 100644 lib/js-api/src/api/content-custom-api/model/classPropertyDescription.ts create mode 100644 lib/js-api/src/api/content-custom-api/model/dateAlfresco.ts create mode 100644 lib/js-api/src/api/content-custom-api/model/index.ts create mode 100644 lib/js-api/src/api/content-custom-api/model/pagination.ts create mode 100644 lib/js-api/src/api/content-rest-api/README.md create mode 100644 lib/js-api/src/api/content-rest-api/api/actions.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/activities.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/audit.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/base.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/categories.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/comments.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/downloads.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/favorites.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/groups.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/index.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/networks.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/nodes.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/people.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/preferences.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/probes.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/queries.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/ratings.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/renditions.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/sharedlinks.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/sites.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/tags.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/trashcan.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/types.ts create mode 100644 lib/js-api/src/api/content-rest-api/api/versions.api.ts create mode 100644 lib/js-api/src/api/content-rest-api/docs/ActionsApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/ActivitiesApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Association.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/AssociationEntry.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/AssociationInfo.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/AuditApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/CategoriesApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/ChildAssociation.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/ChildAssociationEntry.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/ChildAssociationInfo.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/CommentsApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Company.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/ContentInfo.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Definition.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/DirectAccessUrl.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/DirectAccessUrlEntry.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/DownloadsApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Error.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/ErrorError.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/FavoritesApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Group.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/GroupMember.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/GroupsApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/NetworksApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Node.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/NodeEntry.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/NodesApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Pagination.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/PathElement.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/PathInfo.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/PeopleApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/PermissionElement.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/PermissionsInfo.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Person.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/PersonEntry.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/PersonPaging.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/PreferencesApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/ProbesApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Property.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/QueriesApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/RatingsApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Rendition.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/RenditionBodyCreate.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/RenditionEntry.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/RenditionPaging.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/RenditionsApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/SharedlinksApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/Site.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/SiteEntry.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/SiteEntryRelations.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/SitePaging.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/SitesApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/TagsApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/TrashcanApi.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/UserInfo.md create mode 100644 lib/js-api/src/api/content-rest-api/docs/VersionsApi.md create mode 100644 lib/js-api/src/api/content-rest-api/index.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/CategoryLinkBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/actionBodyExec.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/actionDefinition.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/actionDefinitionEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/actionDefinitionList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/actionDefinitionListList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/actionExecResult.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/actionExecResultEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/actionParameterDefinition.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/activity.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/activityEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/activityPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/activityPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/association.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/associationBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/associationEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/associationInfo.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditApp.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditAppEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditAppPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditAppPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditBodyUpdate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditEntryEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditEntryPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/auditEntryPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/capabilities.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/category.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/categoryBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/categoryEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/categoryPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/categoryPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/childAssociation.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/childAssociationBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/childAssociationEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/childAssociationInfo.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/clientBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/comment.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/commentBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/commentEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/commentPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/commentPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/company.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/constraint.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/contentInfo.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/definition.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/deletedNode.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/deletedNodeBodyRestore.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/deletedNodeEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/deletedNodesPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/deletedNodesPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/directAccessUrl.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/directAccessUrlEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/download.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/downloadBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/downloadEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/errorError.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/favorite.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/favoriteBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/favoriteEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/favoritePaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/favoritePagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/favoriteSite.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/favoriteSiteBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/favoriteSiteEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/group.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupBodyUpdate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupMember.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupMemberEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupMemberPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupMemberPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupMembershipBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/groupPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/index.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/modelError.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/networkQuota.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/node.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeAssociation.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeAssociationEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeAssociationPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeAssociationPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeBodyCopy.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeBodyCreateAssociation.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeBodyLock.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeBodyMove.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeBodyUpdate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeChildAssociation.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeChildAssociationEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeChildAssociationPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeChildAssociationPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodeEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodePaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/nodePagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/pagination.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/passwordResetBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/pathElement.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/pathInfo.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/permissionElement.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/permissionsBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/permissionsInfo.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/person.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personBodyUpdate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personNetwork.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personNetworkEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personNetworkPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personNetworkPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/personPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/preference.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/preferenceEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/preferencePaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/preferencePagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/probeEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/probeEntryEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/property.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/rating.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/ratingAggregate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/ratingBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/ratingEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/ratingPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/ratingPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/rendition.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/renditionBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/renditionEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/renditionPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/renditionPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/revertBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/sharedLink.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/sharedLinkBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/sharedLinkBodyEmail.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/sharedLinkEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/sharedLinkPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/sharedLinkPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/site.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteBodyUpdate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteContainer.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteContainerEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteContainerPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteContainerPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteEntryRelations.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteGroup.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteGroupEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteGroupPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteGroupPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMember.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMemberEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMemberPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMemberPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipApprovalBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipBodyUpdate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRejectionBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequest.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestBodyCreate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestBodyUpdate.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPerson.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/sitePaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/sitePagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteRole.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteRoleEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteRolePaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/siteRolePagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/tag.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/tagBody.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/tagEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/tagPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/tagPagingList.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/userInfo.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/version.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/versionEntry.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/versionPaging.ts create mode 100644 lib/js-api/src/api/content-rest-api/model/versionPagingList.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/README.md create mode 100644 lib/js-api/src/api/discovery-rest-api/api/base.api.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/api/discovery.api.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/api/index.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/DiscoveryApi.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/DiscoveryEntry.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/EntitlementsInfo.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/Error.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/Error_error.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/LicenseInfo.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/ModuleInfo.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/RepositoryEntry.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/RepositoryInfo.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/StatusInfo.md create mode 100644 lib/js-api/src/api/discovery-rest-api/docs/VersionInfo.md create mode 100644 lib/js-api/src/api/discovery-rest-api/index.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/discoveryEntry.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/entitlementsInfo.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/index.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/licenseInfo.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/moduleInfo.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/repositoryEntry.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/repositoryInfo.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/statusInfo.ts create mode 100644 lib/js-api/src/api/discovery-rest-api/model/versionInfo.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/README.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/authorityClearance.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/base.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/classificationGuides.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/classificationReasons.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/declassificationExemptions.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/defaultClassificationValues.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/index.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/nodeSecurityMarks.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/securityControlSettings.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/securityGroups.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/securityMarks.api.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/api/types.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroup.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupPaging.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupPaging_list.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceMark.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuide.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideInTopic.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidePaging.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidePaging_list.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuides.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesApi.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesInTopic.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationInformation.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReason.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsApi.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsPaging.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsPaging_list.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/CombinedInstructionBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationDate.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemption.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsApi.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsPaging.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsPaging_list.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/DefaultClassificationValuesApi.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/Error.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/Error_error.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/Instruction.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/InstructionBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/InstructionEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/NodeSecurityMarkBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/Pagination.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/Path.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/PathElement.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSetting.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingsApi.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroup.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupPaging.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupPaging_list.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMark.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkInformation.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkInformationBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkPaging.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkPaging_list.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarks.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarksBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/SubtopicPaging.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/Topic.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/TopicBody.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/TopicEntry.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/TopicPaging.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/docs/TopicPaging_list.md create mode 100644 lib/js-api/src/api/gs-classification-rest-api/index.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroup.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupPaging.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupPagingList.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceMark.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuide.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideInTopic.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidePaging.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidePagingList.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuides.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesInTopic.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationInformation.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationReason.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonsPaging.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonsPagingList.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/combinedInstructionBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/declassificationDate.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemption.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionsPaging.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionsPagingList.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/index.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/instruction.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/instructionBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/instructionEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/nodeSecurityMarkBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/path.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityControlSetting.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityControlSettingBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityControlSettingEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityGroup.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityGroupBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityGroupEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityGroupPaging.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityGroupPagingList.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMark.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMarkBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMarkEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMarkInformation.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMarkInformationBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMarkPaging.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMarkPagingList.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMarks.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/securityMarksBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/subtopicPaging.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/topic.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/topicBody.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/topicEntry.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/topicPaging.ts create mode 100644 lib/js-api/src/api/gs-classification-rest-api/model/topicPagingList.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/README.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/base.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/filePlans.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/files.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/gsSites.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/index.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/recordCategories.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/recordFolders.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/records.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/transferContainers.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/transfers.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/types.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/unfiledContainers.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/api/unfiledRecordFolders.api.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/ChildAssociationInfo.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/ContentInfo.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/Error.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/Error_error.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/FilePlan.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/FilePlanBodyUpdate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/FilePlanComponentBodyUpdate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/FilePlanEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/FilePlansApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/FilesApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/GssitesApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/Pagination.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/PathElement.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/PathInfo.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RMNodeBodyCreate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RMNodeBodyCreateWithRelativePath.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RMSite.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RMSiteBodyCreate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RMSiteBodyUpdate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RMSiteEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/Record.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoriesApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategory.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChild.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildPaging.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildPaging_list.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryPaging.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryPaging_list.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordFolder.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderAssociationPaging.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderAssociationPaging_list.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderChildAssociation.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderChildAssociationEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordFoldersApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RecordsApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RequestBodyFile.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/RootCategoryBodyCreate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/Transfer.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferAssociationPaging.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferAssociationPaging_list.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferChild.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferChildAssociation.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferChildAssociationEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainer.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerAssociationPaging.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerAssociationPaging_list.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerBodyUpdate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChild.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChildAssociation.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChildAssociationEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferContainersApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransferEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/TransfersApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainer.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerAssociationPaging.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerAssociationPaging_list.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChild.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChildAssociation.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChildAssociationEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainersApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordContainerBodyUpdate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolder.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderAssociationPaging.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderAssociationPaging_list.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderBodyUpdate.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChild.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChildAssociation.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChildAssociationEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderEntry.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFoldersApi.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/docs/UserInfo.md create mode 100644 lib/js-api/src/api/gs-core-rest-api/index.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/filePlan.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/filePlanBodyUpdate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/filePlanComponentBodyUpdate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/filePlanEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/index.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/rMNodeBodyCreate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/rMNodeBodyCreateWithRelativePath.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/rMSite.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/rMSiteBodyCreate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/rMSiteBodyUpdate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/rMSiteEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/record.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordCategory.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChild.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildPaging.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildPagingList.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordCategoryEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordCategoryPaging.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordCategoryPagingList.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordFolder.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordFolderAssociationPaging.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordFolderAssociationPagingList.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordFolderChildAssociation.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordFolderChildAssociationEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/recordFolderEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/requestBodyFile.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/rootCategoryBodyCreate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transfer.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferAssociationPaging.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferAssociationPagingList.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferChild.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferChildAssociation.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferChildAssociationEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferContainer.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferContainerAssociationPaging.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferContainerAssociationPagingList.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferContainerBodyUpdate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferContainerChild.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferContainerChildAssociation.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferContainerChildAssociationEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferContainerEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/transferEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledContainer.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerAssociationPaging.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerAssociationPagingList.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChild.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChildAssociation.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChildAssociationEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordContainerBodyUpdate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolder.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderAssociationPaging.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderAssociationPagingList.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderBodyUpdate.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChild.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChildAssociation.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChildAssociationEntry.ts create mode 100644 lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderEntry.ts create mode 100644 lib/js-api/src/api/model-rest-api/README.md create mode 100644 lib/js-api/src/api/model-rest-api/api/aspects.api.ts create mode 100644 lib/js-api/src/api/model-rest-api/api/base.api.ts create mode 100644 lib/js-api/src/api/model-rest-api/api/index.ts create mode 100644 lib/js-api/src/api/model-rest-api/api/types.api.ts create mode 100644 lib/js-api/src/api/model-rest-api/docs/AbstractClassAssociation.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/AbstractClassAssociationSource.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/Aspect.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/AspectEntry.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/AspectPaging.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/AspectPaging_list.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/AspectsApi.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/Model.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/Type.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/TypeEntry.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/TypePaging.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/TypePaging_list.md create mode 100644 lib/js-api/src/api/model-rest-api/docs/TypesApi.md create mode 100644 lib/js-api/src/api/model-rest-api/index.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/abstractClass.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/abstractClassAssociation.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/abstractClassAssociationSource.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/aspect.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/aspectEntry.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/aspectPaging.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/aspectPagingList.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/index.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/model.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/type.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/typeEntry.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/typePaging.ts create mode 100644 lib/js-api/src/api/model-rest-api/model/typePagingList.ts create mode 100644 lib/js-api/src/api/search-rest-api/README.md create mode 100644 lib/js-api/src/api/search-rest-api/api/index.ts create mode 100644 lib/js-api/src/api/search-rest-api/api/search.api.ts create mode 100644 lib/js-api/src/api/search-rest-api/docs/ContentInfo.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/Error.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/Error_error.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/GenericBucket.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/GenericBucket_bucketInfo.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/GenericFacetResponse.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/GenericMetric.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/Node.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/Pagination.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/PathElement.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/PathInfo.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestDefaults.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFacetField.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFacetFields.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFacetIntervals.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFacetIntervals_intervals.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFacetQueries.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFacetQueries_inner.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFacetSet.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFields.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFilterQueries.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestFilterQueries_inner.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestHighlight.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestHighlight_fields.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestInclude.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestLimits.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestLocalization.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestPagination.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestPivot.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestQuery.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestRange.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestScope.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestSortDefinition.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestSortDefinition_inner.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestSpellcheck.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestStats.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestTemplates.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/RequestTemplates_inner.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResponseConsistency.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultBuckets.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultBuckets_buckets.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultNode.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultSetContext.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultSetContext_facetQueries.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultSetContext_spellcheck.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultSetPaging.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultSetPaging_list.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/ResultSetRowEntry.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/SearchApi.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/SearchEntry.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/SearchEntry_highlight.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/SearchRequest.md create mode 100644 lib/js-api/src/api/search-rest-api/docs/UserInfo.md create mode 100644 lib/js-api/src/api/search-rest-api/index.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/contentInfo.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/genericBucket.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/genericBucketBucketInfo.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/genericFacetResponse.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/genericMetric.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/index.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestDefaults.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFacetField.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFacetFields.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFacetIntervals.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFacetIntervalsIntervals.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFacetQueries.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFacetQueriesInner.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFacetSet.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFields.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFilterQueries.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestFilterQueriesInner.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestHighlight.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestHighlightFields.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestInclude.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestLimits.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestLocalization.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestPagination.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestPivot.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestQuery.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestRange.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestScope.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestSortDefinition.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestSortDefinitionInner.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestSpellcheck.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestStats.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestTemplates.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/requestTemplatesInner.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/responseConsistency.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultBuckets.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultBucketsBuckets.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultNode.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultSetContext.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultSetContextFacetQueries.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultSetContextSpellcheck.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultSetPaging.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultSetPagingList.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/resultSetRowEntry.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/searchEntry.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/searchEntryHighlight.ts create mode 100644 lib/js-api/src/api/search-rest-api/model/searchRequest.ts create mode 100644 lib/js-api/src/assert.ts create mode 100644 lib/js-api/src/authentication/authentication.ts create mode 100644 lib/js-api/src/authentication/basicAuth.ts create mode 100644 lib/js-api/src/authentication/contentAuth.ts create mode 100644 lib/js-api/src/authentication/oauth2.ts create mode 100644 lib/js-api/src/authentication/oauth2Auth.ts create mode 100644 lib/js-api/src/authentication/oauth2Config.ts create mode 100644 lib/js-api/src/authentication/processAuth.ts create mode 100644 lib/js-api/src/contentClient.ts create mode 100644 lib/js-api/src/index.ts create mode 100644 lib/js-api/src/ng-package.json create mode 100644 lib/js-api/src/package.json create mode 100644 lib/js-api/src/processClient.ts create mode 100644 lib/js-api/src/storage.ts create mode 100644 lib/js-api/src/superagentHttpClient.ts create mode 100644 lib/js-api/src/to-deprecate/alfresco-api-type.ts create mode 100644 lib/js-api/src/tsconfig.json create mode 100644 lib/js-api/src/tsconfig.lib.json create mode 100644 lib/js-api/src/tsconfig.lib.prod.json create mode 100644 lib/js-api/src/utils/index.ts create mode 100644 lib/js-api/src/utils/is-browser.ts create mode 100644 lib/js-api/src/utils/param-to-string.ts create mode 100644 lib/js-api/src/utils/path-matcher.ts create mode 100644 lib/js-api/test/alfrescoApi.spec.ts create mode 100644 lib/js-api/test/alfrescoApiClient.spec.ts create mode 100644 lib/js-api/test/alfrescoContent.spec.ts create mode 100644 lib/js-api/test/auth.spec.ts create mode 100644 lib/js-api/test/bpmAuth.spec.ts create mode 100644 lib/js-api/test/changeConfig.spec.ts create mode 100644 lib/js-api/test/content-services/categoriesApi.spec.ts create mode 100644 lib/js-api/test/content-services/commentsApi.spec.ts create mode 100644 lib/js-api/test/content-services/customModelApi.spec.ts create mode 100644 lib/js-api/test/content-services/groupsApi.spec.ts create mode 100644 lib/js-api/test/content-services/nodeApi.spec.ts create mode 100644 lib/js-api/test/content-services/peopleApi.spec.ts create mode 100644 lib/js-api/test/content-services/queriesApi.spec.ts create mode 100644 lib/js-api/test/content-services/renditionApi.spec.ts create mode 100644 lib/js-api/test/content-services/tagApi.spec.ts create mode 100644 lib/js-api/test/content-services/versionsApi.spec.ts create mode 100644 lib/js-api/test/content-services/webScriptApi.spec.ts create mode 100644 lib/js-api/test/discoveryApi.spec.ts create mode 100644 lib/js-api/test/ecmAuth.spec.ts create mode 100644 lib/js-api/test/governance-services/authorityClearanceApi.spec.ts create mode 100644 lib/js-api/test/governance-services/gsSitesApi.spec.ts create mode 100644 lib/js-api/test/governance-services/nodeSecurityMarksApi.spec.ts create mode 100644 lib/js-api/test/governance-services/securityGroupApi.spec.ts create mode 100644 lib/js-api/test/governance-services/securityMarksApi.spec.ts create mode 100644 lib/js-api/test/mockObjects/assets/testFile.txt create mode 100644 lib/js-api/test/mockObjects/assets/testFile2.txt create mode 100644 lib/js-api/test/mockObjects/base.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/categories.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/comment.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/custom-model.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/discovery.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/ecm-auth.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/find-nodes.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/groups.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/node.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/people.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/rendition.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/search.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/tag.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/upload.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/version.mock.ts create mode 100644 lib/js-api/test/mockObjects/content-services/webscript.mock.ts create mode 100644 lib/js-api/test/mockObjects/goverance-services/authority-clearance.mock.ts create mode 100644 lib/js-api/test/mockObjects/goverance-services/gs-sites.mock.ts create mode 100644 lib/js-api/test/mockObjects/goverance-services/node-security-marks.mock.ts create mode 100644 lib/js-api/test/mockObjects/goverance-services/security-groups.mock.ts create mode 100644 lib/js-api/test/mockObjects/goverance-services/security-marks.mock.ts create mode 100644 lib/js-api/test/mockObjects/index.ts create mode 100644 lib/js-api/test/mockObjects/oauth2/oauth.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/bpm-auth.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/model-json.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/models.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/process-instance-variables.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/process.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/profile.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/reports.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/task-form.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/tasks.mock.ts create mode 100644 lib/js-api/test/mockObjects/process-services/user-filters.mock.ts create mode 100644 lib/js-api/test/oauth2Auth.spec.ts create mode 100644 lib/js-api/test/oauth2AuthImplicitFlow.spec.ts create mode 100644 lib/js-api/test/path-matcher.spec.ts create mode 100644 lib/js-api/test/peopleApi.spec.ts create mode 100644 lib/js-api/test/process-services/modelApi.spec.ts create mode 100644 lib/js-api/test/process-services/modelJsonBpmnApi.spec.ts create mode 100644 lib/js-api/test/process-services/processApi.spec.ts create mode 100644 lib/js-api/test/process-services/processInstanceVariablesApi.spec.ts create mode 100644 lib/js-api/test/process-services/profileApi.spec.ts create mode 100644 lib/js-api/test/process-services/reportApi.spec.ts create mode 100644 lib/js-api/test/process-services/taskApi.spec.ts create mode 100644 lib/js-api/test/process-services/taskFormApi.spec.ts create mode 100644 lib/js-api/test/process-services/userFiltersApi.spec.ts create mode 100644 lib/js-api/test/searchApi.spec.spec.ts create mode 100644 lib/js-api/test/superagentHttpClient.spec.ts create mode 100644 lib/js-api/test/tsconfig.json create mode 100644 lib/js-api/test/upload.spec.ts delete mode 100755 scripts/github/update/check-pr-already-exist.js delete mode 100755 scripts/github/update/latest-version-of.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..9bea255a96 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,11 @@ +.angular +nxcache +node_modules +dist +coverage +.github +.vscode +scripts +/angular.json +docs/**/*.md +lib/js-api/docs/**/*.md diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index e05c7e3899..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,188 +0,0 @@ -module.exports = { - root: true, - ignorePatterns: [ - 'projects/**/*', - '**/node_modules/**/*', - 'lib/cli/node_modules/**/*', - '**/node_modules', - '**/docker', - '**/assets', - '**/scripts', - '**/docs' - ], - plugins: ['@nrwl/nx'], - overrides: [ - { - files: ['*.ts'], - parserOptions: { - project: ['tsconfig.json', 'e2e/tsconfig.e2e.json'], - createDefaultProgram: true - }, - extends: [ - 'plugin:@nrwl/nx/typescript', - 'plugin:@nrwl/nx/angular', - 'plugin:@cspell/recommended', - 'plugin:@angular-eslint/ng-cli-compat', - 'plugin:@angular-eslint/ng-cli-compat--formatting-add-on', - 'plugin:@angular-eslint/template/process-inline-templates', - 'plugin:jsdoc/recommended-typescript-error' - ], - plugins: [ - 'eslint-plugin-unicorn', - 'eslint-plugin-rxjs', - 'prettier', - 'ban', - 'license-header', - '@cspell', - 'eslint-plugin-import', - '@angular-eslint/eslint-plugin', - '@typescript-eslint', - 'jsdoc' - ], - rules: { - // Uncomment this to enable prettier checks as part of the ESLint - // 'prettier/prettier': 'error', - 'ban/ban': [ - 'error', - { name: 'eval', message: 'Calls to eval is not allowed.' }, - { name: 'fdescribe', message: 'Calls to fdescribe is not allowed' }, - { name: 'fit', message: 'Calls to fit is not allowed' }, - { name: 'xit', message: 'Calls to xit is not allowed' }, - { name: 'xdescribe', message: 'Calls to xdescribe is not allowed' }, - { name: ['test', 'only'], message: 'Calls to test.only is not allowed' }, - { name: ['describe', 'only'], message: 'Calls to describe.only is not allowed' } - ], - '@angular-eslint/component-selector': [ - 'error', - { - type: 'element', - prefix: ['adf', 'app'], - style: 'kebab-case' - } - ], - '@angular-eslint/directive-selector': [ - 'error', - { - type: ['element', 'attribute'], - prefix: ['adf', 'app'], - style: 'kebab-case' - } - ], - '@angular-eslint/no-host-metadata-property': 'off', - '@angular-eslint/no-input-prefix': 'error', - '@typescript-eslint/consistent-type-definitions': 'error', - '@typescript-eslint/dot-notation': 'off', - '@typescript-eslint/explicit-member-accessibility': [ - 'off', - { - accessibility: 'explicit' - } - ], - '@typescript-eslint/await-thenable': 'error', - '@typescript-eslint/prefer-optional-chain': 'warn', - '@typescript-eslint/no-inferrable-types': 'off', - '@typescript-eslint/no-require-imports': 'off', - '@typescript-eslint/no-var-requires': 'error', - '@typescript-eslint/naming-convention': [ - 'error', - { - selector: [ - 'classProperty', - 'objectLiteralProperty', - 'typeProperty', - 'classMethod', - 'objectLiteralMethod', - 'typeMethod', - 'accessor', - 'enumMember' - ], - format: null, - modifiers: ['requiresQuotes'] - } - ], - '@typescript-eslint/member-ordering': 'off', - 'prefer-arrow/prefer-arrow-functions': 'off', - 'prefer-promise-reject-errors': 'error', - 'brace-style': 'off', - '@typescript-eslint/brace-style': 'error', - 'comma-dangle': 'error', - 'default-case': 'error', - 'import/order': 'off', - 'max-len': [ - 'error', - { - code: 240 - } - ], - 'no-bitwise': 'off', - 'no-console': [ - 'error', - { - allow: [ - 'warn', - 'dir', - 'timeLog', - 'assert', - 'clear', - 'count', - 'countReset', - 'group', - 'groupEnd', - 'table', - 'dirxml', - 'error', - 'groupCollapsed', - 'Console', - 'profile', - 'profileEnd', - 'timeStamp', - 'context' - ] - } - ], - 'no-duplicate-imports': 'error', - 'no-multiple-empty-lines': 'error', - 'no-redeclare': 'error', - 'no-return-await': 'error', - 'rxjs/no-create': 'error', - 'rxjs/no-subject-unsubscribe': 'error', - 'rxjs/no-subject-value': 'error', - 'rxjs/no-unsafe-takeuntil': 'error', - 'unicorn/filename-case': 'error', - '@typescript-eslint/no-unused-expressions': [ - 'error', - { - allowShortCircuit: true, - allowTernary: true - } - ], - 'license-header/header': [ - 'error', - [ - '/*!', - ' * @license', - ' * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.', - ' *', - ' * Licensed under the Apache License, Version 2.0 (the "License");', - ' * you may not use this file except in compliance with the License.', - ' * You may obtain a copy of the License at', - ' *', - ' * http://www.apache.org/licenses/LICENSE-2.0', - ' *', - ' * Unless required by applicable law or agreed to in writing, software', - ' * distributed under the License is distributed on an "AS IS" BASIS,', - ' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.', - ' * See the License for the specific language governing permissions and', - ' * limitations under the License.', - ' */' - ] - ] - } - }, - { - files: ['*.html'], - extends: ['plugin:@angular-eslint/template/recommended'], - rules: {} - } - ] -}; diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f2bb331279..bb60c33eff 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -218,16 +218,18 @@ jobs: # max-parallel: 4 matrix: unit-tests: + - name: js-api + exclude: "core,insights,content-services,process-services,process-services-cloud,eslint-plugin-eslint-angular" - name: content-services - exclude: "insights,core,extensions,process-services,process-services-cloud,eslint-plugin-eslint-angular" + exclude: "insights,core,extensions,process-services,process-services-cloud,eslint-plugin-eslint-angular,js-api" - name: core - exclude: "insights,content-services,process-services,process-services-cloud,eslint-plugin-eslint-angular" + exclude: "insights,content-services,process-services,process-services-cloud,eslint-plugin-eslint-angular,js-api" - name: insights - exclude: "core,extensions,content-services,process-services-cloud,process-services,eslint-plugin-eslint-angular" + exclude: "core,extensions,content-services,process-services-cloud,process-services,eslint-plugin-eslint-angular,js-api" - name: process-services - exclude: "core,extensions,content-services,process-services-cloud,insights,eslint-plugin-eslint-angular" + exclude: "core,extensions,content-services,process-services-cloud,insights,eslint-plugin-eslint-angular,js-api" - name: process-cloud - exclude: "insights,core,extensions,content-services,process-services,eslint-plugin-eslint-angular" + exclude: "insights,core,extensions,content-services,process-services,eslint-plugin-eslint-angular,js-api" steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/.github/workflows/upstream-js.yml b/.github/workflows/upstream-js.yml deleted file mode 100644 index 3da44c59b6..0000000000 --- a/.github/workflows/upstream-js.yml +++ /dev/null @@ -1,214 +0,0 @@ -name: Upstream js -on: - schedule: - - cron: '0 */3 * * *' # “At minute 0 past every 3rd hour.” - workflow_dispatch: - inputs: - tag_version: - description: image tag - type: choice - required: true - options: - - alpha - - latest - default: alpha - -jobs: - upstream: - runs-on: ubuntu-latest - outputs: - hasAtLeastOneNewVersion: ${{ steps.fetchLatestPkg.outputs.hasAtLeastOneNewVersion }} - hasNewVersionAvailableJS: ${{ steps.fetchLatestPkg.outputs.hasVersionNewJS }} - latestVersionAvailableJS: ${{ steps.fetchLatestPkg.outputs.latestVersionJS }} - hasAtLeastOneNewVersionWithoutPR: ${{ steps.checkPrAlreadyExist.outputs.hasAtLeastOneNewVersionWithoutPR }} - steps: - - id: checkoutRepo - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - id: fetchLatestPkg - name: Fetch the latest package version - uses: actions/github-script@v6 - env: - TAG_VERSION: ${{ inputs.tag_version }} - with: - github-token: ${{ secrets.PAT_WRITE_PKG }} - script: | - const tagVersion = process.env.TAG_VERSION; - console.log('tagVersion:',tagVersion); - const getLatestVersionOf = require('./scripts/github/update/latest-version-of.js'); - - const { hasVersionNew: hasVersionNewJS, latestVersion: latestVersionJS } = await getLatestVersionOf({github, context, dependencyName: 'js-api', tagVersion}); - console.log('hasVersionNewJS', hasVersionNewJS) - console.log('latestVersionJS', latestVersionJS) - - if (hasVersionNewJS === 'true' ) { - core.setOutput('hasAtLeastOneNewVersion', 'true'); - core.setOutput('hasVersionNewJS', 'true'); - core.setOutput('latestVersionJS', latestVersionJS); - } else { - core.setOutput('hasAtLeastOneNewVersion', 'false'); - console.log('No new version available, skipping upstream!') - } - - - name: Check value after - run: | - echo "The value hasAtLeastOneNewVersion is: ${{ steps.fetchLatestPkg.outputs.hasAtLeastOneNewVersion }}" - echo "The value hasVersionNewJS is: ${{ steps.fetchLatestPkg.outputs.hasVersionNewJS }}" - echo "The value latestVersionJS is: ${{ steps.fetchLatestPkg.outputs.latestVersionJS }}" - - - id: checkPrAlreadyExist - name: Check PR with latest already exist - if: ${{ steps.fetchLatestPkg.outputs.hasAtLeastOneNewVersion == 'true' }} - uses: actions/github-script@v6 - env: - HAS_NEW_JS_VERSION: ${{ steps.fetchLatestPkg.outputs.hasVersionNewJS }} - LATEST_JS_VERSION: ${{ steps.fetchLatestPkg.outputs.latestVersionJS }} - with: - github-token: ${{ secrets.BOT_GITHUB_TOKEN }} - script: | - const hasVersionNewJS = process.env.HAS_NEW_JS_VERSION; - const latestVersionJS = process.env.LATEST_JS_VERSION; - - const checkPRAlreadyExist = require('./scripts/github/update/check-pr-already-exist.js'); - let isPRWithLatestJSAlreadyAvailable = false; - - if (hasVersionNewJS === 'true') { - isPRWithLatestJSAlreadyAvailable = await checkPRAlreadyExist({github, context, version: latestVersionJS}); - console.log('isPRWithLatestJSAlreadyAvailable', isPRWithLatestJSAlreadyAvailable); - } - - if (isPRWithLatestJSAlreadyAvailable) { - console.log('Warning: Upstream PR already exist, stop the migration execution!'); - core.setOutput('hasAtLeastOneNewVersionWithoutPR', 'false'); - } else { - core.setOutput('hasAtLeastOneNewVersionWithoutPR', 'true'); - } - - migrate: - if: ${{ needs.upstream.outputs.hasAtLeastOneNewVersionWithoutPR == 'true' }} - runs-on: ubuntu-latest - needs: upstream - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - token: ${{ secrets.BOT_GITHUB_TOKEN }} - fetch-depth: 1 - - name: setup NPM - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache-dependency-path: package-lock.json - - name: "General :: dbpci-install" - run: | - npm ci --ignore-scripts - - name: Migration - shell: bash - env: - IS_JS_AFFECTED: ${{ needs.upstream.outputs.hasNewVersionAvailableJS }} - PACKAGE_VERSION_JS: ${{ needs.upstream.outputs.latestVersionAvailableJS }} - BRANCH_TO_CREATE: "upstream-dependencies" - run: | - - migrateDependenciesJS() { - echo "Update JS dependencies to: ${PACKAGE_VERSION_JS}" - echo "Calling migration JS" - npx nx migrate @alfresco/js-api@${PACKAGE_VERSION_JS} - echo "Migration JS done" - } - - migrateLibDependenciesJS() { - eval projects=( "cli" - "core" - "content-services" - "process-services" - "process-services-cloud" - "insights" - "testing" - "extensions" ) - - projectslength=${#projects[@]} - for (( i=0; i<${projectslength}; i++ )); - do - echo "Update JS dependencies in adf-${projects[$i]} to: ${PACKAGE_VERSION_JS}" - DESTDIR="lib/${projects[$i]}" - sed -i "${sedi[@]}" "s/\"@alfresco\/js-api\": \".*\"/\"@alfresco\/js-api\": \">=${PACKAGE_VERSION_JS}\"/g" ${DESTDIR}/package.json - done - } - - regeneratePackageLock() { - echo "Regenerate lock" - npm i --package-lock-only - echo "Package-lock done." - } - - if git checkout ${BRANCH_TO_CREATE} 2>/dev/null ; then - git reset --hard origin/develop - echo "Reset branch" - fi - - if [[ "$IS_JS_AFFECTED" == "true" ]]; then - migrateDependenciesJS - migrateLibDependenciesJS - fi - - regeneratePackageLock - - - name: Commit Code - if: ${{ needs.upstream.outputs.hasAtLeastOneNewVersion == 'true' }} - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "[ci:force][auto-commit] Update dependencies JS:${{ needs.upstream.outputs.latestVersionAvailableJS }}" - branch: upstream-dependencies - push_options: '--force' - create_branch: true - - - name: Create a Pull request - uses: actions/github-script@v6 - env: - PACKAGE_VERSION_JS: ${{ needs.upstream.outputs.latestVersionAvailableJS }} - with: - github-token: ${{ secrets.BOT_GITHUB_TOKEN }} - script: | - const { PACKAGE_VERSION_JS } = process.env - const BRANCH_TO_CREATE = 'upstream-dependencies'; - - const { data: prs } = await github.rest.pulls.list({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open', - head: `${context.repo.owner}:${BRANCH_TO_CREATE}`, - base: 'develop' - }); - - if (prs.length < 1) { - const payloadPullRequest = { - owner: context.repo.owner, - repo: context.repo.repo, - title: `GH Auto: Upstream dependencies JS-API:${PACKAGE_VERSION_JS}`, - head: `${context.repo.owner}:${BRANCH_TO_CREATE}`, - base: 'develop', - body: `Automatic PR` - }; - - console.log('Payload: ',payloadPullRequest); - - const { data: pr } = await github.rest.pulls.create(payloadPullRequest); - return pr.number; - } else { - const upstreamPrOpen = prs[0]; - - // override the title to contains the latest js dep number - const payloadUpdatePullRequest = { - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: upstreamPrOpen.number, - title: `GH Auto: Upstream dependencies JS-API:${PACKAGE_VERSION_JS}`, - }; - - await github.rest.pulls.update(payloadUpdatePullRequest); - return upstreamPrOpen.number; - } - console.log(`Trigger a dispatch event for the monorepo`); diff --git a/angular.json b/angular.json index 3ffa67f349..ac5ba5eb1b 100644 --- a/angular.json +++ b/angular.json @@ -238,6 +238,59 @@ } } }, + "js-api": { + "projectType": "library", + "root": "lib/js-api/src", + "sourceRoot": "lib/js-api/src", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "options": { + "tsConfig": "lib/js-api/src/tsconfig.lib.json", + "project": "lib/js-api/src/ng-package.json" + }, + "configurations": { + "production": { + "project": "lib/js-api/src/ng-package.json", + "tsConfig": "lib/js-api/src/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "lib/js-api/src/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "executor": "nx:run-commands", + "options": { + "commands": ["TS_NODE_PROJECT=lib/js-api/test/tsconfig.json mocha --full-trace --config lib/js-api/.mocharc.json"] + } + }, + "lint": { + "builder": "@nrwl/linter:eslint", + "options": { + "lintFilePatterns": [ + "lib/js-api/**/*.ts" + ] + } + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/js-api", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } + } + } + }, "core": { "projectType": "library", "root": "lib/core", diff --git a/cspell.json b/cspell.json index 9e3dd28159..f8f274258e 100644 --- a/cspell.json +++ b/cspell.json @@ -1,5 +1,5 @@ { - "version": "0.1", + "version": "0.2", "language": "en", "words": [ "activiti", diff --git a/e2e/process-services/tasks/task-filters-sorting.e2e.ts b/e2e/process-services/tasks/task-filters-sorting.e2e.ts index 1577ed69bf..bb15df7f5c 100644 --- a/e2e/process-services/tasks/task-filters-sorting.e2e.ts +++ b/e2e/process-services/tasks/task-filters-sorting.e2e.ts @@ -22,7 +22,6 @@ import { TasksPage } from '../pages/tasks.page'; import { TasksListPage } from '../pages/tasks-list.page'; import { TaskDetailsPage } from '../pages/task-details.page'; import { TaskFiltersDemoPage } from '../pages/task-filters-demo.page'; -import { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api'; import { browser } from 'protractor'; describe('Task Filters Sorting', () => { @@ -87,12 +86,12 @@ describe('Task Filters Sorting', () => { }); it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ + const newFilter = { appId, name: 'Newest first', icon: 'glyphicon-filter', filter: { sort: 'created-desc', state: 'completed' } - }); + }; await userFiltersUtil.createUserTaskFilter(newFilter); await browser.refresh(); @@ -104,12 +103,12 @@ describe('Task Filters Sorting', () => { }); it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ + const newFilter = { appId, name: 'Newest last', icon: 'glyphicon-filter', filter: { sort: 'created-asc', state: 'completed' } - }); + }; await userFiltersUtil.createUserTaskFilter(newFilter); await browser.refresh(); @@ -121,12 +120,12 @@ describe('Task Filters Sorting', () => { }); it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ + const newFilter = { appId, name: 'Due first', icon: 'glyphicon-filter', filter: { sort: 'due-desc', state: 'completed' } - }); + }; await userFiltersUtil.createUserTaskFilter(newFilter); await browser.refresh(); @@ -138,12 +137,12 @@ describe('Task Filters Sorting', () => { }); it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ + const newFilter = { appId, name: 'Due last', icon: 'glyphicon-filter', filter: { sort: 'due-asc', state: 'completed' } - }); + }; await userFiltersUtil.createUserTaskFilter(newFilter); await browser.refresh(); @@ -155,12 +154,12 @@ describe('Task Filters Sorting', () => { }); it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ + const newFilter = { appId, name: 'Newest first Open', icon: 'glyphicon-filter', filter: { sort: 'created-desc', state: 'open' } - }); + }; await userFiltersUtil.createUserTaskFilter(newFilter); await browser.refresh(); @@ -172,12 +171,12 @@ describe('Task Filters Sorting', () => { }); it('[C277259] Should display tasks under new filter from oldest to newest when they are open', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ + const newFilter = { appId, name: 'Newest last Open', icon: 'glyphicon-filter', filter: { sort: 'created-asc', state: 'open' } - }); + }; await userFiltersUtil.createUserTaskFilter(newFilter); await browser.refresh(); @@ -189,12 +188,12 @@ describe('Task Filters Sorting', () => { }); it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ + const newFilter = { appId, name: 'Due first Open', icon: 'glyphicon-filter', filter: { sort: 'due-desc', state: 'open' } - }); + }; await userFiltersUtil.createUserTaskFilter(newFilter); await browser.refresh(); @@ -206,12 +205,12 @@ describe('Task Filters Sorting', () => { }); it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ + const newFilter = { appId, name: 'Due last Open', icon: 'glyphicon-filter', filter: { sort: 'due-asc', state: 'open' } - }); + }; await userFiltersUtil.createUserTaskFilter(newFilter); await browser.refresh(); diff --git a/lib/content-services/src/lib/audit/audit.service.ts b/lib/content-services/src/lib/audit/audit.service.ts index ab5a55ce07..9981fa60d8 100644 --- a/lib/content-services/src/lib/audit/audit.service.ts +++ b/lib/content-services/src/lib/audit/audit.service.ts @@ -18,7 +18,7 @@ import { Injectable } from '@angular/core'; import { Observable, from } from 'rxjs'; import { AlfrescoApiService } from '@alfresco/adf-core'; -import { AuditApi, AuditAppPaging, AuditApp, AuditBodyUpdate, AuditEntryPaging, AuditEntryEntry } from '@alfresco/js-api'; +import { AuditApi, AuditAppPaging, AuditApp, AuditEntryPaging, AuditEntryEntry } from '@alfresco/js-api'; @Injectable({ providedIn: 'root' @@ -72,7 +72,7 @@ export class AuditService { updateAuditApp(auditApplicationId: string, auditAppBodyUpdate: boolean, opts?: any): Observable<AuditApp | any> { const defaultOptions = {}; const queryOptions = Object.assign({}, defaultOptions, opts); - return from(this.auditApi.updateAuditApp(auditApplicationId, new AuditBodyUpdate({ isEnabled: auditAppBodyUpdate }), queryOptions)); + return from(this.auditApi.updateAuditApp(auditApplicationId, { isEnabled: auditAppBodyUpdate }, queryOptions)); } /** diff --git a/lib/content-services/src/lib/category/services/category.service.spec.ts b/lib/content-services/src/lib/category/services/category.service.spec.ts index 3a744b9bc5..6d5d60d481 100644 --- a/lib/content-services/src/lib/category/services/category.service.spec.ts +++ b/lib/content-services/src/lib/category/services/category.service.spec.ts @@ -20,10 +20,12 @@ import { CategoryBody, CategoryEntry, CategoryLinkBody, - CategoryPaging, PathInfo, - RequestQuery, ResultNode, + CategoryPaging, + PathInfo, + ResultNode, ResultSetPaging, - ResultSetPagingList, ResultSetRowEntry + ResultSetPagingList, + ResultSetRowEntry } from '@alfresco/js-api'; import { fakeAsync, TestBed } from '@angular/core/testing'; import { CategoryService } from './category.service'; @@ -35,16 +37,14 @@ describe('CategoryService', () => { const fakeParentCategoryId = 'testParentId'; const fakeCategoryId = 'fakeId'; const fakeNodeId = 'fakeNodeId'; - const fakeCategoriesResponse: CategoryPaging = { list: { pagination: {}, entries: [] }}; - const fakeCategoryEntry: CategoryEntry = { entry: { id: 'testId', name: 'testName' }}; + const fakeCategoriesResponse: CategoryPaging = { list: { pagination: {}, entries: [] } }; + const fakeCategoryEntry: CategoryEntry = { entry: { id: 'testId', name: 'testName' } }; const fakeCategoryBody: CategoryBody = { name: 'updatedName' }; const fakeCategoriesLinkBodies: CategoryLinkBody[] = [{ categoryId: fakeCategoryId }]; beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - CoreTestingModule - ] + imports: [CoreTestingModule] }); categoryService = TestBed.inject(CategoryService); @@ -54,21 +54,21 @@ describe('CategoryService', () => { it('should fetch categories with provided parentId', fakeAsync(() => { const getSpy = spyOn(categoryService.categoriesApi, 'getSubcategories').and.returnValue(Promise.resolve(fakeCategoriesResponse)); categoryService.getSubcategories(fakeParentCategoryId, 0, 100).subscribe(() => { - expect(getSpy).toHaveBeenCalledOnceWith(fakeParentCategoryId, {skipCount: 0, maxItems: 100}); + expect(getSpy).toHaveBeenCalledOnceWith(fakeParentCategoryId, { skipCount: 0, maxItems: 100 }); }); })); it('should fetch root level categories when parentId not provided', fakeAsync(() => { const getSpy = spyOn(categoryService.categoriesApi, 'getSubcategories').and.returnValue(Promise.resolve(fakeCategoriesResponse)); categoryService.getSubcategories(null, 0, 100).subscribe(() => { - expect(getSpy).toHaveBeenCalledOnceWith('-root-', {skipCount: 0, maxItems: 100}); + expect(getSpy).toHaveBeenCalledOnceWith('-root-', { skipCount: 0, maxItems: 100 }); }); })); it('should fetch the category with the provided categoryId', fakeAsync(() => { const getSpy = spyOn(categoryService.categoriesApi, 'getCategory').and.returnValue(Promise.resolve(fakeCategoryEntry)); - categoryService.getCategory(fakeParentCategoryId, {include: ['path']}).subscribe(() => { - expect(getSpy).toHaveBeenCalledOnceWith(fakeParentCategoryId, {include: ['path']}); + categoryService.getCategory(fakeParentCategoryId, { include: ['path'] }).subscribe(() => { + expect(getSpy).toHaveBeenCalledOnceWith(fakeParentCategoryId, { include: ['path'] }); }); })); @@ -119,7 +119,7 @@ describe('CategoryService', () => { categoryService.searchCategories(name, skipCount, maxItems); expect(categoryService.searchApi.search).toHaveBeenCalledWith({ query: { - language: RequestQuery.LanguageEnum.Afts, + language: 'afts', query: `cm:name:"*${name}*" AND TYPE:'cm:category' AND PATH:"/cm:categoryRoot/cm:generalclassifiable//*"` }, paging: { @@ -136,7 +136,7 @@ describe('CategoryService', () => { categoryService.searchCategories(name); expect(categoryService.searchApi.search).toHaveBeenCalledWith({ query: { - language: RequestQuery.LanguageEnum.Afts, + language: 'afts', query: `cm:name:"*${name}*" AND TYPE:'cm:category' AND PATH:"/cm:categoryRoot/cm:generalclassifiable//*"` }, paging: { @@ -156,9 +156,11 @@ describe('CategoryService', () => { }); it('should fetch categories linked to node with nodeId with path included', fakeAsync(() => { - const getLinkedCategoriesSpy = spyOn(categoryService.categoriesApi, 'getCategoryLinksForNode').and.returnValue(Promise.resolve(fakeCategoriesResponse)); + const getLinkedCategoriesSpy = spyOn(categoryService.categoriesApi, 'getCategoryLinksForNode').and.returnValue( + Promise.resolve(fakeCategoriesResponse) + ); categoryService.getCategoryLinksForNode(fakeNodeId).subscribe(() => { - expect(getLinkedCategoriesSpy).toHaveBeenCalledOnceWith(fakeNodeId, {include: ['path']}); + expect(getLinkedCategoriesSpy).toHaveBeenCalledOnceWith(fakeNodeId, { include: ['path'] }); }); })); diff --git a/lib/content-services/src/lib/category/services/category.service.ts b/lib/content-services/src/lib/category/services/category.service.ts index 5c3d0e43b0..0409a93c19 100644 --- a/lib/content-services/src/lib/category/services/category.service.ts +++ b/lib/content-services/src/lib/category/services/category.service.ts @@ -17,16 +17,7 @@ import { Injectable } from '@angular/core'; import { AlfrescoApiService, UserPreferencesService } from '@alfresco/adf-core'; -import { - CategoriesApi, - CategoryBody, - CategoryEntry, - CategoryLinkBody, - CategoryPaging, - RequestQuery, - ResultSetPaging, - SearchApi -} from '@alfresco/js-api'; +import { CategoriesApi, CategoryBody, CategoryEntry, CategoryLinkBody, CategoryPaging, ResultSetPaging, SearchApi } from '@alfresco/js-api'; import { from, Observable } from 'rxjs'; @Injectable({ providedIn: 'root' }) @@ -55,7 +46,7 @@ export class CategoryService { * @returns Observable<CategoryPaging> */ getSubcategories(parentCategoryId: string, skipCount?: number, maxItems?: number): Observable<CategoryPaging> { - return from(this.categoriesApi.getSubcategories(parentCategoryId ?? '-root-', {skipCount, maxItems})); + return from(this.categoriesApi.getSubcategories(parentCategoryId ?? '-root-', { skipCount, maxItems })); } /** @@ -115,17 +106,19 @@ export class CategoryService { */ searchCategories(name: string, skipCount = 0, maxItems?: number): Observable<ResultSetPaging> { maxItems = maxItems || this.userPreferencesService.paginationSize; - return from(this.searchApi.search({ - query: { - language: RequestQuery.LanguageEnum.Afts, - query: `cm:name:"*${name}*" AND TYPE:'cm:category' AND PATH:"/cm:categoryRoot/cm:generalclassifiable//*"` - }, - paging: { - skipCount, - maxItems - }, - include: ['path'] - })); + return from( + this.searchApi.search({ + query: { + language: 'afts', + query: `cm:name:"*${name}*" AND TYPE:'cm:category' AND PATH:"/cm:categoryRoot/cm:generalclassifiable//*"` + }, + paging: { + skipCount, + maxItems + }, + include: ['path'] + }) + ); } /** @@ -135,7 +128,7 @@ export class CategoryService { * @returns Observable<CategoryPaging> Categories that node is assigned to */ getCategoryLinksForNode(nodeId: string): Observable<CategoryPaging> { - return from(this.categoriesApi.getCategoryLinksForNode(nodeId, {include: ['path']})); + return from(this.categoriesApi.getCategoryLinksForNode(nodeId, { include: ['path'] })); } /** @@ -145,7 +138,7 @@ export class CategoryService { * @param categoryId The identifier of a category. * @returns Observable<void> */ - unlinkNodeFromCategory(nodeId: string, categoryId: string): Observable<void> { + unlinkNodeFromCategory(nodeId: string, categoryId: string): Observable<void> { return from(this.categoriesApi.unlinkNodeFromCategory(nodeId, categoryId)); } @@ -156,7 +149,7 @@ export class CategoryService { * @param categoryLinkBodyCreate Array of a categories that node will be linked to. * @returns Observable<CategoryEntry> */ - linkNodeToCategory(nodeId: string, categoryLinkBodyCreate: CategoryLinkBody[]): Observable<CategoryPaging | CategoryEntry> { + linkNodeToCategory(nodeId: string, categoryLinkBodyCreate: CategoryLinkBody[]): Observable<CategoryPaging | CategoryEntry> { return from(this.categoriesApi.linkNodeToCategory(nodeId, categoryLinkBodyCreate)); } } diff --git a/lib/content-services/src/lib/content-node-selector/content-node-selector-panel.component.spec.ts b/lib/content-services/src/lib/content-node-selector/content-node-selector-panel.component.spec.ts index ff0d9a187d..aa49c6abc2 100644 --- a/lib/content-services/src/lib/content-node-selector/content-node-selector-panel.component.spec.ts +++ b/lib/content-services/src/lib/content-node-selector/content-node-selector-panel.component.spec.ts @@ -18,14 +18,13 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Node, NodeEntry, NodePaging, PathElement, ResultSetPaging, Site, SiteEntry, SitePaging, SitePagingList, UserInfo } from '@alfresco/js-api'; +import { Node, NodeEntry, NodePaging, ResultSetPaging, Site, SiteEntry, SitePaging, SitePagingList, UserInfo } from '@alfresco/js-api'; import { AppConfigService, DataRow, ThumbnailService, DataColumn } from '@alfresco/adf-core'; import { ContentService } from '../common/services/content.service'; import { UploadService } from '../common/services/upload.service'; import { NodesApiService } from '../common/services/nodes-api.service'; import { FileModel, FileUploadStatus } from '../common/models/file.model'; import { FileUploadCompleteEvent } from '../common/events/file.event'; - import { of, throwError } from 'rxjs'; import { DropdownBreadcrumbComponent } from '../breadcrumb'; import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component'; @@ -129,7 +128,7 @@ describe('ContentNodeSelectorPanelComponent', () => { it('should trigger siteChange event on init with parent site Title of start folder', () => { let lastValue: string; - component.siteChange.subscribe((siteTitle: string) => lastValue = siteTitle); + component.siteChange.subscribe((siteTitle: string) => (lastValue = siteTitle)); component.ngOnInit(); fixture.detectChanges(); @@ -143,7 +142,7 @@ describe('ContentNodeSelectorPanelComponent', () => { await fixture.whenStable(); let lastValue: string; - component.siteChange.subscribe((siteTitle: string) => lastValue = siteTitle); + component.siteChange.subscribe((siteTitle: string) => (lastValue = siteTitle)); const sitesDropdown = fixture.debugElement.query(By.directive(DropdownSitesComponent)); sitesDropdown.componentInstance.selectedSite({ value: fakeSiteEntry }); @@ -180,7 +179,7 @@ describe('ContentNodeSelectorPanelComponent', () => { it('should trigger the select event when selection has been made', () => { const expectedNode = { id: 'fakeid' } as Node; let lastValue: Node[]; - component.select.subscribe((nodes) => lastValue = nodes); + component.select.subscribe((nodes) => (lastValue = nodes)); component.chosenNode = [expectedNode]; expect(lastValue.length).toBe(1); @@ -303,7 +302,7 @@ describe('ContentNodeSelectorPanelComponent', () => { searchQueryBuilderService.update(); triggerSearchResults(fakeResultSetPaging); - const chosenNode = new Node({ path: { elements: [new PathElement({ name: 'one' })] } }); + const chosenNode = new Node({ path: { elements: [{ name: 'one' }] } }); component.onCurrentSelection([{ entry: chosenNode }]); fixture.detectChanges(); @@ -318,7 +317,7 @@ describe('ContentNodeSelectorPanelComponent', () => { searchQueryBuilderService.update(); triggerSearchResults(fakeResultSetPaging); - const chosenNode = new Node({ path: { elements: [new PathElement({ name: 'fake-path' })] }, isFile: false, isFolder: true }); + const chosenNode = new Node({ path: { elements: [{ name: 'fake-path' }] }, isFile: false, isFolder: true }); component.onCurrentSelection([{ entry: chosenNode }]); fixture.detectChanges(); diff --git a/lib/content-services/src/lib/dialogs/download-zip/download-zip.dialog.ts b/lib/content-services/src/lib/dialogs/download-zip/download-zip.dialog.ts index 010b58da2d..b091370f63 100755 --- a/lib/content-services/src/lib/dialogs/download-zip/download-zip.dialog.ts +++ b/lib/content-services/src/lib/dialogs/download-zip/download-zip.dialog.ts @@ -17,8 +17,6 @@ import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { DownloadEntry } from '@alfresco/js-api'; -import { LogService } from '@alfresco/adf-core'; import { NodesApiService } from '../../common/services/nodes-api.service'; import { DownloadZipService } from './services/download-zip.service'; import { ContentService } from '../../common/services/content.service'; @@ -39,7 +37,6 @@ export class DownloadZipDialogComponent implements OnInit { private dialogRef: MatDialogRef<DownloadZipDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any, - private logService: LogService, private downloadZipService: DownloadZipService, private nodeService: NodesApiService, private contentService: ContentService @@ -49,8 +46,6 @@ export class DownloadZipDialogComponent implements OnInit { if (this.data?.nodeIds?.length > 0) { if (!this.cancelled) { this.downloadZip(this.data.nodeIds); - } else { - this.logService.log('Cancelled'); } } } @@ -63,12 +58,11 @@ export class DownloadZipDialogComponent implements OnInit { downloadZip(nodeIds: string[]) { if (nodeIds && nodeIds.length > 0) { - this.downloadZipService.createDownload({ nodeIds }).subscribe((data: DownloadEntry) => { + this.downloadZipService.createDownload({ nodeIds }).subscribe((data) => { if (data?.entry?.id) { const url = this.contentService.getContentUrl(data.entry.id, true); this.nodeService.getNode(data.entry.id).subscribe((downloadNode) => { - this.logService.log(downloadNode); const fileName = downloadNode.name; this.downloadId = data.entry.id; this.waitAndDownload(data.entry.id, url, fileName); @@ -83,7 +77,7 @@ export class DownloadZipDialogComponent implements OnInit { return; } - this.downloadZipService.getDownload(downloadId).subscribe((downloadEntry: DownloadEntry) => { + this.downloadZipService.getDownload(downloadId).subscribe((downloadEntry) => { if (downloadEntry.entry) { if (downloadEntry.entry.status === 'DONE') { this.download(url, fileName); diff --git a/lib/content-services/src/lib/dialogs/download-zip/mock/download-zip-service.mock.ts b/lib/content-services/src/lib/dialogs/download-zip/mock/download-zip-service.mock.ts index b3a2476db1..099c3324b3 100644 --- a/lib/content-services/src/lib/dialogs/download-zip/mock/download-zip-service.mock.ts +++ b/lib/content-services/src/lib/dialogs/download-zip/mock/download-zip-service.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { DownloadBodyCreate, DownloadEntry } from '@alfresco/js-api'; +import { DownloadBodyCreate, DownloadEntry, Node } from '@alfresco/js-api'; import { from, Observable, of, ReplaySubject, Subject } from 'rxjs'; import { catchError } from 'rxjs/internal/operators/catchError'; import { zipNode, downloadEntry } from './download-zip-data.mock'; @@ -40,8 +40,7 @@ class AlfrescoApiMock { } export class ContentApiMock { - getContentUrl = (_: string, _1?: boolean, _2?: string): string => - zipNode.entry.contentUrl; + getContentUrl = (_: string, _1?: boolean, _2?: string): string => zipNode.entry.contentUrl; } class CoreMock { @@ -54,13 +53,9 @@ export class NodesApiMock { } class DownloadsApiMock { - createDownload = ( - _: DownloadBodyCreate, - _2?: any - ): Promise<DownloadEntry> => Promise.resolve(downloadEntry); + createDownload = (_: DownloadBodyCreate, _2?: any): Promise<DownloadEntry> => Promise.resolve(downloadEntry); - getDownload = (_: string, _2?: any): Promise<DownloadEntry> => - Promise.resolve(downloadEntry); + getDownload = (_: string, _2?: any): Promise<DownloadEntry> => Promise.resolve(downloadEntry); cancelDownload(_: string) {} } @@ -72,9 +67,7 @@ export class DownloadZipMockService { } createDownload(payload: DownloadBodyCreate): Observable<DownloadEntry> { - return from(this.downloadsApi.createDownload(payload)).pipe( - catchError((err) => of(err)) - ); + return from(this.downloadsApi.createDownload(payload)).pipe(catchError((err) => of(err))); } getDownload(downloadId: string): Observable<DownloadEntry> { diff --git a/lib/content-services/src/lib/dialogs/node-lock.dialog.ts b/lib/content-services/src/lib/dialogs/node-lock.dialog.ts index ae96f02566..c92b46e1dc 100644 --- a/lib/content-services/src/lib/dialogs/node-lock.dialog.ts +++ b/lib/content-services/src/lib/dialogs/node-lock.dialog.ts @@ -28,7 +28,6 @@ import { AlfrescoApiService } from '@alfresco/adf-core'; encapsulation: ViewEncapsulation.None }) export class NodeLockDialogComponent implements OnInit { - form: UntypedFormGroup; node: Node = null; nodeName: string; @@ -46,8 +45,7 @@ export class NodeLockDialogComponent implements OnInit { @Optional() @Inject(MAT_DIALOG_DATA) public data: any - ) { - } + ) {} ngOnInit() { const { node } = this.data; @@ -73,15 +71,17 @@ export class NodeLockDialogComponent implements OnInit { } private get nodeBodyLock(): NodeBodyLock { - return new NodeBodyLock({ + return { timeToExpire: this.lockTimeInSeconds, type: this.form.value.allowOwner ? 'ALLOW_OWNER_CHANGES' : 'FULL', lifetime: 'PERSISTENT' - }); + }; } private toggleLock(): Promise<NodeEntry> { - const { data: { node } } = this; + const { + data: { node } + } = this; if (this.form.value.isLocked) { return this.nodesApi.lockNode(node.id, this.nodeBodyLock); diff --git a/lib/content-services/src/lib/document-list/services/custom-resources.service.ts b/lib/content-services/src/lib/document-list/services/custom-resources.service.ts index 5bf7d17583..bfd8375bb4 100644 --- a/lib/content-services/src/lib/document-list/services/custom-resources.service.ts +++ b/lib/content-services/src/lib/document-list/services/custom-resources.service.ts @@ -41,7 +41,6 @@ const CREATE_PERMISSION: string = 'create'; @Injectable({ providedIn: 'root' }) export class CustomResourcesService { - private _peopleApi: PeopleApi; get peopleApi(): PeopleApi { this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance()); @@ -84,8 +83,7 @@ export class CustomResourcesService { return this._nodesApi; } - constructor(private apiService: AlfrescoApiService) { - } + constructor(private apiService: AlfrescoApiService) {} /** * Gets files recently accessed by a user. @@ -120,52 +118,57 @@ export class CustomResourcesService { ]; return new Observable((observer) => { - this.peopleApi.getPerson(personId) - .then((person) => { - const username = person.entry.id; - const filterQueries = [ - { query: `cm:modified:[NOW/DAY-30DAYS TO NOW/DAY+1DAY]` }, - { query: `cm:modifier:'${username}' OR cm:creator:'${username}'` }, - { query: defaultFilter.join(' AND ') } - ]; + this.peopleApi.getPerson(personId).then( + (person) => { + const username = person.entry.id; + const filterQueries = [ + { query: `cm:modified:[NOW/DAY-30DAYS TO NOW/DAY+1DAY]` }, + { query: `cm:modifier:'${username}' OR cm:creator:'${username}'` }, + { query: defaultFilter.join(' AND ') } + ]; - if (filters && filters.length > 0) { - filterQueries.push({ - query: filters.join() - }); - } + if (filters && filters.length > 0) { + filterQueries.push({ + query: filters.join() + }); + } - const query = new SearchRequest({ - query: { - query: '*', - language: 'afts' - }, - filterQueries, - include: ['path', 'properties', 'allowableOperations'], - sort: [{ + const query: SearchRequest = { + query: { + query: '*', + language: 'afts' + }, + filterQueries, + include: ['path', 'properties', 'allowableOperations'], + sort: [ + { type: 'FIELD', field: 'cm:modified', ascending: false - }], - paging: { - maxItems: pagination.maxItems, - skipCount: pagination.skipCount } - }); - return this.searchApi.search(query) - .then((searchResult) => { - observer.next(searchResult); - observer.complete(); - }, - (err) => { - observer.error(err); - observer.complete(); - }); - }, - (err) => { - observer.error(err); - observer.complete(); - }); + ], + paging: { + maxItems: pagination.maxItems, + skipCount: pagination.skipCount + } + }; + + return this.searchApi.search(query).then( + (searchResult) => { + observer.next(searchResult); + observer.complete(); + }, + (err) => { + observer.error(err); + observer.complete(); + } + ); + }, + (err) => { + observer.error(err); + observer.complete(); + } + ); }); } @@ -189,36 +192,36 @@ export class CustomResourcesService { }; return new Observable((observer) => { - this.favoritesApi.listFavorites('-me-', options) - .then((result) => { - const page: FavoritePaging = { - list: { - entries: result.list.entries - .map(({ entry }: any) => { - const target = entry.target.file || entry.target.folder; - target.properties = { - ...(target.properties || { - 'cm:title': entry.title || target.title, - 'cm:description': entry.description || target.description - }), - ...(entry.properties || {}) - }; - - return { - entry: target - }; + this.favoritesApi.listFavorites('-me-', options).then( + (result) => { + const page: FavoritePaging = { + list: { + entries: result.list.entries.map(({ entry }: any) => { + const target = entry.target.file || entry.target.folder; + target.properties = { + ...(target.properties || { + 'cm:title': entry.title || target.title, + 'cm:description': entry.description || target.description }), - pagination: result.list.pagination - } - }; + ...(entry.properties || {}) + }; - observer.next(page); - observer.complete(); - }, - (err) => { - observer.error(err); - observer.complete(); - }); + return { + entry: target + }; + }), + pagination: result.list.pagination + } + }; + + observer.next(page); + observer.complete(); + }, + (err) => { + observer.error(err); + observer.complete(); + } + ); }); } @@ -238,29 +241,29 @@ export class CustomResourcesService { }; return new Observable((observer) => { - this.sitesApi.listSiteMembershipsForPerson('-me-', options) - .then((result: SiteRolePaging) => { - const page: SiteMemberPaging = new SiteMemberPaging({ - list: { - entries: result.list.entries - .map(({ entry: { site } }: any) => { - site.allowableOperations = site.allowableOperations ? site.allowableOperations : [CREATE_PERMISSION]; - site.name = site.name || site.title; - return { - entry: site - }; - }), - pagination: result.list.pagination - } - }); - - observer.next(page); - observer.complete(); - }, - (err) => { - observer.error(err); - observer.complete(); + this.sitesApi.listSiteMembershipsForPerson('-me-', options).then( + (result: SiteRolePaging) => { + const page: SiteMemberPaging = new SiteMemberPaging({ + list: { + entries: result.list.entries.map(({ entry: { site } }: any) => { + site.allowableOperations = site.allowableOperations ? site.allowableOperations : [CREATE_PERMISSION]; + site.name = site.name || site.title; + return { + entry: site + }; + }), + pagination: result.list.pagination + } }); + + observer.next(page); + observer.complete(); + }, + (err) => { + observer.error(err); + observer.complete(); + } + ); }); } @@ -280,23 +283,20 @@ export class CustomResourcesService { }; return new Observable((observer) => { - this.sitesApi - .listSites(options) - .then( - (page) => { - page.list.entries.map( - ({ entry }: any) => { - entry.name = entry.name || entry.title; - return { entry }; - } - ); - observer.next(page); - observer.complete(); - }, - (err) => { - observer.error(err); - observer.complete(); + this.sitesApi.listSites(options).then( + (page) => { + page.list.entries.map(({ entry }: any) => { + entry.name = entry.name || entry.title; + return { entry }; }); + observer.next(page); + observer.complete(); + }, + (err) => { + observer.error(err); + observer.complete(); + } + ); }); } @@ -410,14 +410,12 @@ export class CustomResourcesService { */ getCorrespondingNodeIds(nodeId: string, pagination: PaginationModel = {}): Observable<string[]> { if (this.isCustomSource(nodeId)) { - - return this.loadFolderByNodeId(nodeId, pagination) - .pipe(map((result: any): string[] => result.list.entries.map((node: any): string => this.getIdFromEntry(node, nodeId)))); - + return this.loadFolderByNodeId(nodeId, pagination).pipe( + map((result: any): string[] => result.list.entries.map((node: any): string => this.getIdFromEntry(node, nodeId))) + ); } else if (nodeId) { // cases when nodeId is '-my-', '-root-' or '-shared-' - return from(this.nodesApi.getNode(nodeId) - .then((node) => [node.entry.id])); + return from(this.nodesApi.getNode(nodeId).then((node) => [node.entry.id])); } return of([]); @@ -453,7 +451,8 @@ export class CustomResourcesService { } private getIncludesFields(includeFields: string[]): string[] { - return ['path', 'properties', 'allowableOperations', 'permissions', 'aspectNames', ...includeFields] - .filter((element, index, array) => index === array.indexOf(element)); + return ['path', 'properties', 'allowableOperations', 'permissions', 'aspectNames', ...includeFields].filter( + (element, index, array) => index === array.indexOf(element) + ); } } diff --git a/lib/content-services/src/lib/permission-manager/components/add-permission/search-config-permission.service.ts b/lib/content-services/src/lib/permission-manager/components/add-permission/search-config-permission.service.ts index 75441e0d99..b3183c0624 100644 --- a/lib/content-services/src/lib/permission-manager/components/add-permission/search-config-permission.service.ts +++ b/lib/content-services/src/lib/permission-manager/components/add-permission/search-config-permission.service.ts @@ -33,7 +33,7 @@ export class SearchPermissionConfigurationService implements SearchConfiguration ) {} public generateQueryBody(searchTerm: string, maxResults: number, skipCount: number): SearchRequest { - return new SearchRequest({ + return { query: { query: this.getQuery(searchTerm) }, @@ -46,7 +46,7 @@ export class SearchPermissionConfigurationService implements SearchConfiguration /* eslint-disable-next-line */ { query: "TYPE:'cm:authority'" } ] - }); + }; } private getQuery(searchTerm: string) { diff --git a/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts b/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts index d914db0bdd..b025661679 100644 --- a/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts +++ b/lib/content-services/src/lib/permission-manager/components/user-name-column/user-name-column.component.ts @@ -26,7 +26,7 @@ import { EcmUserModel } from '../../../common/models/ecm-user.model'; template: ` <div class="adf-ellipsis-cell" [attr.data-automation-id]="displayText$ | async"> <span class="adf-user-name-column" title="{{ displayText$ | async }}"> {{ displayText$ | async }}</span> - <br/> + <br /> <span class="adf-user-email-column" title="{{ subTitleText$ | async }}" *ngIf="subTitleText$ | async"> {{ subTitleText$ | async }} </span> @@ -51,7 +51,7 @@ export class UserNameColumnComponent implements OnInit { ngOnInit() { if (this.context != null) { const { person, group, authorityId } = this.context.row.obj?.entry ?? this.context.row.obj; - const permissionGroup = authorityId ? { displayName: authorityId } as Group : null; + const permissionGroup = authorityId ? ({ displayName: authorityId } as Group) : null; this.updatePerson(person); this.updateGroup(group || permissionGroup); } @@ -68,7 +68,7 @@ export class UserNameColumnComponent implements OnInit { this.displayText$.next(`${person.firstName ?? ''} ${person.lastName ?? ''}`); this.subTitleText$.next(person.email ?? ''); } - } + } private updateGroup(group: Group) { if (group) { diff --git a/lib/content-services/src/lib/permission-manager/models/member.model.ts b/lib/content-services/src/lib/permission-manager/models/member.model.ts index 7674bd3409..8a453b09ad 100644 --- a/lib/content-services/src/lib/permission-manager/models/member.model.ts +++ b/lib/content-services/src/lib/permission-manager/models/member.model.ts @@ -30,7 +30,7 @@ export interface NodePermissionsModel { export class MemberModel { id: string; role: string; - accessStatus: PermissionElement.AccessStatusEnum | string; + accessStatus: 'ALLOWED' | 'DENIED' | string; entry: { person?: EcmUserModel; group?: Group; @@ -62,10 +62,10 @@ export class MemberModel { } if (entry.nodeType === 'cm:authorityContainer') { - const group = new Group({ + const group: Group = { id: entry.properties['cm:authorityName'], displayName: entry.properties['cm:authorityDisplayName'] || entry.properties['cm:authorityName'] - }); + }; result.id = group.id; result.entry = { group }; diff --git a/lib/content-services/src/lib/permission-manager/models/permission.model.ts b/lib/content-services/src/lib/permission-manager/models/permission.model.ts index c2058056ab..14ac91ee54 100644 --- a/lib/content-services/src/lib/permission-manager/models/permission.model.ts +++ b/lib/content-services/src/lib/permission-manager/models/permission.model.ts @@ -18,10 +18,9 @@ import { PermissionElement } from '@alfresco/js-api'; export class PermissionDisplayModel implements PermissionElement { - authorityId?: string; name?: string; - accessStatus?: PermissionElement.AccessStatusEnum; + accessStatus?: 'ALLOWED' | 'DENIED' | string; isInherited: boolean = false; icon: string; readonly?: boolean; diff --git a/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts b/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts index 997a76933d..8421bc8bb5 100644 --- a/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts +++ b/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts @@ -18,17 +18,7 @@ import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core'; import { NodesApiService } from '../../common/services/nodes-api.service'; import { EcmUserModel } from '../../common/models/ecm-user.model'; -import { - Group, - GroupMemberEntry, - GroupMemberPaging, - GroupsApi, - Node, - PathElement, - PermissionElement, - ResultSetPaging, - SearchRequest -} from '@alfresco/js-api'; +import { Group, GroupMemberPaging, GroupsApi, Node, PathElement, PermissionElement, SearchRequest } from '@alfresco/js-api'; import { SearchService } from '../../search/services/search.service'; import { Injectable } from '@angular/core'; import { forkJoin, from, Observable, of, throwError } from 'rxjs'; @@ -60,13 +50,14 @@ export class NodePermissionService { * @returns Array of strings representing the roles */ getNodeRoles(node: Node): Observable<string[]> { - if (node.path.elements.some(el => (el.nodeType === 'st:site' || el.nodeType === 'st:sites'))) { + if (node.path.elements.some((el) => el.nodeType === 'st:site' || el.nodeType === 'st:sites')) { const searchRequest = this.buildRetrieveSiteQueryBody(node.path.elements); return this.searchApiService.searchByQueryBody(searchRequest).pipe( - switchMap((siteNodeList: ResultSetPaging) => { + switchMap((siteNodeList) => { const siteName = siteNodeList.list.entries[0].entry.name; return this.getGroupMembersBySiteName(siteName); - })); + }) + ); } else { return of(node.permissions?.settable); } @@ -152,7 +143,7 @@ export class NodePermissionService { private getDuplicatedPermissions(nodeLocallySet: PermissionElement[], permissionListAdded: PermissionElement[]): PermissionElement[] { const duplicatePermissions: PermissionElement[] = []; if (nodeLocallySet) { - permissionListAdded.forEach((permission: PermissionElement) => { + permissionListAdded.forEach((permission) => { const duplicate = nodeLocallySet.find((localPermission) => this.isEqualPermission(localPermission, permission)); if (duplicate) { duplicatePermissions.push(duplicate); @@ -193,9 +184,9 @@ export class NodePermissionService { private getGroupMembersBySiteName(siteName: string): Observable<string[]> { const groupName = 'GROUP_site_' + siteName; return this.getGroupMemberByGroupName(groupName).pipe( - map((groupMemberPaging: GroupMemberPaging) => { + map((groupMemberPaging) => { const displayResult: string[] = []; - groupMemberPaging.list.entries.forEach((member: GroupMemberEntry) => { + groupMemberPaging.list.entries.forEach((member) => { displayResult.push(this.formattedRoleName(member.entry.displayName, 'site_' + siteName)); }); return displayResult; @@ -219,7 +210,7 @@ export class NodePermissionService { } private buildRetrieveSiteQueryBody(nodePath: PathElement[]): SearchRequest { - const pathNames = nodePath.map((node: PathElement) => 'name: "' + node.name + '"'); + const pathNames = nodePath.map((node) => 'name: "' + node.name + '"'); const builtPathNames = pathNames.join(' OR '); return { @@ -319,7 +310,7 @@ export class NodePermissionService { transformNodeToUserPerson(node: Node): { person: EcmUserModel; group: Group } { let person = null; - let group = null; + let group: Group = null; if (node.nodeType === 'cm:person') { const firstName = node.properties['cm:firstName']; const lastName = node.properties['cm:lastName']; @@ -331,7 +322,7 @@ export class NodePermissionService { if (node.nodeType === 'cm:authorityContainer') { const displayName = node.properties['cm:authorityDisplayName'] || node.properties['cm:authorityName']; const id = node.properties['cm:authorityName']; - group = new Group({ displayName, id }); + group = { displayName, id }; } return { person, group }; } diff --git a/lib/content-services/src/lib/search/services/base-query-builder.service.ts b/lib/content-services/src/lib/search/services/base-query-builder.service.ts index b4d967f48d..b091868fd2 100644 --- a/lib/content-services/src/lib/search/services/base-query-builder.service.ts +++ b/lib/content-services/src/lib/search/services/base-query-builder.service.ts @@ -424,14 +424,11 @@ export abstract class BaseQueryBuilderService { } protected get sort(): RequestSortDefinitionInner[] { - return this.sorting.map( - (def) => - new RequestSortDefinitionInner({ - type: def.type, - field: def.field, - ascending: def.ascending - }) - ); + return this.sorting.map((def) => ({ + type: def.type, + field: def.field, + ascending: def.ascending + })); } protected get facetQueries(): FacetQuery[] { diff --git a/lib/content-services/src/lib/search/services/search-configuration.service.ts b/lib/content-services/src/lib/search/services/search-configuration.service.ts index 286f722b0d..44e3aa865a 100644 --- a/lib/content-services/src/lib/search/services/search-configuration.service.ts +++ b/lib/content-services/src/lib/search/services/search-configuration.service.ts @@ -32,7 +32,7 @@ export class SearchConfigurationService implements SearchConfigurationInterface * @returns Query body defined by the parameters */ generateQueryBody(searchTerm: string, maxResults: number, skipCount: number): SearchRequest { - return new SearchRequest({ + return { query: { query: searchTerm ? `'${searchTerm}*' OR name:'${searchTerm}*'` : searchTerm }, @@ -42,6 +42,6 @@ export class SearchConfigurationService implements SearchConfigurationInterface skipCount }, filterQueries: [{ query: `TYPE:'cm:folder' OR TYPE:'cm:content'` }, { query: 'NOT cm:creator:System' }] - }); + }; } } diff --git a/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.spec.ts b/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.spec.ts index 2052023d60..9d88ed8c92 100644 --- a/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.spec.ts +++ b/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.spec.ts @@ -21,7 +21,7 @@ import { SecurityControlsService } from './security-controls-groups-marks-securi import { fakeAuthorityClearanceApiResponse } from './mock/security-authorities.mock'; import { fakeGroupsApiResponse, createNewSecurityGroupMock } from './mock/security-groups.mock'; import { fakeMarksApiResponse, createNewSecurityMarkMock } from './mock/security-marks.mock'; -import { SecurityGroup, SecurityGroupBody, SecurityGroupEntry, SecurityMarkBody, SecurityMarkEntry } from '@alfresco/js-api'; +import { SecurityGroupBody, SecurityMarkBody, SecurityMarkEntry } from '@alfresco/js-api'; describe('SecurityControlsService', () => { let service: SecurityControlsService; @@ -74,15 +74,13 @@ describe('SecurityControlsService', () => { it('should create new security group', async () => { spyOn(service.groupsApi, 'createSecurityGroup').and.returnValue( - Promise.resolve( - new SecurityGroupEntry({ - entry: new SecurityGroup({ - groupName: 'TestGroup', - groupType: 'HIERARCHICAL', - id: 'eddf6269-ceba-42c6-b979-9ac445d29a94' - }) - }) - ) + Promise.resolve({ + entry: { + groupName: 'TestGroup', + groupType: 'HIERARCHICAL', + id: 'eddf6269-ceba-42c6-b979-9ac445d29a94' + } + }) ); const response = await service.createSecurityGroup(createNewSecurityGroupMock).toPromise(); @@ -110,37 +108,31 @@ describe('SecurityControlsService', () => { it('should create new security mark', async () => { spyOn(service.marksApi, 'createSecurityMarks').and.returnValue( - Promise.resolve( - new SecurityMarkEntry({ - entry: { - groupId: 'eddf6269-ceba-42c6-b979-9ac445d29a94', - name: 'securityMark1', - id: 'ffBOeOJJ' - } - }) - ) + Promise.resolve({ + entry: { + groupId: 'eddf6269-ceba-42c6-b979-9ac445d29a94', + name: 'securityMark1', + id: 'ffBOeOJJ' + } + }) ); - const response = await service.createSecurityMarks(securityGroupId, createNewSecurityMarkMock); - if (response instanceof SecurityMarkEntry) { - securityMarkId = response.entry.id; - expect(response.entry.groupId).toEqual('eddf6269-ceba-42c6-b979-9ac445d29a94'); - expect(response.entry.name).toEqual('securityMark1'); - expect(response.entry.id).toEqual('ffBOeOJJ'); - } + const response = (await service.createSecurityMarks(securityGroupId, createNewSecurityMarkMock)) as SecurityMarkEntry; + securityMarkId = response.entry.id; + expect(response.entry.groupId).toEqual('eddf6269-ceba-42c6-b979-9ac445d29a94'); + expect(response.entry.name).toEqual('securityMark1'); + expect(response.entry.id).toEqual('ffBOeOJJ'); }); it('should edit a security mark', async () => { spyOn(service.marksApi, 'updateSecurityMark').and.returnValue( - Promise.resolve( - new SecurityMarkEntry({ - entry: { - groupId: 'eddf6269-ceba-42c6-b979-9ac445d29a94', - name: 'securityMark1', - id: 'ffBOeOJJ' - } - }) - ) + Promise.resolve({ + entry: { + groupId: 'eddf6269-ceba-42c6-b979-9ac445d29a94', + name: 'securityMark1', + id: 'ffBOeOJJ' + } + }) ); const response = await service.updateSecurityMark(securityGroupId, securityMarkId, securityMarkBody); @@ -153,15 +145,13 @@ describe('SecurityControlsService', () => { it('should update a security group', async () => { spyOn(service.groupsApi, 'updateSecurityGroup').and.returnValue( - Promise.resolve( - new SecurityGroupEntry({ - entry: new SecurityGroup({ - groupName: 'TestGroup', - groupType: 'HIERARCHICAL', - id: 'eddf6269-ceba-42c6-b979-9ac445d29a94' - }) - }) - ) + Promise.resolve({ + entry: { + groupName: 'TestGroup', + groupType: 'HIERARCHICAL', + id: 'eddf6269-ceba-42c6-b979-9ac445d29a94' + } + }) ); const opts = {}; const response = await service.updateSecurityGroup(securityGroupId, securityGroupBody, opts); @@ -172,15 +162,13 @@ describe('SecurityControlsService', () => { it('should delete a security mark', async () => { spyOn(service.marksApi, 'deleteSecurityMark').and.returnValue( - Promise.resolve( - new SecurityMarkEntry({ - entry: { - groupId: 'eddf6269-ceba-42c6-b979-9ac445d29a94', - name: 'securityMark1', - id: 'ffBOeOJJ' - } - }) - ) + Promise.resolve({ + entry: { + groupId: 'eddf6269-ceba-42c6-b979-9ac445d29a94', + name: 'securityMark1', + id: 'ffBOeOJJ' + } + }) ); const response = await service.deleteSecurityMark(securityGroupId, securityMarkId); securityMarkId = response.entry.id; @@ -218,17 +206,15 @@ describe('SecurityControlsService', () => { it('should update a clearances for authority', async () => { spyOn(service.authorityClearanceApi, 'updateAuthorityClearance').and.returnValue( - Promise.resolve( - new SecurityMarkEntry({ - entry: { - id: 'test-id', - name: 'test-name', - groupId: 'test-groupId' - } - }) - ) + Promise.resolve({ + entry: { + id: 'test-id', + name: 'test-name', + groupId: 'test-groupId' + } + }) ); - const response = await service + const response = (await service .updateClearancesForAuthority('test-id', [ { groupId: 'test-group-id', @@ -236,13 +222,11 @@ describe('SecurityControlsService', () => { id: 'test-id' } ]) - .toPromise(); + .toPromise()) as SecurityMarkEntry; - if (response instanceof SecurityMarkEntry) { - expect(response.entry.id).toEqual('test-id'); - expect(response.entry.groupId).toEqual('test-groupId'); - expect(response.entry.name).toEqual('test-name'); - } + expect(response.entry.id).toEqual('test-id'); + expect(response.entry.groupId).toEqual('test-groupId'); + expect(response.entry.name).toEqual('test-name'); }); it('should reload security groups', (doneCallback) => { diff --git a/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts b/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts index a2905b2ecc..f79d6d2b5b 100644 --- a/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts +++ b/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts @@ -27,7 +27,6 @@ import { SecurityGroupBody, SecurityMarkPaging, SecurityMarkBody, - SecurityGroupPaging, AuthorityClearanceApi, AuthorityClearanceGroupPaging, NodeSecurityMarkBody, @@ -98,13 +97,11 @@ export class SecurityControlsService { skipCount, maxItems }) - .then((response: SecurityGroupPaging) => { + .then((response) => { this.groupsPaginatedSource.next( (securityControlsGroupResponse = { pagination: response.list.pagination, - entries: response.list.entries.map( - (group: SecurityGroupEntry) => group.entry - ) + entries: response.list.entries.map((group) => group.entry) }) ); resolve(securityControlsGroupResponse); @@ -119,9 +116,7 @@ export class SecurityControlsService { * @param input securityGroupBody. * @returns Observable<SecurityGroupEntry> */ - createSecurityGroup( - input: SecurityGroupBody - ): Observable<SecurityGroupEntry> { + createSecurityGroup(input: SecurityGroupBody): Observable<SecurityGroupEntry> { this.loadingSource.next(true); const payload: SecurityGroupBody = { ...input @@ -131,9 +126,7 @@ export class SecurityControlsService { }; const promise = this.groupsApi.createSecurityGroup(payload, opts); - return from(promise).pipe( - finalize(() => this.loadingSource.next(false)) - ); + return from(promise).pipe(finalize(() => this.loadingSource.next(false))); } /** @@ -143,15 +136,10 @@ export class SecurityControlsService { * @param input securityMarkBody[]. * @returns Promise<SecurityMarkPaging | SecurityMarkEntry> */ - createSecurityMarks( - securityGroupId: string, - input: SecurityMarkBody[] - ): Promise<SecurityMarkPaging | SecurityMarkEntry> { + createSecurityMarks(securityGroupId: string, input: SecurityMarkBody[]): Promise<SecurityMarkPaging | SecurityMarkEntry> { this.loadingSource.next(true); - const promise = this.marksApi.createSecurityMarks( - securityGroupId, - input - ) + const promise = this.marksApi + .createSecurityMarks(securityGroupId, input) .then((result) => { this.loadingSource.next(false); return result; @@ -172,23 +160,18 @@ export class SecurityControlsService { * @param skipCount The number of entities that exist in the collection before those included in this list. * @returns Promise<SecurityControlsMarkResponse> */ - getSecurityMark( - securityGroupId: string, - skipCount = DEFAULT_SKIP_COUNT - ): Promise<SecurityControlsMarkResponse> { + getSecurityMark(securityGroupId: string, skipCount = DEFAULT_SKIP_COUNT): Promise<SecurityControlsMarkResponse> { let securityControlsMarkResponse: SecurityControlsMarkResponse; return new Promise((resolve, reject) => { this.marksApi .getSecurityMarks(securityGroupId, { skipCount }) - .then((response: SecurityMarkPaging) => { + .then((response) => { this.marksPaginatedSource.next( (securityControlsMarkResponse = { pagination: response.list.pagination, - entries: response.list.entries.map( - (mark: SecurityMarkEntry) => mark.entry - ) + entries: response.list.entries.map((mark) => mark.entry) }) ); resolve(securityControlsMarkResponse); @@ -205,11 +188,7 @@ export class SecurityControlsService { * @param opts additional information about the security group * @returns Promise<SecurityGroupEntry> */ - updateSecurityGroup( - securityGroupId: string, - input: SecurityGroupBody, - opts?: any - ): Promise<SecurityGroupEntry> { + updateSecurityGroup(securityGroupId: string, input: SecurityGroupBody, opts?: any): Promise<SecurityGroupEntry> { this.loadingSource.next(true); const payload: SecurityGroupBody = { ...input @@ -219,11 +198,8 @@ export class SecurityControlsService { DEFAULT_INCLUDE }; } - const promise = this.groupsApi.updateSecurityGroup( - securityGroupId, - payload, - opts - ) + const promise = this.groupsApi + .updateSecurityGroup(securityGroupId, payload, opts) .then((result) => { this.loadingSource.next(false); return result; @@ -244,20 +220,13 @@ export class SecurityControlsService { * @param input securityMarkBody. * @returns Promise<SecurityMarkEntry> */ - updateSecurityMark( - securityGroupId: string, - securityMarkId: string, - input: SecurityMarkBody - ): Promise<SecurityMarkEntry> { + updateSecurityMark(securityGroupId: string, securityMarkId: string, input: SecurityMarkBody): Promise<SecurityMarkEntry> { this.loadingSource.next(true); const payload: SecurityMarkBody = { ...input }; - const promise = this.marksApi.updateSecurityMark( - securityGroupId, - securityMarkId, - payload - ) + const promise = this.marksApi + .updateSecurityMark(securityGroupId, securityMarkId, payload) .then((result) => { this.loadingSource.next(false); return result; @@ -276,15 +245,11 @@ export class SecurityControlsService { * @param securityGroupId The key for the security group id. * @returns Observable<void> */ - deleteSecurityGroup( - securityGroupId: string - ): Observable<void> { + deleteSecurityGroup(securityGroupId: string): Observable<void> { this.loadingSource.next(true); const promise = this.groupsApi.deleteSecurityGroup(securityGroupId); - return from(promise).pipe( - finalize(() => this.loadingSource.next(false)) - ); + return from(promise).pipe(finalize(() => this.loadingSource.next(false))); } /** @@ -294,15 +259,10 @@ export class SecurityControlsService { * @param securityMarkId The key for the security mark id. * @returns Promise<SecurityMarkEntry> */ - deleteSecurityMark( - securityGroupId: string, - securityMarkId: string - ): Promise<SecurityMarkEntry> { + deleteSecurityMark(securityGroupId: string, securityMarkId: string): Promise<SecurityMarkEntry> { this.loadingSource.next(true); - const promise = this.marksApi.deleteSecurityMark( - securityGroupId, - securityMarkId - ) + const promise = this.marksApi + .deleteSecurityMark(securityGroupId, securityMarkId) .then((result) => { this.loadingSource.next(false); return result; @@ -330,14 +290,12 @@ export class SecurityControlsService { ): Observable<AuthorityClearanceGroupPaging> { this.loadingSource.next(true); const opts = { - skipCount, maxItems + skipCount, + maxItems }; - const promise = - this.authorityClearanceApi.getAuthorityClearanceForAuthority(authorityName, opts); + const promise = this.authorityClearanceApi.getAuthorityClearanceForAuthority(authorityName, opts); - return from(promise).pipe( - finalize(() => this.loadingSource.next(false)) - ); + return from(promise).pipe(finalize(() => this.loadingSource.next(false))); } /** @@ -347,7 +305,10 @@ export class SecurityControlsService { * @param securityMarksList NodeSecurityMarkBody[] * @returns Observable<SecurityMarkEntry | SecurityMarkPaging> */ - updateClearancesForAuthority(authorityName: string, securityMarksList: NodeSecurityMarkBody[]): Observable<SecurityMarkEntry | SecurityMarkPaging> { + updateClearancesForAuthority( + authorityName: string, + securityMarksList: NodeSecurityMarkBody[] + ): Observable<SecurityMarkEntry | SecurityMarkPaging> { this.loadingSource.next(true); const promise = this.authorityClearanceApi.updateAuthorityClearance(authorityName, securityMarksList); diff --git a/lib/content-services/src/lib/social/services/rating.service.ts b/lib/content-services/src/lib/social/services/rating.service.ts index 5e745c75d8..172499ce36 100644 --- a/lib/content-services/src/lib/social/services/rating.service.ts +++ b/lib/content-services/src/lib/social/services/rating.service.ts @@ -25,15 +25,13 @@ import { RatingServiceInterface } from './rating.service.interface'; providedIn: 'root' }) export class RatingService implements RatingServiceInterface { - private _ratingsApi: RatingsApi; get ratingsApi(): RatingsApi { this._ratingsApi = this._ratingsApi ?? new RatingsApi(this.apiService.getInstance()); return this._ratingsApi; } - constructor(private apiService: AlfrescoApiService) { - } + constructor(private apiService: AlfrescoApiService) {} /** * Gets the current user's rating for a node. @@ -55,10 +53,10 @@ export class RatingService implements RatingServiceInterface { * @returns Details about the rating, including the new value */ postRating(nodeId: string, ratingType: string, vote: any): Observable<RatingEntry | any> { - const ratingBody: RatingBody = new RatingBody({ + const ratingBody: RatingBody = { id: ratingType, myRating: vote - }); + }; return from(this.ratingsApi.createRating(nodeId, ratingBody)); } diff --git a/lib/content-services/tsconfig.lib.json b/lib/content-services/tsconfig.lib.json index e44edfc3ff..e0a8ffae05 100644 --- a/lib/content-services/tsconfig.lib.json +++ b/lib/content-services/tsconfig.lib.json @@ -8,7 +8,9 @@ "@alfresco/adf-extensions": ["../../../dist/libs/extensions"], "@alfresco/adf-extensions/*": ["../../../dist/libs/extensions/*"], "@alfresco/adf-core": ["../../../dist/libs/core"], - "@alfresco/adf-core/*": ["../../../dist/libs/core/*"] + "@alfresco/adf-core/*": ["../../../dist/libs/core/*"], + "@alfresco/js-api": ["../../../dist/libs/js-api"], + "@alfresco/js-api/*": ["../../../dist/libs/js-api/*"] } } } diff --git a/lib/core/tsconfig.lib.json b/lib/core/tsconfig.lib.json index 985607d7d6..2b9d37bfa8 100644 --- a/lib/core/tsconfig.lib.json +++ b/lib/core/tsconfig.lib.json @@ -10,7 +10,8 @@ "@alfresco/adf-core/auth": ["../auth/src/index.ts"], "@alfresco/adf-core/shell": ["../shell/src/index.ts"], "@alfresco/adf-core/api": ["../api/src/index.ts"], - + "@alfresco/js-api": ["../../../dist/libs/js-api"], + "@alfresco/js-api/*": ["../../../dist/libs/js-api/*"] } }, "exclude": ["./test.ts", "**/*.spec.ts", "**/*.test.ts"], diff --git a/lib/insights/tsconfig.lib.json b/lib/insights/tsconfig.lib.json index e44edfc3ff..e0a8ffae05 100644 --- a/lib/insights/tsconfig.lib.json +++ b/lib/insights/tsconfig.lib.json @@ -8,7 +8,9 @@ "@alfresco/adf-extensions": ["../../../dist/libs/extensions"], "@alfresco/adf-extensions/*": ["../../../dist/libs/extensions/*"], "@alfresco/adf-core": ["../../../dist/libs/core"], - "@alfresco/adf-core/*": ["../../../dist/libs/core/*"] + "@alfresco/adf-core/*": ["../../../dist/libs/core/*"], + "@alfresco/js-api": ["../../../dist/libs/js-api"], + "@alfresco/js-api/*": ["../../../dist/libs/js-api/*"] } } } diff --git a/lib/js-api/.eslintrc.json b/lib/js-api/.eslintrc.json new file mode 100644 index 0000000000..fae7922eb9 --- /dev/null +++ b/lib/js-api/.eslintrc.json @@ -0,0 +1,52 @@ +{ + "extends": ["../../.eslintrc.js"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "extends": ["plugin:@nrwl/nx/angular"], + "rules": { + "no-underscore-dangle": ["warn", { "allowAfterThis": true }], + "@typescript-eslint/dot-notation": "off", + "@typescript-eslint/explicit-member-accessibility": [ + "off", + { + "accessibility": "explicit" + } + ], + "@typescript-eslint/no-floating-promises": "off", + "@typescript-eslint/no-inferrable-types": "off", + "@typescript-eslint/no-require-imports": "off", + "@typescript-eslint/no-var-requires": "error", + "comma-dangle": "error", + "default-case": "error", + "import/order": "off", + "max-len": [ + "error", + { + "code": 240 + } + ], + "no-bitwise": "off", + "no-duplicate-imports": "error", + "no-multiple-empty-lines": "error", + "no-return-await": "error", + + "unicorn/filename-case": "off", + "@typescript-eslint/no-unused-expressions": "off", + "@typescript-eslint/consistent-type-assertions": "off", + "jsdoc/check-param-names": "off", + "jsdoc/require-returns": "off", + "jsdoc/require-param": "off", + "jsdoc/check-tag-names": "off", + "@typescript-eslint/no-shadow": "warn", + "@typescript-eslint/member-ordering": "off", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/consistent-type-definitions": "off", + "no-redeclare": "off", + "space-before-function-paren": "off", + "@typescript-eslint/no-empty-interface": "warn" + } + } + ] +} diff --git a/lib/js-api/.mocharc.json b/lib/js-api/.mocharc.json new file mode 100644 index 0000000000..77c6823278 --- /dev/null +++ b/lib/js-api/.mocharc.json @@ -0,0 +1,7 @@ +{ + "extensions": ["ts"], + "spec": ["lib/js-api/test/**/*.spec.ts"], + "node-option": [ + "loader=ts-node/register" + ] +} diff --git a/lib/js-api/docs/audit/.gitkeep b/lib/js-api/docs/audit/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/js-api/docs/audit/audit-info-4.10.0.md b/lib/js-api/docs/audit/audit-info-4.10.0.md new file mode 100644 index 0000000000..541e43ef4c --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-4.10.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 4.10.0 +--- + +# Audit information for @alfresco/js-api 4.10.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 41 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-4.11.0.md b/lib/js-api/docs/audit/audit-info-4.11.0.md new file mode 100644 index 0000000000..fe93c3aef1 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-4.11.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 4.11.0 +--- + +# Audit information for @alfresco/js-api 4.11.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 41 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-4.7.0.md b/lib/js-api/docs/audit/audit-info-4.7.0.md new file mode 100644 index 0000000000..6d9684c011 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-4.7.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 4.7.0 +--- + +# Audit information for @alfresco/js-api 4.7.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-4.8.0.md b/lib/js-api/docs/audit/audit-info-4.8.0.md new file mode 100644 index 0000000000..1d6319eb67 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-4.8.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 4.8.0 +--- + +# Audit information for @alfresco/js-api 4.8.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-4.9.0.md b/lib/js-api/docs/audit/audit-info-4.9.0.md new file mode 100644 index 0000000000..c814071786 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-4.9.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 4.9.0 +--- + +# Audit information for @alfresco/js-api 4.9.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 41 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-5.0.0.md b/lib/js-api/docs/audit/audit-info-5.0.0.md new file mode 100644 index 0000000000..53ed94acc4 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-5.0.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 5.0.0 +--- + +# Audit information for @alfresco/js-api 5.0.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 41 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-5.1.0.md b/lib/js-api/docs/audit/audit-info-5.1.0.md new file mode 100644 index 0000000000..07db03e827 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-5.1.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 5.1.0 +--- + +# Audit information for @alfresco/js-api 5.1.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 42 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-5.2.0.md b/lib/js-api/docs/audit/audit-info-5.2.0.md new file mode 100644 index 0000000000..20b67031ee --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-5.2.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 5.2.0 +--- + +# Audit information for @alfresco/js-api 5.2.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 42 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-5.3.0.md b/lib/js-api/docs/audit/audit-info-5.3.0.md new file mode 100644 index 0000000000..5cb249c1d2 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-5.3.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 5.3.0 +--- + +# Audit information for @alfresco/js-api 5.3.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 42 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-5.4.0.md b/lib/js-api/docs/audit/audit-info-5.4.0.md new file mode 100644 index 0000000000..3432d93426 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-5.4.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 5.4.0 +--- + +# Audit information for @alfresco/js-api 5.4.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 42 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-5.5.0.md b/lib/js-api/docs/audit/audit-info-5.5.0.md new file mode 100644 index 0000000000..57da821280 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-5.5.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 5.5.0 +--- + +# Audit information for @alfresco/js-api 5.5.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 39 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-6.0.0.md b/lib/js-api/docs/audit/audit-info-6.0.0.md new file mode 100644 index 0000000000..37ed46d935 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-6.0.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 6.0.0 +--- + +# Audit information for @alfresco/js-api 6.0.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: 39 + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-6.1.0.md b/lib/js-api/docs/audit/audit-info-6.1.0.md new file mode 100644 index 0000000000..5946993418 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-6.1.0.md @@ -0,0 +1,22 @@ +--- +Title: Audit info, @alfresco/js-api 6.1.0 +--- + +# Audit information for @alfresco/js-api 6.1.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + diff --git a/lib/js-api/docs/audit/audit-info-6.2.0.md b/lib/js-api/docs/audit/audit-info-6.2.0.md new file mode 100644 index 0000000000..fb8cfba136 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-6.2.0.md @@ -0,0 +1,24 @@ +--- +Title: Audit info, @alfresco/js-api 6.2.0 +--- + +# Audit information for @alfresco/js-api 6.2.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 1 +- Low risk: 0 + +Dependencies analyzed: + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | +|moderate | semver | "<7.5.2" | + + diff --git a/lib/js-api/docs/audit/audit-info-7.0.0.md b/lib/js-api/docs/audit/audit-info-7.0.0.md new file mode 100644 index 0000000000..1ee63bf25c --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-7.0.0.md @@ -0,0 +1,23 @@ +--- +Title: Audit info, @alfresco/js-api 7.0.0 +--- + +# Audit information for @alfresco/js-api 7.0.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + + diff --git a/lib/js-api/docs/audit/audit-info-7.1.0.md b/lib/js-api/docs/audit/audit-info-7.1.0.md new file mode 100644 index 0000000000..26e71e53bd --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-7.1.0.md @@ -0,0 +1,23 @@ +--- +Title: Audit info, @alfresco/js-api 7.1.0 +--- + +# Audit information for @alfresco/js-api 7.1.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + + diff --git a/lib/js-api/docs/audit/audit-info-7.2.0.md b/lib/js-api/docs/audit/audit-info-7.2.0.md new file mode 100644 index 0000000000..f90b058622 --- /dev/null +++ b/lib/js-api/docs/audit/audit-info-7.2.0.md @@ -0,0 +1,23 @@ +--- +Title: Audit info, @alfresco/js-api 7.2.0 +--- + +# Audit information for @alfresco/js-api 7.2.0 + +This page lists the security audit of the dependencies this project depends on. + +## Risks + +- Critical risk: 0 +- High risk: 0 +- Moderate risk: 0 +- Low risk: 0 + +Dependencies analyzed: + +## Libraries + +| Severity | Module | Vulnerable versions | +| --- | --- | --- | + + diff --git a/lib/js-api/docs/authentication.md b/lib/js-api/docs/authentication.md new file mode 100644 index 0000000000..e9dc7f6d3e --- /dev/null +++ b/lib/js-api/docs/authentication.md @@ -0,0 +1,320 @@ +# Authentication JS-API + +## Login + +AlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket}); + +| Property | Description | default value | +|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| +| hostEcm | (Optional) The Ip or Name of the host where your Alfresco instance is running | http://127.0.0.1:8080 | +| hostBpm | (Optional) The Ip or Name of the host where your Activiti instance is running | http://127.0.0.1:9999 | +| authType | (Optional) can be 'BASIC' or 'OAUTH' | 'BASIC' | +| oauth2 | (Optional) configuration for SSO | | +| contextRoot | (Optional) that define the context Root of the Alfresco ECM API default value is alfresco | alfresco | +| contextRootBpm | (Optional) that define the context Root of the Activiti API default value is activiti-app | alfresco | +| tenant | (Optional) needed in case of multi tenant content service | '-default-' | +| provider | (Optional) default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both | alfresco | +| ticket | (Optional) only if you want login with the ticket see example below | | +| disableCsrf | To disable CSRF Token to be submitted. Only for Activiti call | false | +| withCredentials | (Optional) configuration for SSO, requires CORS on ECM | false | +| oauthInit | (Optional) if false skip the OAuth2 initialization | true | + +### Login with Username and Password BPM and ECM + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi({ provider: 'ALL' }); + +try { + await alfrescoJsApi.login('admin', 'admin'); + console.log('API called successfully Login in BPM and ECM performed '); +} catch (error) { + console.error(error); +} +``` + +### Login with Username and Password ECM + +**Example** + +```javascript +const alfrescoJsApi = new AlfrescoApi(); + +try { + const data = await alfrescoJsApi.login('admin', 'admin'); + + console.log('API called successfully Login ticket:' + data); + // The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1 +} catch (error) { + console.error(error); +} +``` + +### Login with ticket + +If you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server + +#### Login with ticket ECM + +This authentication validate also the ticket against the server + +**Example** + +```javascript +const ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'; + +try { + await alfrescoJsApi.loginTicket(ticket); + console.log('valid ticket you are logged in'); +} catch (error) { + console.error(error); +} +``` + +#### Login with ticket ECM/BPM as parameter in the constructor + +With this authentication the ticket is not validated against the server + +**Example** + +```javascript + +// Login with ECM ticket +const alfrescoApi = new AlfrescoApi({ + ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', + hostEcm:'http://127.0.0.1:8080' +}); + +// Login with BPM ticket +const alfrescoApi = new AlfrescoApi({ + ticketBpm: 'Basic YWRtaW46YWRtaW4=', + hostBpm:'http://127.0.0.1:9999' +}); + +// Login with ECM and BPM tickets +const alfrescoApi = new AlfrescoApi({ + ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', + ticketBpm: 'Basic YWRtaW46YWRtaW4=', + hostEcm:'http://127.0.0.1:8080', + hostBpm:'http://127.0.0.1:9999' +}); +``` + +### Login with Username and Password BPM + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi({ provider:'BPM' }); + +try { + await alfrescoJsApi.login('admin', 'admin'); + console.log('API called successfully Login in Activiti BPM performed '); +} catch (error) { + console.error(error); +} +``` + +### Login with OAUTH2 Alfresco authorization server + +#### Implicit Flow + +If your want to redirect to the authorization server and login there, you can use the implicit flow to login + +**oauth2 properties** + +| Property | Description | Default Value | +|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------| +| host | Your oauth2 server URL | null | +| clientId | Your clientId oauth2 | null | +| secret | Your secret oauth2 | null | +| scope | Your scope | null | +| implicitFlow | true/false | false | +| redirectUri | url to be redirect after login | null | +| redirectLogout | url to be redirect after logout optional, if is nor present the redirectUri will be used | null | +| refreshTokenTimeout | millisecond value, after how many millisecond you want refresh the token | 30000 | +| redirectSilentIframeUri | url to be redirect after silent refresh login | /assets/silent-refresh.html | +| silentLogin | direct execute the implicit login without the need to call AlfrescoJsApi.implicitLogin() method | false | +| publicUrls | list of public urls that don't need authorization. It is possible too pass absolute paths and string patterns. In patterns you can use * or ** wildcards. Single means that you can have anything in one part of URL for example http://some-public-url/path/* matches with http://some-public-url/path/test. Double means that you can have anything in any number of parts, for example http://some-public-url/path/** matches with http://some-public-url/path/test/some-test. | +| authorizationUrl | authorization url, relative to the host | /protocol/openid-connect/auth | +| tokenUrl | token url, relative to the host | /protocol/openid-connect/token | +| logoutUrl | logout url, relative to the host | /protocol/openid-connect/logout | + +The api/js-api will automatically redirect you to the login page anf refresh the token if necessary + +**Events** + +| Property | Description | Default Value | +|-------------------|--------------------------------------------------------------------------------------------------------------|---------------| +| implicit_redirect | triggered when the user is redirect to the auth server return url parameter of the redirect | | +| discovery | triggered when all the openId discovery url phase is terminated return an object with all the discovered url | | +| token_issued | triggered when a new token is issued | | + +The api/js-api will automatically redirect you to the login page and refresh the token if necessary + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi({ + oauth2: { + host: 'HOST_OAUTH2_SERVER', + clientId: 'YOUR_CLIENT_ID', + secret: 'SECRET', + scope: 'openid', + implicitFlow: true, + redirectUri: 'YOUR_HOME_APP_URL', + silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value + }, + authType: 'OAUTH', + provider: 'ALL' +}); + +alfrescoJsApi.implicitLogin(); +``` + +**Example skip login form (implicitFlow)** + +```javascript +const alfrescoApi = new AlfrescoApi({ + oauth2: { + host: 'HOST_OAUTH2_SERVER', + clientId: 'YOUR_CLIENT_ID', + secret: 'SECRET', + scope: 'openid', + implicitFlow: true, + redirectUri: 'YOUR_HOME_APP_URL', + silentRefreshTimeout: '600000', // Optional parameter 10 minutes default value, + silentLogin: true, + publicUrls: ['PUBLIC_URL', 'URL_PATTERN'] + }, + authType: 'OAUTH', + provider: 'ALL' +}); +``` + +#### Password Flow + +If your auth endpoint is different from the standard one "/oauth/token" you can override it through the property authPath + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi({ + oauth2: { + host: 'HOST_OAUTH2_SERVER', + clientId: 'YOUR_CLIENT_ID', + secret: 'SECRET', + authPath:'my-custom-auth-endpoint/token' + }, + authType: 'OAUTH', + provider: 'ALL' +}); + +try { + await alfrescoJsApi.login('admin', 'admin'); + console.log('API called successfully Login in with authorization server performed'); +} catch (error) { + console.error(error); +} +``` + +After the login if you want refresh your token you can use this call + +**Example** + +```javascript +try { + await alfrescoJsApi.refreshToken(); + console.log('Your token has been refreshed'); +} catch (error) { + console.error(error); +} +``` + +## Logout + +```javascript +alfrescoJsApi.logout(); +``` + +**Example** + +```javascript +try { + await alfrescoJsApi.logout(); + console.log('Successfully logged out'); +} catch (error) { + console.error('Error logging out'); +} +``` + +## isLoggedIn + +```javascript +alfrescoJsApi.isLoggedIn() +``` + +Returns `true` if you are logged in, and `false` if you are not. + +**Example** + +```javascript + +const isLoggedIn = alfrescoJsApi.isLoggedIn(); + +if (isLoggedIn) { + console.log('You are logged in'); +} else { + console.log('You are not logged in'); +} +``` + +## Get tickets + +### getTicketEcm() + +After the log in you can retrieve you ECM ticket + +```javascript +const ecmTicket = alfrescoJsApi.getTicketEcm() ; + +console.log('This is your ECM ticket ' + ecmTicket); +``` + +### getTicketBpm() + +After the log in you can retrieve you BPM ticket + +```javascript +const bpmTicket = alfrescoJsApi.getTicketBpm(); + +console.log('This is your BPM ticket ' + bpmTicket); +``` + +**Events login/logout** + +The login/logout are also an EventEmitter which you can register to listen to any of the following event types: + +- unauthorized (If this event is triggered a call to the Api was unauthorized) +- success (If this event is triggered the login was success you can use this event > instead the login promise) +- logout (If this event is triggered the client is successfully logout) + +**Example** + +```javascript +alfrescoJsApi.login('admin', 'admin') + .on('unauthorized', () => { + console.log('You are unauthorized you can use this event to redirect to login'); + }); + +alfrescoJsApi.login('admin', 'admin') + .on('success', () => { + console.log('Success Login'); + }); + +alfrescoJsApi.logout() + .on('logout', () => { + console.log('Successfully Logout'); + }); +``` \ No newline at end of file diff --git a/lib/js-api/docs/bpm-example.md b/lib/js-api/docs/bpm-example.md new file mode 100644 index 0000000000..44360bbadc --- /dev/null +++ b/lib/js-api/docs/bpm-example.md @@ -0,0 +1,563 @@ +<!-- markdown-toc start - Don't edit this section. npm run toc to generate it--> + +<!-- toc --> + +- [BPM](#bpm) + * [Task Api](#task-api) + + [List Task](#list-task) + + [Get Task](#get-task) + + [Filter Tasks](#filter-tasks) + + [Complete Task](#complete-task) + + [Get Task Form](#get-task-form) + + [Complete Task Form](#complete-task-form) + * [Process Api](#process-api) + + [Get Process Instances](#get-process-instances) + * [Models Api](#models-api) + + [Get Model](#get-model) + * [Report Api](#report-api) + + [Create default Reports](#create-default-reports) + + [Get Reports](#get-reports) + + [Report Params](#report-params) + * [Report Process Definitions](#report-process-definitions) + * [Tasks of process definition](#tasks-of-process-definition) + * [Generate reports](#generate-reports) + * [Update report details](#update-report-details) + * [Export to csv](#export-to-csv) + * [Save Report](#save-report) + * [Delete report](#delete-report) + +<!-- tocstop --> + +<!-- markdown-toc end --> + +# BPM + +A complete list of all the BPM methods is available here: [Activiti API](../src/api/activiti-rest-api/README.md). + +Below you can find some common examples. + +## Task Api + +Below you can find some example relative to the Activiti process api for all the possible method go to [Tasks Api](../src/api/activiti-rest-api/docs/TasksApi.md) documentation. + +### List Task + +```javascript +TasksApi.listTasks(tasksQuery) +``` + +return a list of task based on the `tasksQuery` query + +#### Example + +```javascript +import { TasksApi, TaskQueryRepresentation } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const taskApi = TasksApi(alfrescoApi); + +const tasksQuery = new TaskQueryRepresentation(); + +taskApi.listTasks(tasksQuery).then( + (data) => { + console.log('listTasks ' + data); + }, + (error) => { + console.log('Error' + error); + }); +``` + +### Get Task + +```javascript +TasksApi.getTask(taskId) +``` + +Returns the [TaskRepresentation](/src/api/activiti-rest-api/docs/TaskRepresentation.md) of single task by id + +**Parameters** + +| Name | Type | Description | +|--------|--------|-------------| +| taskId | String | taskId | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const taskApi = TasksApi(this.alfrescoApi); + +const taskId = '10'; // String | taskId + +taskApi.getTask(taskId).then( + (data) => { + console.log('Task representation ' + data); + }, (error) => { + console.log('Error' + error); + }); +``` + +### Filter Tasks + +```javascript +TasksApi.filterTasks(requestTasks) +``` + +Returns the [ResultListDataRepresentation](../src/api/activiti-rest-api/docs/ResultListDataRepresentation«TaskRepresentation».md) that is a filtered list of all the tasks. + +**Parameters** + +| Name | Type | Description | +|--------------|------------------------------------------------------------------------------------------------------|--------------| +| requestTasks | [TaskFilterRequestRepresentation](../src/api/activiti-rest-api/docs/TaskFilterRequestRepresentation.md) | requestTasks | + + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const taskApi = TasksApi(alfrescoApi); + +const requestTasks = new TaskFilterRequestRepresentation({ + appDefinitionId: 1 +}); + +taskApi.filterTasks(requestTasks).then( + (data) => { + console.log('Task filter list ' + data); + }, + (error) => { + console.log('Error' + error); + }); +``` + +### Complete Task + +```javascript +TasksApi.completeTask(taskId) +``` + +To complete a task (standalone or without a task form). + +**Parameters** + +| Name | Type | Description | +|------------|------------|-------------| +| **taskId** | **String** | taskId | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const taskApi = TasksApi(alfrescoApi); + +const taskId = '10'; // String | taskId + +taskApi.taskApi.completeTask(taskId).then( + () => { + console.log('Task completed'); + }, + (error) => { + console.log('Error' + error); + }); +``` +### Get Task Form + +```javascript +TasksApi.getTaskForm(taskId) +``` + +Retrieve the [Task Form](../src/api/activiti-rest-api/docs/FormDefinitionRepresentation.md) representation. + +**Parameters** + +| Name | Type | Description | +|------------|------------|-------------| +| **taskId** | **String** | taskId | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const taskApi = TasksApi(this.alfrescoApi); + +const taskId = '10'; + +taskApi.getTaskForm(taskId).then( + (data) => { + console.log('Task form representation' + data); + }, + (error) => { + console.log('Error' + error); + }); +``` + +### Complete Task Form + +completeTaskForm(taskId, completeTaskFormRepresentation) + +Complete a Task Form + +**Parameters** + +| Name | Type | Description | +|--------------------------------|--------------------------------------------------------------------------------------------|--------------------------------| +| taskId | String | taskId | +| completeTaskFormRepresentation | [CompleteFormRepresentation](../src/api/activiti-rest-api/docs/CompleteFormRepresentation.md) | completeTaskFormRepresentation | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const taskApi = TasksApi(this.alfrescoApi); + +const taskId = '10'; // String | taskId + +taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then( + () => { + console.log('Task completed'); + }, + (error) => { + console.log('Error' + error); + }); +``` + +## Process Api + +### Get Process Instances + +```javascript +ProcessInstancesApi.getProcessInstances(requestNode) +``` + +Retrieve a list of process instances, see [ResultListDataRepresentationProcessInstanceRepresentation](../src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessInstanceRepresentation».md) + +**Parameters** + +| Name | Type | Description | +|-------------|------------------------------------------------------------------------------------------------------------|-------------| +| requestNode | [ProcessInstanceQueryRepresentation](../src/api/activiti-rest-api/docs/ProcessInstanceQueryRepresentation.md) | requestNode | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const processApi = ProcessApi(alfrescoApi); +const requestNode = new ProcessInstanceQueryRepresentation(); + +processApi.getProcessInstances(requestNode).then( + (data) => { + console.log('All processes' + data); + }, + (error) => { + console.log('Error' + error); + }); +``` + +Filtered process: + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const processApi = ProcessApi(this.alfrescoApi); + +const requestNode = new ProcessInstanceQueryRepresentation({ + page: 0, + sort: 'created-desc', + state: 'completed' +}); + +processApi.getProcessInstances(requestNode).then( + (data) => { + console.log('All processes completed' + data); + }, + (error) => { + console.log('Error' + error); + }); +``` + +## Models Api + +Below you can find some example relative to the Activiti process api for all the possible method go to [Models Api](../src/api/activiti-rest-api/docs/ModelsApi.md) documentation. + +### Get Model + +getModel(modelId, opts) + +To retrieve details about a particular model (process, form, decision rule or app) return a [ModelRepresentation](../src/api/activiti-rest-api/docs/ModelRepresentation.md) + +**Parameters** + +| Name | Type | Description | Notes | +|--------------------|---------|--------------------|------------| +| modelId | Number | modelId | | +| includePermissions | Boolean | includePermissions | [optional] | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const modelsApi = new ModelsApi(alfrescoApi); + +const opts = { + filter: 'myReusableForms', + modelType: 2 +}; + +modelsApi.getModels(opts).then( + (data) => { + console.log('All your reusable forms' + data); + }, + (error) => { + console.log('Error' + error); + }); +``` + +## Report Api + +Below you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](../src/api/activiti-rest-api/docs/ReportApi.md) + +### Create Default Reports + +```javascript +ReportApi.createDefaultReports() +``` + +Creates the default reports + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +reportApi.createDefaultReports(); +``` + +### Get Reports + +```javascript +ReportApi.getReportList() +``` + +Retrieve the available report list + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +reportApi.getReportList(); +``` + +### Report Params + +```javascript +ReportApi.getReportParams(reportId) +``` + +> Retrieve the parameters referring to the reportId. + +**Parameters** + +| Name | Type | Description | +|----------|--------|-------------| +| reportId | String | reportId | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +const reportId = '1'; +reportApi.getReportParams(reportId); +``` + +## Report Process Definitions + +```javascript +ReportApi.getProcessDefinitions() +``` + +Retrieve the process definition list for all the apps. + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +reportApi.getProcessDefinitions(); +``` + +## Tasks of Process Definition + +getTasksByProcessDefinitionId(reportId, processDefinitionId) + +Retrieves all tasks that refer to the processDefinitionId + +**Parameters** + +| Name | Type | Description | +|---------------------|--------|-----------------------| +| reportId | String | reportId | +| processDefinitionId | String | process definition id | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +const reportId = '1'; +const processDefinitionId = '1'; + +reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId); +``` + +## Generate reports + +```javascript +ReportApi.getReportsByParams(reportId, paramsQuery) +``` + +Generate the reports based on the input parameters + +**Parameters** + +| Name | Type | Description | +|-------------|--------|------------------| +| reportId | String | reportId | +| paramsQuery | Object | Query parameters | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +const reportId = '1'; +const paramsQuery = { status: 'ALL' }; + +reportApi.getReportsByParams(reportId, paramsQuery); +``` +## Update report details + +```javascript +ReportApi.updateReport(reportId, name) +``` + +Update the report details + +**Parameters** + +| Name | Type | Description | +|----------|--------|-----------------| +| reportId | String | reportId | +| name | String | The report name | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +const reportId = '1'; +const name = 'new report name'; + +reportApi.updateReport(reportId, name); +``` + +## Export to CSV + +```javascript +ReportApi.exportToCsv(reportId, queryParams) +``` + +Export a report as csv + +**Parameters** + +| Name | Type | Description | +|-------------|--------|------------------| +| reportId | String | reportId | +| queryParams | Object | Query parameters | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +const reportId = '1'; +const queryParams = { + processDefinitionId: 'TEST:99:999', + dateRange: { + startDate: '2017-01-01T00:00:00.000Z', + endDate: '2017-01-24T23:59:59.999Z', + rangeId: 'currentYear' + }, + slowProcessInstanceInteger: 10, + status: 'All', + __reportName: 'FAKE_REPORT_NAME' +}; + +reportApi.exportToCsv(reportId, queryParams); +``` + +## Save Report + +```javascript +ReportApi.saveReport(reportId, queryParams) +``` + +Save a report + +**Parameters** + +| Name | Type | Description | +|-------------|--------|------------------| +| reportId | String | reportId | +| queryParams | Object | Query parameters | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +const reportId = '1'; +const queryParams = { + processDefinitionId: 'TEST:99:999', + dateRange: { + startDate: '2017-01-01T00:00:00.000Z', + endDate: '2017-01-24T23:59:59.999Z', + rangeId: 'currentYear' + }, + slowProcessInstanceInteger: 10, + status: 'All', + __reportName: 'FAKE_REPORT_NAME' +}; + +reportApi.saveReport(reportId, queryParams); +``` + +## Delete report + +```javascript +ReportApi.deleteReport(reportId) +``` + +Delete a report + +**Parameters** + +| Name | Type | Description | +|----------|--------|-------------| +| reportId | String | reportId | + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const reportApi = ReportApi(alfrescoApi); + +const reportId = '1'; + +reportApi.deleteReport(reportId); +``` diff --git a/lib/js-api/docs/calling-custom-endpoints.md b/lib/js-api/docs/calling-custom-endpoints.md new file mode 100644 index 0000000000..916e4c187f --- /dev/null +++ b/lib/js-api/docs/calling-custom-endpoints.md @@ -0,0 +1,36 @@ +# Calling Custom Endpoints + +Content service and process service has two different clients: + +- AlfrescoJsApi.ProcessClient +- AlfrescoJsApi.ContentClient + +Both clients expose a method ***callApi** + +```typescript +function callApi( + path: string, + httpMethod: string, + pathParams?: any, + queryParams?: any, + headerParams?: any, + formParams?: any, + bodyParam?: any, + contentTypes?: string[], + accepts?: string[], + returnType?: any, + contextRoot?: string, + responseType?: string +): Promise<any> {}; +``` + +If you want call your custom rest point in one of those two service use the corresponding client. + +**Example** + +```javascript +alfrescoJsApi.bpmClient.callApi( + '/api/enterprise/app-version', 'GET', + {}, {}, {}, {}, {}, ['application/json'], ['application/json'], {'String': 'String'} +) + ``` \ No newline at end of file diff --git a/lib/js-api/docs/changelog/.gitkeep b/lib/js-api/docs/changelog/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/js-api/docs/changelog/changelog-4.10.0.md b/lib/js-api/docs/changelog/changelog-4.10.0.md new file mode 100644 index 0000000000..5bdcbd98bc --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-4.10.0.md @@ -0,0 +1,18 @@ +--- +Title: Changelog for @alfresco/js-api v4.10.0 +--- + +# Changelog + +- [b9c450cd4](https://github.com/Alfresco/alfresco-js-api/commit/b9c450cd4) Update .mergify.yml +- [ee63a51a6](https://github.com/Alfresco/alfresco-js-api/commit/ee63a51a6) Update js-api-build.yml +- [83db6f6e3](https://github.com/Alfresco/alfresco-js-api/commit/83db6f6e3) Update js-api-build.yml +- [d09f7601c](https://github.com/Alfresco/alfresco-js-api/commit/d09f7601c) Update js-api-build.yml +- [c158ba2ec](https://github.com/Alfresco/alfresco-js-api/commit/c158ba2ec) Update js-api-build.yml (#1358) +- [445a36953](https://github.com/Alfresco/alfresco-js-api/commit/445a36953) fix build +- [be9ccaa78](https://github.com/Alfresco/alfresco-js-api/commit/be9ccaa78) Update js-api-build.yml +- [bc3ee9017](https://github.com/Alfresco/alfresco-js-api/commit/bc3ee9017) Update README.md +- [20abc2960](https://github.com/Alfresco/alfresco-js-api/commit/20abc2960) Move to github actions (#1353) +- [d7f899b49](https://github.com/Alfresco/alfresco-js-api/commit/d7f899b49) Update package.json +- [2730595bd](https://github.com/Alfresco/alfresco-js-api/commit/2730595bd) [AAE-7657] Let js-api depend on generic http client (#1332) + diff --git a/lib/js-api/docs/changelog/changelog-4.11.0.md b/lib/js-api/docs/changelog/changelog-4.11.0.md new file mode 100644 index 0000000000..100cca9a3d --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-4.11.0.md @@ -0,0 +1,15 @@ +--- +Title: Changelog for @alfresco/js-api v4.11.0 +--- + +# Changelog + +- [0c345b466](https://github.com/Alfresco/alfresco-js-api/commit/0c345b466) remove mergify config (#1371) +- [a50e297eb](https://github.com/Alfresco/alfresco-js-api/commit/a50e297eb) feat: rename and export LegacyAlfrescoApi in public-api (#1382) +- [e19d6ce50](https://github.com/Alfresco/alfresco-js-api/commit/e19d6ce50) Expose the api to fetch userinfo (#1381) +- [c7273a2ee](https://github.com/Alfresco/alfresco-js-api/commit/c7273a2ee) Check out and npm ci +- [f074f6d0e](https://github.com/Alfresco/alfresco-js-api/commit/f074f6d0e) Create a different flow for upstream manually (#1380) +- [75ba2574e](https://github.com/Alfresco/alfresco-js-api/commit/75ba2574e) Being able to trigger the adf trigger from workflow (#1379) +- [470d9c3ed](https://github.com/Alfresco/alfresco-js-api/commit/470d9c3ed) [AAE-8649] Being able to use input values of discovery (#1378) +- [005b96df6](https://github.com/Alfresco/alfresco-js-api/commit/005b96df6) Ability to pass client secret (#1373) + diff --git a/lib/js-api/docs/changelog/changelog-4.7.0.md b/lib/js-api/docs/changelog/changelog-4.7.0.md new file mode 100644 index 0000000000..7c3841b8d6 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-4.7.0.md @@ -0,0 +1,8 @@ +--- +Title: Changelog for @alfresco/js-api v4.7.0 +--- + +# Changelog + +- [14f1b3ba](https://github.com/Alfresco/alfresco-js-api/commit/14f1b3ba) release reports generation (#1258) +- [e55cff6b](https://github.com/Alfresco/alfresco-js-api/commit/e55cff6b) Update publish.sh diff --git a/lib/js-api/docs/changelog/changelog-4.8.0.md b/lib/js-api/docs/changelog/changelog-4.8.0.md new file mode 100644 index 0000000000..0d2eea7923 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-4.8.0.md @@ -0,0 +1,8 @@ +--- +Title: Changelog for @alfresco/js-api v4.8.0 +--- + +# Changelog + +- [39afcf33](https://github.com/Alfresco/alfresco-js-api/commit/39afcf33) Bump typescript from 4.5.3 to 4.5.4 (#1273) +- [f2e43b36](https://github.com/Alfresco/alfresco-js-api/commit/f2e43b36) Support custom OAuth endpoints (#1259) diff --git a/lib/js-api/docs/changelog/changelog-4.9.0.md b/lib/js-api/docs/changelog/changelog-4.9.0.md new file mode 100644 index 0000000000..031fcadff5 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-4.9.0.md @@ -0,0 +1,9 @@ +--- +Title: Changelog for @alfresco/js-api v4.9.0 +--- + +# Changelog + +- [cdeecd6f6](https://github.com/Alfresco/alfresco-js-api/commit/cdeecd6f6) Revert the superagent upgrade (#1340) +- [6dc7e489d](https://github.com/Alfresco/alfresco-js-api/commit/6dc7e489d) Make ADF possible to update on request (#1339) +- [c8db476cb](https://github.com/Alfresco/alfresco-js-api/commit/c8db476cb) revert superagent (#1338) \ No newline at end of file diff --git a/lib/js-api/docs/changelog/changelog-5.0.0.md b/lib/js-api/docs/changelog/changelog-5.0.0.md new file mode 100644 index 0000000000..25a836a8b4 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-5.0.0.md @@ -0,0 +1,11 @@ +--- +Title: Changelog for @alfresco/js-api v5.0.0 +--- + +# Changelog + +- [73acb91ed](https://github.com/Alfresco/alfresco-js-api/commit/73acb91ed) Fix problems around legacyAlfrescoApi (#1403) +- [434c24ea6](https://github.com/Alfresco/alfresco-js-api/commit/434c24ea6) Fix the order of httpClient testing conditions (#1402) +- [8240936f2](https://github.com/Alfresco/alfresco-js-api/commit/8240936f2) [AAE-9334] Improve update project script (#1395) +- [a7fc2e92a](https://github.com/Alfresco/alfresco-js-api/commit/a7fc2e92a) [MNT-22840] Use ticket parameter instead of alf_ticket when withCredentials configuration is enabled (#1392) + diff --git a/lib/js-api/docs/changelog/changelog-5.1.0.md b/lib/js-api/docs/changelog/changelog-5.1.0.md new file mode 100644 index 0000000000..1b044f4040 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-5.1.0.md @@ -0,0 +1,10 @@ +--- +Title: Changelog for @alfresco/js-api v5.1.0 +--- + +# Changelog + +- [ADF-5501] fix: change the guard for progress event detection (#1441) +- add missing tslib dependency (#1437) +- [APPS-1732] Removed AuthorityType and clearance parameters from GET AuthorityClearance endpoint (#1435) +- [AAE-9473] feat: extract http client to handle custom implementations (#1412) (#1392) \ No newline at end of file diff --git a/lib/js-api/docs/changelog/changelog-5.2.0.md b/lib/js-api/docs/changelog/changelog-5.2.0.md new file mode 100644 index 0000000000..a296d30954 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-5.2.0.md @@ -0,0 +1,9 @@ +--- +Title: Changelog for @alfresco/js-api v5.2.0 +--- + +# Changelog + +- 90ab51c26 [MNT-23143] Add withCredentials to isLoggedIn +- 80106a493 [MNT-23143] Move withCredentials check to correct method +- f80ed199a [MNT-23143] withCredentials reflected in isBpmLoggedIn \ No newline at end of file diff --git a/lib/js-api/docs/changelog/changelog-5.3.0.md b/lib/js-api/docs/changelog/changelog-5.3.0.md new file mode 100644 index 0000000000..5f79c65948 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-5.3.0.md @@ -0,0 +1,20 @@ +--- +Title: Changelog for @alfresco/js-api v5.3.0 +--- + +# Changelog + +- 86fec25ec [ACS-4118] create a tag from tags list +- 11252d0e0 [ACS-4413] upgrade CodeQL to v2 (#1493) +- 3d8e2851a [ACS-4118] Update readme file +- 4b58f0f60 [ACS-4118] Little correction for documentation +- b9809fa36 [ACS-4118] Allow to return tags for specified name +- e692367a7 [ACS-4118] Use callApi and write some documentation for tags creation +- cfd2b60b4 [ACS-4118] Update api for tags creation +- ddc565fa2 [ACS-4240] delete category api change (#1484) +- 4286228b5 [ACS-4115] Added module annotation to categoriesApi and added category models to index +- 6ee349878 [ACS-4116]update of updateCategory endpoint. +- f0c6e8e45 added module annotation to categoriesApi and other models to index +- 22d5c2940 [ACS-4114] Export categories api +- 1c1305e91 [ACS-4114] Export categories api +- 2ebce874f [ACS-4114] Add categories api (#1477) diff --git a/lib/js-api/docs/changelog/changelog-5.4.0.md b/lib/js-api/docs/changelog/changelog-5.4.0.md new file mode 100644 index 0000000000..0340a62ae1 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-5.4.0.md @@ -0,0 +1,16 @@ +--- +Title: Changelog for @alfresco/js-api v5.4.0 +--- + +# Changelog + +- [4b9b21f4f](https://github.com/Alfresco/alfresco-js-api/commit/4b9b21f4f) fix-js-api-upstream (#1526) +- [4152c12f3](https://github.com/Alfresco/alfresco-js-api/commit/4152c12f3) [ACS-4331] Add deleteTag method to tags API (#1490) +- [d979e35be](https://github.com/Alfresco/alfresco-js-api/commit/d979e35be) [ACS-4590] cleanup performance tests (#1516) +- [90d83635c](https://github.com/Alfresco/alfresco-js-api/commit/90d83635c) [ACS-4611] Check proper storage (#1515) +- [41e31845e](https://github.com/Alfresco/alfresco-js-api/commit/41e31845e) Improved ESLint setup (#1509) +- [26bbe4e18](https://github.com/Alfresco/alfresco-js-api/commit/26bbe4e18) Fix GHA warnings for upcoming changes for setup-node action (#1508) +- [009444391](https://github.com/Alfresco/alfresco-js-api/commit/009444391) [ADF-5515] disable integration tests until config fixes (#1505) +- [fea47c040](https://github.com/Alfresco/alfresco-js-api/commit/fea47c040) [ACS-4412] Unit tests for createTags function (#1499) +- [39b3c3004](https://github.com/Alfresco/alfresco-js-api/commit/39b3c3004) AAE-12059: Removed createProcessInstanceVariables method from process instance variavles api (#1494) + diff --git a/lib/js-api/docs/changelog/changelog-5.5.0.md b/lib/js-api/docs/changelog/changelog-5.5.0.md new file mode 100644 index 0000000000..c8869a66eb --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-5.5.0.md @@ -0,0 +1,17 @@ +--- +Title: Changelog for @alfresco/js-api v5.5.0 +--- + +# Changelog + +- [3939ed803](https://github.com/Alfresco/alfresco-js-api/commit/3939ed803) use the gh strategy (#1565) +- [e90fb3c62](https://github.com/Alfresco/alfresco-js-api/commit/e90fb3c62) [ACS-4126] viewer allow assigning tags to content basic (#1557) +- [b4b9ffe28](https://github.com/Alfresco/alfresco-js-api/commit/b4b9ffe28) [ACS-4753] list of tags is not rendered because of missing count field in backend response (#1546) +- [c3dcf1c39](https://github.com/Alfresco/alfresco-js-api/commit/c3dcf1c39) Use token as part of workflow (#1544) +- [835bb11f7](https://github.com/Alfresco/alfresco-js-api/commit/835bb11f7) fix tab +- [9bd75b802](https://github.com/Alfresco/alfresco-js-api/commit/9bd75b802) Inverte release order (#1543) +- [d697c7623](https://github.com/Alfresco/alfresco-js-api/commit/d697c7623) Rely on action to create npmrc (#1542) +- [3dea8b143](https://github.com/Alfresco/alfresco-js-api/commit/3dea8b143) Publish js pkgs on gh pkg registry (#1538) +- [2414d226f](https://github.com/Alfresco/alfresco-js-api/commit/2414d226f) [ACS-4724] remove minimatch dependency (#1536) +- [a7c0cee18](https://github.com/Alfresco/alfresco-js-api/commit/a7c0cee18) [ACS-4723] Remove fs-extra dependency (#1535) + diff --git a/lib/js-api/docs/changelog/changelog-6.0.0.md b/lib/js-api/docs/changelog/changelog-6.0.0.md new file mode 100644 index 0000000000..5e78ea039c --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-6.0.0.md @@ -0,0 +1,11 @@ +--- +Title: Changelog for @alfresco/js-api v6.0.0 +--- + +# Changelog + +- [e70da65bc](https://github.com/Alfresco/alfresco-js-api/commit/e70da65bc) ACS-5040 Renamed one left reference to Alfresco (#1573) +- [c93b633ca](https://github.com/Alfresco/alfresco-js-api/commit/c93b633ca) [AAE-13902] - Create the release tag using the github API (#1572) +- [5cdab4525](https://github.com/Alfresco/alfresco-js-api/commit/5cdab4525) split testing jobs and add error reporting (#1567) +- [22938d88c](https://github.com/Alfresco/alfresco-js-api/commit/22938d88c) [ACS-5040] update license headers to reflect hyland copyright guidelines (#1561) + diff --git a/lib/js-api/docs/changelog/changelog-6.1.0.md b/lib/js-api/docs/changelog/changelog-6.1.0.md new file mode 100644 index 0000000000..702f58d0b2 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-6.1.0.md @@ -0,0 +1,8 @@ +--- +Title: Changelog for @alfresco/js-api v6.1.0 +--- + +# Changelog + +- [a1c51dfec](git@github.com:Alfresco/alfresco-js-api/commit/a1c51dfec) [ADF-5510] Upgrade to Node 18 (#1579) + diff --git a/lib/js-api/docs/changelog/changelog-6.2.0.md b/lib/js-api/docs/changelog/changelog-6.2.0.md new file mode 100644 index 0000000000..05f0890bf6 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-6.2.0.md @@ -0,0 +1,11 @@ +--- +Title: Changelog for @alfresco/js-api v6.2.0 +--- + +# Changelog + +- [b7cd96b84](https://github.com/Alfresco/alfresco-js-api/commit/b7cd96b84) do not escape basic auth credentials (#1599) +- [a55266731](https://github.com/Alfresco/alfresco-js-api/commit/a55266731) fix child assocs pagination (#1598) +- [58d8c4dff](https://github.com/Alfresco/alfresco-js-api/commit/58d8c4dff) fix missing parentId for declareRecord (#1597) +- [409e47e09](https://github.com/Alfresco/alfresco-js-api/commit/409e47e09) Fix git tag creation failing on master (#1592) + diff --git a/lib/js-api/docs/changelog/changelog-7.0.0.md b/lib/js-api/docs/changelog/changelog-7.0.0.md new file mode 100644 index 0000000000..7a944c628f --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-7.0.0.md @@ -0,0 +1,31 @@ +--- +Title: Changelog for @alfresco/js-api v7.0.0 +--- + +# Changelog + +- [a67a0222e](https://github.com/Alfresco/alfresco-js-api/commit/a67a0222e) [ACS-5946] aps documentation enhancements (#1659) +- [2f1de4ec6](https://github.com/Alfresco/alfresco-js-api/commit/2f1de4ec6) Add relations to site entry (#1658) +- [7d6d1882b](https://github.com/Alfresco/alfresco-js-api/commit/7d6d1882b) [ACS-5946] documentation improvements (#1652) +- [4e3b831bd](https://github.com/Alfresco/alfresco-js-api/commit/4e3b831bd) [ACS-5839] api typings and docs improvements (#1651) +- [76f951f67](https://github.com/Alfresco/alfresco-js-api/commit/76f951f67) [ACS-5839] api typings and docs (#1650) +- [8ca4ed0a1](https://github.com/Alfresco/alfresco-js-api/commit/8ca4ed0a1) [ACS-5839] GS Api enhancements and typings(#1649) +- [0e9673d8b](https://github.com/Alfresco/alfresco-js-api/commit/0e9673d8b) [ACS-5839] fix security groups api +- [7119cbe0f](https://github.com/Alfresco/alfresco-js-api/commit/7119cbe0f) [ACS-5839] minor fix to trigger gha deployment +- [03c641de2](https://github.com/Alfresco/alfresco-js-api/commit/03c641de2) [ACS-5839] bump to 7.0.0, api enhancements (#1648) +- [277b79f3e](https://github.com/Alfresco/alfresco-js-api/commit/277b79f3e) [ACS-5839] typing fixes (#1646) +- [de66ea713](https://github.com/Alfresco/alfresco-js-api/commit/de66ea713) [ACS-5839] api fixes and improvements (#1645) +- [12567fefe](https://github.com/Alfresco/alfresco-js-api/commit/12567fefe) [ACS-5839] improved typing support (#1638) +- [877bae3f7](https://github.com/Alfresco/alfresco-js-api/commit/877bae3f7) [ACS-5839] improved documentation and TypeScript support (#1636) +- [241a47ee6](https://github.com/Alfresco/alfresco-js-api/commit/241a47ee6) [ACS-5839] improved API typings (#1635) +- [b7b8dbbbc](https://github.com/Alfresco/alfresco-js-api/commit/b7b8dbbbc) [ACS-5845] Remove deprecated apis, documentation updates (#1629) +- [54c609427](https://github.com/Alfresco/alfresco-js-api/commit/54c609427) [ACS-5839] Make `contextRoot` optional as per documentation (#1628) +- [8cc1d4cdd](https://github.com/Alfresco/alfresco-js-api/commit/8cc1d4cdd) [ACS-5845] remove Alfresco Compatibility usage (#1627) +- [e274913c7](https://github.com/Alfresco/alfresco-js-api/commit/e274913c7) [ACS-5839] Improved typings for model classes (#1626) +- [5ecfdb2f1](https://github.com/Alfresco/alfresco-js-api/commit/5ecfdb2f1) Remove console logs from auth and fix promise rejections (#1621) +- [8faeff9bb](https://github.com/Alfresco/alfresco-js-api/commit/8faeff9bb) [ACS-5839] more TS typings support for Content API models (#1622) +- [f1e55ab17](https://github.com/Alfresco/alfresco-js-api/commit/f1e55ab17) Fix FormFieldRepresentation typings, add missing "fields" property (#1623) +- [e736ce8ec](https://github.com/Alfresco/alfresco-js-api/commit/e736ce8ec) Update dependencies and various audit fixes (#1620) +- [14129b977](https://github.com/Alfresco/alfresco-js-api/commit/14129b977) bump superagent (#1614) +- [70e78e889](https://github.com/Alfresco/alfresco-js-api/commit/70e78e889) [AAE-12502] Handle Storage as a singleton to fix on ADF the alf_ticket in not added to the content api because config.ticketECM is undefined (#1616) + diff --git a/lib/js-api/docs/changelog/changelog-7.1.0.md b/lib/js-api/docs/changelog/changelog-7.1.0.md new file mode 100644 index 0000000000..c8f5fbc4fb --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-7.1.0.md @@ -0,0 +1,12 @@ +--- +Title: Changelog for @alfresco/js-api v7.1.0 +--- + +# Changelog + +- [f00bc51ed](git@github.com:Alfresco/alfresco-js-api/commit/f00bc51ed) [ACA-4724] Use jsdom directly instead of mocha-jsdom in unit test (#1693) +- [ca1ef4f45](git@github.com:Alfresco/alfresco-js-api/commit/ca1ef4f45) [ACS-5994] Add multiple nodes deletion support (#1687) +- [9d1c6a752](git@github.com:Alfresco/alfresco-js-api/commit/9d1c6a752) Break various dependencies on 3rd party libs (#1679) +- [2ee68fbec](git@github.com:Alfresco/alfresco-js-api/commit/2ee68fbec) remove mocha-jsdom dependency due to security issues and deprecated status (#1678) +- [8f3c66976](git@github.com:Alfresco/alfresco-js-api/commit/8f3c66976) [ACTIVITI-4914] updated getProcessesAndTasksOnContent (#1672) + diff --git a/lib/js-api/docs/changelog/changelog-7.2.0.md b/lib/js-api/docs/changelog/changelog-7.2.0.md new file mode 100644 index 0000000000..1f31fb5e56 --- /dev/null +++ b/lib/js-api/docs/changelog/changelog-7.2.0.md @@ -0,0 +1,10 @@ +--- +Title: Changelog for @alfresco/js-api v7.2.0 +--- + +# Changelog + +- [b41cc2629](https://github.com/Alfresco/alfresco-js-api/commit/b41cc2629) [ACS-6231] cleanup old codegen (#1716) +- [8d02eb4ea](https://github.com/Alfresco/alfresco-js-api/commit/8d02eb4ea) [ACS-6231] cleanup old angular projects and break dependency on remove env (#1715) +- [928f9cd91](https://github.com/Alfresco/alfresco-js-api/commit/928f9cd91) [ACS-6231] preparation cleanup before supporting Nx (#1714) + diff --git a/lib/js-api/docs/ecm-example.md b/lib/js-api/docs/ecm-example.md new file mode 100644 index 0000000000..4457e842af --- /dev/null +++ b/lib/js-api/docs/ecm-example.md @@ -0,0 +1,494 @@ +<!-- markdown-toc start - Don't edit this section. npm run toc to generate it--> + +<!-- toc --> + +- [ECM](#ecm) + * [Get Node content](#get-node--content) + * [Get File or Folder Info](#get-file-or-folder-info) + * [Get Folder Children Info](#get-folder-children-info) + * [Create Folder](#create-folder) + * [Upload File](#upload-file) + * [Events Upload File](#events-upload-file) + * [Delete File or Folder](#delete-file-or-folder) + * [Delete File or Folder Permanent](#delete-file-or-folder-permanent) + * [Get thumbnail Url](#get-thumbnail-url) + * [Get preview Url](#get-preview-url) + * [Get content Url](#get-content-url) + * [Custom web scripts call](#custom-web-scripts-call) + +<!-- tocstop --> + +<!-- markdown-toc end --> + +# ECM + +A complete list of all the ECM methods is available here: [Content API](../src/api/content-rest-api/README.md). +Below you can find some common examples. + +## Get Node Content + +```javascript +NodesApi.getFileContent(nodeId, opts) +``` + +Returns the file content of the node with identifier **nodeId**. + +**Example** + +```javascript +const fs = require('fs'); + +const alfrescoApi = new AlfrescoApi(/*...*/); +const nodesApi = new NodesApi(alfrescoApi); +const nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c'; + +nodesApi.getNodeContent(nodeId).then( + (data) => { + fs.writeFile('./test/grass.jpg', data, (error) => { + if (error) { + console.error(error); + return; + } + console.log('The file was saved!'); + }); + }, + (error) => { + console.error(error); + }); +``` + +## Get a Node Info + +```javascript +NodesApi.getNodeInfo(nodeId, opts) +``` + +Get information for the File/Folder with the identifier nodeId. +You can also use one of these well-known aliases: `-my-`, `-shared-` or `-root-` as `nodeId` value. + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c'; +const nodesApi = new NodesApi(alfrescoApi); + +nodesApi.getNode(nodeId, opts).then( + (nodeEntry) => { + console.log('This is the name' + nodeEntry.entry.name ); + }, + (error) => { + console.log('This node does not exist'); + }); +``` +## Get Folder Children Info + +```javascript +NodesApi.getNodeChildren(fileOrFolderId, opts) +``` + +Minimal information for each child is returned by default. + +You can use the include parameter to return additional information. +returns a promise with the Info about the children of the node if resolved and `{error}` if rejected. + +You can also use one of these well-known aliases: `-my-`, `-shared-` or `-root-` as `nodeId` value. + +**Example**: + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c'; +const nodesApi = new NodesApi(alfrescoApi); + +nodesApi.listNodeChildren(nodeId, opts).then( + (data) => { + console.log( + 'The number of children in this folder are ' + data.list.pagination.count + ); + }, + (error) => { + console.log('This node does not exist'); + }); +``` +## Create Folder + +```javascript +NodesApi.addNode(nodeId, nodeBody, opts) +``` + +Returns a promise that is resolved if the folder is created and `{error}` if rejected. + +You can also use one of these well-known aliases: `-my-`, `-shared-` or `-root-` as `nodeId` value. + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const nodesApi = new NodesApi(alfrescoApi); + +const nodeBody = { + 'name': 'newFolderName', + 'nodeType': 'cm:folder', + 'relativePath': relativePath +}; + +nodesApi.addNode('-root-', nodeBody).then( + (data) => { + console.log('The folder is created in root'); + }, + (error) => { + console.log('Error in creation of this folder or folder already exist' + error); + }); +``` + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const nodesApi = new NodesApi(alfrescoApi); + +const nodeBody = { + 'name': 'newFolderName', + 'nodeType': 'cm:folder', + 'relativePath': 'folderA/folderB' +}; + +nodesApi.addNode('-root-', nodeBody).then( + (data) => { + console.log('The folder is created in folderA/folderB from root'); + }, + (error) => { + console.log('Error in creation of this folder or folder already exist' + error); + }); +``` + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const nodesApi = new NodesApi(alfrescoApi); + +const nodeBody = { + 'name': 'newFolderName', + 'nodeType': 'cm:folder', + 'relativePath': 'folderA/folderB' +}; +const parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c' + +nodesApi.addNode(parentFolder, nodeBody).then( + (data) => { + console.log('The folder is created in folderA/folderB from parentFolder:' + parentFolder); + }, + (error) => { + console.log('Error in creation of this folder or folder already exist' + error); + }); +``` + +**CreateFolder With Auto Rename** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const nodesApi = new NodesApi(this.alfrescoApi); + +const nodeBody = { + name: 'newFolderName', + nodeType: 'cm:folder', + autoRename: true, + relativePath: 'folderA/folderB' +}; + +nodesApi.addNode('-root-', nodeBody).then( + (data) => { + console.log('The folder is created in root'); + }, + (error) => { + console.log('Error in creation of this folder or folder already exist' + error); + }); +``` + +## Upload File + +```javascript +UploadApi.uploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts) +``` + +Returns a promise that is resolved if the file is successful uploaded and `{error}` if rejected. + +The `fileDefinition` provides information about files and allows JavaScript to access their content. + +**Web** + +File Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the `<input>` element + +**Node** + +File Definition are generally retrieved from a read stream + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const fs = require('fs'); + +const fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt'); +const uploadApi = new UploadApi(alfrescoApi); + +uploadApi.uploadFile(fileToUpload).then( + () => { + console.log('File Uploaded in the root'); + }, + (error) => { + console.log('Error during the upload' + error); + }); + +uploadApi.uploadFile(fileToUpload, null, null, null, { autoRename: true }) + .then(() => { + console.log('File Uploaded in the root'); + }, (error) => { + console.log('Error during the upload' + error); + }); + +uploadApi.uploadFile(fileToUpload, 'folderX/folderY/folderZ') + .then(() => { + console.log('File Uploaded in the from root folderX/folderY/folderZ'); + }, (error) => { + console.log('Error during the upload' + error); + }); + +const parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'; + +uploadApi.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder ) + .then(() => { + console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ'); + }, (error) => { + console.log('Error during the upload' + error); + }); +``` + +The default behaviour of the Upload API will not create any thumbnail. + +In order to create a thumbnail you have to perform to pass the parameter `{renditions: 'doclib'}` as in the example below. +This parameter will basically perform also a call to the Rendition API. + +For more information about the Rendition API : + +* [Rendition API](../src/api/content-rest-api/docs/RenditionsApi.md) +* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service) + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const fs = require('fs'); + +const fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt'); +const uploadApi = new UploadApi(alfrescoApi); + +uploadApi.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'}) + .then(() => { + console.log('File Uploaded in the root'); + }, (error) => { + console.log('Error during the upload' + error); + }); +``` + +To abort a file uploading: + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const fs = require('fs'); + +const fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt'); +const uploadApi = new UploadApi(alfrescoApi); + +const promiseUpload = uploadApi.uploadFile(fileToUpload) + .once('abort', function () { + console.log('File Uploaded aborted'); + }); + +promiseUpload.abort(); +``` + +### Upload File Events + +The `uploadFile` is also an `EventEmitter` which you can register to listen to any of the following event types: + +* progress +* success +* abort +* error +* unauthorized + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const fs = require('fs'); + +const fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt'); +const uploadApi = new UploadApi(alfrescoApi); + +uploadApi.uploadFile(fileToUpload) + .on('progress', (progress) => { + console.log( 'Total :' + progress.total ); + console.log( 'Loaded :' + progress.loaded ); + console.log( 'Percent :' + progress.percent ); + }) + .on('success', () => { + console.log( 'Your File is uploaded'); + }) + .on('abort', () => { + console.log( 'Upload Aborted'); + }) + .on('error', () => { + console.log( 'Error during the upload'); + }) + .on('unauthorized', () => { + console.log('You are unauthorized'); + }) +``` + +## Delete a Node + +```javascript +NodesApi.deleteNode(fileOrFolderId, opts) +``` + +Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted. +Deleted nodes are moved to the trash bin, and it is still possible to recover them. + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c'; +const nodesApi = new NodesApi(alfrescoApi); + +nodesApi.deleteNode(fileOrFolderId).then( + (data) => { + console.log('The file/folder is deleted'); + }, + (error) => { + console.log('This node does not exist'); + }); +``` + +### Delete a Node Permanently + +```javascript +NodesApi.deleteNode(fileOrFolderId, { permanent: true }) +``` + +Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted. +It will not be possible to recover the files after this call. + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c'; +const nodesApi = new NodesApi(alfrescoApi); + +nodesApi.deleteNode(fileOrFolderId, { permanent: true }).then( + (data) => { + console.log('The file/folder is deleted'); + }, + (error) => { + console.log('This node does not exist'); + }); +``` + +## Get Thumbnail Url + +```javascript +ContentApi.getDocumentThumbnailUrl(documentId) +``` + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const contentApi = new ContentApi(alfrescoApi); + +const thumbnailUrl = contentApi.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4'); +``` + +## Get Preview Url + +```javascript +ContentApi.getDocumentPreviewUrl(documentId) +``` + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const contentApi = new ContentApi(alfrescoApi); + +const previewUrl = contentApi.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4'); +``` + +## Get Content Url + +```javascript +ContentApi.getContentUrl(documentId) +``` + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const contentApi = new ContentApi(alfrescoApi); + +const contentUrl = contentApi.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4'); +``` + +## Custom WebScript Calls + +For mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples) + +```javascript +executeWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath, postBody) +``` + +Anatomy of a Web Script URI: + +```text +http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs) +``` + +A Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. +While using the same underlying code, there are broadly two kinds of Web Scripts. + +**Parameters** + +| Name | Description | +|-----------------|-----------------------------------------------------------------| +| **httpMethod** | possible value GET, POST, PUT and DELETE | +| **scriptPath** | path to Web Script (as defined by Web Script) | +| **scriptArgs** | arguments to pass to Web Script | +| **contextRoot** | path where application is deployed default value 'alfresco' | +| **servicePath** | path where Web Script service is mapped default value 'service' | +| **postBody** | post body | + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const webscriptApi = new WebscriptApi(alfrescoApi); + +// Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks + +webscriptApi.executeWebScript('GET', 'mytasks').then( + (data) => { + console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data); + }, + (error) => { + console.log('Error' + error); + }); + +// Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks + +webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then( + (data)=> { + console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data); + }, + (error)=> { + console.log('Error' + error); + }); + +// Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks + +webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then( + (data)=> { + console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data); + }, + (error) => { + console.log('Error' + error); + }); +``` diff --git a/lib/js-api/docs/error-events.md b/lib/js-api/docs/error-events.md new file mode 100644 index 0000000000..f204cb640d --- /dev/null +++ b/lib/js-api/docs/error-events.md @@ -0,0 +1,11 @@ +# Error Events + +The api/js-api has an error handler event where you can subscribe + +**Example** + +```javascript +alfrescoJsApi.on('error', error => { + console.log(error); +}); +``` \ No newline at end of file diff --git a/lib/js-api/docs/licences/.gitkeep b/lib/js-api/docs/licences/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/js-api/docs/licences/license-info-4.10.0.md b/lib/js-api/docs/licences/license-info-4.10.0.md new file mode 100644 index 0000000000..09cb849760 --- /dev/null +++ b/lib/js-api/docs/licences/license-info-4.10.0.md @@ -0,0 +1,55 @@ +--- +Title: License info, @alfresco/js-api 4.10.0 +--- + +# License information for @alfresco/js-api 4.10.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 4.10.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 2.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 5.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.10.3 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-4.11.0.md b/lib/js-api/docs/licences/license-info-4.11.0.md new file mode 100644 index 0000000000..b8d0799ab0 --- /dev/null +++ b/lib/js-api/docs/licences/license-info-4.11.0.md @@ -0,0 +1,55 @@ +--- +Title: License info, @alfresco/js-api 4.11.0 +--- + +# License information for @alfresco/js-api 4.11.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 4.11.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 2.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 5.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.10.3 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-4.7.0.md b/lib/js-api/docs/licences/license-info-4.7.0.md new file mode 100644 index 0000000000..8abecc386b --- /dev/null +++ b/lib/js-api/docs/licences/license-info-4.7.0.md @@ -0,0 +1,47 @@ +--- +Title: License info, @alfresco/js-api 4.7.0 +--- + +# License information for @alfresco/js-api 4.7.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 4.7.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 1.1.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [concat-map](https://github.com/substack/node-concat-map) | 0.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.0.7 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.4.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 3.0.4 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.9.4 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | + diff --git a/lib/js-api/docs/licences/license-info-4.8.0.md b/lib/js-api/docs/licences/license-info-4.8.0.md new file mode 100644 index 0000000000..e21472aac5 --- /dev/null +++ b/lib/js-api/docs/licences/license-info-4.8.0.md @@ -0,0 +1,47 @@ +--- +Title: License info, @alfresco/js-api 4.8.0 +--- + +# License information for @alfresco/js-api 4.8.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 4.8.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 1.1.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [concat-map](https://github.com/substack/node-concat-map) | 0.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.0.7 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.4.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 3.0.4 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.9.4 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | + diff --git a/lib/js-api/docs/licences/license-info-4.9.0.md b/lib/js-api/docs/licences/license-info-4.9.0.md new file mode 100644 index 0000000000..530e79e1ac --- /dev/null +++ b/lib/js-api/docs/licences/license-info-4.9.0.md @@ -0,0 +1,55 @@ +--- +Title: License info, @alfresco/js-api 4.9.0 +--- + +# License information for @alfresco/js-api 4.9.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 4.9.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 2.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 5.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.10.3 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-5.0.0.md b/lib/js-api/docs/licences/license-info-5.0.0.md new file mode 100644 index 0000000000..a8c748d70f --- /dev/null +++ b/lib/js-api/docs/licences/license-info-5.0.0.md @@ -0,0 +1,55 @@ +--- +Title: License info, @alfresco/js-api 5.0.0 +--- + +# License information for @alfresco/js-api 5.0.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 5.0.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 2.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 5.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.10.3 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-5.1.0.md b/lib/js-api/docs/licences/license-info-5.1.0.md new file mode 100644 index 0000000000..93f6cc5a38 --- /dev/null +++ b/lib/js-api/docs/licences/license-info-5.1.0.md @@ -0,0 +1,55 @@ +--- +Title: License info, @alfresco/js-api 5.1.0 +--- + +# License information for @alfresco/js-api 5.1.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 5.1.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 2.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.10.3 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.4.0 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-5.2.0.md b/lib/js-api/docs/licences/license-info-5.2.0.md new file mode 100644 index 0000000000..66d461ce75 --- /dev/null +++ b/lib/js-api/docs/licences/license-info-5.2.0.md @@ -0,0 +1,56 @@ +--- +Title: License info, @alfresco/js-api 5.2.0 +--- + +# License information for @alfresco/js-api 5.2.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 5.2.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 2.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 5.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.10.3 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.4.0 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-5.3.0.md b/lib/js-api/docs/licences/license-info-5.3.0.md new file mode 100644 index 0000000000..4b69b17fd7 --- /dev/null +++ b/lib/js-api/docs/licences/license-info-5.3.0.md @@ -0,0 +1,56 @@ +--- +Title: License info, @alfresco/js-api 5.3.0 +--- + +# License information for @alfresco/js-api 5.3.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 5.3.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 2.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 5.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.10.3 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.4.0 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-5.4.0.md b/lib/js-api/docs/licences/license-info-5.4.0.md new file mode 100644 index 0000000000..da5987c28d --- /dev/null +++ b/lib/js-api/docs/licences/license-info-5.4.0.md @@ -0,0 +1,56 @@ +--- +Title: License info, @alfresco/js-api 5.4.0 +--- + +# License information for @alfresco/js-api 5.4.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 5.4.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [balanced-match](https://github.com/juliangruber/balanced-match) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [brace-expansion](https://github.com/juliangruber/brace-expansion) | 2.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [minimatch](https://github.com/isaacs/minimatch) | 5.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.11.0 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.5.0 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-5.5.0.md b/lib/js-api/docs/licences/license-info-5.5.0.md new file mode 100644 index 0000000000..193f4e0b79 --- /dev/null +++ b/lib/js-api/docs/licences/license-info-5.5.0.md @@ -0,0 +1,53 @@ +--- +Title: License info, @alfresco/js-api 5.5.0 +--- + +# License information for @alfresco/js-api 5.5.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 5.5.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.11.0 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.5.0 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-6.0.0.md b/lib/js-api/docs/licences/license-info-6.0.0.md new file mode 100644 index 0000000000..340c50c619 --- /dev/null +++ b/lib/js-api/docs/licences/license-info-6.0.0.md @@ -0,0 +1,53 @@ +--- +Title: License info, @alfresco/js-api 6.0.0 +--- + +# License information for @alfresco/js-api 6.0.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 6.0.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.11.0 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.5.0 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-6.1.0.md b/lib/js-api/docs/licences/license-info-6.1.0.md new file mode 100644 index 0000000000..72b7ec2f8b --- /dev/null +++ b/lib/js-api/docs/licences/license-info-6.1.0.md @@ -0,0 +1,53 @@ +--- +Title: License info, @alfresco/js-api 6.1.0 +--- + +# License information for @alfresco/js-api 6.1.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 6.1.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.11.0 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.5.2 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-6.2.0.md b/lib/js-api/docs/licences/license-info-6.2.0.md new file mode 100644 index 0000000000..01e5b38bee --- /dev/null +++ b/lib/js-api/docs/licences/license-info-6.2.0.md @@ -0,0 +1,53 @@ +--- +Title: License info, @alfresco/js-api 6.2.0 +--- + +# License information for @alfresco/js-api 6.2.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 6.2.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/visionmedia/debug) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 3.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 1.2.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [inherits](https://github.com/isaacs/inherits) | 2.0.3 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.11.0 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [readable-stream](https://github.com/nodejs/readable-stream) | 3.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [semver](https://github.com/npm/node-semver) | 7.3.5 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/visionmedia/superagent) | 6.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.5.3 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [util-deprecate](https://github.com/TooTallNate/util-deprecate) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-7.0.0.md b/lib/js-api/docs/licences/license-info-7.0.0.md new file mode 100644 index 0000000000..775da01b0f --- /dev/null +++ b/lib/js-api/docs/licences/license-info-7.0.0.md @@ -0,0 +1,53 @@ +--- +Title: License info, @alfresco/js-api 7.0.0 +--- + +# License information for @alfresco/js-api 7.0.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 7.0.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asap](https://github.com/kriskowal/asap) | 2.0.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/debug-js/debug) | 4.3.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [dezalgo](https://github.com/npm/dezalgo) | 1.0.4 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 4.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [hexoid](https://github.com/lukeed/hexoid) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [once](https://github.com/isaacs/once) | 1.4.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [qs](https://github.com/ljharb/qs) | 6.11.0 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [semver](https://github.com/npm/node-semver) | 7.5.4 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/ladjs/superagent) | 8.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.6.2 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [wrappy](https://github.com/npm/wrappy) | 1.0.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-7.1.0.md b/lib/js-api/docs/licences/license-info-7.1.0.md new file mode 100644 index 0000000000..e5dbb45b7f --- /dev/null +++ b/lib/js-api/docs/licences/license-info-7.1.0.md @@ -0,0 +1,90 @@ +--- +Title: License info, @alfresco/js-api 7.1.0 +--- + +# License information for @alfresco/js-api 7.1.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 7.1.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [@tootallnate/once](https://github.com/TooTallNate/once) | 2.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [abab](https://github.com/jsdom/abab) | 2.0.6 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [agent-base](https://github.com/TooTallNate/node-agent-base) | 6.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [asap](https://github.com/kriskowal/asap) | 2.0.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cssstyle](https://github.com/jsdom/cssstyle) | 3.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [data-urls](https://github.com/jsdom/data-urls) | 4.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [debug](https://github.com/debug-js/debug) | 4.3.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [decimal.js](https://github.com/MikeMcl/decimal.js) | 10.4.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [dezalgo](https://github.com/npm/dezalgo) | 1.0.4 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [domexception](https://github.com/jsdom/domexception) | 4.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [entities](https://github.com/fb55/entities) | 4.5.0 | [BSD-2-Clause](http://www.opensource.org/licenses/BSD-2-Clause) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 4.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-proto](https://github.com/inspect-js/has-proto) | 1.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [hexoid](https://github.com/lukeed/hexoid) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [html-encoding-sniffer](https://github.com/jsdom/html-encoding-sniffer) | 3.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [http-proxy-agent](https://github.com/TooTallNate/node-http-proxy-agent) | 5.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) | 5.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [iconv-lite](https://github.com/ashtuchkin/iconv-lite) | 0.6.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [is-potential-custom-element-name](https://github.com/mathiasbynens/is-potential-custom-element-name) | 1.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [jsdom](https://github.com/jsdom/jsdom) | 22.1.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [nwsapi](https://github.com/dperini/nwsapi) | 2.2.7 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [once](https://github.com/isaacs/once) | 1.4.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [parse5](https://github.com/inikulin/parse5) | 7.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [psl](https://github.com/lupomontero/psl) | 1.9.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [punycode](https://github.com/mathiasbynens/punycode.js) | 2.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [qs](https://github.com/ljharb/qs) | 6.11.0 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [querystringify](https://github.com/unshiftio/querystringify) | 2.2.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [requires-port](https://github.com/unshiftio/requires-port) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [rrweb-cssom](https://github.com/rrweb-io/CSSOM) | 0.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [safer-buffer](https://github.com/ChALkeR/safer-buffer) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [saxes](https://github.com/lddubeau/saxes) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [semver](https://github.com/npm/node-semver) | 7.5.4 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/ladjs/superagent) | 8.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [symbol-tree](https://github.com/jsdom/js-symbol-tree) | 3.2.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tough-cookie](https://github.com/salesforce/tough-cookie) | 4.1.3 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [tr46](https://github.com/jsdom/tr46) | 4.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.6.2 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [universalify](https://github.com/RyanZim/universalify) | 0.2.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [url-parse](https://github.com/unshiftio/url-parse) | 1.5.10 | [MIT](http://www.opensource.org/licenses/MIT) | +| [w3c-xmlserializer](https://github.com/jsdom/w3c-xmlserializer) | 4.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [webidl-conversions](https://github.com/jsdom/webidl-conversions) | 7.0.0 | [BSD-2-Clause](http://www.opensource.org/licenses/BSD-2-Clause) | +| [whatwg-encoding](https://github.com/jsdom/whatwg-encoding) | 2.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [whatwg-mimetype](https://github.com/jsdom/whatwg-mimetype) | 3.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [whatwg-url](https://github.com/jsdom/whatwg-url) | 12.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [wrappy](https://github.com/npm/wrappy) | 1.0.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [ws](https://github.com/websockets/ws) | 8.14.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [xml-name-validator](https://github.com/jsdom/xml-name-validator) | 4.0.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [xmlchars](https://github.com/lddubeau/xmlchars) | 2.2.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/docs/licences/license-info-7.2.0.md b/lib/js-api/docs/licences/license-info-7.2.0.md new file mode 100644 index 0000000000..a4aed005ae --- /dev/null +++ b/lib/js-api/docs/licences/license-info-7.2.0.md @@ -0,0 +1,54 @@ +--- +Title: License info, @alfresco/js-api 7.2.0 +--- + +# License information for @alfresco/js-api 7.2.0 + +This page lists all third party libraries the project depends on. + +## Libraries + +| Name | Version | License | +| --- | --- | --- | +| [@alfresco/js-api](https://github.com/Alfresco/alfresco-js-api) | 7.2.0 | [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0) | +| [asap](https://github.com/kriskowal/asap) | 2.0.6 | [MIT](http://www.opensource.org/licenses/MIT) | +| [asynckit](https://github.com/alexindigo/asynckit) | 0.4.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [call-bind](https://github.com/ljharb/call-bind) | 1.0.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [combined-stream](https://github.com/felixge/node-combined-stream) | 1.0.8 | [MIT](http://www.opensource.org/licenses/MIT) | +| [component-emitter](https://github.com/component/emitter) | 1.3.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [cookiejar](https://github.com/bmeck/node-cookiejar) | 2.1.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [d](https://github.com/medikoo/d) | 1.0.1 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [debug](https://github.com/debug-js/debug) | 4.3.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [delayed-stream](https://github.com/felixge/node-delayed-stream) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [dezalgo](https://github.com/npm/dezalgo) | 1.0.4 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es5-ext](https://github.com/medikoo/es5-ext) | 0.10.51 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [es6-iterator](https://github.com/medikoo/es6-iterator) | 2.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [es6-symbol](https://github.com/medikoo/es6-symbol) | 3.1.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [event-emitter](https://github.com/medikoo/event-emitter) | 0.3.5 | [MIT](http://www.opensource.org/licenses/MIT) | +| [fast-safe-stringify](https://github.com/davidmarkclements/fast-safe-stringify) | 2.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [form-data](https://github.com/form-data/form-data) | 4.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [formidable](https://github.com/node-formidable/formidable) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [function-bind](https://github.com/Raynos/function-bind) | 1.1.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [get-intrinsic](https://github.com/ljharb/get-intrinsic) | 1.2.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-proto](https://github.com/inspect-js/has-proto) | 1.0.1 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has-symbols](https://github.com/inspect-js/has-symbols) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [has](https://github.com/tarruda/has) | 1.0.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [hexoid](https://github.com/lukeed/hexoid) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [lru-cache](https://github.com/isaacs/node-lru-cache) | 6.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [methods](https://github.com/jshttp/methods) | 1.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-db](https://github.com/jshttp/mime-db) | 1.40.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime-types](https://github.com/jshttp/mime-types) | 2.1.24 | [MIT](http://www.opensource.org/licenses/MIT) | +| [mime](https://github.com/broofa/mime) | 2.6.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [ms](https://github.com/zeit/ms) | 2.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [next-tick](https://github.com/medikoo/next-tick) | 1.0.0 | [MIT](http://www.opensource.org/licenses/MIT) | +| [object-inspect](https://github.com/inspect-js/object-inspect) | 1.12.3 | [MIT](http://www.opensource.org/licenses/MIT) | +| [once](https://github.com/isaacs/once) | 1.4.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [qs](https://github.com/ljharb/qs) | 6.11.0 | [BSD-3-Clause](http://www.opensource.org/licenses/BSD-3-Clause) | +| [semver](https://github.com/npm/node-semver) | 7.5.4 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [side-channel](https://github.com/ljharb/side-channel) | 1.0.4 | [MIT](http://www.opensource.org/licenses/MIT) | +| [superagent](https://github.com/ladjs/superagent) | 8.1.2 | [MIT](http://www.opensource.org/licenses/MIT) | +| [tslib](https://github.com/Microsoft/tslib) | 2.6.2 | [0BSD](http://landley.net/toybox/license.html) | +| [type](https://github.com/medikoo/type) | 1.2.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [wrappy](https://github.com/npm/wrappy) | 1.0.2 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | +| [yallist](https://github.com/isaacs/yallist) | 4.0.0 | [ISC](https://www.isc.org/downloads/software-support-policy/isc-license/) | + diff --git a/lib/js-api/src/LICENSE.txt b/lib/js-api/src/LICENSE.txt new file mode 100644 index 0000000000..430d42bbea --- /dev/null +++ b/lib/js-api/src/LICENSE.txt @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/lib/js-api/src/README.md b/lib/js-api/src/README.md new file mode 100644 index 0000000000..4555f7d289 --- /dev/null +++ b/lib/js-api/src/README.md @@ -0,0 +1,52 @@ +# Alfresco JavaScript API + +JavaScript client API for the Alfresco REST API and Activiti REST API. + +## API clients documentation + +- [Authentication Api](src/api/auth-rest-api/README.md) +- [Content Api](src/api/content-rest-api/README.md) +- [Model Api](src/api/model-rest-api/README.md) +- [Process Api (AAE)](src/api/activiti-rest-api/README.md) +- [Search Api](src/api/search-rest-api/README.md) +- [Governance Classification Api](src/api/gs-classification-rest-api/README.md) +- [Governance Core Api](src/api/gs-core-rest-api/README.md) +- [Discovery Content API](src/api/discovery-rest-api/README.md) + +## Guides + +- [Authentication](docs/authentication.md) +- [Calling Custom Endpoints](docs/calling-custom-endpoints.md) +- [Error Events](docs/error-events.md) +- [ECM Examples](docs/ecm-example.md), full docs: [Content API](src/api/content-rest-api/README.md) +- [BPM Examples](docs/bpm-example.md), full docs: [APS 2.X API](src/api/activiti-rest-api/README.md) + +## Prerequisites + +The minimal supported versions are: + +- Alfresco Platform Repository: version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer +- Activiti: 1.5 +- Node.js ([Long Term Support](https://nodejs.org/en/) version) + +## Installing + +Using NPM: + +```sh +npm install @alfresco/js-api +``` + +## Development + +To run the build + +```sh +npm run build +``` + +To run the test + +```sh +npm run test +``` diff --git a/lib/js-api/src/alfrescoApi.ts b/lib/js-api/src/alfrescoApi.ts new file mode 100644 index 0000000000..33daa63b0f --- /dev/null +++ b/lib/js-api/src/alfrescoApi.ts @@ -0,0 +1,576 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ee, { EmitterMethod, Emitter } from 'event-emitter'; +import { ContentAuth } from './authentication/contentAuth'; +import { ProcessAuth } from './authentication/processAuth'; +import { Oauth2Auth } from './authentication/oauth2Auth'; +import { ContentClient } from './contentClient'; +import { ProcessClient } from './processClient'; +import { Storage } from './storage'; +import { AlfrescoApiConfig } from './alfrescoApiConfig'; +import { Authentication } from './authentication/authentication'; +import { AlfrescoApiType } from './to-deprecate/alfresco-api-type'; +import { HttpClient } from './api-clients/http-client.interface'; + +export class AlfrescoApi implements Emitter, AlfrescoApiType { + __type = 'legacy-client'; + storage: Storage; + config: AlfrescoApiConfig; + contentClient: ContentClient; + contentPrivateClient: ContentClient; + processClient: ProcessClient; + searchClient: ContentClient; + discoveryClient: ContentClient; + gsClient: ContentClient; + authClient: ContentClient; + oauth2Auth: Oauth2Auth; + processAuth: ProcessAuth; + contentAuth: ContentAuth; + + on: EmitterMethod; + off: EmitterMethod; + once: EmitterMethod; + + bufferEvents: string[] = []; + + emit: (type: string, ...args: any[]) => void; + + username: string; + + constructor(config?: AlfrescoApiConfig, public httpClient?: HttpClient) { + ee(this); + + if (config) { + this.setConfig(config); + } + } + + setConfig(config: AlfrescoApiConfig) { + if (!config) { + config = {}; + } + + this.storage = Storage.getInstance(); + this.storage.setDomainPrefix(config.domainPrefix); + + this.config = new AlfrescoApiConfig(config); + + this.clientsFactory(); + + this.errorListeners(); + if (this.config.oauthInit) { + this.initAuth(config); + + if (this.isLoggedIn()) { + this.emitBuffer('logged-in'); + } + } + + return config; + } + + private initAuth(config: AlfrescoApiConfig): void { + if (this.isOauthConfiguration()) { + if (!this.oauth2Auth) { + this.oauth2Auth = new Oauth2Auth(this.config, this, this.httpClient); + } else { + this.oauth2Auth.setConfig(this.config, this); + } + + this.oauth2Auth?.on('logged-in', () => { + this.emitBuffer('logged-in'); + }); + + this.setAuthenticationClientECMBPM(this.oauth2Auth.getAuthentication(), this.oauth2Auth.getAuthentication()); + } else { + if (!this.processAuth) { + this.processAuth = new ProcessAuth(this.config, this.httpClient); + } else { + this.processAuth.setConfig(this.config); + } + + this.processAuth?.on('logged-in', () => { + this.emitBuffer('logged-in'); + }); + + if (!this.contentAuth) { + this.contentAuth = new ContentAuth(this.config, this, this.httpClient); + } else { + this.contentAuth.setConfig(config); + } + + this.contentAuth?.on('logged-in', () => { + this.emitBuffer('logged-in'); + }); + + this.setAuthenticationClientECMBPM(this.contentAuth.getAuthentication(), this.processAuth.getAuthentication()); + } + } + + private clientsFactory() { + if (!this.contentPrivateClient) { + this.contentPrivateClient = new ContentClient(this.config, `/api/${this.config.tenant}/private/alfresco/versions/1`, this.httpClient); + } else { + this.contentPrivateClient.setConfig(this.config, `/api/${this.config.tenant}/private/alfresco/versions/1`); + } + + if (!this.contentClient) { + this.contentClient = new ContentClient(this.config, `/api/${this.config.tenant}/public/alfresco/versions/1`, this.httpClient); + } else { + this.contentClient.setConfig(this.config, `/api/${this.config.tenant}/public/alfresco/versions/1`); + } + + if (!this.authClient) { + this.authClient = new ContentClient(this.config, `/api/${this.config.tenant}/public/authentication/versions/1`, this.httpClient); + } else { + this.authClient.setConfig(this.config, `/api/${this.config.tenant}/public/authentication/versions/1`); + } + + if (!this.searchClient) { + this.searchClient = new ContentClient(this.config, `/api/${this.config.tenant}/public/search/versions/1`, this.httpClient); + } else { + this.searchClient.setConfig(this.config, `/api/${this.config.tenant}/public/search/versions/1`); + } + + if (!this.discoveryClient) { + this.discoveryClient = new ContentClient(this.config, `/api`, this.httpClient); + } else { + this.discoveryClient.setConfig(this.config, `/api`); + } + + if (!this.gsClient) { + this.gsClient = new ContentClient(this.config, `/api/${this.config.tenant}/public/gs/versions/1`, this.httpClient); + } else { + this.gsClient.setConfig(this.config, `/api/${this.config.tenant}/public/gs/versions/1`); + } + + if (!this.processClient) { + this.processClient = new ProcessClient(this.config, this.httpClient); + } else { + this.processClient.setConfig(this.config); + } + } + + /**@private? */ + errorListeners() { + this.contentClient.off('error', () => {}); + this.authClient.off('error', () => {}); + this.contentPrivateClient.off('error', () => {}); + this.processClient.off('error', () => {}); + this.searchClient.off('error', () => {}); + this.discoveryClient.off('error', () => {}); + this.gsClient.off('error', () => {}); + + this.contentClient.on('error', (error: any) => { + this.errorHandler(error); + }); + + this.authClient.on('error', (error: any) => { + this.errorHandler(error); + }); + + this.contentPrivateClient.on('error', (error: any) => { + this.errorHandler(error); + }); + + this.processClient.on('error', (error: any) => { + this.errorHandler(error); + }); + + this.searchClient.on('error', (error: any) => { + this.errorHandler(error); + }); + + this.discoveryClient.on('error', (error: any) => { + this.errorHandler(error); + }); + + this.gsClient.on('error', (error: any) => { + this.errorHandler(error); + }); + } + + /**@private? */ + errorHandler(error: { status?: number }) { + if (error.status === 401) { + this.invalidateSession(); + } + + this.emitBuffer('error', error); + } + + changeWithCredentialsConfig(withCredentials: boolean) { + this.config.withCredentials = withCredentials; + } + + changeCsrfConfig(disableCsrf: boolean) { + this.config.disableCsrf = disableCsrf; + this.processAuth.changeCsrfConfig(disableCsrf); + } + + changeEcmHost(hostEcm: string) { + this.config.hostEcm = hostEcm; + this.contentAuth.changeHost(); + this.contentClient.changeHost(); + this.authClient.changeHost(); + } + + changeBpmHost(hostBpm: string) { + this.config.hostBpm = hostBpm; + this.processAuth.changeHost(); + this.processClient.changeHost(); + } + + /** + * login Alfresco API + * + * @param username Username to login + * @param password Password to login + * @returns A promise that returns {new authentication ticket} if resolved and {error} if rejected. + */ + login(username: string, password: string): Promise<any> { + if (!this.isCredentialValid(username) || !this.isCredentialValid(password)) { + return Promise.reject(new Error('missing username or password')); + } + + if (username) { + username = username.trim(); + } + + this.username = username; + + if (this.isOauthConfiguration()) { + const promise = this.oauth2Auth.login(username, password); + promise.then((accessToken) => { + this.config.accessToken = accessToken; + }); + return promise; + } else { + if (this.isBpmConfiguration()) { + const promise = this.processAuth.login(username, password); + promise.then((ticketBpm) => { + this.config.ticketBpm = ticketBpm; + }); + return promise; + } else if (this.isEcmConfiguration()) { + const promise = this.contentAuth.login(username, password); + promise.then((ticketEcm) => { + this.setAuthenticationClientECMBPM(this.contentAuth.getAuthentication(), null); + this.config.ticketEcm = ticketEcm; + }); + return promise; + } else if (this.isEcmBpmConfiguration()) { + const contentProcessPromise = this.loginBPMECM(username, password); + + contentProcessPromise.then((data) => { + this.config.ticketEcm = data[0]; + this.config.ticketBpm = data[1]; + }); + + return contentProcessPromise; + } else { + return Promise.reject(new Error('Unknown configuration')); + } + } + } + + isCredentialValid(credential: string): boolean { + return credential !== undefined && credential !== null && credential !== ''; + } + + implicitLogin(): Promise<any> { + if (!this.isOauthConfiguration()) { + return Promise.reject(new Error('Missing the required oauth2 configuration')); + } + + return new Promise(() => { + this.oauth2Auth.implicitLogin(); + }); + } + + setAuthenticationClientECMBPM(authECM: Authentication, authBPM: Authentication) { + this.contentClient.setAuthentications(authECM); + this.authClient.setAuthentications(authECM); + this.searchClient.setAuthentications(authECM); + this.contentPrivateClient.setAuthentications(authECM); + this.processClient.setAuthentications(authBPM); + this.searchClient.setAuthentications(authECM); + this.discoveryClient.setAuthentications(authECM); + this.gsClient.setAuthentications(authECM); + } + + /** + * login Tickets + * + * @param ticketEcm alfresco ticket + * @param ticketBpm alfresco ticket + */ + loginTicket(ticketEcm: string, ticketBpm: string): Promise<string> { + this.config.ticketEcm = ticketEcm; + this.config.ticketBpm = ticketBpm; + + return this.contentAuth.validateTicket(); + } + + private loginBPMECM(username: string, password: string): Promise<[string, string]> { + const contentPromise = this.contentAuth.login(username, password); + const processPromise = this.processAuth.login(username, password); + + const promise: any = new Promise<[string, string]>((resolve, reject) => { + Promise.all([contentPromise, processPromise]).then( + (data) => { + promise.emit('success'); + resolve(data); + }, + (error) => { + this.contentAuth.invalidateSession(); + this.processAuth.invalidateSession(); + + if (error.status === 401) { + promise.emit('unauthorized'); + } + promise.emit('error'); + reject(error); + } + ); + }); + + ee(promise); // jshint ignore:line + return promise; + } + + /** + * logout Alfresco API + */ + logout(): Promise<void> { + this.username = null; + + if (this.isOauthConfiguration()) { + return this.oauth2Auth.logOut(); + } + + if (this.isBpmConfiguration()) { + return this.processAuth.logout(); + } + + if (this.isEcmConfiguration()) { + const contentPromise = this.contentAuth.logout(); + contentPromise.then( + () => (this.config.ticket = undefined), + () => {} + ); + return contentPromise; + } + + if (this.isEcmBpmConfiguration()) { + return this._logoutBPMECM(); + } + + return Promise.resolve(); + } + + private _logoutBPMECM(): Promise<void> { + const contentPromise = this.contentAuth.logout(); + const processPromise = this.processAuth.logout(); + + const promise: any = new Promise<void>((resolve, reject) => { + Promise.all([contentPromise, processPromise]).then( + () => { + this.config.ticket = undefined; + promise.emit('logout'); + resolve(); + }, + (error) => { + if (error.status === 401) { + promise.emit('unauthorized'); + } + promise.emit('error'); + reject(error); + } + ); + }); + + ee(promise); // jshint ignore:line + return promise; + } + + /** + * If the client is logged in return true + */ + isLoggedIn(): boolean { + if (this.isOauthConfiguration()) { + return this.oauth2Auth.isLoggedIn(); + } + + if (this.isBpmConfiguration()) { + return this.processAuth.isLoggedIn(); + } + + if (this.isEcmConfiguration()) { + return this.config.withCredentials ? true : this.contentAuth.isLoggedIn(); + } + + if (this.isEcmBpmConfiguration()) { + return this.config.withCredentials ? true : this.contentAuth.isLoggedIn() && this.processAuth.isLoggedIn(); + } + + return false; + } + + isBpmLoggedIn(): boolean { + if (this.isBpmConfiguration() || this.isEcmBpmConfiguration()) { + if (this.isOauthConfiguration()) { + return this.oauth2Auth.isLoggedIn(); + } else { + return this.processAuth.isLoggedIn(); + } + } + return false; + } + + isEcmLoggedIn(): boolean { + if (this.isEcmConfiguration() || this.isEcmBpmConfiguration()) { + if (this.isOauthConfiguration()) { + return this.oauth2Auth.isLoggedIn(); + } else { + return this.config.withCredentials ? true : this.contentAuth.isLoggedIn(); + } + } + return false; + } + + getBpmUsername(): string { + if (this.isOauthConfiguration()) { + return this.username || this.oauth2Auth.storage.getItem('USERNAME'); + } else { + return this.username || this.processAuth.storage.getItem('APS_USERNAME'); + } + } + + getEcmUsername(): string { + if (this.isOauthConfiguration()) { + return this.username || this.oauth2Auth.storage.getItem('USERNAME'); + } else { + return this.username || this.contentAuth.storage.getItem('ACS_USERNAME'); + } + } + + /** + * refresh token + */ + refreshToken(): Promise<any> { + if (!this.isOauthConfiguration()) { + return Promise.reject(new Error('Missing the required oauth2 configuration')); + } + + if (this.config.oauth2.implicitFlow) { + return Promise.reject(new Error('Manual refresh token not possible in implicit flow')); + } + + return this.oauth2Auth.refreshToken(); + } + + getTicketAuth(): string { + return this.oauth2Auth?.getToken(); + } + + /** + * Set the current Ticket + * + * @param ticketEcm ecm ticket + * @param ticketBpm bpm ticket + */ + setTicket(ticketEcm: string, ticketBpm: string) { + if (this.contentAuth) { + this.contentAuth.setTicket(ticketEcm); + } + if (this.processAuth) { + this.processAuth.setTicket(ticketBpm); + } + } + + /** + * invalidate the current session + */ + invalidateSession() { + if (this.oauth2Auth) { + this.oauth2Auth.invalidateSession(); + } else { + this.contentAuth.invalidateSession(); + this.processAuth.invalidateSession(); + } + } + + /** + * Get the current Ticket for the Bpm + */ + getTicketBpm(): string { + return this.processAuth?.getTicket(); + } + + /** + * Get the current Ticket for the Ecm + */ + getTicketEcm(): string { + return this.contentAuth?.getTicket(); + } + + /** + * Get the current Ticket for the Ecm and BPM + */ + getTicket(): [string, string] { + return [this.contentAuth.getTicket(), this.processAuth.getTicket()]; + } + + isBpmConfiguration(): boolean { + return this.config.provider && this.config.provider.toUpperCase() === 'BPM'; + } + + isEcmConfiguration(): boolean { + return this.config.provider && this.config.provider.toUpperCase() === 'ECM'; + } + + isOauthConfiguration(): boolean { + return this.config.authType === 'OAUTH'; + } + + isPublicUrl(): boolean { + if (this.isOauthConfiguration()) { + return this.oauth2Auth.isPublicUrl(); + } + return false; + } + + isEcmBpmConfiguration(): boolean { + return this.config.provider && this.config.provider.toUpperCase() === 'ALL'; + } + + private emitBuffer(event: string, callback?: any): void { + this.emit(event, callback); + this.bufferEvents.push(event); + } + + reply(event: string, callback?: any): void { + if (this.bufferEvents.indexOf(event) >= 0) { + // eslint-disable-next-line prefer-rest-params + Function.prototype.apply.call(callback, this, arguments); + } else { + this.on(event, callback); + } + } +} diff --git a/lib/js-api/src/alfrescoApiClient.ts b/lib/js-api/src/alfrescoApiClient.ts new file mode 100644 index 0000000000..6683d5e41b --- /dev/null +++ b/lib/js-api/src/alfrescoApiClient.ts @@ -0,0 +1,396 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ee from 'event-emitter'; +import { AlfrescoApiConfig } from './alfrescoApiConfig'; +import { Authentication } from './authentication/authentication'; +import { SuperagentHttpClient } from './superagentHttpClient'; +import { Emitters, HttpClient, LegacyHttpClient, RequestOptions, SecurityOptions } from './api-clients/http-client.interface'; +import { paramToString } from './utils'; +import { Storage } from './storage'; + +declare const Buffer: any; + +export type AlfrescoApiClientPromise<T = any> = Promise<T> & { + on: ee.EmitterMethod; + off: ee.EmitterMethod; + once: ee.EmitterMethod; + emit: (type: string, ...args: any[]) => void; + abort?: () => void; +}; + +/** + * Builds a string representation of an array-type actual parameter, according to the given collection format. + * + * @param param An array parameter. + * @param collectionFormat The array element separator strategy. + * @returns A string representation of the supplied collection, using the specified delimiter. Returns + * <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>. + */ +export function buildCollectionParam(param: string[], collectionFormat: string): string | any[] { + if (!param) { + return null; + } + + switch (collectionFormat) { + case 'csv': + return param.map(paramToString).join(','); + case 'ssv': + return param.map(paramToString).join(' '); + case 'tsv': + return param.map(paramToString).join('\t'); + case 'pipes': + return param.map(paramToString).join('|'); + case 'multi': + // return the array directly as SuperAgent will handle it as expected + return param.map(paramToString); + default: + throw new Error('Unknown collection format: ' + collectionFormat); + } +} + +export class AlfrescoApiClient implements ee.Emitter, LegacyHttpClient { + on: ee.EmitterMethod; + off: ee.EmitterMethod; + once: ee.EmitterMethod; + emit: (type: string, ...args: any[]) => void; + + storage: Storage; + host: string; + className: string; + config: AlfrescoApiConfig; + url: string; + /** + * The base URL against which to resolve every API call's (relative) path. + */ + basePath = ''; + + /** + * The authentication methods to be included for all API calls. + */ + authentications: Authentication = { + basicAuth: { + ticket: '' + }, + type: 'basic' + }; + /** + * The default HTTP headers to be included for all API calls. + */ + defaultHeaders = {}; + + /** + * The default HTTP timeout for all API calls. + */ + timeout: number | { deadline?: number; response?: number } = undefined; + + contentTypes = { + JSON: ['application/json'] + }; + + httpClient: HttpClient; + + constructor(host?: string, httpClient?: HttpClient) { + this.host = host; + + this.storage = Storage.getInstance(); + + // fallback for backward compatibility + this.httpClient = httpClient || new SuperagentHttpClient(); + + ee(this); + } + + request<T = any>(options: RequestOptions): Promise<T> { + return this.buildRequestCall(this.basePath, options, this.httpClient.request.bind(this.httpClient)); + } + + post<T = any>(options: RequestOptions): AlfrescoApiClientPromise<T> { + const url = this.getCallApiUrl(options); + return this.buildRequestCall(url, options, this.httpClient.post.bind(this.httpClient)); + } + + put<T = any>(options: RequestOptions): AlfrescoApiClientPromise<T> { + const url = this.getCallApiUrl(options); + return this.buildRequestCall(url, options, this.httpClient.put.bind(this.httpClient)); + } + + get<T = any>(options: RequestOptions): AlfrescoApiClientPromise<T> { + const url = this.getCallApiUrl(options); + return this.buildRequestCall(url, options, this.httpClient.get.bind(this.httpClient)); + } + + delete<T = void>(options: RequestOptions): AlfrescoApiClientPromise<T> { + const url = this.getCallApiUrl(options); + return this.buildRequestCall<T>(url, options, this.httpClient.delete.bind(this.httpClient)); + } + + callApi( + path: string, + httpMethod: string, + pathParams?: any, + queryParams?: any, + headerParams?: any, + formParams?: any, + bodyParam?: any, + contentTypes?: string[], + accepts?: string[], + returnType?: any, + contextRoot?: string, + responseType?: string, + url?: string + ): AlfrescoApiClientPromise<any> { + const callApiUrl = url ?? this.getCallApiUrl({ contextRoot, path, pathParams }); + + const options: RequestOptions = { + path, + httpMethod, + pathParams, + queryParams, + headerParams, + formParams, + bodyParam, + contentTypes, + accepts, + returnType, + contextRoot, + responseType, + url + }; + + return this.buildRequestCall(callApiUrl, options, this.httpClient.request.bind(this.httpClient)); + } + + callCustomApi( + path: string, + httpMethod: string, + pathParams?: any, + queryParams?: any, + headerParams?: any, + formParams?: any, + bodyParam?: any, + contentTypes?: string[], + accepts?: string[], + returnType?: any, + contextRoot?: string, + responseType?: string + ): AlfrescoApiClientPromise<any> { + const customApiUrl = AlfrescoApiClient.buildUrl(path, '', pathParams); + const options: RequestOptions = { + path, + httpMethod, + pathParams, + queryParams, + headerParams, + formParams, + bodyParam, + contentTypes, + accepts, + returnType, + contextRoot, + responseType + }; + + return this.buildRequestCall(customApiUrl, options, this.httpClient.request.bind(this.httpClient)); + } + + isCsrfEnabled(): boolean { + if (this.config) { + return !this.config.disableCsrf; + } else { + return true; + } + } + + isBpmRequest(): boolean { + return this.className === 'ProcessAuth' || this.className === 'ProcessClient'; + } + + basicAuth(username: string, password: string): string { + const str = username + ':' + password; + + let base64; + + if (typeof Buffer === 'function') { + base64 = Buffer.from(str, 'binary').toString('base64'); + } else { + base64 = btoa(str); + } + + return 'Basic ' + base64; + } + + isWithCredentials(): boolean { + return !!this.config?.withCredentials; + } + + getAlfTicket(ticket: string): string { + const ticketParam = this.isWithCredentials() ? '&ticket=' : '&alf_ticket='; + + if (ticket) { + return ticketParam + ticket; + } else if (this.config.ticketEcm) { + return ticketParam + this.config.ticketEcm; + } else if (this.storage.getItem('ticket-ECM')) { + return ticketParam + this.storage.getItem('ticket-ECM'); + } + + return ''; + } + + /** + * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders + * with parameter values + */ + private static buildUrl(basePath: string, path: string, pathParams: any): string { + if (path && path !== '' && !path.match(/^\//)) { + path = '/' + path; + } + const url = basePath + path; + + return AlfrescoApiClient.addParamsToUrl(url, pathParams); + } + + private static addParamsToUrl(path: string, pathParams: any) { + return path.replace(/\{([\w-]+)}/g, (fullMatch, key) => { + let value; + + if (Object.prototype.hasOwnProperty.call(pathParams, key)) { + value = paramToString(pathParams[key]); + } else { + value = fullMatch; + } + + return encodeURIComponent(value); + }); + } + + private getCallApiUrl({ contextRoot, path, pathParams }: { contextRoot?: string; path: string; pathParams?: any }): string { + const basePath = contextRoot ? `${this.host}/${contextRoot}` : this.basePath; + + return AlfrescoApiClient.buildUrl(basePath, path, pathParams); + } + + private buildRequestCall<T = any>( + url: string, + options: RequestOptions, + httpCall: (url: string, options: RequestOptions, security: SecurityOptions, emitters: Emitters) => Promise<T> + ): AlfrescoApiClientPromise<T> { + const security = this.getSecurityOptions(); + const emitters = this.getEventEmitters(); + const httpRequestOptions = this.getRequestOptionsWithAcceptAndContentType(options); + const promise = httpCall(url, httpRequestOptions, security, emitters); + + return this.addPromiseListeners(promise, emitters.eventEmitter); + } + + private getSecurityOptions(): SecurityOptions { + return { + isBpmRequest: this.isBpmRequest(), + enableCsrf: this.isCsrfEnabled(), + withCredentials: this.isWithCredentials(), + authentications: this.authentications, + defaultHeaders: this.defaultHeaders + }; + } + + private getEventEmitters(): Emitters { + const apiClientEmitter = { + on: this.on.bind(this), + off: this.off.bind(this), + once: this.once.bind(this), + emit: this.emit.bind(this) + }; + + return { + apiClientEmitter, + eventEmitter: ee({}) + }; + } + + private getRequestOptionsWithAcceptAndContentType(options: RequestOptions): RequestOptions { + const contentType = AlfrescoApiClient.jsonPreferredMime(options.contentTypes); + const accept = AlfrescoApiClient.jsonPreferredMime(options.accepts); + + return { + ...options, + contentType, + accept + }; + } + + /** + * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. + * + * @param contentTypes content types + * @returns The chosen content type, preferring JSON. + */ + private static jsonPreferredMime(contentTypes: readonly string[]): string { + if (!contentTypes?.length) { + return 'application/json'; + } + + for (const item of contentTypes) { + if (AlfrescoApiClient.isJsonMime(item)) { + return item; + } + } + return contentTypes[0]; + } + + /** + * Checks whether the given content type represents JSON.<br> + * + * JSON content type examples:<br> + * <ul> + * <li>application/json</li> + * <li>application/json; charset=UTF8</li> + * <li>APPLICATION/JSON</li> + * </ul> + * + * @param contentType The MIME content type to check. + * @returns <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>. + */ + private static isJsonMime(contentType: string): boolean { + return Boolean(contentType?.match(/^application\/json(;.*)?$/i)); + } + + private addPromiseListeners<T = any>(promise: Promise<T>, eventEmitter: ee.Emitter): AlfrescoApiClientPromise<T> { + return Object.assign(promise, { + on() { + // eslint-disable-next-line prefer-spread,prefer-rest-params + eventEmitter.on.apply(eventEmitter, arguments); + return this; + }, + once() { + // eslint-disable-next-line prefer-spread,prefer-rest-params + eventEmitter.once.apply(eventEmitter, arguments); + return this; + }, + emit() { + // eslint-disable-next-line prefer-spread,prefer-rest-params + eventEmitter.emit.apply(eventEmitter, arguments); + return this; + }, + off() { + // eslint-disable-next-line prefer-spread,prefer-rest-params + eventEmitter.off.apply(eventEmitter, arguments); + return this; + } + }); + } +} diff --git a/lib/js-api/src/alfrescoApiConfig.ts b/lib/js-api/src/alfrescoApiConfig.ts new file mode 100644 index 0000000000..5a495ca985 --- /dev/null +++ b/lib/js-api/src/alfrescoApiConfig.ts @@ -0,0 +1,54 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Oauth2Config } from './authentication/oauth2Config'; + +export class AlfrescoApiConfig { + ticket?: string; + hostEcm?: string = 'http://127.0.0.1:8080'; + hostBpm?: string = 'http://127.0.0.1:9999'; + hostOauth2?: string; + authType?: string = 'BASIC'; + oauth2?: Oauth2Config; + contextRoot? = 'alfresco'; + tenant?: string = '-default-'; + contextRootBpm?: string = 'activiti-app'; + domainPrefix?: string = ''; + provider?: string = 'ECM'; + ticketEcm?: string; + ticketBpm?: string; + accessToken?: string; + disableCsrf?: boolean = false; + withCredentials?: boolean = false; + oauthInit?: boolean = true; + + constructor(input: any = { oauth2: {} }) { + Object.assign(this, input); + + this.hostEcm = input.hostEcm ? input.hostEcm : 'http://127.0.0.1:8080'; + this.hostBpm = input.hostBpm ? input.hostBpm : 'http://127.0.0.1:9999'; + this.authType = input.authType ? input.authType : 'BASIC'; + this.contextRoot = input.contextRoot ? input.contextRoot : 'alfresco'; + this.contextRootBpm = input.contextRootBpm ? input.contextRootBpm : 'activiti-app'; + this.tenant = input.tenant ? input.tenant : '-default-'; + this.provider = input.provider ? input.provider : 'ECM'; + this.disableCsrf = input.disableCsrf ? input.disableCsrf : false; + this.domainPrefix = input.domainPrefix ? input.domainPrefix : ''; + this.withCredentials = input.withCredentials ? input.withCredentials : false; + this.oauth2 = input.oauth2; + } +} diff --git a/lib/js-api/src/api-clients/api-client.ts b/lib/js-api/src/api-clients/api-client.ts new file mode 100644 index 0000000000..2e4661478d --- /dev/null +++ b/lib/js-api/src/api-clients/api-client.ts @@ -0,0 +1,59 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoApiType } from '../to-deprecate/alfresco-api-type'; +import { LegacyHttpClient, RequestOptions } from './http-client.interface'; + +export abstract class ApiClient { + protected alfrescoApi: AlfrescoApiType; + protected httpClient: LegacyHttpClient; + + get apiClient(): LegacyHttpClient { + return this.httpClient; + } + + constructor(legacyApi?: AlfrescoApiType); + constructor(httpClient: LegacyHttpClient); + constructor(httpClient?: AlfrescoApiType & LegacyHttpClient) { + if (httpClient?.__type === 'legacy-client') { + // TODO: remove legacyApi?: AlfrescoApi option and clean up this code. BREAKING CHANGE! + this.alfrescoApi = httpClient; + } else { + this.httpClient = httpClient; + } + } + + post<T = any>(options: RequestOptions): Promise<T> { + return this.apiClient.post<T>(options); + } + + put<T = any>(options: RequestOptions): Promise<T> { + return this.apiClient.put<T>(options); + } + + get<T = any>(options: RequestOptions): Promise<T> { + return this.apiClient.get<T>(options); + } + + delete<T = void>(options: RequestOptions): Promise<T> { + return this.apiClient.delete(options); + } + + errorMessage(param: string, methodName: string) { + return `Missing param ${param} in ${methodName}`; + } +} diff --git a/lib/js-api/src/api-clients/http-client.interface.ts b/lib/js-api/src/api-clients/http-client.interface.ts new file mode 100644 index 0000000000..31a39caef4 --- /dev/null +++ b/lib/js-api/src/api-clients/http-client.interface.ts @@ -0,0 +1,106 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Authentication } from '../authentication/authentication'; +import { Emitter } from 'event-emitter'; + +export interface RequestOptions { + path: string; + httpMethod?: string; + pathParams?: any; + queryParams?: any; + headerParams?: any; + formParams?: any; + bodyParam?: any; + contentTypes?: string[]; + accepts?: string[]; + returnType?: any; + contextRoot?: string; + responseType?: string; + url?: string; + readonly accept?: string; + readonly contentType?: string; +} + +export interface HttpClientConfig { + contextRoot?: string; + host?: string; // Should be mandatory but can't make it because of AlfrescoApiConfig incompatibility 😕 + servicePath?: string; // Should be mandatory but can't make it because of AlfrescoApiConfig incompatibility 😕 +} + +export interface LegacyHttpClient { + basePath: string; + config: HttpClientConfig; + + request<T = any>(options: RequestOptions): Promise<T>; + post<T = any>(options: RequestOptions): Promise<T>; + put<T = any>(options: RequestOptions): Promise<T>; + get<T = any>(options: RequestOptions): Promise<T>; + delete<T = void>(options: RequestOptions): Promise<T>; + /** @deprecated */ + callApi( + path: string, + httpMethod: string, + pathParams?: any, + queryParams?: any, + headerParams?: any, + formParams?: any, + bodyParam?: any, + contentTypes?: string[], + accepts?: string[], + returnType?: any, + contextRoot?: string, + responseType?: string, + url?: string + ): Promise<any>; + /** @deprecated */ + callCustomApi( + path: string, + httpMethod: string, + pathParams?: any, + queryParams?: any, + headerParams?: any, + formParams?: any, + bodyParam?: any, + contentTypes?: string[], + accepts?: string[], + returnType?: any, + contextRoot?: string, + responseType?: string + ): Promise<any>; +} + +export interface SecurityOptions { + readonly isBpmRequest: boolean; + readonly enableCsrf?: boolean; + readonly withCredentials?: boolean; + readonly authentications: Authentication; + readonly defaultHeaders: Record<string, string>; +} + +export interface Emitters { + readonly eventEmitter: Emitter; + readonly apiClientEmitter: Emitter; +} + +export interface HttpClient { + request<T = any>(url: string, options: RequestOptions, security: SecurityOptions, emitters: Emitters): Promise<T>; + post<T = any>(url: string, options: RequestOptions, security: SecurityOptions, emitters: Emitters): Promise<T>; + put<T = any>(url: string, options: RequestOptions, security: SecurityOptions, emitters: Emitters): Promise<T>; + get<T = any>(url: string, options: RequestOptions, security: SecurityOptions, emitters: Emitters): Promise<T>; + delete<T = void>(url: string, options: RequestOptions, security: SecurityOptions, emitters: Emitters): Promise<T>; +} diff --git a/lib/js-api/src/api/activiti-rest-api/README.md b/lib/js-api/src/api/activiti-rest-api/README.md new file mode 100644 index 0000000000..a46bc18bb3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/README.md @@ -0,0 +1,55 @@ +# **Process API** + +Provides access to the complete features provided by Alfresco Process Services powered by Activiti. + +You can use this API to integrate Alfresco Process Services with external applications. + +## Endpoint Clients + +All URIs are relative to: + +```text +/activiti-app/api +``` + +- [AboutApi](docs/AboutApi.md) +- [AccountIntegrationApi](docs/AccountIntegrationApi.md) +- [AdminEndpointsApi](docs/AdminEndpointsApi.md) +- [AdminGroupsApi](docs/AdminGroupsApi.md) +- [AdminTenantsApi](docs/AdminTenantsApi.md) +- [AdminUsersApi](docs/AdminUsersApi.md) +- [AppDefinitionsApi](docs/AppDefinitionsApi.md) +- [ChecklistsApi](docs/ChecklistsApi.md) +- [CommentsApi](docs/CommentsApi.md) +- [ContentApi](docs/ContentApi.md) +- [DataSourcesApi](docs/DataSourcesApi.md) +- [DecisionAuditsApi](docs/DecisionAuditsApi.md) +- [EndpointsApi](docs/EndpointsApi.md) +- [FormModelsApi](docs/FormModelsApi.md) +- [GroupsApi](docs/GroupsApi.md) +- [IDMSyncApi](docs/IDMSyncApi.md) +- [IntegrationAlfrescoOnPremiseApi](docs/IntegrationAlfrescoOnPremiseApi.md) +- [IntegrationBoxApi](docs/IntegrationBoxApi.md) +- [IntegrationDriveApi](docs/IntegrationDriveApi.md) +- [ModelsApi](docs/ModelsApi.md) +- [ModelsBpmnApi](docs/ModelsBpmnApi.md) +- [ModelsHistoryApi](docs/ModelsHistoryApi.md) +- [ProcessDefinitionsApi](docs/ProcessDefinitionsApi.md) +- [ProcessInstancesApi](docs/ProcessInstancesApi.md) +- [ProcessInstanceVariablesApi](docs/ProcessInstanceVariablesApi.md) +- [ProcessScopesApi](docs/ProcessScopesApi.md) +- [RuntimeAppDefinitionsApi](docs/RuntimeAppDefinitionsApi.md) +- [RuntimeAppDeploymentsApi](docs/RuntimeAppDeploymentsApi.md) +- [ScriptFilesApi](docs/ScriptFilesApi.md) +- [SubmittedFormsApi](docs/SubmittedFormsApi.md) +- [SystemPropertiesApi](docs/SystemPropertiesApi.md) +- [TaskActionsApi](docs/TaskActionsApi.md) +- [TaskFormsApi](docs/TaskFormsApi.md) +- [TasksApi](docs/TasksApi.md) +- [TaskVariablesApi](docs/TaskVariablesApi.md) +- [UserFiltersApi](docs/UserFiltersApi.md) +- [UserProfileApi](docs/UserProfileApi.md) +- [UsersApi](docs/UsersApi.md) +- [ReportApi](docs/ReportApi.md) +- [ModelJsonBpmnApi](docs/ModelJsonBpmnApi.md) +- [TemporaryApi](docs/TemporaryApi.md) \ No newline at end of file diff --git a/lib/js-api/src/api/activiti-rest-api/api/about.api.ts b/lib/js-api/src/api/activiti-rest-api/api/about.api.ts new file mode 100644 index 0000000000..ebe0cbcc0d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/about.api.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; + +/** + * About service. + */ +export class AboutApi extends BaseApi { + /** + * Get server type and version + * Provides information about the running Alfresco Process Services Suite. The response payload object has the properties type, majorVersion, minorVersion, revisionVersion and edition. + * + * @return Promise<{ [key: string]: string; }> + */ + getAppVersion(): Promise<{ [key: string]: string }> { + return this.get({ + path: '/api/enterprise/app-version' + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/accountIntegration.api.ts b/lib/js-api/src/api/activiti-rest-api/api/accountIntegration.api.ts new file mode 100644 index 0000000000..62c11668d6 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/accountIntegration.api.ts @@ -0,0 +1,36 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultListDataRepresentationAccountRepresentation } from '../model'; +import { BaseApi } from './base.api'; + +/** + * AccountIntegrationApi service. + */ +export class AccountIntegrationApi extends BaseApi { + /** + * Retrieve external account information + * Accounts are used to integrate with third party apps and clients + * + * @return Promise<ResultListDataRepresentationAccountRepresentation> + */ + getAccounts(): Promise<ResultListDataRepresentationAccountRepresentation> { + return this.get({ + path: '/api/enterprise/account/integration' + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/adminEndpoints.api.ts b/lib/js-api/src/api/activiti-rest-api/api/adminEndpoints.api.ts new file mode 100644 index 0000000000..fbdee3df7b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/adminEndpoints.api.ts @@ -0,0 +1,251 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CreateEndpointBasicAuthRepresentation, EndpointBasicAuthRepresentation, EndpointConfigurationRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * AdminEndpointsApi service. + */ +export class AdminEndpointsApi extends BaseApi { + /** + * Add an endpoint authorization + * + * @param createRepresentation createRepresentation + * @return Promise<EndpointBasicAuthRepresentation> + */ + createBasicAuthConfiguration(createRepresentation: CreateEndpointBasicAuthRepresentation): Promise<EndpointBasicAuthRepresentation> { + throwIfNotDefined(createRepresentation, 'createRepresentation'); + + return this.post({ + path: '/api/enterprise/admin/basic-auths', + bodyParam: createRepresentation, + returnType: EndpointBasicAuthRepresentation + }); + } + + /** + * Create an endpoint + * + * @param representation representation + * @return Promise<EndpointConfigurationRepresentation> + */ + createEndpointConfiguration(representation: EndpointConfigurationRepresentation): Promise<EndpointConfigurationRepresentation> { + throwIfNotDefined(representation, 'representation'); + + return this.post({ + path: '/api/enterprise/admin/endpoints', + bodyParam: representation + }); + } + + /** + * Get an endpoint authorization + * + * @param basicAuthId basicAuthId + * @param tenantId tenantId + * @return Promise<EndpointBasicAuthRepresentation> + */ + getBasicAuthConfiguration(basicAuthId: number, tenantId: number): Promise<EndpointBasicAuthRepresentation> { + throwIfNotDefined(basicAuthId, 'basicAuthId'); + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + basicAuthId + }; + + const queryParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/admin/basic-auths/{basicAuthId}', + pathParams, + queryParams, + returnType: EndpointBasicAuthRepresentation + }); + } + + /** + * List endpoint authorizations + * + * @param tenantId tenantId + * @return Promise<EndpointBasicAuthRepresentation> + */ + getBasicAuthConfigurations(tenantId: number): Promise<EndpointBasicAuthRepresentation> { + throwIfNotDefined(tenantId, 'tenantId'); + + const queryParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/admin/basic-auths', + queryParams, + returnType: EndpointBasicAuthRepresentation + }); + } + + /** + * Get an endpoint + * + * @param endpointConfigurationId endpointConfigurationId + * @param tenantId tenantId + * @return Promise<EndpointConfigurationRepresentation> + */ + getEndpointConfiguration(endpointConfigurationId: number, tenantId: number): Promise<EndpointConfigurationRepresentation> { + throwIfNotDefined(endpointConfigurationId, 'endpointConfigurationId'); + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + endpointConfigurationId + }; + + const queryParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/admin/endpoints/{endpointConfigurationId}', + pathParams, + queryParams + }); + } + + /** + * List endpoints + * + * @param tenantId tenantId + * @return Promise<EndpointConfigurationRepresentation> + */ + getEndpointConfigurations(tenantId: number): Promise<EndpointConfigurationRepresentation> { + throwIfNotDefined(tenantId, 'tenantId'); + + const queryParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/admin/endpoints', + queryParams + }); + } + + /** + * Delete an endpoint authorization + * + * @param basicAuthId basicAuthId + * @param tenantId tenantId + * @return Promise<{}> + */ + removeBasicAuthConfiguration(basicAuthId: number, tenantId: number): Promise<void> { + throwIfNotDefined(basicAuthId, 'basicAuthId'); + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + basicAuthId + }; + + const queryParams = { + tenantId + }; + + return this.delete({ + path: '/api/enterprise/admin/basic-auths/{basicAuthId}', + pathParams, + queryParams + }); + } + + /** + * Delete an endpoint + * + * @param endpointConfigurationId endpointConfigurationId + * @param tenantId tenantId + * @return Promise<{}> + */ + removeEndpointConfiguration(endpointConfigurationId: number, tenantId: number): Promise<void> { + throwIfNotDefined(endpointConfigurationId, 'endpointConfigurationId'); + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + endpointConfigurationId + }; + + const queryParams = { + tenantId + }; + + return this.delete({ + path: '/api/enterprise/admin/endpoints/{endpointConfigurationId}', + pathParams, + queryParams + }); + } + + /** + * Update an endpoint authorization + * + * @param basicAuthId basicAuthId + * @param createRepresentation createRepresentation + * @return Promise<EndpointBasicAuthRepresentation> + */ + updateBasicAuthConfiguration( + basicAuthId: number, + createRepresentation: CreateEndpointBasicAuthRepresentation + ): Promise<EndpointBasicAuthRepresentation> { + throwIfNotDefined(basicAuthId, 'basicAuthId'); + throwIfNotDefined(createRepresentation, 'createRepresentation'); + + const pathParams = { + basicAuthId + }; + + return this.put({ + path: '/api/enterprise/admin/basic-auths/{basicAuthId}', + pathParams, + bodyParam: createRepresentation, + returnType: EndpointBasicAuthRepresentation + }); + } + + /** + * Update an endpoint + * + * @param endpointConfigurationId endpointConfigurationId + * @param representation representation + * @return Promise<EndpointConfigurationRepresentation> + */ + updateEndpointConfiguration( + endpointConfigurationId: number, + representation: EndpointConfigurationRepresentation + ): Promise<EndpointConfigurationRepresentation> { + throwIfNotDefined(endpointConfigurationId, 'endpointConfigurationId'); + throwIfNotDefined(representation, 'representation'); + + const pathParams = { + endpointConfigurationId + }; + + return this.put({ + path: '/api/enterprise/admin/endpoints/{endpointConfigurationId}', + pathParams, + bodyParam: representation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/adminGroups.api.ts b/lib/js-api/src/api/activiti-rest-api/api/adminGroups.api.ts new file mode 100644 index 0000000000..74725cb699 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/adminGroups.api.ts @@ -0,0 +1,362 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + AbstractGroupRepresentation, + AddGroupCapabilitiesRepresentation, + GroupRepresentation, + LightGroupRepresentation, + ResultListDataRepresentationLightUserRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * AdminGroupsApi service. + */ +export class AdminGroupsApi extends BaseApi { + /** + * Activate a group + * + * @param groupId groupId + * @return Promise<{}> + */ + activate(groupId: number): Promise<any> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + return this.post({ + path: '/api/enterprise/admin/groups/{groupId}/action/activate', + pathParams + }); + } + + /** + * Add users to a group + * + * @param groupId groupId + * @return Promise<{}> + */ + addAllUsersToGroup(groupId: number): Promise<any> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + return this.post({ + path: '/api/enterprise/admin/groups/{groupId}/add-all-users', + pathParams + }); + } + + /** + * Add capabilities to a group + * + * @param groupId groupId + * @param addGroupCapabilitiesRepresentation addGroupCapabilitiesRepresentation + * @return Promise<{}> + */ + addGroupCapabilities(groupId: number, addGroupCapabilitiesRepresentation: AddGroupCapabilitiesRepresentation): Promise<any> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(addGroupCapabilitiesRepresentation, 'addGroupCapabilitiesRepresentation'); + + const pathParams = { + groupId + }; + + return this.post({ + path: '/api/enterprise/admin/groups/{groupId}/capabilities', + pathParams, + bodyParam: addGroupCapabilitiesRepresentation + }); + } + + /** + * Add a user to a group + * + * @param groupId groupId + * @param userId userId + * @return Promise<{}> + */ + addGroupMember(groupId: number, userId: number): Promise<any> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(userId, 'userId'); + + const pathParams = { + groupId, + userId + }; + + return this.post({ + path: '/api/enterprise/admin/groups/{groupId}/members/{userId}', + pathParams + }); + } + + /** + * Get a related group + * + * @param groupId groupId + * @param relatedGroupId relatedGroupId + * @param type type + * @return Promise<{}> + */ + addRelatedGroup(groupId: number, relatedGroupId: number, type: string): Promise<any> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(relatedGroupId, 'relatedGroupId'); + throwIfNotDefined(type, 'type'); + + const pathParams = { + groupId, + relatedGroupId + }; + + const queryParams = { + type + }; + + return this.post({ + path: '/api/enterprise/admin/groups/{groupId}/related-groups/{relatedGroupId}', + pathParams, + queryParams + }); + } + + /** + * Create a group + * + * @param groupRepresentation groupRepresentation + * @return Promise<GroupRepresentation> + */ + createNewGroup(groupRepresentation: GroupRepresentation): Promise<GroupRepresentation> { + throwIfNotDefined(groupRepresentation, 'groupRepresentation'); + + return this.post({ + path: '/api/enterprise/admin/groups', + bodyParam: groupRepresentation, + returnType: GroupRepresentation + }); + } + + /** + * Remove a capability from a group + * + * @param groupId groupId + * @param groupCapabilityId groupCapabilityId + * @return Promise<{}> + */ + deleteGroupCapability(groupId: number, groupCapabilityId: number): Promise<void> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(groupCapabilityId, 'groupCapabilityId'); + + const pathParams = { + groupId, + groupCapabilityId + }; + + return this.delete({ + path: '/api/enterprise/admin/groups/{groupId}/capabilities/{groupCapabilityId}', + pathParams + }); + } + + /** + * Delete a member from a group + * + * @param groupId groupId + * @param userId userId + * @return Promise<{}> + */ + deleteGroupMember(groupId: number, userId: number): Promise<void> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(userId, 'userId'); + + const pathParams = { + groupId, + userId + }; + + return this.delete({ + path: '/api/enterprise/admin/groups/{groupId}/members/{userId}', + pathParams + }); + } + + /** + * Delete a group + * + * @param groupId groupId + * @return Promise<{}> + */ + deleteGroup(groupId: number): Promise<void> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + return this.delete({ + path: '/api/enterprise/admin/groups/{groupId}', + pathParams + }); + } + + /** + * Delete a related group + * + * @param groupId groupId + * @param relatedGroupId relatedGroupId + * @return Promise<{}> + */ + deleteRelatedGroup(groupId: number, relatedGroupId: number): Promise<void> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(relatedGroupId, 'relatedGroupId'); + + const pathParams = { + groupId, + relatedGroupId + }; + + return this.delete({ + path: '/api/enterprise/admin/groups/{groupId}/related-groups/{relatedGroupId}', + pathParams + }); + } + + /** + * List group capabilities + * + * @param groupId groupId + * @return Promise<string> + */ + getCapabilities(groupId: number): Promise<string> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + return this.get({ + path: '/api/enterprise/admin/groups/{groupId}/potential-capabilities', + pathParams + }); + } + + /** + * Get group members + * + * @param groupId groupId + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationLightUserRepresentation> + */ + getGroupUsers( + groupId: number, + opts?: { filter?: string; page?: number; pageSize?: number } + ): Promise<ResultListDataRepresentationLightUserRepresentation> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + return this.get({ + path: '/api/enterprise/admin/groups/{groupId}/users', + pathParams, + queryParams: opts + }); + } + + /** + * Get a group + * + * @param groupId groupId + * @param opts Optional parameters + * @return Promise<AbstractGroupRepresentation> + */ + getGroup(groupId: number, opts?: { includeAllUsers?: boolean; summary?: boolean }): Promise<AbstractGroupRepresentation> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + return this.get({ + path: '/api/enterprise/admin/groups/{groupId}', + pathParams, + queryParams: opts + }); + } + + /** + * Query groups + * + * @param opts Optional parameters + * @return Promise<LightGroupRepresentation> + */ + getGroups(opts?: { tenantId?: number; functional?: boolean; summary?: boolean }): Promise<LightGroupRepresentation> { + return this.get({ + path: '/api/enterprise/admin/groups', + queryParams: opts + }); + } + + /** + * Get related groups + * + * @param groupId groupId + * @return Promise<LightGroupRepresentation> + */ + getRelatedGroups(groupId: number): Promise<LightGroupRepresentation> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + return this.get({ + path: '/api/enterprise/admin/groups/{groupId}/related-groups', + pathParams + }); + } + + /** + * Update a group + * + * @param groupId groupId + * @param groupRepresentation groupRepresentation + * @return Promise<GroupRepresentation> + */ + updateGroup(groupId: number, groupRepresentation: GroupRepresentation): Promise<GroupRepresentation> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(groupRepresentation, 'groupRepresentation'); + + const pathParams = { + groupId + }; + + return this.put({ + path: '/api/enterprise/admin/groups/{groupId}', + pathParams, + bodyParam: groupRepresentation, + returnType: GroupRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/adminTenants.api.ts b/lib/js-api/src/api/activiti-rest-api/api/adminTenants.api.ts new file mode 100644 index 0000000000..2b611b1875 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/adminTenants.api.ts @@ -0,0 +1,182 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CreateTenantRepresentation, ImageUploadRepresentation, LightTenantRepresentation, TenantEvent, TenantRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * AdminTenantsApi service. + */ +export class AdminTenantsApi extends BaseApi { + /** + * Create a tenant + * Only a tenant manager may access this endpoint + * + * @param createTenantRepresentation createTenantRepresentation + * @return Promise<LightTenantRepresentation> + */ + createTenant(createTenantRepresentation: CreateTenantRepresentation): Promise<LightTenantRepresentation> { + throwIfNotDefined(createTenantRepresentation, 'groupId'); + + return this.post({ + path: '/api/enterprise/admin/tenants', + bodyParam: createTenantRepresentation + }); + } + + /** + * Delete a tenant + * + * @param tenantId tenantId + * @return Promise<{}> + */ + deleteTenant(tenantId: number): Promise<void> { + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + tenantId + }; + + return this.delete({ + path: '/api/enterprise/admin/tenants/{tenantId}', + pathParams + }); + } + + /** + * Get tenant events + * + * @param tenantId tenantId + * @return Promise<TenantEvent> + */ + getTenantEvents(tenantId: number): Promise<TenantEvent> { + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/admin/tenants/{tenantId}/events', + pathParams, + returnType: TenantEvent + }); + } + + /** + * Get a tenant's logo + * + * @param tenantId tenantId + * @return Promise<{}> + */ + getTenantLogo(tenantId: number): Promise<any> { + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/admin/tenants/{tenantId}/logo', + pathParams + }); + } + + /** + * Get a tenant + * + * @param tenantId tenantId + * @return Promise<TenantRepresentation> + */ + getTenant(tenantId: number): Promise<TenantRepresentation> { + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/admin/tenants/{tenantId}', + pathParams, + returnType: TenantRepresentation + }); + } + + /** + * List tenants + * Only a tenant manager may access this endpoint + * + * @return Promise<LightTenantRepresentation> + */ + getTenants(): Promise<LightTenantRepresentation> { + return this.get({ + path: '/api/enterprise/admin/tenants' + }); + } + + /** + * Update a tenant + * + * @param tenantId tenantId + * @param createTenantRepresentation createTenantRepresentation + * @return Promise<TenantRepresentation> + */ + update(tenantId: number, createTenantRepresentation: CreateTenantRepresentation): Promise<TenantRepresentation> { + throwIfNotDefined(tenantId, 'tenantId'); + throwIfNotDefined(createTenantRepresentation, 'createTenantRepresentation'); + + const pathParams = { + tenantId + }; + + return this.put({ + path: '/api/enterprise/admin/tenants/{tenantId}', + pathParams, + bodyParam: createTenantRepresentation, + returnType: TenantRepresentation + }); + } + + /** + * Update a tenant's logo + * + * @param tenantId tenantId + * @param file file + * @return Promise<ImageUploadRepresentation> + */ + uploadTenantLogo(tenantId: number, file: any): Promise<ImageUploadRepresentation> { + throwIfNotDefined(tenantId, 'tenantId'); + throwIfNotDefined(file, 'file'); + + const pathParams = { + tenantId + }; + + const formParams = { + file + }; + + return this.post({ + path: '/api/enterprise/admin/tenants/{tenantId}/logo', + pathParams, + formParams, + contentTypes: ['multipart/form-data'], + returnType: ImageUploadRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/adminUsers.api.ts b/lib/js-api/src/api/activiti-rest-api/api/adminUsers.api.ts new file mode 100644 index 0000000000..85b9df6b52 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/adminUsers.api.ts @@ -0,0 +1,131 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + AbstractUserRepresentation, + BulkUserUpdateRepresentation, + ResultListDataRepresentationAbstractUserRepresentation, + UserRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +export interface GetUsersOpts { + filter?: string; + status?: string; + accountType?: string; + sort?: string; + company?: string; + start?: number; + page?: number; + size?: number; + groupId?: number; + tenantId?: number; + summary?: boolean; +} + +/** + * AdminUsersApi service. + */ +export class AdminUsersApi extends BaseApi { + /** + * Bulk update a list of users + * + * @param update update + * @return Promise<{}> + */ + bulkUpdateUsers(update: BulkUserUpdateRepresentation): Promise<any> { + throwIfNotDefined(update, 'update'); + + return this.put({ + path: '/api/enterprise/admin/users', + bodyParam: update + }); + } + + /** + * Create a user + * + * @param userRepresentation userRepresentation + * @return Promise<UserRepresentation> + */ + createNewUser(userRepresentation: UserRepresentation): Promise<UserRepresentation> { + throwIfNotDefined(userRepresentation, 'userRepresentation'); + + return this.post({ + path: '/api/enterprise/admin/users', + bodyParam: userRepresentation, + returnType: UserRepresentation + }); + } + + /** + * Get a user + * + * @param userId userId + * @param opts Optional parameters + * @return Promise<AbstractUserRepresentation> + */ + getUser(userId: number, opts?: { summary?: boolean }): Promise<AbstractUserRepresentation> { + throwIfNotDefined(userId, 'userId'); + + const pathParams = { + userId + }; + + return this.get({ + path: '/api/enterprise/admin/users/{userId}', + pathParams, + queryParams: opts + }); + } + + /** + * Query users + * + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationAbstractUserRepresentation> + */ + getUsers(opts?: GetUsersOpts): Promise<ResultListDataRepresentationAbstractUserRepresentation> { + return this.get({ + path: '/api/enterprise/admin/users', + queryParams: opts + }); + } + + /** + * Update a user + * + * @param userId userId + * @param userRepresentation userRepresentation + * @return Promise<{}> + */ + updateUserDetails(userId: number, userRepresentation: UserRepresentation): Promise<any> { + throwIfNotDefined(userId, 'userId'); + throwIfNotDefined(userRepresentation, 'userRepresentation'); + + const pathParams = { + userId + }; + + return this.put({ + path: '/api/enterprise/admin/users/{userId}', + pathParams, + bodyParam: userRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/appDefinitions.api.ts b/lib/js-api/src/api/activiti-rest-api/api/appDefinitions.api.ts new file mode 100644 index 0000000000..d4eaf689c8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/appDefinitions.api.ts @@ -0,0 +1,207 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + AppDefinitionPublishRepresentation, + AppDefinitionRepresentation, + AppDefinitionSaveRepresentation, + AppDefinitionUpdateResultRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * AppDefinitionsApi service. + */ +export class AppDefinitionsApi extends BaseApi { + /** + * deleteAppDefinition + * + * @param appDefinitionId appDefinitionId + * @return Promise<{}> + */ + deleteAppDefinition(appDefinitionId: number): Promise<void> { + throwIfNotDefined(appDefinitionId, 'appDefinitionId'); + + const pathParams = { + appDefinitionId + }; + + return this.delete({ + path: '/api/enterprise/app-definitions/{appDefinitionId}', + pathParams + }); + } + + /** + * Export an app definition + * + * This will return a zip file containing the app definition model and all related models (process definitions and forms). + * + * @param modelId modelId from a runtime app or the id of an app definition model + * @return Promise<{}> + */ + exportAppDefinition(modelId: number): Promise<any> { + throwIfNotDefined(modelId, 'modelId'); + + const pathParams = { + modelId + }; + + const contentTypes = ['application/json']; + const accepts = ['application/json', 'application/zip']; + + return this.get({ + path: '/api/enterprise/app-definitions/{modelId}/export', + pathParams, + contentTypes, + accepts + }); + } + + /** + * Get an app definition + * + * @param modelId Application definition ID + * @return Promise<AppDefinitionRepresentation> + */ + getAppDefinition(modelId: number): Promise<AppDefinitionRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + + const pathParams = { + modelId + }; + + return this.get({ + path: '/api/enterprise/app-definitions/{modelId}', + pathParams + }); + } + + /** + * importAndPublishApp + * + * @param file file + * @param opts options + * @return Promise<AppDefinitionUpdateResultRepresentation> + */ + importAndPublishApp(file: any, opts?: { renewIdmEntries?: boolean }): Promise<AppDefinitionUpdateResultRepresentation> { + throwIfNotDefined(file, 'file'); + + const formParams = { + file + }; + + const queryParams = { + renewIdmEntries: opts?.renewIdmEntries + }; + + return this.post({ + path: '/api/enterprise/app-definitions/publish-app', + formParams, + queryParams, + contentTypes: ['multipart/form-data'] + }); + } + + /** + * Import a new app definition + * + * Allows a zip file to be uploaded containing an app definition and any number of included models. + * <p>This is useful to bootstrap an environment (for users or continuous integration).<p> + * Before using any processes included in the import the app must be published and deployed. + * + * @param file file + * @param opts Optional parameters + * @param opts.renewIdmEntries Whether to renew user and group identifiers (default to false) + * @return Promise<AppDefinitionRepresentation> + */ + importAppDefinition(file: any, opts?: { renewIdmEntries?: string }): Promise<AppDefinitionRepresentation> { + throwIfNotDefined(file, 'file'); + + const formParams = { + file + }; + + return this.post({ + path: '/api/enterprise/app-definitions/import', + queryParams: opts, + formParams, + contentTypes: ['multipart/form-data'] + }); + } + + /** + * Publish an app definition + * + * Publishing an app definition makes it available for use. The application must not have any validation errors or an error will be returned.<p>Before an app definition can be used by other users, it must also be deployed for their use + * + * @param modelId modelId + * @param publishModel publishModel + * @return Promise<AppDefinitionUpdateResultRepresentation> + */ + publishAppDefinition(modelId: number, publishModel: AppDefinitionPublishRepresentation): Promise<AppDefinitionUpdateResultRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + throwIfNotDefined(publishModel, 'publishModel'); + + const pathParams = { + modelId + }; + + return this.post({ + path: '/api/enterprise/app-definitions/{modelId}/publish', + pathParams, + bodyParam: publishModel + }); + } + + /** + * Update an app definition + * + * @param modelId Application definition ID + * @param updatedModel updatedModel | + * @return Promise<AppDefinitionUpdateResultRepresentation> + */ + updateAppDefinition(modelId: number, updatedModel: AppDefinitionSaveRepresentation | any): Promise<any> { + throwIfNotDefined(modelId, 'modelId'); + throwIfNotDefined(updatedModel, 'updatedModel'); + + const pathParams = { + modelId + }; + + if (!updatedModel['appDefinition']) { + const formParams = { + file: updatedModel + }; + + return this.post({ + path: '/api/enterprise/app-definitions/{modelId}/import', + pathParams, + formParams, + bodyParam: updatedModel, + contentTypes: ['multipart/form-data'] + }); + } else { + return this.put({ + path: '/api/enterprise/app-definitions/{modelId}', + pathParams, + bodyParam: updatedModel + }); + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/base.api.ts b/lib/js-api/src/api/activiti-rest-api/api/base.api.ts new file mode 100644 index 0000000000..e45cd821ea --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/base.api.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient } from '../../../api-clients/http-client.interface'; + +export abstract class BaseApi extends ApiClient { + override get apiClient(): LegacyHttpClient { + return this.httpClient ?? this.alfrescoApi.processClient; + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/checklists.api.ts b/lib/js-api/src/api/activiti-rest-api/api/checklists.api.ts new file mode 100644 index 0000000000..216ffe2542 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/checklists.api.ts @@ -0,0 +1,92 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChecklistOrderRepresentation } from '../model/checklistOrderRepresentation'; +import { ResultListDataRepresentationTaskRepresentation } from '../model/resultListDataRepresentationTaskRepresentation'; +import { TaskRepresentation } from '../model/taskRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Checklists service. + */ +export class ChecklistsApi extends BaseApi { + /** + * Create a task checklist + * + * @param taskId taskId + * @param taskRepresentation taskRepresentation + * @return Promise<TaskRepresentation> + */ + addSubtask(taskId: string, taskRepresentation: TaskRepresentation): Promise<TaskRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(taskRepresentation, 'taskRepresentation'); + + const pathParams = { + taskId + }; + + return this.post({ + path: '/api/enterprise/tasks/{taskId}/checklist', + pathParams, + bodyParam: taskRepresentation, + returnType: TaskRepresentation + }); + } + + /** + * Get checklist for a task + * + * @param taskId taskId + * @return Promise<ResultListDataRepresentationTaskRepresentation> + */ + getChecklist(taskId: string): Promise<ResultListDataRepresentationTaskRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/checklist', + pathParams, + returnType: ResultListDataRepresentationTaskRepresentation + }); + } + + /** + * Change the order of items on a checklist + * + * @param taskId taskId + * @param orderRepresentation orderRepresentation + * @return Promise<{}> + */ + orderChecklist(taskId: string, orderRepresentation: ChecklistOrderRepresentation): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(orderRepresentation, 'orderRepresentation'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/checklist', + bodyParam: orderRepresentation, + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/comments.api.ts b/lib/js-api/src/api/activiti-rest-api/api/comments.api.ts new file mode 100644 index 0000000000..833dd4378d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/comments.api.ts @@ -0,0 +1,119 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommentRepresentation } from '../model/commentRepresentation'; +import { ResultListDataRepresentationCommentRepresentation } from '../model/resultListDataRepresentationCommentRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Comments service. + */ +export class ActivitiCommentsApi extends BaseApi { + /** + * Add a comment to a process instance + * + * @param commentRequest commentRequest + * @param processInstanceId processInstanceId + * @return Promise<CommentRepresentation> + */ + addProcessInstanceComment(commentRequest: CommentRepresentation, processInstanceId: string): Promise<CommentRepresentation> { + throwIfNotDefined(commentRequest, 'commentRequest'); + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.post({ + path: '/api/enterprise/process-instances/{processInstanceId}/comments', + pathParams, + bodyParam: commentRequest, + returnType: CommentRepresentation + }); + } + + /** + * Add a comment to a task + * + * @param commentRequest commentRequest + * @param taskId taskId + * @return Promise<CommentRepresentation> + */ + addTaskComment(commentRequest: CommentRepresentation, taskId: string): Promise<CommentRepresentation> { + throwIfNotDefined(commentRequest, 'commentRequest'); + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.post({ + path: '/api/enterprise/tasks/{taskId}/comments', + pathParams, + bodyParam: commentRequest, + returnType: CommentRepresentation + }); + } + + /** + * Get comments for a process + * + * @param processInstanceId processInstanceId + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationCommentRepresentation> + */ + getProcessInstanceComments( + processInstanceId: string, + opts?: { latestFirst?: boolean } + ): Promise<ResultListDataRepresentationCommentRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/comments', + pathParams, + queryParams: opts, + returnType: ResultListDataRepresentationCommentRepresentation + }); + } + + /** + * Get comments for a task + * + * @param taskId taskId + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationCommentRepresentation> + */ + getTaskComments(taskId: string, opts?: { latestFirst?: boolean }): Promise<ResultListDataRepresentationCommentRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/comments', + pathParams, + queryParams: opts, + returnType: ResultListDataRepresentationCommentRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/content.api.ts b/lib/js-api/src/api/activiti-rest-api/api/content.api.ts new file mode 100644 index 0000000000..3643bb838d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/content.api.ts @@ -0,0 +1,321 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + RelatedContentRepresentation, + ResultListDataRepresentationRelatedContentRepresentation, + ResultListDataRepresentationRelatedProcessTask +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Content service. + */ +export class ContentApi extends BaseApi { + /** + * Attach existing content to a process instance + * + * @param processInstanceId processInstanceId + * @param relatedContent relatedContent + * @param opts Optional parameters + * @return Promise<RelatedContentRepresentation> + */ + createRelatedContentOnProcessInstance( + processInstanceId: string, + relatedContent: RelatedContentRepresentation | any, + opts?: { isRelatedContent?: boolean } + ): Promise<RelatedContentRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(relatedContent, 'relatedContent'); + + opts = opts || {}; + + const pathParams = { + processInstanceId + }; + + if (relatedContent instanceof RelatedContentRepresentation) { + return this.post({ + path: '/api/enterprise/process-instances/{processInstanceId}/content', + pathParams, + queryParams: opts, + bodyParam: relatedContent, + returnType: RelatedContentRepresentation + }); + } else { + const formParams = { + file: relatedContent + }; + + return this.post({ + path: '/api/enterprise/process-instances/{processInstanceId}/raw-content', + pathParams, + formParams, + queryParams: opts, + contentTypes: ['multipart/form-data'], + returnType: RelatedContentRepresentation + }); + } + } + + /** + * Attach existing content to a task + * + * @param taskId taskId + * @param relatedContent relatedContent + * @param opts Optional parameters + * @return Promise<RelatedContentRepresentation> + */ + createRelatedContentOnTask( + taskId: string, + relatedContent: RelatedContentRepresentation | any, + opts?: { isRelatedContent?: boolean } + ): Promise<RelatedContentRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(relatedContent, 'relatedContent'); + + const pathParams = { + taskId + }; + + if (relatedContent instanceof RelatedContentRepresentation) { + return this.post({ + path: '/api/enterprise/tasks/{taskId}/content', + pathParams, + queryParams: opts, + bodyParam: relatedContent, + returnType: RelatedContentRepresentation + }); + } else { + const formParams = { + file: relatedContent + }; + + return this.post({ + path: '/api/enterprise/tasks/{taskId}/raw-content', + pathParams, + queryParams: opts, + formParams, + contentTypes: ['multipart/form-data'], + returnType: RelatedContentRepresentation + }); + } + } + + /** + * Upload content and create a local representation + * + * @param file file + * @return Promise<RelatedContentRepresentation> + */ + createTemporaryRawRelatedContent(file: any): Promise<RelatedContentRepresentation> { + throwIfNotDefined(file, 'file'); + + const formParams = { + file + }; + + return this.post({ + path: '/api/enterprise/content/raw', + formParams, + contentTypes: ['multipart/form-data'], + returnType: RelatedContentRepresentation + }); + } + + /** + * Create a local representation of content from a remote repository + * + * @param relatedContent relatedContent + * @return Promise<RelatedContentRepresentation> + */ + createTemporaryRelatedContent(relatedContent: RelatedContentRepresentation): Promise<RelatedContentRepresentation> { + throwIfNotDefined(relatedContent, 'relatedContent'); + + return this.post({ + path: '/api/enterprise/content', + bodyParam: relatedContent, + returnType: RelatedContentRepresentation + }); + } + + /** + * Remove a local content representation + * + * @param contentId contentId + * @return Promise<{}> + */ + deleteContent(contentId: number): Promise<void> { + throwIfNotDefined(contentId, 'contentId'); + + const pathParams = { + contentId + }; + + return this.delete({ + path: '/api/enterprise/content/{contentId}', + pathParams + }); + } + + /** + * Get a local content representation + * + * @param contentId contentId + * @return Promise<RelatedContentRepresentation> + */ + getContent(contentId: number): Promise<RelatedContentRepresentation> { + throwIfNotDefined(contentId, 'contentId'); + + const pathParams = { + contentId + }; + + return this.get({ + path: '/api/enterprise/content/{contentId}', + pathParams, + returnType: RelatedContentRepresentation + }); + } + + /** + * Get content Raw URL for the given contentId + * + * @param contentId contentId + */ + getRawContentUrl(contentId: number): string { + return `${this.apiClient.basePath}/api/enterprise/content/${contentId}/raw`; + } + + /** + * Stream content rendition + * + * @param contentId contentId + * @param renditionType renditionType + * @return Promise<{}> + */ + getRawContent(contentId: number, renditionType?: string): Promise<any> { + throwIfNotDefined(contentId, 'contentId'); + + if (renditionType) { + const pathParams = { + contentId, + renditionType + }; + + return this.get({ + path: '/api/enterprise/content/{contentId}/rendition/{renditionType}', + pathParams, + returnType: 'blob', + responseType: 'blob' + }); + } else { + const pathParams = { + contentId + }; + + return this.get({ + path: '/api/enterprise/content/{contentId}/raw', + pathParams, + returnType: 'blob', + responseType: 'blob' + }); + } + } + + /** + * List content attached to a process instance + * + * @param processInstanceId processInstanceId + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationRelatedContentRepresentation> + */ + getRelatedContentForProcessInstance( + processInstanceId: string, + opts?: { isRelatedContent?: boolean } + ): Promise<ResultListDataRepresentationRelatedContentRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + opts = opts || {}; + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/content', + pathParams, + queryParams: opts, + returnType: ResultListDataRepresentationRelatedContentRepresentation + }); + } + + /** + * List content attached to a task + * + * @param taskId taskId + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationRelatedContentRepresentation> + */ + getRelatedContentForTask( + taskId: string, + opts?: { isRelatedContent?: boolean } + ): Promise<ResultListDataRepresentationRelatedContentRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/content', + pathParams, + queryParams: opts, + returnType: ResultListDataRepresentationRelatedContentRepresentation + }); + } + + /** + * Lists processes and tasks on workflow started with provided document + * + * @param sourceId - id of the document that workflow or task has been started with + * @param source - source of the document that workflow or task has been started with + * @param size - size of the entries to get + * @param page - page number + * @return Promise<ResultListDataRepresentationRelatedProcessTask> + */ + getProcessesAndTasksOnContent( + sourceId: string, + source: string, + size?: number, + page?: number + ): Promise<ResultListDataRepresentationRelatedProcessTask> { + throwIfNotDefined(sourceId, 'sourceId'); + throwIfNotDefined(source, 'source'); + + return this.get({ + path: '/api/enterprise/document-runtime', + queryParams: { + sourceId, + source, + size, + page + } + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/dataSources.api.ts b/lib/js-api/src/api/activiti-rest-api/api/dataSources.api.ts new file mode 100644 index 0000000000..8e446d1017 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/dataSources.api.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultListDataRepresentationDataSourceRepresentation } from '../model'; +import { BaseApi } from './base.api'; + +/** + * DataSourcesApi service. + */ +export class DataSourcesApi extends BaseApi { + /** + * Get data sources + * + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationDataSourceRepresentation> + */ + getDataSources(opts?: { tenantId?: number }): Promise<ResultListDataRepresentationDataSourceRepresentation> { + return this.get({ + path: '/api/enterprise/editor/data-sources', + queryParams: opts + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/decisionAudits.api.ts b/lib/js-api/src/api/activiti-rest-api/api/decisionAudits.api.ts new file mode 100644 index 0000000000..23eb28e3e8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/decisionAudits.api.ts @@ -0,0 +1,69 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DecisionAuditRepresentation } from '../model/decisionAuditRepresentation'; +import { ResultListDataRepresentationDecisionAuditRepresentation } from '../model/resultListDataRepresentationDecisionAuditRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * DecisionAuditsApi service. + */ +export class DecisionAuditsApi extends BaseApi { + /** + * Get an audit trail + * + * @param auditTrailId auditTrailId + * @return Promise<DecisionAuditRepresentation> + */ + getAuditTrail(auditTrailId: number): Promise<DecisionAuditRepresentation> { + throwIfNotDefined(auditTrailId, 'taskId'); + + const pathParams = { + auditTrailId + }; + + return this.get({ + path: '/api/enterprise/decisions/audits/{auditTrailId}', + pathParams, + returnType: DecisionAuditRepresentation + }); + } + + /** + * Query decision table audit trails + * + * @param decisionKey decisionKey + * @param dmnDeploymentId dmnDeploymentId + * @return Promise<ResultListDataRepresentationDecisionAuditRepresentation> + */ + getAuditTrails(decisionKey: string, dmnDeploymentId: number): Promise<ResultListDataRepresentationDecisionAuditRepresentation> { + throwIfNotDefined(decisionKey, 'decisionKey'); + throwIfNotDefined(dmnDeploymentId, 'dmnDeploymentId'); + + const queryParams = { + decisionKey, + dmnDeploymentId + }; + + return this.get({ + path: '/api/enterprise/decisions/audits', + queryParams, + returnType: ResultListDataRepresentationDecisionAuditRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/decisionTables.api.ts b/lib/js-api/src/api/activiti-rest-api/api/decisionTables.api.ts new file mode 100644 index 0000000000..4ceebdb1a5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/decisionTables.api.ts @@ -0,0 +1,87 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { JsonNode, ResultListDataRepresentationRuntimeDecisionTableRepresentation, RuntimeDecisionTableRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +export interface GetDecisionTablesOpts { + nameLike?: string; + keyLike?: string; + tenantIdLike?: string; + deploymentId?: number; + sort?: string; + order?: string; + start?: number; + size?: number; +} + +/** + * DecisionTablesApi service. + */ +export class DecisionTablesApi extends BaseApi { + /** + * Get definition for a decision table + * + * @param decisionTableId decisionTableId + * @return Promise<JsonNode> + */ + getDecisionTableEditorJson(decisionTableId: number): Promise<JsonNode> { + throwIfNotDefined(decisionTableId, 'decisionTableId'); + + const pathParams = { + decisionTableId + }; + + return this.get({ + path: '/api/enterprise/decisions/decision-tables/{decisionTableId}/editorJson', + pathParams + }); + } + + /** + * Get a decision table + * + * @param decisionTableId decisionTableId + * @return Promise<RuntimeDecisionTableRepresentation> + */ + getDecisionTable(decisionTableId: number): Promise<RuntimeDecisionTableRepresentation> { + throwIfNotDefined(decisionTableId, 'decisionTableId'); + + const pathParams = { + decisionTableId + }; + + return this.get({ + path: '/api/enterprise/decisions/decision-tables/{decisionTableId}', + pathParams + }); + } + + /** + * Query decision tables + * + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationRuntimeDecisionTableRepresentation> + */ + getDecisionTables(opts?: GetDecisionTablesOpts): Promise<ResultListDataRepresentationRuntimeDecisionTableRepresentation> { + return this.get({ + path: '/api/enterprise/decisions/decision-tables', + queryParams: opts + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/endpoints.api.ts b/lib/js-api/src/api/activiti-rest-api/api/endpoints.api.ts new file mode 100644 index 0000000000..abe7639f3c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/endpoints.api.ts @@ -0,0 +1,55 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { EndpointConfigurationRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Endpoints service. + */ +export class EndpointsApi extends BaseApi { + /** + * Get an endpoint configuration + * + * @param endpointConfigurationId endpointConfigurationId + * @return Promise<EndpointConfigurationRepresentation> + */ + getEndpointConfiguration(endpointConfigurationId: number): Promise<EndpointConfigurationRepresentation> { + throwIfNotDefined(endpointConfigurationId, 'endpointConfigurationId'); + + const pathParams = { + endpointConfigurationId + }; + + return this.get({ + path: '/api/enterprise/editor/endpoints/{endpointConfigurationId}', + pathParams + }); + } + + /** + * List endpoint configurations + * + * @return Promise<EndpointConfigurationRepresentation> + */ + getEndpointConfigurations(): Promise<EndpointConfigurationRepresentation> { + return this.get({ + path: '/api/enterprise/editor/endpoints' + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/formModels.api.ts b/lib/js-api/src/api/activiti-rest-api/api/formModels.api.ts new file mode 100644 index 0000000000..841a9fbf95 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/formModels.api.ts @@ -0,0 +1,184 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + FormDefinitionRepresentation, + FormRepresentation, + FormSaveRepresentation, + ResultListDataRepresentationFormRepresentation, + ResultListDataRepresentationRuntimeFormRepresentation, + ValidationErrorRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; + +export interface GetFormsOpts { + nameLike?: string; + appId?: number; + tenantId?: number; + start?: number; + sort?: string; + order?: string; + size?: number; +} + +/** + * FormModelsApi service. + */ +export class FormModelsApi extends BaseApi { + /** + * Get form content + * + * @param formId formId + * @return Promise<FormDefinitionRepresentation> + */ + getFormEditorJson(formId: number): Promise<FormDefinitionRepresentation> { + throwIfNotDefined(formId, 'formId'); + + const pathParams = { + formId + }; + + return this.get({ + path: '/api/enterprise/forms/{formId}/editorJson', + pathParams + }); + } + + /** + * Get form history + * + * @param formId formId + * @param formHistoryId formHistoryId + * @return Promise<FormRepresentation> + */ + getFormHistory(formId: number, formHistoryId: number): Promise<FormRepresentation> { + throwIfNotDefined(formId, 'formId'); + throwIfNotDefined(formHistoryId, 'formHistoryId'); + + const pathParams = { + formId, + formHistoryId + }; + + return this.get({ + path: '/api/enterprise/editor/form-models/{formId}/history/{formHistoryId}', + pathParams, + returnType: FormRepresentation + }); + } + + /** + * Get a form model + * + * @param formId {number} formId + * @return Promise<FormRepresentation> + */ + getForm(formId: number): Promise<FormRepresentation> { + throwIfNotDefined(formId, 'formId'); + + const pathParams = { + formId + }; + + return this.get({ + path: '/api/enterprise/editor/form-models/{formId}', + pathParams, + returnType: FormRepresentation + }); + } + + /** + * Get forms + * + * @param input input + * @return Promise<FormRepresentation> + */ + getForms( + input: string[] | GetFormsOpts + ): Promise<FormRepresentation | ResultListDataRepresentationRuntimeFormRepresentation | ResultListDataRepresentationFormRepresentation> { + if (typeof input === 'string') { + const queryParams = { + formId: buildCollectionParam(input, 'multi') + }; + + return this.get({ + path: '/api/enterprise/editor/form-models/values', + queryParams, + returnType: FormRepresentation + }); + } else if (typeof input === 'object') { + return this.get({ + path: '/api/enterprise/forms', + queryParams: input + }); + } else { + return this.get({ + path: '/api/enterprise/editor/form-models', + returnType: ResultListDataRepresentationFormRepresentation + }); + } + } + + /** + * Update form model content + * + * @param formId ID of the form to update + * @param saveRepresentation saveRepresentation + * @return Promise<FormRepresentation> + */ + saveForm(formId: number, saveRepresentation: FormSaveRepresentation): Promise<FormRepresentation> { + throwIfNotDefined(formId, 'formId'); + throwIfNotDefined(saveRepresentation, 'saveRepresentation'); + + const pathParams = { + formId + }; + + return this.put({ + path: '/api/enterprise/editor/form-models/{formId}', + pathParams, + bodyParam: saveRepresentation, + returnType: FormRepresentation + }); + } + + /** + * Validate form model content + * + * The model content to be validated must be specified in the POST body + * + * @param formId formId + * @param saveRepresentation saveRepresentation + * @return Promise<ValidationErrorRepresentation> + */ + validateModel(formId: number, saveRepresentation: FormSaveRepresentation): Promise<ValidationErrorRepresentation> { + throwIfNotDefined(formId, 'formId'); + throwIfNotDefined(saveRepresentation, 'saveRepresentation'); + + const pathParams = { + formId + }; + + return this.get({ + path: '/api/enterprise/editor/form-models/{formId}/validate', + pathParams, + bodyParam: saveRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/groups.api.ts b/lib/js-api/src/api/activiti-rest-api/api/groups.api.ts new file mode 100644 index 0000000000..339c89e5b1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/groups.api.ts @@ -0,0 +1,65 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultListDataRepresentationLightGroupRepresentation, ResultListDataRepresentationLightUserRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +export interface GetGroupsOpts { + filter?: string; + groupId?: number; + externalId?: string; + externalIdCaseInsensitive?: string; + tenantId?: string; +} + +/** + * Groups service. + */ +export class ActivitiGroupsApi extends BaseApi { + /** + * Query groups + * + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationLightGroupRepresentation> + */ + getGroups(opts?: GetGroupsOpts): Promise<ResultListDataRepresentationLightGroupRepresentation> { + return this.get({ + path: '/api/enterprise/groups', + queryParams: opts + }); + } + + /** + * List members of a group + * + * @param groupId groupId + * @return Promise<ResultListDataRepresentationLightUserRepresentation> + */ + getUsersForGroup(groupId: number): Promise<ResultListDataRepresentationLightUserRepresentation> { + throwIfNotDefined(groupId, 'formId'); + + const pathParams = { + groupId + }; + + return this.get({ + path: '/api/enterprise/groups/{groupId}/users', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/iDMSync.api.ts b/lib/js-api/src/api/activiti-rest-api/api/iDMSync.api.ts new file mode 100644 index 0000000000..96b7dc0f8c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/iDMSync.api.ts @@ -0,0 +1,62 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SyncLogEntryRepresentation } from '../model/syncLogEntryRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * IDMSyncApi service. + */ +export class IDMSyncApi extends BaseApi { + /** + * Get log file for a sync log entry + * + * @param syncLogEntryId syncLogEntryId + * @return Promise<{}> + */ + getLogFile(syncLogEntryId: number): Promise<any> { + throwIfNotDefined(syncLogEntryId, 'syncLogEntryId'); + + const pathParams = { + syncLogEntryId + }; + + return this.get({ + path: '/api/enterprise/idm-sync-log-entries/{syncLogEntryId}/logfile', + pathParams + }); + } + + /** + * List sync log entries + * + * @param opts Optional parameters + * @param opts.tenantId {number} tenantId + * @param opts.page {number} page + * @param opts.start {number} start + * @param opts.size {number} size + * @return Promise<SyncLogEntryRepresentation> + */ + getSyncLogEntries(opts?: { tenantId?: number; page?: number; start?: number; size?: number }): Promise<SyncLogEntryRepresentation> { + return this.get({ + path: '/api/enterprise/idm-sync-log-entries', + queryParams: opts, + returnType: SyncLogEntryRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/index.ts b/lib/js-api/src/api/activiti-rest-api/api/index.ts new file mode 100644 index 0000000000..8805abe0cf --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/index.ts @@ -0,0 +1,62 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './about.api'; +export * from './accountIntegration.api'; +export * from './adminEndpoints.api'; +export * from './adminGroups.api'; +export * from './adminTenants.api'; +export * from './adminUsers.api'; +export * from './appDefinitions.api'; +export * from './checklists.api'; +export * from './comments.api'; +import { ContentApi as ActivitiContentApi } from './content.api'; +export { ActivitiContentApi }; +export * from './dataSources.api'; +export * from './decisionAudits.api'; +export * from './decisionTables.api'; +export * from './endpoints.api'; +export * from './formModels.api'; +export * from './groups.api'; +export * from './iDMSync.api'; +export * from './integrationAlfrescoCloud.api'; +export * from './integrationAlfrescoOnPremise.api'; +export * from './integrationBox.api'; +export * from './integrationDrive.api'; +export * from './models.api'; +export * from './modelsBpmn.api'; +export * from './modelsHistory.api'; +export * from './processDefinitions.api'; +export * from './processInstances.api'; +export * from './processInstanceVariables.api'; +export * from './processScopes.api'; +export * from './runtimeAppDefinitions.api'; +export * from './runtimeAppDeployments.api'; +export * from './scriptFiles.api'; +export * from './submittedForms.api'; +export * from './systemProperties.api'; +export * from './taskActions.api'; +export * from './taskForms.api'; +export * from './tasks.api'; +export * from './taskVariables.api'; +export * from './userFilters.api'; +export * from './userProfile.api'; +export * from './users.api'; +export * from './report.api'; +export * from './modelJsonBpmn.api'; +export * from './temporary.api'; +export * from './types'; diff --git a/lib/js-api/src/api/activiti-rest-api/api/integrationAlfrescoCloud.api.ts b/lib/js-api/src/api/activiti-rest-api/api/integrationAlfrescoCloud.api.ts new file mode 100644 index 0000000000..f5c3914841 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/integrationAlfrescoCloud.api.ts @@ -0,0 +1,151 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + ResultListDataRepresentationAlfrescoContentRepresentation, + ResultListDataRepresentationAlfrescoNetworkRepresenation, + ResultListDataRepresentationAlfrescoSiteRepresenation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * IntegrationAlfrescoCloudApi service. + */ +export class IntegrationAlfrescoCloudApi extends BaseApi { + /** + * Alfresco Cloud Authorization + * Returns Alfresco OAuth HTML Page + * + * @param code code + * @return Promise<{}> + */ + confirmAuthorisation(code: string): Promise<any> { + throwIfNotDefined(code, 'code'); + + const queryParams = { + code + }; + + return this.get({ + path: '/api/enterprise/integration/alfresco-cloud/confirm-auth-request', + queryParams, + accepts: ['text/html'] + }); + } + + /** + * List Alfresco networks + * + * @return Promise<ResultListDataRepresentationAlfrescoNetworkRepresenation> + */ + getAllNetworks(): Promise<ResultListDataRepresentationAlfrescoNetworkRepresenation> { + return this.get({ + path: '/api/enterprise/integration/alfresco-cloud/networks' + }); + } + + /** + * List Alfresco sites + * Returns ALL Sites + * + * @param networkId networkId + * @return Promise<ResultListDataRepresentationAlfrescoSiteRepresenation> + */ + getAllSites(networkId: string): Promise<ResultListDataRepresentationAlfrescoSiteRepresenation> { + throwIfNotDefined(networkId, 'networkId'); + + const pathParams = { + networkId + }; + + return this.get({ + path: '/api/enterprise/integration/alfresco-cloud/networks/{networkId}/sites', + pathParams + }); + } + + /** + * List files and folders inside a specific folder identified by path + * + * @param networkId networkId + * @param opts Optional parameters + * @param opts.siteId {string} siteId + * @param opts.path {string} path + * @return Promise<ResultListDataRepresentationAlfrescoContentRepresentation> + */ + getContentInFolderPath( + networkId: string, + opts?: { siteId?: string; path?: string } + ): Promise<ResultListDataRepresentationAlfrescoContentRepresentation> { + throwIfNotDefined(networkId, 'networkId'); + + const pathParams = { + networkId + }; + + return this.get({ + path: '/api/enterprise/integration/alfresco-cloud/networks/{networkId}/sites/{siteId}/folderpath/{folderPath}/content', + pathParams, + queryParams: opts + }); + } + + /** + * List files and folders inside a specific folder + * + * @param networkId networkId + * @param folderId folderId + * @return Promise<ResultListDataRepresentationAlfrescoContentRepresentation> + */ + getContentInFolder(networkId: string, folderId: string): Promise<ResultListDataRepresentationAlfrescoContentRepresentation> { + throwIfNotDefined(networkId, 'networkId'); + throwIfNotDefined(folderId, 'folderId'); + + const pathParams = { + networkId, + folderId + }; + + return this.get({ + path: '/api/enterprise/integration/alfresco-cloud/networks/{networkId}/folders/{folderId}/content', + pathParams + }); + } + + /** + * List files and folders inside a specific site + * + * @param networkId networkId + * @param siteId siteId + * @return Promise<ResultListDataRepresentationAlfrescoContentRepresentation> + */ + getContentInSite(networkId: string, siteId: string): Promise<ResultListDataRepresentationAlfrescoContentRepresentation> { + throwIfNotDefined(networkId, 'networkId'); + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + networkId, + siteId + }; + + return this.get({ + path: '/api/enterprise/integration/alfresco-cloud/networks/{networkId}/sites/{siteId}/content', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/integrationAlfrescoOnPremise.api.ts b/lib/js-api/src/api/activiti-rest-api/api/integrationAlfrescoOnPremise.api.ts new file mode 100644 index 0000000000..e408878ef6 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/integrationAlfrescoOnPremise.api.ts @@ -0,0 +1,140 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + ResultListDataRepresentationAlfrescoContentRepresentation, + ResultListDataRepresentationAlfrescoEndpointRepresentation, + ResultListDataRepresentationAlfrescoSiteRepresenation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * IntegrationAlfrescoOnPremiseApi service. + */ +export class IntegrationAlfrescoOnPremiseApi extends BaseApi { + /** + * List Alfresco sites + * Returns ALL Sites + * + * @param repositoryId repositoryId + * @return Promise<ResultListDataRepresentationAlfrescoSiteRepresenation> + */ + getAllSites(repositoryId: string): Promise<ResultListDataRepresentationAlfrescoSiteRepresenation> { + throwIfNotDefined(repositoryId, 'networkId'); + + const pathParams = { + repositoryId + }; + + return this.get({ + path: '/api/enterprise/integration/alfresco/{repositoryId}/sites', + pathParams + }); + } + + /** + * List files and folders inside a specific folder identified by folder path + * + * @param repositoryId repositoryId + * @param siteId siteId + * @param folderPath folderPath + * @return Promise<ResultListDataRepresentationAlfrescoContentRepresentation> + */ + getContentInFolderPath( + repositoryId: string, + siteId: string, + folderPath: string + ): Promise<ResultListDataRepresentationAlfrescoContentRepresentation> { + throwIfNotDefined(repositoryId, 'networkId'); + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(folderPath, 'folderPath'); + + const pathParams = { + repositoryId, + siteId, + folderPath + }; + + return this.get({ + path: '/api/enterprise/rest/integration/alfresco/{repositoryId}/sites/{siteId}/folderpath/{folderPath}/content', + pathParams + }); + } + + /** + * List files and folders inside a specific folder + * + * @param repositoryId repositoryId + * @param folderId folderId + * @return Promise<ResultListDataRepresentationAlfrescoContentRepresentation> + */ + getContentInFolder(repositoryId: string, folderId: string): Promise<ResultListDataRepresentationAlfrescoContentRepresentation> { + throwIfNotDefined(repositoryId, 'networkId'); + throwIfNotDefined(folderId, 'folderId'); + + const pathParams = { + repositoryId, + folderId + }; + + return this.get({ + path: '/api/enterprise/integration/alfresco/{repositoryId}/folders/{folderId}/content', + pathParams + }); + } + + /** + * List files and folders inside a specific site + * + * @param repositoryId repositoryId + * @param siteId siteId + * @return Promise<ResultListDataRepresentationAlfrescoContentRepresentation> + */ + getContentInSite(repositoryId: string, siteId: string): Promise<ResultListDataRepresentationAlfrescoContentRepresentation> { + throwIfNotDefined(repositoryId, 'networkId'); + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + repositoryId, + siteId + }; + + return this.get({ + path: '/api/enterprise/integration/alfresco/{repositoryId}/sites/{siteId}/content', + pathParams + }); + } + + /** + * List Alfresco repositories + * + * A tenant administrator can configure one or more Alfresco repositories to use when working with content. + * + * @param opts Optional parameters + * @param opts.tenantId {string} tenantId + * @param opts.includeAccounts {boolean} includeAccounts (default to true) + * @return Promise<ResultListDataRepresentationAlfrescoEndpointRepresentation> + */ + getRepositories(opts?: { tenantId?: string; includeAccounts?: boolean }): Promise<ResultListDataRepresentationAlfrescoEndpointRepresentation> { + return this.get({ + path: '/api/enterprise/profile/accounts/alfresco', + queryParams: opts, + returnType: ResultListDataRepresentationAlfrescoEndpointRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/integrationBox.api.ts b/lib/js-api/src/api/activiti-rest-api/api/integrationBox.api.ts new file mode 100644 index 0000000000..458a38f48b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/integrationBox.api.ts @@ -0,0 +1,155 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultListDataRepresentationBoxContent, UserAccountCredentialsRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * IntegrationBoxApi service. + */ +export class IntegrationBoxApi extends BaseApi { + /** + * Box Authorization + * Returns Box OAuth HTML Page + * + * @return Promise<{}> + */ + confirmAuthorisation(): Promise<any> { + return this.get({ + path: '/api/enterprise/integration/box/confirm-auth-request', + accepts: ['text/html'] + }); + } + + /** + * Add Box account + * + * @param userId userId + * @param credentials credentials + * @return Promise<{}> + */ + createRepositoryAccount(userId: number, credentials: UserAccountCredentialsRepresentation): Promise<any> { + throwIfNotDefined(userId, 'userId'); + throwIfNotDefined(credentials, 'credentials'); + + const pathParams = { + userId + }; + + return this.post({ + path: '/api/enterprise/integration/box/{userId}/account', + pathParams, + bodyParam: credentials + }); + } + + /** + * Delete account information + * + * @param userId userId + * @return Promise<{}> + */ + deleteRepositoryAccount(userId: number): Promise<void> { + throwIfNotDefined(userId, 'userId'); + + const pathParams = { + userId + }; + + const accepts = ['*/*']; + + return this.delete({ + path: '/api/enterprise/integration/box/{userId}/account', + pathParams, + accepts + }); + } + + /** + * Get status information + * + * @return Promise<boolean> + */ + getBoxPluginStatus(): Promise<boolean> { + return this.get({ + path: '/api/enterprise/integration/box/status', + accepts: ['*/*'] + }); + } + + /** + * List file and folders + * + * @param opts Optional parameters + * @param opts.filter filter + * @param opts.parent parent + * @return Promise<ResultListDataRepresentationBoxContent> + */ + getFiles(opts?: { filter?: string; parent?: string }): Promise<ResultListDataRepresentationBoxContent> { + opts = opts || {}; + + return this.get({ + path: '/api/enterprise/integration/box/files', + queryParams: opts, + accepts: ['*/*'] + }); + } + + /** + * Get account information + * + * @param userId userId + * @return Promise<{}> + */ + getRepositoryAccount(userId: number): Promise<any> { + throwIfNotDefined(userId, 'userId'); + + const pathParams = { + userId + }; + + return this.get({ + path: '/api/enterprise/integration/box/{userId}/account', + pathParams, + accepts: ['*/*'] + }); + } + + /** + * Update account information + * + * @param userId userId + * @param credentials credentials + * @return Promise<{}> + */ + updateRepositoryAccount(userId: number, credentials: UserAccountCredentialsRepresentation): Promise<any> { + throwIfNotDefined(userId, 'userId'); + throwIfNotDefined(credentials, 'credentials'); + + const pathParams = { + userId + }; + + return this.put({ + path: '/api/enterprise/integration/box/{userId}/account', + pathParams, + bodyParam: credentials, + accepts: ['*/*'] + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/integrationDrive.api.ts b/lib/js-api/src/api/activiti-rest-api/api/integrationDrive.api.ts new file mode 100644 index 0000000000..8c673fb853 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/integrationDrive.api.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultListDataRepresentationGoogleDriveContent } from '../model'; +import { BaseApi } from './base.api'; + +/** + * IntegrationDriveApi service. + */ +export class IntegrationDriveApi extends BaseApi { + /** + * Drive Authorization + * Returns Drive OAuth HTML Page + * + * @return Promise<{}> + */ + confirmAuthorisation(): Promise<any> { + return this.get({ + path: '/api/enterprise/integration/google-drive/confirm-auth-request', + accepts: ['text/html'] + }); + } + + /** + * List files and folders + * + * @param opts Optional parameters + * @param opts.filter {string} filter + * @param opts.parent {string} parent + * @param opts.currentFolderOnly {boolean} currentFolderOnly + * @return Promise<ResultListDataRepresentationGoogleDriveContent> + */ + getFiles(opts?: { filter?: string; parent?: string; currentFolderOnly?: boolean }): Promise<ResultListDataRepresentationGoogleDriveContent> { + return this.get({ + path: '/api/enterprise/integration/google-drive/files', + queryParams: opts + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/modelJsonBpmn.api.ts b/lib/js-api/src/api/activiti-rest-api/api/modelJsonBpmn.api.ts new file mode 100644 index 0000000000..28c1fb611e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/modelJsonBpmn.api.ts @@ -0,0 +1,96 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +export class ModelJsonBpmnApi extends BaseApi { + /** + * Export a previous process definition model to a JSON + * + * @param processModelId processModelId + * @param processModelHistoryId processModelHistoryId + */ + getHistoricEditorDisplayJsonClient(processModelId: number, processModelHistoryId: number) { + throwIfNotDefined(processModelId, 'processModelId'); + throwIfNotDefined(processModelHistoryId, 'processModelHistoryId'); + + const pathParams = { + processModelId, + processModelHistoryId + }; + + return this.get({ + path: '/app/rest/models/{processModelId}/history/{processModelHistoryId}/model-json', + pathParams + }); + } + + /** + * Export a process definition model to a JSON + * + * @param processModelId processModelId + */ + getEditorDisplayJsonClient(processModelId: number) { + throwIfNotDefined(processModelId, 'processModelId'); + + const pathParams = { + processModelId + }; + + return this.get({ + path: '/app/rest/models/{processModelId}/model-json', + pathParams + }); + } + + /** + * Function to receive the result of the getModelJSONForProcessDefinition operation. + * + * @param processDefinitionId processDefinitionId + */ + getModelJSON(processDefinitionId: string) { + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + + const pathParams = { + processDefinitionId + }; + + return this.get({ + path: '/app/rest/process-definitions/{processDefinitionId}/model-json', + pathParams + }); + } + + /** + * Function to receive the result of the getModelHistoryJSON operation. + * + * @param processInstanceId processInstanceId + */ + getModelJSONForProcessDefinition(processInstanceId: string) { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/app/rest/process-instances/{processInstanceId}/model-json', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/models.api.ts b/lib/js-api/src/api/activiti-rest-api/api/models.api.ts new file mode 100644 index 0000000000..7b45da680c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/models.api.ts @@ -0,0 +1,314 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ModelRepresentation, ObjectNode, ResultListDataRepresentationModelRepresentation, ValidationErrorRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +export interface GetModelsQuery { + filter?: string; + sort?: string; + modelType?: number; + referenceId?: number; +} + +/** + * Models service. + */ +export class ModelsApi extends BaseApi { + /** + * Create a new model + * + * @param modelRepresentation modelRepresentation + * @return Promise<ModelRepresentation> + */ + createModel(modelRepresentation: ModelRepresentation): Promise<ModelRepresentation> { + throwIfNotDefined(modelRepresentation, 'modelRepresentation'); + + return this.post({ + path: '/api/enterprise/models', + bodyParam: modelRepresentation, + returnType: ModelRepresentation + }); + } + + /** + * Delete a model + * + * @param modelId modelId + * @param opts Optional parameters + * @param opts.cascade cascade + * @param opts.deleteRuntimeApp deleteRuntimeApp + * @return Promise<{}> + */ + deleteModel(modelId: number, opts?: { cascade?: boolean; deleteRuntimeApp?: boolean }): Promise<any> { + throwIfNotDefined(modelId, 'modelId'); + + const pathParams = { + modelId + }; + + const queryParams = { + cascade: opts?.cascade, + deleteRuntimeApp: opts?.deleteRuntimeApp + }; + + return this.delete({ + path: '/api/enterprise/models/{modelId}', + pathParams, + queryParams + }); + } + + /** + * Duplicate an existing model + * + * @param modelId modelId + * @param modelRepresentation modelRepresentation + * @return Promise<ModelRepresentation> + */ + duplicateModel(modelId: number, modelRepresentation: ModelRepresentation): Promise<ModelRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + throwIfNotDefined(modelRepresentation, 'modelRepresentation'); + + const pathParams = { + modelId + }; + + return this.post({ + path: '/api/enterprise/models/{modelId}/clone', + pathParams, + bodyParam: modelRepresentation, + returnType: ModelRepresentation + }); + } + + /** + * Get model content + * + * @param modelId modelId + * @return Promise<ObjectNode> + */ + getModelJSON(modelId: number): Promise<ObjectNode> { + throwIfNotDefined(modelId, 'modelId'); + + const pathParams = { + modelId + }; + + return this.get({ + path: '/api/enterprise/models/{modelId}/editor/json', + pathParams + }); + } + + /** + * Get a model's thumbnail image + * + * @param modelId modelId + * @return Promise<string> + */ + getModelThumbnail(modelId: number): Promise<string> { + throwIfNotDefined(modelId, 'modelId'); + + const pathParams = { + modelId + }; + + return this.get({ + path: '/api/enterprise/models/{modelId}/thumbnail', + pathParams, + accepts: ['image/png'] + }); + } + + /** + * Get a model + * + * Models act as containers for process, form, decision table and app definitions + * + * @param modelId modelId + * @param opts Optional parameters + * @return Promise<ModelRepresentation> + */ + getModel(modelId: number, opts?: { includePermissions?: boolean }): Promise<ModelRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + + const pathParams = { + modelId + }; + + const queryParams = { + includePermissions: opts?.includePermissions + }; + + return this.get({ + path: '/api/enterprise/models/{modelId}', + pathParams, + queryParams, + returnType: ModelRepresentation + }); + } + + /** + * List process definition models shared with the current user + * + * @return Promise<ResultListDataRepresentationModelRepresentation> + */ + getModelsToIncludeInAppDefinition(): Promise<ResultListDataRepresentationModelRepresentation> { + return this.get({ + path: '/api/enterprise/models-for-app-definition', + returnType: ResultListDataRepresentationModelRepresentation + }); + } + + /** + * List models (process, form, decision rule or app) + * + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationModelRepresentation> + */ + getModels(opts?: GetModelsQuery): Promise<ResultListDataRepresentationModelRepresentation> { + return this.get({ + path: '/api/enterprise/models', + queryParams: opts, + returnType: ResultListDataRepresentationModelRepresentation + }); + } + + /** + * Create a new version of a model + * + * @param modelId modelId + * @param file file + * @return Promise<ModelRepresentation> + */ + importNewVersion(modelId: number, file: any): Promise<ModelRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + throwIfNotDefined(file, 'file'); + + const pathParams = { + modelId + }; + + const formParams = { + file + }; + + return this.post({ + path: '/api/enterprise/models/{modelId}/newversion', + pathParams, + formParams, + contentTypes: ['multipart/form-data'], + returnType: ModelRepresentation + }); + } + + /** + * Import a BPMN 2.0 XML file + * + * @param file file + * @return Promise<ModelRepresentation> + */ + importProcessModel(file: any): Promise<ModelRepresentation> { + throwIfNotDefined(file, 'file'); + + const formParams = { + file + }; + + return this.post({ + path: '/api/enterprise/process-models/import', + contentTypes: ['multipart/form-data'], + formParams, + returnType: ModelRepresentation + }); + } + + /** + * Update model content + * + * @param modelId modelId + * @param values values + * @return Promise<ModelRepresentation> + */ + saveModel(modelId: number, values: any): Promise<ModelRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + throwIfNotDefined(values, 'values'); + + const pathParams = { + modelId + }; + + return this.post({ + path: '/api/enterprise/models/{modelId}/editor/json', + pathParams, + bodyParam: values, + returnType: ModelRepresentation + }); + } + + /** + * Update a model + * + * This method allows you to update the metadata of a model. In order to update the content of the model you will need to call the specific endpoint for that model type. + * + * @param modelId modelId + * @param updatedModel updatedModel + * @return Promise<ModelRepresentation> + */ + updateModel(modelId: number, updatedModel: ModelRepresentation): Promise<ModelRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + throwIfNotDefined(updatedModel, 'updatedModel'); + + const pathParams = { + modelId + }; + + return this.put({ + path: '/api/enterprise/models/{modelId}', + pathParams, + bodyParam: updatedModel, + returnType: ModelRepresentation + }); + } + + /** + * Validate model content + * + * @param modelId modelId + * @param opts Optional parameters + * @param opts.values values + * @return Promise<ValidationErrorRepresentation> + */ + validateModel(modelId: number, opts?: { values?: any }): Promise<ValidationErrorRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + + const postBody = opts?.values; + + const pathParams = { + modelId + }; + + return this.post({ + path: '/api/enterprise/models/{modelId}/editor/validate', + pathParams, + bodyParam: postBody, + contentTypes: ['application/x-www-form-urlencoded'] + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/modelsBpmn.api.ts b/lib/js-api/src/api/activiti-rest-api/api/modelsBpmn.api.ts new file mode 100644 index 0000000000..a50f448bcc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/modelsBpmn.api.ts @@ -0,0 +1,71 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * ModelsBpmnApi service. + */ +export class ModelsBpmnApi extends BaseApi { + /** + * Export a historic version of a process definition as BPMN 2.0 XML + * + * @param processModelId processModelId + * @param processModelHistoryId processModelHistoryId + * @return Promise<{}> + */ + getHistoricProcessModelBpmn20Xml(processModelId: number, processModelHistoryId: number): Promise<any> { + throwIfNotDefined(processModelId, 'processModelId'); + throwIfNotDefined(processModelHistoryId, 'processModelHistoryId'); + + const pathParams = { + processModelId, + processModelHistoryId + }; + + const accepts = ['application/xml']; + + return this.get({ + path: '/api/enterprise/models/{processModelId}/history/{processModelHistoryId}/bpmn20', + pathParams, + accepts + }); + } + + /** + * Export a process definition as BPMN 2.0 XML + * + * @param processModelId processModelId + * @return Promise<{}> + */ + getProcessModelBpmn20Xml(processModelId: number): Promise<any> { + throwIfNotDefined(processModelId, 'processModelId'); + + const pathParams = { + processModelId + }; + + const accepts = ['application/xml']; + + return this.get({ + path: '/api/enterprise/models/{processModelId}/bpmn20', + pathParams, + accepts + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/modelsHistory.api.ts b/lib/js-api/src/api/activiti-rest-api/api/modelsHistory.api.ts new file mode 100644 index 0000000000..b1a7a55e52 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/modelsHistory.api.ts @@ -0,0 +1,76 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ModelRepresentation } from '../model/modelRepresentation'; +import { ResultListDataRepresentationModelRepresentation } from '../model/resultListDataRepresentationModelRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * ModelsHistoryApi service. + */ +export class ModelsHistoryApi extends BaseApi { + /** + * List a model's historic versions + * + * @param modelId modelId + * @param opts Optional parameters + * @param opts.includeLatestVersion includeLatestVersion + * @return Promise<ResultListDataRepresentationModelRepresentation> + */ + getModelHistoryCollection(modelId: number, opts?: { includeLatestVersion?: boolean }): Promise<ResultListDataRepresentationModelRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + + const pathParams = { + modelId + }; + + const queryParams = { + includeLatestVersion: opts?.includeLatestVersion + }; + + return this.get({ + path: '/api/enterprise/models/{modelId}/history', + pathParams, + queryParams, + returnType: ResultListDataRepresentationModelRepresentation + }); + } + + /** + * Get a historic version of a model + * + * @param modelId modelId + * @param modelHistoryId modelHistoryId + * @return Promise<ModelRepresentation> + */ + getProcessModelHistory(modelId: number, modelHistoryId: number): Promise<ModelRepresentation> { + throwIfNotDefined(modelId, 'modelId'); + throwIfNotDefined(modelHistoryId, 'modelHistoryId'); + + const pathParams = { + modelId, + modelHistoryId + }; + + return this.get({ + path: '/api/enterprise/models/{modelId}/history/{modelHistoryId}', + pathParams, + returnType: ModelRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/processDefinitions.api.ts b/lib/js-api/src/api/activiti-rest-api/api/processDefinitions.api.ts new file mode 100644 index 0000000000..aa4fc5f759 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/processDefinitions.api.ts @@ -0,0 +1,259 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + FormDefinitionRepresentation, + FormValueRepresentation, + IdentityLinkRepresentation, + ResultListDataRepresentationProcessDefinitionRepresentation, + ResultListDataRepresentationRuntimeDecisionTableRepresentation, + ResultListDataRepresentationRuntimeFormRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * ProcessDefinitionsApi service. + */ +export class ProcessDefinitionsApi extends BaseApi { + /** + * Add a user or group involvement to a process definition + * + * @param processDefinitionId processDefinitionId + * @param identityLinkRepresentation identityLinkRepresentation + * @return Promise<IdentityLinkRepresentation> + */ + createIdentityLink(processDefinitionId: string, identityLinkRepresentation: IdentityLinkRepresentation): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + throwIfNotDefined(identityLinkRepresentation, 'identityLinkRepresentation'); + + const pathParams = { + processDefinitionId + }; + + return this.post({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/identitylinks', + pathParams, + bodyParam: identityLinkRepresentation + }); + } + + /** + * Remove a user or group involvement from a process definition + * + * @param processDefinitionId Process definition ID + * @param family Identity type + * @param identityId User or group ID + * @return Promise<{}> + */ + deleteIdentityLink(processDefinitionId: string, family: string, identityId: string): Promise<void> { + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + throwIfNotDefined(family, 'family'); + throwIfNotDefined(identityId, 'identityId'); + + const pathParams = { + processDefinitionId, + family, + identityId + }; + + return this.delete({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/identitylinks/{family}/{identityId}', + pathParams + }); + } + + /** + * Get a user or group involvement with a process definition + * + * @param processDefinitionId Process definition ID + * @param family Identity type + * @param identityId User or group ID + * @return Promise<IdentityLinkRepresentation> + */ + getIdentityLinkType(processDefinitionId: string, family: string, identityId: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + throwIfNotDefined(family, 'family'); + throwIfNotDefined(identityId, 'identityId'); + + const pathParams = { + processDefinitionId, + family, + identityId + }; + + return this.get({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/identitylinks/{family}/{identityId}', + pathParams + }); + } + + /** + * List either the users or groups involved with a process definition + * + * @param processDefinitionId processDefinitionId + * @param family Identity type + * @return Promise<IdentityLinkRepresentation> + */ + getIdentityLinksForFamily(processDefinitionId: string, family: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + throwIfNotDefined(family, 'family'); + + const pathParams = { + processDefinitionId, + family + }; + + return this.get({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/identitylinks/{family}', + pathParams + }); + } + + /** + * List the users and groups involved with a process definition + * + * @param processDefinitionId processDefinitionId + * @return Promise<IdentityLinkRepresentation> + */ + getIdentityLinks(processDefinitionId: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + + const pathParams = { + processDefinitionId + }; + + return this.get({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/identitylinks', + pathParams + }); + } + + /** + * List the decision tables associated with a process definition + * + * @param processDefinitionId processDefinitionId + * @return Promise<ResultListDataRepresentationRuntimeDecisionTableRepresentation> + */ + getProcessDefinitionDecisionTables(processDefinitionId: string): Promise<ResultListDataRepresentationRuntimeDecisionTableRepresentation> { + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + + const pathParams = { + processDefinitionId + }; + + return this.get({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/decision-tables', + pathParams + }); + } + + /** + * List the forms associated with a process definition + * + * @param processDefinitionId processDefinitionId + * @return Promise<ResultListDataRepresentationRuntimeFormRepresentation> + */ + getProcessDefinitionForms(processDefinitionId: string): Promise<ResultListDataRepresentationRuntimeFormRepresentation> { + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + + const pathParams = { + processDefinitionId + }; + + return this.get({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/forms', + pathParams + }); + } + + /** + * Retrieve the start form for a process definition + * + * @param processDefinitionId processDefinitionId + * @return Promise<FormDefinitionRepresentation> + */ + getProcessDefinitionStartForm(processDefinitionId: string): Promise<FormDefinitionRepresentation> { + const pathParams = { + processDefinitionId + }; + + return this.get({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/start-form', + pathParams + }); + } + + /** + * Retrieve a list of process definitions + * + * Get a list of process definitions (visible within the tenant of the user) + * + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationProcessDefinitionRepresentation> + */ + getProcessDefinitions(opts?: { + latest?: boolean; + appDefinitionId?: number; + deploymentId?: string; + }): Promise<ResultListDataRepresentationProcessDefinitionRepresentation> { + return this.get({ + path: '/api/enterprise/process-definitions', + queryParams: opts + }); + } + + /** + * Retrieve field values (e.g. the typeahead field) + * + * @param processDefinitionId processDefinitionId + * @param field field + * @return Promise<FormValueRepresentation[]> + */ + getRestFieldValues(processDefinitionId: string, field: string): Promise<FormValueRepresentation[]> { + const pathParams = { + processDefinitionId, + field + }; + + return this.get({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/start-form-values/{field}', + pathParams + }); + } + + /** + * Retrieve field values (eg. the table field) + * + * @param processDefinitionId processDefinitionId + * @param field field + * @param column column + * @return Promise<FormValueRepresentation []> + */ + getRestTableFieldValues(processDefinitionId: string, field: string, column: string): Promise<FormValueRepresentation[]> { + const pathParams = { + processDefinitionId, + field, + column + }; + + return this.get({ + path: '/api/enterprise/process-definitions/{processDefinitionId}/start-form-values/{field}/{column}', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/processInstanceVariables.api.ts b/lib/js-api/src/api/activiti-rest-api/api/processInstanceVariables.api.ts new file mode 100644 index 0000000000..1be12fde32 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/processInstanceVariables.api.ts @@ -0,0 +1,135 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RestVariable } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * ProcessInstanceVariablesApi service. + */ +export class ProcessInstanceVariablesApi extends BaseApi { + /** + * Create or update variables + * + * @param processInstanceId Process instance ID + * @param restVariables restVariables + * @return Promise<RestVariable> + */ + createOrUpdateProcessInstanceVariables(processInstanceId: string, restVariables: RestVariable[]): Promise<RestVariable[]> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(restVariables, 'restVariables'); + + const pathParams = { + processInstanceId + }; + + return this.put({ + path: '/api/enterprise/process-instances/{processInstanceId}/variables', + pathParams, + bodyParam: restVariables + }); + } + + /** + * Delete a variable + * + * @param processInstanceId processInstanceId + * @param variableName variableName + * @return Promise<{}> + */ + deleteProcessInstanceVariable(processInstanceId: string, variableName: string): Promise<void> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(variableName, 'variableName'); + + const pathParams = { + processInstanceId, + variableName + }; + + return this.delete({ + path: '/api/enterprise/process-instances/{processInstanceId}/variables/{variableName}', + pathParams + }); + } + + /** + * Get a variable + * + * @param processInstanceId processInstanceId + * @param variableName variableName + * @return Promise<RestVariable> + */ + getProcessInstanceVariable(processInstanceId: string, variableName: string): Promise<RestVariable> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(variableName, 'variableName'); + + const pathParams = { + processInstanceId, + variableName + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/variables/{variableName}', + pathParams + }); + } + + /** + * List variables + * + * @param processInstanceId Process instance ID + * @return Promise<RestVariable> + */ + getProcessInstanceVariables(processInstanceId: string): Promise<RestVariable[]> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/variables', + pathParams + }); + } + + /** + * Update a variable + * + * @param processInstanceId processInstanceId + * @param variableName variableName + * @param restVariable restVariable + * @return Promise<RestVariable> + */ + updateProcessInstanceVariable(processInstanceId: string, variableName: string, restVariable: RestVariable): Promise<RestVariable> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(variableName, 'variableName'); + throwIfNotDefined(restVariable, 'restVariable'); + + const pathParams = { + processInstanceId, + variableName + }; + + return this.put({ + path: '/api/enterprise/process-instances/{processInstanceId}/variables/{variableName}', + pathParams, + bodyParam: restVariable + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/processInstances.api.ts b/lib/js-api/src/api/activiti-rest-api/api/processInstances.api.ts new file mode 100644 index 0000000000..26cc59a11d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/processInstances.api.ts @@ -0,0 +1,453 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + CreateProcessInstanceRepresentation, + FormDefinitionRepresentation, + HistoricProcessInstanceQueryRepresentation, + IdentityLinkRepresentation, + ProcessInstanceAuditInfoRepresentation, + ProcessInstanceFilterRequestRepresentation, + ProcessInstanceQueryRepresentation, + ProcessInstanceRepresentation, + ProcessInstanceVariableRepresentation, + ResultListDataRepresentationDecisionTaskRepresentation, + ResultListDataRepresentationProcessContentRepresentation, + ResultListDataRepresentationProcessInstanceRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Process Instances service. + */ +export class ProcessInstancesApi extends BaseApi { + /** + * Activate a process instance + * + * @param processInstanceId processInstanceId + * @return Promise<ProcessInstanceRepresentation> + */ + activateProcessInstance(processInstanceId: string): Promise<ProcessInstanceRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.put({ + path: '/api/enterprise/process-instances/{processInstanceId}/activate', + pathParams, + returnType: ProcessInstanceRepresentation + }); + } + + /** + * Add a user or group involvement to a process instance + * + * @param processInstanceId processInstanceId + * @param identityLinkRepresentation identityLinkRepresentation + * @return Promise<IdentityLinkRepresentation> + */ + createIdentityLink(processInstanceId: string, identityLinkRepresentation: IdentityLinkRepresentation): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(identityLinkRepresentation, 'identityLinkRepresentation'); + + const pathParams = { + processInstanceId + }; + + return this.post({ + path: '/api/enterprise/process-instances/{processInstanceId}/identitylinks', + pathParams, + bodyParam: identityLinkRepresentation + }); + } + + /** + * Remove a user or group involvement from a process instance + * + * @param processInstanceId processInstanceId + * @param family family + * @param identityId identityId + * @param type type + * @return Promise<{}> + */ + deleteIdentityLink(processInstanceId: string, family: string, identityId: string, type: string): Promise<void> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(family, 'family'); + throwIfNotDefined(identityId, 'identityId'); + throwIfNotDefined(type, 'type'); + + const pathParams = { + processInstanceId, + family, + identityId, + type + }; + + return this.delete({ + path: '/api/enterprise/process-instances/{processInstanceId}/identitylinks/{family}/{identityId}/{type}', + pathParams + }); + } + + /** + * Cancel or remove a process instance + * + * If the process instance has not yet been completed, it will be cancelled. If it has already finished or been cancelled then the process instance will be removed and will no longer appear in queries. + * + * @param processInstanceId processInstanceId + * @return Promise<{}> + */ + deleteProcessInstance(processInstanceId: string): Promise<void> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.delete({ + path: '/api/enterprise/process-instances/{processInstanceId}', + pathParams + }); + } + + /** + * List process instances using a filter + * + * The request body provided must define either a valid filterId value or filter object + * + * @param filterRequest filterRequest + * @return Promise<ResultListDataRepresentationProcessInstanceRepresentation> + */ + filterProcessInstances( + filterRequest: ProcessInstanceFilterRequestRepresentation + ): Promise<ResultListDataRepresentationProcessInstanceRepresentation> { + throwIfNotDefined(filterRequest, 'filterRequest'); + + return this.post({ + path: '/api/enterprise/process-instances/filter', + bodyParam: filterRequest, + returnType: ResultListDataRepresentationProcessInstanceRepresentation + }); + } + + /** + * Get decision tasks in a process instance + * + * @param processInstanceId processInstanceId + * @return Promise<ResultListDataRepresentationDecisionTaskRepresentation> + */ + getHistoricProcessInstanceDecisionTasks(processInstanceId: string): Promise<ResultListDataRepresentationDecisionTaskRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/decision-tasks', + pathParams, + returnType: ResultListDataRepresentationDecisionTaskRepresentation + }); + } + + /** + * Get historic variables for a process instance + * + * @param processInstanceId processInstanceId + * @return Promise<ProcessInstanceVariableRepresentation> + */ + getHistoricProcessInstanceVariables(processInstanceId: string): Promise<ProcessInstanceVariableRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/historic-variables', + pathParams + }); + } + + /** + * Query historic process instances + * + * @param queryRequest queryRequest + * @return Promise<ResultListDataRepresentationProcessInstanceRepresentation> + */ + getHistoricProcessInstances( + queryRequest: HistoricProcessInstanceQueryRepresentation + ): Promise<ResultListDataRepresentationProcessInstanceRepresentation> { + throwIfNotDefined(queryRequest, 'queryRequest'); + + return this.post({ + path: '/api/enterprise/historic-process-instances/query', + bodyParam: queryRequest, + returnType: ResultListDataRepresentationProcessInstanceRepresentation + }); + } + + /** + * Get a user or group involvement with a process instance + * + * @param processInstanceId processInstanceId + * @param family family + * @param identityId identityId + * @param type type + * @return Promise<IdentityLinkRepresentation> + */ + getIdentityLinkType(processInstanceId: string, family: string, identityId: string, type: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(family, 'family'); + throwIfNotDefined(identityId, 'identityId'); + throwIfNotDefined(type, 'type'); + + const pathParams = { + processInstanceId, + family, + identityId, + type + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/identitylinks/{family}/{identityId}/{type}', + pathParams + }); + } + + /** + * List either the users or groups involved with a process instance + * + * @param processInstanceId processInstanceId + * @param family family + * @return Promise<IdentityLinkRepresentation> + */ + getIdentityLinksForFamily(processInstanceId: string, family: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + throwIfNotDefined(family, 'family'); + + const pathParams = { + processInstanceId, + family + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/identitylinks/{family}', + pathParams + }); + } + + /** + * List the users and groups involved with a process instance + * + * @param processInstanceId processInstanceId + * @return Promise<IdentityLinkRepresentation> + */ + getIdentityLinks(processInstanceId: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/identitylinks', + pathParams + }); + } + + /** + * List content attached to process instance fields + * + * @param processInstanceId processInstanceId + * @return Promise<ResultListDataRepresentationProcessContentRepresentation> + */ + getProcessInstanceContent(processInstanceId: string): Promise<ResultListDataRepresentationProcessContentRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/field-content', + pathParams, + returnType: ResultListDataRepresentationProcessContentRepresentation + }); + } + + /** + * Get the process diagram for the process instance + * + * @param processInstanceId processInstanceId + * @return Promise<string> + */ + getProcessInstanceDiagram(processInstanceId: string): Promise<string> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + const accepts = ['image/png']; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/diagram', + pathParams, + accepts + }); + } + + /** + * Get a process instance start form + * + * The start form for a process instance can be retrieved when the process definition has a start form defined (hasStartForm = true on the process instance) + * + * @param processInstanceId processInstanceId + * @return Promise<FormDefinitionRepresentation> + */ + getProcessInstanceStartForm(processInstanceId: string): Promise<FormDefinitionRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/start-form', + pathParams + }); + } + + /** + * Get a process instance + * + * @param processInstanceId processInstanceId + * @return Promise<ProcessInstanceRepresentation> + */ + getProcessInstance(processInstanceId: string): Promise<ProcessInstanceRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}', + pathParams, + returnType: ProcessInstanceRepresentation + }); + } + + /** + * Query process instances + * + * @param processInstancesQuery processInstancesQuery + * @return Promise<ResultListDataRepresentationProcessInstanceRepresentation> + */ + getProcessInstances( + processInstancesQuery: ProcessInstanceQueryRepresentation + ): Promise<ResultListDataRepresentationProcessInstanceRepresentation> { + throwIfNotDefined(processInstancesQuery, 'processInstancesQuery'); + + return this.post({ + path: '/api/enterprise/process-instances/query', + bodyParam: processInstancesQuery, + returnType: ResultListDataRepresentationProcessInstanceRepresentation + }); + } + + /** + * Get the audit log for a process instance + * + * @param processInstanceId processInstanceId + * @return Promise<ProcessInstanceAuditInfoRepresentation> + */ + getTaskAuditLog(processInstanceId: string): Promise<ProcessInstanceAuditInfoRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.get({ + path: '/api/enterprise/process-instances/{processInstanceId}/audit-log', + pathParams + }); + } + + /** + * Retrieve the process audit in the PDF format + * + * @param processInstanceId processId + * @returns process audit + */ + getProcessAuditPdf(processInstanceId: string): Promise<Blob> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + const responseType = 'blob'; + + return this.get({ + path: '/app/rest/process-instances/{processInstanceId}/audit', + pathParams, + responseType + }); + } + + /** + * Start a process instance + * + * @param startRequest startRequest + * @return Promise<ProcessInstanceRepresentation> + */ + startNewProcessInstance(startRequest: CreateProcessInstanceRepresentation): Promise<ProcessInstanceRepresentation> { + throwIfNotDefined(startRequest, 'startRequest'); + + return this.post({ + path: '/api/enterprise/process-instances', + bodyParam: startRequest, + returnType: ProcessInstanceRepresentation + }); + } + + /** + * Suspend a process instance + * + * @param processInstanceId processInstanceId + * @return Promise<ProcessInstanceRepresentation> + */ + suspendProcessInstance(processInstanceId: string): Promise<ProcessInstanceRepresentation> { + throwIfNotDefined(processInstanceId, 'processInstanceId'); + + const pathParams = { + processInstanceId + }; + + return this.put({ + path: '/api/enterprise/process-instances/{processInstanceId}/suspend', + pathParams, + returnType: ProcessInstanceRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/processScopes.api.ts b/lib/js-api/src/api/activiti-rest-api/api/processScopes.api.ts new file mode 100644 index 0000000000..661b8cc2bb --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/processScopes.api.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProcessScopeRepresentation, ProcessScopesRequestRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * ProcessScopesApi service. + */ +export class ProcessScopesApi extends BaseApi { + /** + * List runtime process scopes + * + * @param processScopesRequest processScopesRequest + * @return Promise<ProcessScopeRepresentation> + */ + getRuntimeProcessScopes(processScopesRequest: ProcessScopesRequestRepresentation): Promise<ProcessScopeRepresentation> { + throwIfNotDefined(processScopesRequest, 'processScopesRequest'); + + return this.post({ + path: '/api/enterprise/process-scopes', + bodyParam: processScopesRequest + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/report.api.ts b/lib/js-api/src/api/activiti-rest-api/api/report.api.ts new file mode 100755 index 0000000000..7bf02c1183 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/report.api.ts @@ -0,0 +1,172 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +export class ReportApi extends BaseApi { + /** + * Create the default reports + */ + createDefaultReports() { + return this.post({ + path: '/app/rest/reporting/default-reports' + }); + } + + getTasksByProcessDefinitionId(reportId: string, processDefinitionId: string) { + throwIfNotDefined(reportId, 'reportId'); + throwIfNotDefined(processDefinitionId, 'processDefinitionId'); + + const pathParams = { + reportId + }; + const queryParams = { + processDefinitionId + }; + + return this.get({ + path: '/app/rest/reporting/report-params/{reportId}/tasks', + pathParams, + queryParams + }); + } + + getReportsByParams(reportId: string, bodyParam: any) { + throwIfNotDefined(reportId, 'reportId'); + + const pathParams = { + reportId + }; + + return this.post({ + path: '/app/rest/reporting/report-params/{reportId}', + pathParams, + bodyParam + }); + } + + getProcessDefinitions() { + return this.get({ + path: '/app/rest/reporting/process-definitions' + }); + } + + getReportParams(reportId: string) { + throwIfNotDefined(reportId, 'reportId'); + + const pathParams = { + reportId + }; + + return this.get({ + path: '/app/rest/reporting/report-params/{reportId}', + pathParams + }); + } + + getReportList() { + return this.get({ + path: '/app/rest/reporting/reports' + }); + } + + updateReport(reportId: string, name: string) { + throwIfNotDefined(reportId, 'reportId'); + + const postBody = { + name + }; + + const pathParams = { + reportId + }; + + return this.put({ + path: '/app/rest/reporting/reports/{reportId}', + pathParams, + bodyParam: postBody + }); + } + + /** + * Export a report + * + * @param reportId report id + * @param bodyParam body parameters + */ + exportToCsv(reportId: string, bodyParam: { reportName?: string }) { + throwIfNotDefined(reportId, 'reportId'); + throwIfNotDefined(bodyParam, 'bodyParam'); + throwIfNotDefined(bodyParam.reportName, 'reportName'); + + const pathParams = { + reportId + }; + + return this.post({ + path: '/app/rest/reporting/reports/{reportId}/export-to-csv', + pathParams, + bodyParam + }); + } + + /** + * Save a report + * + * @param reportId report id + * @param opts Optional parameters + */ + saveReport(reportId: string, opts: { reportName?: string }) { + throwIfNotDefined(reportId, 'reportId'); + throwIfNotDefined(opts, 'opts'); + throwIfNotDefined(opts.reportName, 'reportName'); + + const bodyParam = { + reportName: opts.reportName, + __reportName: opts.reportName + }; + + const pathParams = { + reportId + }; + + return this.post({ + path: '/app/rest/reporting/reports/{reportId}', + pathParams, + bodyParam + }); + } + + /** + * Delete a report + * + * @param reportId report id + */ + deleteReport(reportId: string) { + throwIfNotDefined(reportId, 'reportId'); + + const pathParams = { + reportId + }; + + return this.delete({ + path: '/app/rest/reporting/reports/{reportId}', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/runtimeAppDefinitions.api.ts b/lib/js-api/src/api/activiti-rest-api/api/runtimeAppDefinitions.api.ts new file mode 100644 index 0000000000..e240e596c1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/runtimeAppDefinitions.api.ts @@ -0,0 +1,78 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + AppDefinitionRepresentation, + ResultListDataRepresentationAppDefinitionRepresentation, + RuntimeAppDefinitionSaveRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * RuntimeAppDefinitionsApi service. + */ +export class RuntimeAppDefinitionsApi extends BaseApi { + /** + * Deploy a published app + * + * Deploying an app allows the user to see it on his/her landing page. Apps must be published before they can be deployed. + * + * @param saveObject saveObject + * @return Promise<{}> + */ + deployAppDefinitions(saveObject: RuntimeAppDefinitionSaveRepresentation): Promise<any> { + throwIfNotDefined(saveObject, 'saveObject'); + + return this.post({ + path: '/api/enterprise/runtime-app-definitions', + bodyParam: saveObject + }); + } + + /** + * Get a runtime app + * + * @param appDefinitionId appDefinitionId + * @return Promise<AppDefinitionRepresentation> + */ + getAppDefinition(appDefinitionId: number): Promise<AppDefinitionRepresentation> { + throwIfNotDefined(appDefinitionId, 'appDefinitionId'); + + const pathParams = { + appDefinitionId + }; + + return this.get({ + path: '/api/enterprise/runtime-app-definitions/{appDefinitionId}', + pathParams + }); + } + + /** + * List runtime apps + * + * When a user logs in into Alfresco Process Services Suite, a landing page is displayed containing all the apps that the user is allowed to see and use. These are referred to as runtime apps. + * + * @return Promise<ResultListDataRepresentationAppDefinitionRepresentation> + */ + getAppDefinitions(): Promise<ResultListDataRepresentationAppDefinitionRepresentation> { + return this.get({ + path: '/api/enterprise/runtime-app-definitions' + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/runtimeAppDeployments.api.ts b/lib/js-api/src/api/activiti-rest-api/api/runtimeAppDeployments.api.ts new file mode 100644 index 0000000000..4a7b9a7a92 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/runtimeAppDeployments.api.ts @@ -0,0 +1,124 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppDeploymentRepresentation } from '../model/appDeploymentRepresentation'; +import { ResultListDataRepresentationAppDeploymentRepresentation } from '../model/resultListDataRepresentationAppDeploymentRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * RuntimeAppDeploymentsApi service. + */ +export class RuntimeAppDeploymentsApi extends BaseApi { + /** + * Remove an app deployment + * + * @param appDeploymentId appDeploymentId + * @return Promise<{}> + */ + deleteAppDeployment(appDeploymentId: number): Promise<any> { + throwIfNotDefined(appDeploymentId, 'appDeploymentId'); + + const pathParams = { + appDeploymentId + }; + + return this.delete({ + path: '/api/enterprise/runtime-app-deployments/{appDeploymentId}', + pathParams + }); + } + + /** + * Export the app archive for a deployment + * + * @param deploymentId deploymentId + * @return Promise<{}> + */ + exportAppDefinition(deploymentId: string): Promise<any> { + throwIfNotDefined(deploymentId, 'deploymentId'); + + const pathParams = { + deploymentId + }; + + const accepts = ['application/zip']; + + return this.get({ + path: '/api/enterprise/export-app-deployment/{deploymentId}', + pathParams, + accepts + }); + } + + /** + * Query app deployments + * + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationAppDeploymentRepresentation> + */ + getAppDefinitions(opts?: { + nameLike?: string; + tenantId?: number; + latest?: boolean; + start?: number; + sort?: string; + order?: string; + size?: number; + }): Promise<ResultListDataRepresentationAppDeploymentRepresentation> { + return this.get({ + path: '/api/enterprise/runtime-app-deployments', + queryParams: opts, + returnType: ResultListDataRepresentationAppDeploymentRepresentation + }); + } + + /** + * Get an app deployment + * + * @param appDeploymentId appDeploymentId + * @return Promise<AppDeploymentRepresentation> + */ + getAppDeployment(appDeploymentId: number): Promise<AppDeploymentRepresentation> { + throwIfNotDefined(appDeploymentId, 'appDeploymentId'); + + const pathParams = { + appDeploymentId + }; + + return this.get({ + path: '/api/enterprise/runtime-app-deployments/{appDeploymentId}', + pathParams, + returnType: AppDeploymentRepresentation + }); + } + + /** + * Get an app by deployment ID or DMN deployment ID + * Either a deploymentId or a dmnDeploymentId must be provided + * + * @param opts Optional parameters + * @return Promise<AppDeploymentRepresentation> + */ + getRuntimeAppDeploymentByDeployment(opts?: { deploymentId?: string; dmnDeploymentId?: number }): Promise<AppDeploymentRepresentation> { + return this.get({ + path: '/api/enterprise/runtime-app-deployment', + queryParams: opts, + returnType: AppDeploymentRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/scriptFiles.api.ts b/lib/js-api/src/api/activiti-rest-api/api/scriptFiles.api.ts new file mode 100644 index 0000000000..36d736845f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/scriptFiles.api.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; + +/** + * ScriptFilesApi service. + */ +export class ScriptFilesApi extends BaseApi { + /** + * getControllers + * + * @returns Promise<string> + */ + getControllers(): Promise<string> { + const accepts = ['text/html']; + + return this.get({ + path: '/api/enterprise/script-files/controllers', + accepts + }); + } + + /** + * getLibraries + * + * @returns Promise<string> + */ + getLibraries(): Promise<string> { + const accepts = ['text/html']; + + return this.get({ + path: '/api/enterprise/script-files/libraries', + accepts + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/submittedForms.api.ts b/lib/js-api/src/api/activiti-rest-api/api/submittedForms.api.ts new file mode 100644 index 0000000000..2a1a523d69 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/submittedForms.api.ts @@ -0,0 +1,111 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultListDataRepresentationSubmittedFormRepresentation } from '../model/resultListDataRepresentationSubmittedFormRepresentation'; +import { SubmittedFormRepresentation } from '../model/submittedFormRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * SubmittedFormsApi service. + */ +export class SubmittedFormsApi extends BaseApi { + /** + * List submissions for a form + * + * @param formId formId + * @param opts Optional parameters + * @return Promise<ResultListDataRepresentationSubmittedFormRepresentation> + */ + getFormSubmittedForms( + formId: number, + opts?: { submittedBy?: number; start?: number; size?: number } + ): Promise<ResultListDataRepresentationSubmittedFormRepresentation> { + throwIfNotDefined(formId, 'formId'); + + const pathParams = { + formId + }; + + return this.get({ + path: '/api/enterprise/form-submitted-forms/{formId}', + pathParams, + queryParams: opts, + returnType: ResultListDataRepresentationSubmittedFormRepresentation + }); + } + + /** + * List submissions for a process instance + * + * @param processId processId + * @return Promise<ResultListDataRepresentationSubmittedFormRepresentation> + */ + getProcessSubmittedForms(processId: string): Promise<ResultListDataRepresentationSubmittedFormRepresentation> { + throwIfNotDefined(processId, 'processId'); + + const pathParams = { + processId + }; + + return this.get({ + path: '/api/enterprise/process-submitted-forms/{processId}', + pathParams, + returnType: ResultListDataRepresentationSubmittedFormRepresentation + }); + } + + /** + * Get a form submission + * + * @param submittedFormId submittedFormId + * @return Promise<SubmittedFormRepresentation> + */ + getSubmittedFrom(submittedFormId: number): Promise<SubmittedFormRepresentation> { + throwIfNotDefined(submittedFormId, 'submittedFormId'); + + const pathParams = { + submittedFormId + }; + + return this.get({ + path: '/api/enterprise/submitted-forms/{submittedFormId}', + pathParams, + returnType: SubmittedFormRepresentation + }); + } + + /** + * Get the submitted form for a task + * + * @param taskId taskId + * @return Promise<SubmittedFormRepresentation> + */ + getTaskSubmittedForms(taskId: string): Promise<SubmittedFormRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/task-submitted-form/{taskId}', + pathParams, + returnType: SubmittedFormRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/systemProperties.api.ts b/lib/js-api/src/api/activiti-rest-api/api/systemProperties.api.ts new file mode 100644 index 0000000000..24b768c881 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/systemProperties.api.ts @@ -0,0 +1,95 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GlobalDateFormatRepresentation, PasswordValidationConstraints, SystemPropertiesRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * SystemPropertiesApi service. + */ +export class SystemPropertiesApi extends BaseApi { + /** + * Get global date format + * + * @param tenantId tenantId + * @return Promise<GlobalDateFormatRepresentation> + */ + getGlobalDateFormat(tenantId: number): Promise<GlobalDateFormatRepresentation> { + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/system/properties/global-date-format/{tenantId}', + pathParams + }); + } + + /** + * Get password validation constraints + * + * @param tenantId tenantId + * @return Promise<PasswordValidationConstraints> + */ + getPasswordValidationConstraints(tenantId: number): Promise<PasswordValidationConstraints> { + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/system/properties/password-validation-constraints/{tenantId}', + pathParams + }); + } + + /** + * Retrieve system properties + * + * Typical value is AllowInvolveByEmail + * + * @return Promise<SystemPropertiesRepresentation> + */ + getProperties(): Promise<SystemPropertiesRepresentation> { + return this.get({ + path: '/api/enterprise/system/properties' + }); + } + + /** + * Get involved users who can edit forms + * + * @param tenantId tenantId + * @return Promise<boolean> + */ + involvedUsersCanEditForms(tenantId: number): Promise<boolean> { + throwIfNotDefined(tenantId, 'tenantId'); + + const pathParams = { + tenantId + }; + + return this.get({ + path: '/api/enterprise/system/properties/involved-users-can-edit-forms/{tenantId}', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/taskActions.api.ts b/lib/js-api/src/api/activiti-rest-api/api/taskActions.api.ts new file mode 100644 index 0000000000..3249f91255 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/taskActions.api.ts @@ -0,0 +1,269 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AssigneeIdentifierRepresentation, FormIdentifierRepresentation, TaskRepresentation, UserIdentifierRepresentation } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * TaskActionsApi service. + */ +export class TaskActionsApi extends BaseApi { + /** + * Assign a task to a user + * + * @param taskId taskId + * @param userIdentifier userIdentifier + * @return Promise<TaskRepresentation> + */ + assignTask(taskId: string, userIdentifier: AssigneeIdentifierRepresentation): Promise<TaskRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(userIdentifier, 'userIdentifier'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/assign', + pathParams, + bodyParam: userIdentifier, + returnType: TaskRepresentation + }); + } + + /** + * Attach a form to a task + * + * @param taskId taskId + * @param formIdentifier formIdentifier + * @return Promise<{}> + */ + attachForm(taskId: string, formIdentifier: FormIdentifierRepresentation): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(formIdentifier, 'formIdentifier'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/attach-form', + pathParams, + bodyParam: formIdentifier + }); + } + + /** + * Claim a task + * + * To claim a task (in case the task is assigned to a group) + * + * @param taskId taskId + * @return Promise<{}> + */ + claimTask(taskId: string): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/claim', + pathParams + }); + } + + /** + * Complete a task + * + * Use this endpoint to complete a standalone task or task without a form + * + * @param taskId taskId + * @return Promise<{}> + */ + completeTask(taskId: string): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/complete', + pathParams + }); + } + + /** + * Delegate a task + * + * @param taskId taskId + * @param userIdentifier userIdentifier + * @return Promise<{}> + */ + delegateTask(taskId: string, userIdentifier: UserIdentifierRepresentation): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(userIdentifier, 'userIdentifier'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/delegate', + pathParams, + bodyParam: userIdentifier + }); + } + + /** + * Involve a group with a task + * + * @param taskId taskId + * @param groupId groupId + * @return Promise<{}> + */ + involveGroup(taskId: string, groupId: string): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + taskId, + groupId + }; + + return this.post({ + path: '/api/enterprise/tasks/{taskId}/groups/{groupId}', + pathParams + }); + } + + /** + * Involve a user with a task + * + * @param taskId taskId + * @param userIdentifier userIdentifier + * @return Promise<{}> + */ + involveUser(taskId: string, userIdentifier: UserIdentifierRepresentation): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(userIdentifier, 'userIdentifier'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/involve', + pathParams, + bodyParam: userIdentifier + }); + } + + /** + * Remove a form from a task + * + * @param taskId taskId + * @return Promise<{}> + */ + removeForm(taskId: string): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.delete({ + path: '/api/enterprise/tasks/{taskId}/action/remove-form', + pathParams + }); + } + + /** + * Remove an involved group from a task + * + * @param taskId taskId + * @param identifier identifier + * @return Promise<{}> + */ + removeInvolvedUser(taskId: string, identifier: string | UserIdentifierRepresentation): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(identifier, 'identifier'); + + const pathParams = { + taskId, + identifier + }; + + if (identifier instanceof String) { + return this.delete({ + path: '/api/enterprise/tasks/{taskId}/groups/{groupId}', + pathParams + }); + } else { + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/remove-involved', + pathParams, + bodyParam: identifier + }); + } + } + + /** + * Resolve a task + * + * + * + * @param taskId taskId + * @return Promise<{}> + */ + resolveTask(taskId: string): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/resolve', + pathParams + }); + } + + /** + * Unclaim a task + * + * To unclaim a task (in case the task was assigned to a group) + * + * @param taskId taskId + * @return Promise<{}> + */ + unclaimTask(taskId: string): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/action/unclaim', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/taskForms.api.ts b/lib/js-api/src/api/activiti-rest-api/api/taskForms.api.ts new file mode 100644 index 0000000000..4d3f841851 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/taskForms.api.ts @@ -0,0 +1,194 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + CompleteFormRepresentation, + FormDefinitionRepresentation, + FormValueRepresentation, + ProcessInstanceVariableRepresentation, + SaveFormRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * TaskFormsApi service. + */ +export class TaskFormsApi extends BaseApi { + /** + * Complete a task form + * + * @param taskId taskId + * @param completeTaskFormRepresentation completeTaskFormRepresentation + * @return Promise<{}> + */ + completeTaskForm(taskId: string, completeTaskFormRepresentation: CompleteFormRepresentation): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(completeTaskFormRepresentation, 'completeTaskFormRepresentation'); + + const pathParams = { + taskId + }; + + return this.post({ + path: '/api/enterprise/task-forms/{taskId}', + pathParams, + bodyParam: completeTaskFormRepresentation + }); + } + + /** + * Get task variables + * + * @param taskId taskId + * @return Promise<ProcessInstanceVariableRepresentation> + */ + getProcessInstanceVariables(taskId: string): Promise<ProcessInstanceVariableRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/task-forms/{taskId}/variables', + pathParams + }); + } + + /** + * Retrieve Column Field Values + * Specific case to retrieve information on a specific column + * + * @param taskId taskId + * @param field field + * @param column column + */ + getRestFieldColumnValues(taskId: string, field: string, column: string) { + // verify the required parameter 'taskId' is set + if (taskId === undefined || taskId === null) { + throw new Error(`Missing param 'taskId' in getRestFieldValues`); + } + + // verify the required parameter 'field' is set + if (field === undefined || field === null) { + throw new Error(`Missing param 'field' in getRestFieldValues`); + } + + // verify the required parameter 'column' is set + if (column === undefined || column === null) { + throw new Error(`Missing param 'column' in getRestFieldValues`); + } + + const pathParams = { + taskId, + field, + column + }; + + return this.get({ + path: '/api/enterprise/task-forms/{taskId}/form-values/{field}/{column}', + pathParams + }); + } + + /** + * Retrieve populated field values + * + * Form field values that are populated through a REST backend, can be retrieved via this service + * + * @param taskId taskId + * @param field field + * @return Promise<FormValueRepresentation []> + */ + getRestFieldValues(taskId: string, field: string): Promise<FormValueRepresentation[]> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(field, 'field'); + + const pathParams = { + taskId, + field + }; + + return this.get({ + path: '/api/enterprise/task-forms/{taskId}/form-values/{field}', + pathParams + }); + } + + /** + * Get a task form + * + * @param taskId taskId + * @returns Promise<FormDefinitionRepresentation> + */ + getTaskForm(taskId: string): Promise<FormDefinitionRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/task-forms/{taskId}', + pathParams + }); + } + + /** + * Save a task form + * + * @param taskId taskId + * @param saveTaskFormRepresentation saveTaskFormRepresentation + * @return Promise<{}> + */ + saveTaskForm(taskId: string, saveTaskFormRepresentation: SaveFormRepresentation): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(saveTaskFormRepresentation, 'saveTaskFormRepresentation'); + + const pathParams = { + taskId + }; + + return this.post({ + path: '/api/enterprise/task-forms/{taskId}/save-form', + pathParams, + bodyParam: saveTaskFormRepresentation + }); + } + + /** + * Retrieve Task Form Variables + * + * @param taskId taskId + */ + getTaskFormVariables(taskId: string) { + // verify the required parameter 'taskId' is set + if (taskId === undefined || taskId === null) { + throw new Error(`Missing param 'taskId' in getTaskFormVariables`); + } + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/task-forms/{taskId}/variables', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/taskVariables.api.ts b/lib/js-api/src/api/activiti-rest-api/api/taskVariables.api.ts new file mode 100644 index 0000000000..72acb0e66f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/taskVariables.api.ts @@ -0,0 +1,160 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RestVariable } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { ScopeQuery } from './types'; + +/** + * TaskVariablesApi service. + */ +export class TaskVariablesApi extends BaseApi { + /** + * Create variables + * + * @param taskId taskId + * @param restVariables restVariables + * @return Promise<RestVariable> + */ + createTaskVariable(taskId: string, restVariables: RestVariable): Promise<RestVariable> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(restVariables, 'restVariables'); + + const pathParams = { + taskId + }; + + return this.post({ + path: '/api/enterprise/tasks/{taskId}/variables', + pathParams, + bodyParam: restVariables + }); + } + + /** + * Create or update variables + * + * @param taskId taskId + * @return Promise<{}> + */ + deleteAllLocalTaskVariables(taskId: string): Promise<void> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.delete({ + path: '/api/enterprise/tasks/{taskId}/variables', + pathParams + }); + } + + /** + * Delete a variable + * + * @param taskId taskId + * @param variableName variableName + * @param opts Optional parameters + * @return Promise<{}> + */ + deleteVariable(taskId: string, variableName: string, opts?: ScopeQuery): Promise<void> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(variableName, 'variableName'); + + const pathParams = { + taskId, + variableName + }; + + return this.delete({ + path: '/api/enterprise/tasks/{taskId}/variables/{variableName}', + pathParams, + queryParams: opts + }); + } + /** + * Get a variable + * + * @param taskId taskId + * @param variableName variableName + * @param opts Optional parameters + * @return Promise<RestVariable> + */ + getVariable(taskId: string, variableName: string, opts?: ScopeQuery): Promise<RestVariable> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(variableName, 'variableName'); + + const pathParams = { + taskId, + variableName + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/variables/{variableName}', + pathParams, + queryParams: opts + }); + } + + /** + * List variables + * + * @param taskId taskId + * @param opts Optional parameters + * @return Promise<RestVariable> + */ + getVariables(taskId: string, opts?: ScopeQuery): Promise<RestVariable> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/variables', + pathParams, + queryParams: opts + }); + } + + /** + * Update a variable + * + * @param taskId taskId + * @param variableName variableName + * @param restVariable restVariable + * @return Promise<RestVariable> + */ + updateVariable(taskId: string, variableName: string, restVariable: RestVariable): Promise<RestVariable> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(variableName, 'variableName'); + throwIfNotDefined(restVariable, 'restVariable'); + + const pathParams = { + taskId, + variableName + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}/variables/{variableName}', + pathParams, + bodyParam: restVariable + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/tasks.api.ts b/lib/js-api/src/api/activiti-rest-api/api/tasks.api.ts new file mode 100644 index 0000000000..9349818dc1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/tasks.api.ts @@ -0,0 +1,323 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + HistoricTaskInstanceQueryRepresentation, + IdentityLinkRepresentation, + ResultListDataRepresentationTaskRepresentation, + TaskAuditInfoRepresentation, + TaskFilterRequestRepresentation, + TaskQueryRepresentation, + TaskRepresentation, + TaskUpdateRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Tasks service. + */ +export class TasksApi extends BaseApi { + /** + * List the users and groups involved with a task + * + * @param taskId taskId + * @param identityLinkRepresentation identityLinkRepresentation + * @returns Promise<IdentityLinkRepresentation> + */ + createIdentityLink(taskId: string, identityLinkRepresentation: IdentityLinkRepresentation): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(identityLinkRepresentation, 'identityLinkRepresentation'); + + const pathParams = { + taskId + }; + + return this.post({ + path: '/api/enterprise/tasks/{taskId}/identitylinks', + pathParams, + bodyParam: identityLinkRepresentation + }); + } + + /** + * Create a standalone task + * + * A standalone task is one which is not associated with any process instance. + * + * @param taskRepresentation taskRepresentation + * @returns Promise<TaskRepresentation> + */ + createNewTask(taskRepresentation: TaskRepresentation): Promise<TaskRepresentation> { + throwIfNotDefined(taskRepresentation, 'taskRepresentation'); + + return this.post({ + path: '/api/enterprise/tasks', + bodyParam: taskRepresentation, + returnType: TaskRepresentation + }); + } + + /** + * Remove a user or group involvement from a task + * + * @param taskId taskId + * @param family family + * @param identityId identityId + * @param type type + * @returns Promise<{}> + */ + deleteIdentityLink(taskId: string, family: string, identityId: string, type: string): Promise<any> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(family, 'family'); + throwIfNotDefined(identityId, 'identityId'); + throwIfNotDefined(type, 'type'); + + const pathParams = { + taskId, + family, + identityId, + type + }; + + return this.delete({ + path: '/api/enterprise/tasks/{taskId}/identitylinks/{family}/{identityId}/{type}', + pathParams + }); + } + + /** + * Delete a task + * + * @param taskId taskId + * @returns Promise<{}> + */ + deleteTask(taskId: string): Promise<void> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.delete({ + path: '/api/enterprise/tasks/{taskId}', + pathParams + }); + } + + /** + * Filter a list of tasks + * + * @param tasksFilter tasksFilter + * @returns Promise<ResultListDataRepresentationTaskRepresentation> + */ + filterTasks(tasksFilter: TaskFilterRequestRepresentation): Promise<ResultListDataRepresentationTaskRepresentation> { + throwIfNotDefined(tasksFilter, 'tasksFilter'); + + return this.post({ + path: '/api/enterprise/tasks/filter', + bodyParam: tasksFilter, + returnType: ResultListDataRepresentationTaskRepresentation + }); + } + + /** + * Get a user or group involvement with a task + * + * @param taskId taskId + * @param family family + * @param identityId identityId + * @param type type + * @returns Promise<IdentityLinkRepresentation> + */ + getIdentityLinkType(taskId: string, family: string, identityId: string, type: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(family, 'family'); + throwIfNotDefined(identityId, 'identityId'); + throwIfNotDefined(type, 'type'); + + const pathParams = { + taskId, + family, + identityId, + type + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/identitylinks/{family}/{identityId}/{type}', + pathParams + }); + } + + /** + * List either the users or groups involved with a process instance + * + * @param taskId taskId + * @param family family + * @returns Promise<IdentityLinkRepresentation> + */ + getIdentityLinksForFamily(taskId: string, family: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(family, 'family'); + + const pathParams = { + taskId, + family + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/identitylinks/{family}', + pathParams + }); + } + + /** + * getIdentityLinks + * + * @param taskId taskId + * @returns Promise<IdentityLinkRepresentation> + */ + getIdentityLinks(taskId: string): Promise<IdentityLinkRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/identitylinks', + pathParams + }); + } + + /** + * Get the audit log for a task + * + * @param taskId taskId + * @returns Promise<TaskAuditInfoRepresentation> + */ + getTaskAuditLog(taskId: string): Promise<TaskAuditInfoRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}/audit', + pathParams + }); + } + + /** + * Get the audit log for a task + * + * @param taskId taskId + * @returns Promise<Blob> task audit in blob + */ + getTaskAuditPdf(taskId: string): Promise<Blob> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + // Todo: update url once ACTIVITI-4191 fixed + path: 'app/rest/tasks/{taskId}/audit', + pathParams, + returnType: 'blob' + }); + } + + /** + * Get a task + * + * @param taskId taskId + * @returns Promise<TaskRepresentation> + */ + getTask(taskId: string): Promise<TaskRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + + const pathParams = { + taskId + }; + + return this.get({ + path: '/api/enterprise/tasks/{taskId}', + pathParams, + returnType: TaskRepresentation + }); + } + + /** + * Query historic tasks + * + * @param queryRequest queryRequest + * @returns Promise<ResultListDataRepresentationTaskRepresentation> + */ + listHistoricTasks(queryRequest: HistoricTaskInstanceQueryRepresentation): Promise<ResultListDataRepresentationTaskRepresentation> { + throwIfNotDefined(queryRequest, 'queryRequest'); + + return this.post({ + path: '/api/enterprise/historic-tasks/query', + bodyParam: queryRequest, + returnType: ResultListDataRepresentationTaskRepresentation + }); + } + + /** + * List tasks + * + * @param tasksQuery tasksQuery + * @returns Promise<ResultListDataRepresentationTaskRepresentation> + */ + listTasks(tasksQuery: TaskQueryRepresentation): Promise<ResultListDataRepresentationTaskRepresentation> { + throwIfNotDefined(tasksQuery, 'tasksQuery'); + + return this.post({ + path: '/api/enterprise/tasks/query', + bodyParam: tasksQuery, + returnType: ResultListDataRepresentationTaskRepresentation + }); + } + + /** + * Update a task + * + * You can edit only name, description and dueDate (ISO 8601 string). + * + * @param taskId taskId + * @param updated updated + * @returns Promise<TaskRepresentation> + */ + updateTask(taskId: string, updated: TaskUpdateRepresentation): Promise<TaskRepresentation> { + throwIfNotDefined(taskId, 'taskId'); + throwIfNotDefined(updated, 'updated'); + + const pathParams = { + taskId + }; + + return this.put({ + path: '/api/enterprise/tasks/{taskId}', + pathParams, + bodyParam: updated, + returnType: TaskRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/temporary.api.ts b/lib/js-api/src/api/activiti-rest-api/api/temporary.api.ts new file mode 100755 index 0000000000..634db9fc79 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/temporary.api.ts @@ -0,0 +1,97 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; + +/** + * Temporary service. + */ +export class TemporaryApi extends BaseApi { + /** + * completeTasks + * + * @param userId userId + * @param processDefinitionKey processDefinitionKey + */ + completeTasks(userId: number, processDefinitionKey: string) { + // verify the required parameter 'userId' is set + if (userId === undefined || userId === null) { + throw new Error(`Missing param 'userId' in completeTasks`); + } + + // verify the required parameter 'processDefinitionKey' is set + if (processDefinitionKey === undefined || processDefinitionKey === null) { + throw new Error(`Missing param 'processDefinitionKey' in completeTasks`); + } + + const queryParams = { + userId, + processDefinitionKey + }; + + return this.get({ + path: '/api/enterprise/temporary/generate-report-data/complete-tasks', + queryParams + }); + } + + /** + * generateData + * + * @param userId userId + * @param processDefinitionKey processDefinitionKey + */ + generateData(userId: number, processDefinitionKey: string) { + // verify the required parameter 'userId' is set + if (userId === undefined || userId === null) { + throw new Error(`Missing param 'userId' in generateData`); + } + + // verify the required parameter 'processDefinitionKey' is set + if (processDefinitionKey === undefined || processDefinitionKey === null) { + throw new Error(`Missing param 'processDefinitionKey' in generateData`); + } + + const queryParams = { + userId, + processDefinitionKey + }; + + return this.get({ + path: '/api/enterprise/temporary/generate-report-data/start-process', + queryParams + }); + } + + /** + * Function to receive the result of the getHeaders operation. + */ + getHeaders() { + return this.get({ + path: '/api/enterprise/temporary/example-headers' + }); + } + + /** + * Function to receive the result of the getOptions operation. + */ + getOptions() { + return this.get({ + path: '/api/enterprise/temporary/example-options' + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/types.ts b/lib/js-api/src/api/activiti-rest-api/api/types.ts new file mode 100644 index 0000000000..11ff01dd9b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/types.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type ScopeQuery = { scope?: string }; +export type AppIdQuery = { appId?: number }; diff --git a/lib/js-api/src/api/activiti-rest-api/api/userFilters.api.ts b/lib/js-api/src/api/activiti-rest-api/api/userFilters.api.ts new file mode 100644 index 0000000000..b9a39cc787 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/userFilters.api.ts @@ -0,0 +1,251 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + ResultListDataRepresentationUserProcessInstanceFilterRepresentation, + ResultListDataRepresentationUserTaskFilterRepresentation, + UserFilterOrderRepresentation, + UserProcessInstanceFilterRepresentation, + UserTaskFilterRepresentation +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { AppIdQuery } from './types'; + +/** + * UserFiltersApi service. + */ +export class UserFiltersApi extends BaseApi { + /** + * Create a process instance filter + * + * @param userProcessInstanceFilterRepresentation userProcessInstanceFilterRepresentation + * @returns Promise<UserProcessInstanceFilterRepresentation> + */ + createUserProcessInstanceFilter( + userProcessInstanceFilterRepresentation: UserProcessInstanceFilterRepresentation + ): Promise<UserProcessInstanceFilterRepresentation> { + throwIfNotDefined(userProcessInstanceFilterRepresentation, 'userProcessInstanceFilterRepresentation'); + + return this.post({ + path: '/api/enterprise/filters/processes', + bodyParam: userProcessInstanceFilterRepresentation + }); + } + + /** + * Create a task filter + * + * @param userTaskFilterRepresentation userTaskFilterRepresentation + * @returns Promise<UserTaskFilterRepresentation> + */ + createUserTaskFilter(userTaskFilterRepresentation: UserTaskFilterRepresentation): Promise<UserTaskFilterRepresentation> { + throwIfNotDefined(userTaskFilterRepresentation, 'userTaskFilterRepresentation'); + + return this.post({ + path: '/api/enterprise/filters/tasks', + bodyParam: userTaskFilterRepresentation, + returnType: UserTaskFilterRepresentation + }); + } + + /** + * Delete a process instance filter + * + * @param userFilterId userFilterId + * @returns Promise<{}> + */ + deleteUserProcessInstanceFilter(userFilterId: number): Promise<void> { + throwIfNotDefined(userFilterId, 'userFilterId'); + + const pathParams = { + userFilterId + }; + + return this.delete({ + path: '/api/enterprise/filters/processes/{userFilterId}', + pathParams + }); + } + + /** + * Delete a task filter + * + * @param userFilterId userFilterId + * @returns Promise<{}> + */ + deleteUserTaskFilter(userFilterId: number): Promise<void> { + throwIfNotDefined(userFilterId, 'userFilterId'); + + const pathParams = { + userFilterId + }; + + return this.delete({ + path: '/api/enterprise/filters/tasks/{userFilterId}', + pathParams + }); + } + + /** + * Get a process instance filter + * + * @param userFilterId userFilterId + * @returns Promise<UserProcessInstanceFilterRepresentation> + */ + getUserProcessInstanceFilter(userFilterId: number): Promise<UserProcessInstanceFilterRepresentation> { + throwIfNotDefined(userFilterId, 'userFilterId'); + + const pathParams = { + userFilterId + }; + + return this.get({ + path: '/api/enterprise/filters/processes/{userFilterId}', + pathParams + }); + } + + /** + * List process instance filters + * + * Returns filters for the current user, optionally filtered by *appId*. + * + * @param opts Optional parameters + * @returns Promise<ResultListDataRepresentationUserProcessInstanceFilterRepresentation> + */ + getUserProcessInstanceFilters(opts?: AppIdQuery): Promise<ResultListDataRepresentationUserProcessInstanceFilterRepresentation> { + return this.get({ + path: '/api/enterprise/filters/processes', + queryParams: opts + }); + } + + /** + * Get a task filter + * + * @param userFilterId userFilterId + * @returns Promise<UserTaskFilterRepresentation> + */ + getUserTaskFilter(userFilterId: number): Promise<UserTaskFilterRepresentation> { + throwIfNotDefined(userFilterId, 'userFilterId'); + + const pathParams = { + userFilterId + }; + + return this.get({ + path: '/api/enterprise/filters/tasks/{userFilterId}', + pathParams, + returnType: UserTaskFilterRepresentation + }); + } + + /** + * List task filters + * + * Returns filters for the current user, optionally filtered by *appId*. + * + * @param opts Optional parameters + * @returns Promise<ResultListDataRepresentationUserTaskFilterRepresentation> + */ + getUserTaskFilters(opts?: AppIdQuery): Promise<ResultListDataRepresentationUserTaskFilterRepresentation> { + return this.get({ + path: '/api/enterprise/filters/tasks', + queryParams: opts, + returnType: ResultListDataRepresentationUserTaskFilterRepresentation + }); + } + + /** + * Re-order the list of user process instance filters + * + * @param filterOrderRepresentation filterOrderRepresentation + * @returns Promise<{}> + */ + orderUserProcessInstanceFilters(filterOrderRepresentation: UserFilterOrderRepresentation): Promise<any> { + throwIfNotDefined(filterOrderRepresentation, 'filterOrderRepresentation'); + + return this.put({ + path: '/api/enterprise/filters/processes', + bodyParam: filterOrderRepresentation + }); + } + + /** + * Re-order the list of user task filters + * + * @param filterOrderRepresentation filterOrderRepresentation + * @returns Promise<{}> + */ + orderUserTaskFilters(filterOrderRepresentation: UserFilterOrderRepresentation): Promise<any> { + throwIfNotDefined(filterOrderRepresentation, 'filterOrderRepresentation'); + + return this.put({ + path: '/api/enterprise/filters/tasks', + bodyParam: filterOrderRepresentation + }); + } + + /** + * Update a process instance filter + * + * @param userFilterId userFilterId + * @param userProcessInstanceFilterRepresentation userProcessInstanceFilterRepresentation + * @returns Promise<UserProcessInstanceFilterRepresentation> + */ + updateUserProcessInstanceFilter( + userFilterId: number, + userProcessInstanceFilterRepresentation: UserProcessInstanceFilterRepresentation + ): Promise<UserProcessInstanceFilterRepresentation> { + throwIfNotDefined(userFilterId, 'userFilterId'); + throwIfNotDefined(userProcessInstanceFilterRepresentation, 'userProcessInstanceFilterRepresentation'); + + const pathParams = { + userFilterId + }; + + return this.put({ + path: '/api/enterprise/filters/processes/{userFilterId}', + pathParams, + bodyParam: userProcessInstanceFilterRepresentation + }); + } + + /** + * Update a task filter + * + * @param userFilterId userFilterId + * @param userTaskFilterRepresentation userTaskFilterRepresentation + * @returns Promise<UserTaskFilterRepresentation> + */ + updateUserTaskFilter(userFilterId: number, userTaskFilterRepresentation: UserTaskFilterRepresentation): Promise<UserTaskFilterRepresentation> { + throwIfNotDefined(userFilterId, 'userFilterId'); + throwIfNotDefined(userTaskFilterRepresentation, 'userTaskFilterRepresentation'); + + const pathParams = { + userFilterId + }; + + return this.put({ + path: '/api/enterprise/filters/tasks/{userFilterId}', + pathParams, + bodyParam: userTaskFilterRepresentation, + returnType: UserTaskFilterRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/userProfile.api.ts b/lib/js-api/src/api/activiti-rest-api/api/userProfile.api.ts new file mode 100644 index 0000000000..eeebadb2fe --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/userProfile.api.ts @@ -0,0 +1,114 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChangePasswordRepresentation } from '../model/changePasswordRepresentation'; +import { ImageUploadRepresentation } from '../model/imageUploadRepresentation'; +import { UserRepresentation } from '../model/userRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Userprofile service. + */ +export class UserProfileApi extends BaseApi { + /** + * Change user password + * + * @param changePasswordRepresentation changePasswordRepresentation + * @return Promise<{}> + */ + changePassword(changePasswordRepresentation: ChangePasswordRepresentation): Promise<any> { + throwIfNotDefined(changePasswordRepresentation, 'changePasswordRepresentation'); + + return this.post({ + path: '/api/enterprise/profile-password', + bodyParam: changePasswordRepresentation + }); + } + + /** + * Retrieve user profile picture + * Generally returns an image file + * + * @return Promise<Blob> + */ + getProfilePicture(): Promise<any> { + return this.get({ + path: '/api/enterprise/profile-picture', + accepts: ['application/json', '*/*'] + }); + } + + /** + * Retrieve user URL profile picture + * Generally returns an image file + */ + getProfilePictureUrl() { + return this.apiClient.basePath + '/app/rest/admin/profile-picture'; + } + + /** + * Get user profile + * This operation returns account information for the current user. + * This is useful to get the name, email, the groups that the user is part of, the user picture, etc. + * + * @return Promise<UserRepresentation> + */ + getProfile(): Promise<UserRepresentation> { + return this.get({ + path: '/api/enterprise/profile', + returnType: UserRepresentation + }); + } + + /** + * Update user profile. + * Only a first name, last name, email and company can be updated + * + * @param userRepresentation userRepresentation + * @return Promise<UserRepresentation> + */ + updateProfile(userRepresentation: UserRepresentation): Promise<UserRepresentation> { + throwIfNotDefined(userRepresentation, 'userRepresentation'); + + return this.post({ + path: '/api/enterprise/profile', + bodyParam: userRepresentation, + returnType: UserRepresentation + }); + } + + /** + * Change user profile picture + * + * @param file file + * @return Promise<ImageUploadRepresentation> + */ + uploadProfilePicture(file: any): Promise<ImageUploadRepresentation> { + throwIfNotDefined(file, 'file'); + + const formParams = { + file + }; + + return this.post({ + path: '/api/enterprise/profile-picture', + formParams, + returnType: ImageUploadRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/api/users.api.ts b/lib/js-api/src/api/activiti-rest-api/api/users.api.ts new file mode 100644 index 0000000000..6026f43d7a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/api/users.api.ts @@ -0,0 +1,159 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResetPasswordRepresentation } from '../model/resetPasswordRepresentation'; +import { ResultListDataRepresentationLightUserRepresentation } from '../model/resultListDataRepresentationLightUserRepresentation'; +import { UserActionRepresentation } from '../model/userActionRepresentation'; +import { UserRepresentation } from '../model/userRepresentation'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +export type GetUsersQuery = { + filter?: string; + email?: string; + externalId?: string; + externalIdCaseInsensitive?: string; + excludeTaskId?: string; + excludeProcessId?: string; + groupId?: number; + tenantId?: number; +}; + +/** + * Users service. + */ +export class UsersApi extends BaseApi { + /** + * Execute an action for a specific user + * + * Typical action is updating/reset password + * + * @param userId userId + * @param actionRequest actionRequest + * @returns Promise<{}> + */ + executeAction(userId: number, actionRequest: UserActionRepresentation): Promise<any> { + throwIfNotDefined(userId, 'userId'); + throwIfNotDefined(actionRequest, 'actionRequest'); + + const pathParams = { + userId + }; + + return this.post({ + path: '/api/enterprise/users/{userId}', + pathParams, + bodyParam: actionRequest + }); + } + + /** + * Stream user profile picture + * + * @param userId userId + * @returns Promise<{}> + */ + getUserProfilePictureUrl(userId: string): string { + return this.apiClient.basePath + '/app/rest/users/' + userId + '/picture'; + } + + /** + * Get a user + * + * @param userId userId + * @returns Promise<UserRepresentation> + */ + getUser(userId: number): Promise<UserRepresentation> { + throwIfNotDefined(userId, 'userId'); + + const pathParams = { + userId + }; + + return this.get({ + path: '/api/enterprise/users/{userId}', + pathParams, + returnType: UserRepresentation + }); + } + + /** + * Query users + * + * A common use case is that a user wants to select another user (eg. when assigning a task) or group. + * + * @param opts Optional parameters + * @returns Promise<ResultListDataRepresentationLightUserRepresentation> + */ + getUsers(opts?: GetUsersQuery): Promise<ResultListDataRepresentationLightUserRepresentation> { + opts = opts || {}; + + const queryParams = { + filter: opts['filter'], + email: opts['email'], + externalId: opts['externalId'], + externalIdCaseInsensitive: opts['externalIdCaseInsensitive'], + excludeTaskId: opts['excludeTaskId'], + excludeProcessId: opts['excludeProcessId'], + groupId: opts['groupId'], + tenantId: opts['tenantId'] + }; + + return this.get({ + path: '/api/enterprise/users', + queryParams + }); + } + + /** + * Request a password reset + * + * @param resetPassword resetPassword + * @returns Promise<{}> + */ + requestPasswordReset(resetPassword: ResetPasswordRepresentation): Promise<any> { + throwIfNotDefined(resetPassword, 'resetPassword'); + + return this.post({ + path: '/api/enterprise/idm/passwords', + bodyParam: resetPassword + }); + } + + /** + * Update a user + * + * @param userId userId + * @param userRequest userRequest + * @returns Promise<UserRepresentation> + */ + updateUser(userId: number, userRequest: UserRepresentation): Promise<UserRepresentation> { + throwIfNotDefined(userId, 'userId'); + throwIfNotDefined(userRequest, 'userRequest'); + + const pathParams = { + userId + }; + + return this.put({ + path: '/api/enterprise/users/{userId}', + pathParams, + bodyParam: userRequest, + returnType: UserRepresentation + }); + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AboutApi.md b/lib/js-api/src/api/activiti-rest-api/docs/AboutApi.md new file mode 100644 index 0000000000..83e5db81c4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AboutApi.md @@ -0,0 +1,30 @@ +# AboutApi + +All URIs are relative to */activiti-app/api* + +| Method | HTTP request | Description | +|---------------------------------|---------------------------------|-----------------------------| +| [getAppVersion](#getAppVersion) | **GET** /enterprise/app-version | Get server type and version | + + +# getAppVersion + +Get server type and version + +Provides information about the running Alfresco Process Services Suite. +The response payload object has the properties type, majorVersion, minorVersion, revisionVersion and edition. + +**Return type**: **Map<string, string>** + +**Example** + +```javascript +import { AlfrescoApi, AboutApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const aboutApi = new AboutApi(alfrescoApi); + +aboutApi.getAppVersion().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AbstractGroupRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AbstractGroupRepresentation.md new file mode 100644 index 0000000000..ed83b592b0 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AbstractGroupRepresentation.md @@ -0,0 +1,11 @@ +# AbstractGroupRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**externalId** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AbstractUserRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AbstractUserRepresentation.md new file mode 100644 index 0000000000..d01e06a887 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AbstractUserRepresentation.md @@ -0,0 +1,14 @@ +# AbstractUserRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company** | **string** | | [optional] [default to null] +**email** | **string** | | [optional] [default to null] +**externalId** | **string** | | [optional] [default to null] +**firstName** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastName** | **string** | | [optional] [default to null] +**pictureId** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AccountIntegrationApi.md b/lib/js-api/src/api/activiti-rest-api/docs/AccountIntegrationApi.md new file mode 100644 index 0000000000..b8401da821 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AccountIntegrationApi.md @@ -0,0 +1,56 @@ +# AccountIntegrationApi + +All URIs are relative to */activiti-app/api* + +| Method | HTTP request | Description | +|-----------------------------|-----------------------------------------|---------------------------------------| +| [getAccounts](#getAccounts) | **GET** /enterprise/account/integration | Retrieve external account information | + +# **getAccounts** + +Retrieve external account information + +Accounts are used to integrate with third party apps and clients + +**Return type**: [ResultListDataRepresentationAccountRepresentation](#ResultListDataRepresentationAccountRepresentation) + +**Example** + +```javascript +import { AlfrescoApi, AccountIntegrationApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const accountIntegrationApi = new AccountIntegrationApi(alfrescoApi); + +accountIntegrationApi.getAccounts().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## ResultListDataRepresentationAccountRepresentation + +**Properties** + +| Name | Type | +|-------|---------------------------------------------------| +| data | [AccountRepresentation[]](#AccountRepresentation) | +| size | number | +| start | number | +| total | number | + + +## AccountRepresentation + +**Properties** + +| Name | Type | +|------------------|---------| +| authorizationUrl | string | +| authorized | boolean | +| metaDataAllowed | boolean | +| name | string | +| serviceId | string | + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AddGroupCapabilitiesRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AddGroupCapabilitiesRepresentation.md new file mode 100644 index 0000000000..55bacb059b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AddGroupCapabilitiesRepresentation.md @@ -0,0 +1,8 @@ +# AddGroupCapabilitiesRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capabilities** | **string[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AdminEndpointsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/AdminEndpointsApi.md new file mode 100644 index 0000000000..81f7fb4016 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AdminEndpointsApi.md @@ -0,0 +1,313 @@ +# AdminEndpointsApi + +All URIs are relative to */activiti-app/api* + +| Method | HTTP request | Description | +|---------------------------------------------------------------|------------------------------------------------------------------|----------------------------------| +| [createBasicAuthConfiguration](#createBasicAuthConfiguration) | **POST** /enterprise/admin/basic-auths | Add an endpoint authorization | +| [createEndpointConfiguration](#createEndpointConfiguration) | **POST** /enterprise/admin/endpoints | Create an endpoint | +| [getBasicAuthConfiguration](#getBasicAuthConfiguration) | **GET** /enterprise/admin/basic-auths/{basicAuthId} | Get an endpoint authorization | +| [getBasicAuthConfigurations](#getBasicAuthConfigurations) | **GET** /enterprise/admin/basic-auths | List endpoint authorizations | +| [getEndpointConfiguration](#getEndpointConfiguration) | **GET** /enterprise/admin/endpoints/{endpointConfigurationId} | Get an endpoint | +| [getEndpointConfigurations](#getEndpointConfigurations) | **GET** /enterprise/admin/endpoints | List endpoints | +| [removeBasicAuthConfiguration](#removeBasicAuthConfiguration) | **DELETE** /enterprise/admin/basic-auths/{basicAuthId} | Delete an endpoint authorization | +| [removeEndpointConfiguration](#removeEndpointConfiguration) | **DELETE** /enterprise/admin/endpoints/{endpointConfigurationId} | Delete an endpoint | +| [updateBasicAuthConfiguration](#updateBasicAuthConfiguration) | **PUT** /enterprise/admin/basic-auths/{basicAuthId} | Update an endpoint authorization | +| [updateEndpointConfiguration](#updateEndpointConfiguration) | **PUT** /enterprise/admin/endpoints/{endpointConfigurationId} | Update an endpoint | + +# createBasicAuthConfiguration + +Add an endpoint authorization + +**Parameters** + +| Name | Type | +|--------------------------|---------------------------------------------------------------------------------| +| **createRepresentation** | [CreateEndpointBasicAuthRepresentation](#CreateEndpointBasicAuthRepresentation) | + +**Return type**: [EndpointBasicAuthRepresentation](#EndpointBasicAuthRepresentation) + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const createRepresentation = {}; + +adminEndpointsApi.createBasicAuthConfiguration(createRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# createEndpointConfiguration + +Create an endpoint + +**Parameters** + +| Name | Type | +|--------------------|-------------------------------------------------------------------------------| +| **representation** | [EndpointConfigurationRepresentation](EndpointConfigurationRepresentation.md) | + +**Return type**: [EndpointConfigurationRepresentation](EndpointConfigurationRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const representation = {}; + +adminEndpointsApi.createEndpointConfiguration(representation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# getBasicAuthConfiguration + +Get an endpoint authorization + +**Parameters** + +| Name | Type | Description | +|-----------------|--------|-------------| +| **basicAuthId** | number | basicAuthId | +| **tenantId** | number | tenantId | + +**Return type**: [EndpointBasicAuthRepresentation](#EndpointBasicAuthRepresentation) + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const authId = 0; +const tenantId = 0; + +adminEndpointsApi.getBasicAuthConfiguration(authId, tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# getBasicAuthConfigurations + +List endpoint authorizations + +**Parameters** + +| Name | Type | +|--------------|--------| +| **tenantId** | number | + +**Return type**: [EndpointBasicAuthRepresentation](#EndpointBasicAuthRepresentation) + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const tenantId = 0; + +adminEndpointsApi.getBasicAuthConfigurations(tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# getEndpointConfiguration + +Get an endpoint + +**Parameters** + +| Name | Type | +|-----------------------------|--------| +| **endpointConfigurationId** | number | +| **tenantId** | number | + +**Return type**: [EndpointConfigurationRepresentation](EndpointConfigurationRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const endpointConfigurationId = 0; +const tenantId = 0; + +adminEndpointsApi.getEndpointConfiguration(endpointConfigurationId, tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# getEndpointConfigurations + +List endpoints + +**Parameters** + +| Name | Type | +|--------------|--------| +| **tenantId** | number | + +**Return type**: [EndpointConfigurationRepresentation](EndpointConfigurationRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const tenantId = 0; + +adminEndpointsApi.getEndpointConfigurations(tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# removeBasicAuthConfiguration + +Delete an endpoint authorization + +**Parameters** + +| Name | Type | +|-----------------|--------| +| **basicAuthId** | number | +| **tenantId** | number | + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const basicAuthId = 0; +const tenantId = 0; + +adminEndpointsApi.removeBasicAuthConfiguration(basicAuthId, tenantId).then(() => { + console.log('API called successfully.'); +}); +``` + +# removeEndpointConfiguration + +Delete an endpoint + +**Parameters** + +| Name | Type | +|-----------------------------|--------| +| **endpointConfigurationId** | number | +| **tenantId** | number | + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const endpointConfigurationId = 0; +const tenantId = 0; + +adminendpointsApi.removeEndpointConfiguration(endpointConfigurationId, tenantId).then(() => { + console.log('API called successfully.'); +}); +``` + +# updateBasicAuthConfiguration + +Update an endpoint authorization + +**Parameters** + +| Name | Type | +|--------------------------|---------------------------------------------------------------------------------| +| **basicAuthId** | number | +| **createRepresentation** | [CreateEndpointBasicAuthRepresentation](#CreateEndpointBasicAuthRepresentation) | + +**Return type**: [EndpointBasicAuthRepresentation](#EndpointBasicAuthRepresentation) + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const basicAuthId = 0; +const createRepresentation = {}; + +adminEndpointsApi.updateBasicAuthConfiguration(basicAuthId, createRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# updateEndpointConfiguration + +Update an endpoint + +**Parameters** + +| Name | Type | +|-----------------------------|-------------------------------------------------------------------------------| +| **endpointConfigurationId** | number | +| **representation** | [EndpointConfigurationRepresentation](EndpointConfigurationRepresentation.md) | + +**Return type**: [EndpointConfigurationRepresentation](EndpointConfigurationRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, AdminEndpointsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const adminEndpointsApi = new AdminEndpointsApi(alfrescoApi); +const endpointConfigurationId = 0; +const representation = {}; + +adminendpointsApi.updateEndpointConfiguration(endpointConfigurationId, representation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## CreateEndpointBasicAuthRepresentation + +**Properties** + +| Name | Type | +|----------|--------| +| name | string | +| password | string | +| tenantId | number | +| username | string | + +## EndpointBasicAuthRepresentation + +**Properties** + +| Name | Type | +|-------------|--------| +| created | Date | +| id | number | +| lastUpdated | Date | +| name | string | +| tenantId | number | +| username | string | + + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AdminGroupsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/AdminGroupsApi.md new file mode 100644 index 0000000000..4604946e14 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AdminGroupsApi.md @@ -0,0 +1,661 @@ +# AdmingroupsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**activate**](AdminGroupsApi.md#activate) | **POST** /enterprise/admin/groups/{groupId}/action/activate | Activate a group +[**addAllUsersToGroup**](AdminGroupsApi.md#addAllUsersToGroup) | **POST** /enterprise/admin/groups/{groupId}/add-all-users | Add users to a group +[**addGroupCapabilities**](AdminGroupsApi.md#addGroupCapabilities) | **POST** /enterprise/admin/groups/{groupId}/capabilities | Add capabilities to a group +[**addGroupMember**](AdminGroupsApi.md#addGroupMember) | **POST** /enterprise/admin/groups/{groupId}/members/{userId} | Add a user to a group +[**addRelatedGroup**](AdminGroupsApi.md#addRelatedGroup) | **POST** /enterprise/admin/groups/{groupId}/related-groups/{relatedGroupId} | Get a related group +[**createNewGroup**](AdminGroupsApi.md#createNewGroup) | **POST** /enterprise/admin/groups | Create a group +[**deleteGroupCapability**](AdminGroupsApi.md#deleteGroupCapability) | **DELETE** /enterprise/admin/groups/{groupId}/capabilities/{groupCapabilityId} | Remove a capability from a group +[**deleteGroupMember**](AdminGroupsApi.md#deleteGroupMember) | **DELETE** /enterprise/admin/groups/{groupId}/members/{userId} | Delete a member from a group +[**deleteGroup**](AdminGroupsApi.md#deleteGroup) | **DELETE** /enterprise/admin/groups/{groupId} | Delete a group +[**deleteRelatedGroup**](AdminGroupsApi.md#deleteRelatedGroup) | **DELETE** /enterprise/admin/groups/{groupId}/related-groups/{relatedGroupId} | Delete a related group +[**getCapabilities**](AdminGroupsApi.md#getCapabilities) | **GET** /enterprise/admin/groups/{groupId}/potential-capabilities | List group capabilities +[**getGroupUsers**](AdminGroupsApi.md#getGroupUsers) | **GET** /enterprise/admin/groups/{groupId}/users | Get group members +[**getGroup**](AdminGroupsApi.md#getGroup) | **GET** /enterprise/admin/groups/{groupId} | Get a group +[**getGroups**](AdminGroupsApi.md#getGroups) | **GET** /enterprise/admin/groups | Query groups +[**getRelatedGroups**](AdminGroupsApi.md#getRelatedGroups) | **GET** /enterprise/admin/groups/{groupId}/related-groups | Get related groups +[**updateGroup**](AdminGroupsApi.md#updateGroup) | **PUT** /enterprise/admin/groups/{groupId} | Update a group + + +<a name="activate"></a> +# **activate** +> activate(groupId) + +Activate a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.activate(groupId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + +### Return type + +null (empty response body) + +<a name="addAllUsersToGroup"></a> +# **addAllUsersToGroup** +> addAllUsersToGroup(groupId) + +Add users to a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.addAllUsersToGroup(groupId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + +### Return type + +null (empty response body) + +<a name="addGroupCapabilities"></a> +# **addGroupCapabilities** +> addGroupCapabilities(groupIdaddGroupCapabilitiesRepresentation) + +Add capabilities to a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.addGroupCapabilities(groupIdaddGroupCapabilitiesRepresentation).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **addGroupCapabilitiesRepresentation** | [**AddGroupCapabilitiesRepresentation**](AddGroupCapabilitiesRepresentation.md)| addGroupCapabilitiesRepresentation | + +### Return type + +null (empty response body) + +<a name="addGroupMember"></a> +# **addGroupMember** +> addGroupMember(groupIduserId) + +Add a user to a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.addGroupMember(groupIduserId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **userId** | **number**| userId | + +### Return type + +null (empty response body) + +<a name="addRelatedGroup"></a> +# **addRelatedGroup** +> addRelatedGroup(groupIdrelatedGroupIdtype) + +Get a related group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.addRelatedGroup(groupIdrelatedGroupIdtype).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **relatedGroupId** | **number**| relatedGroupId | + **type** | **string**| type | + +### Return type + +null (empty response body) + +<a name="createNewGroup"></a> +# **createNewGroup** +> GroupRepresentation createNewGroup(groupRepresentation) + +Create a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.createNewGroup(groupRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupRepresentation** | [**GroupRepresentation**](GroupRepresentation.md)| groupRepresentation | + +### Return type + +[**GroupRepresentation**](GroupRepresentation.md) + +<a name="deleteGroupCapability"></a> +# **deleteGroupCapability** +> deleteGroupCapability(groupIdgroupCapabilityId) + +Remove a capability from a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.deleteGroupCapability(groupIdgroupCapabilityId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **groupCapabilityId** | **number**| groupCapabilityId | + +### Return type + +null (empty response body) + +<a name="deleteGroupMember"></a> +# **deleteGroupMember** +> deleteGroupMember(groupIduserId) + +Delete a member from a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.deleteGroupMember(groupIduserId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **userId** | **number**| userId | + +### Return type + +null (empty response body) + +<a name="deleteGroup"></a> +# **deleteGroup** +> deleteGroup(groupId) + +Delete a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.deleteGroup(groupId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + +### Return type + +null (empty response body) + +<a name="deleteRelatedGroup"></a> +# **deleteRelatedGroup** +> deleteRelatedGroup(groupIdrelatedGroupId) + +Delete a related group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.deleteRelatedGroup(groupIdrelatedGroupId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **relatedGroupId** | **number**| relatedGroupId | + +### Return type + +null (empty response body) + +<a name="getCapabilities"></a> +# **getCapabilities** +> string getCapabilities(groupId) + +List group capabilities + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.getCapabilities(groupId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + +### Return type + +**string** + +<a name="getGroupUsers"></a> +# **getGroupUsers** +> ResultListDataRepresentationLightUserRepresentation getGroupUsers(groupIdopts) + +Get group members + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + +let opts = { + 'filter': filter_example // | filter + 'page': 56 // | page + 'pageSize': 56 // | pageSize +}; + +admingroupsApi.getGroupUsers(groupIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **filter** | **string**| filter | [optional] + **page** | **number**| page | [optional] + **pageSize** | **number**| pageSize | [optional] + +### Return type + +[**ResultListDataRepresentationLightUserRepresentation**](ResultListDataRepresentationLightUserRepresentation.md) + +<a name="getGroup"></a> +# **getGroup** +> AbstractGroupRepresentation getGroup(groupIdopts) + +Get a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + +let opts = { + 'includeAllUsers': true // | includeAllUsers + 'summary': true // | summary +}; + +admingroupsApi.getGroup(groupIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **includeAllUsers** | **boolean**| includeAllUsers | [optional] + **summary** | **boolean**| summary | [optional] + +### Return type + +[**AbstractGroupRepresentation**](AbstractGroupRepresentation.md) + +<a name="getGroups"></a> +# **getGroups** +> LightGroupRepresentation getGroups(opts) + +Query groups + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + +let opts = { + 'tenantId': 789 // | tenantId + 'functional': true // | functional + 'summary': true // | summary +}; + +admingroupsApi.getGroups(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | [optional] + **functional** | **boolean**| functional | [optional] + **summary** | **boolean**| summary | [optional] + +### Return type + +[**LightGroupRepresentation**](LightGroupRepresentation.md) + +<a name="getRelatedGroups"></a> +# **getRelatedGroups** +> LightGroupRepresentation getRelatedGroups(groupId) + +Get related groups + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.getRelatedGroups(groupId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + +### Return type + +[**LightGroupRepresentation**](LightGroupRepresentation.md) + +<a name="updateGroup"></a> +# **updateGroup** +> GroupRepresentation updateGroup(groupIdgroupRepresentation) + +Update a group + +### Example + +```javascript +import AdmingroupsApi from 'src/api/activiti-rest-api/docs/AdminGroupsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admingroupsApi = new AdmingroupsApi(this.alfrescoApi); + + +admingroupsApi.updateGroup(groupIdgroupRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + **groupRepresentation** | [**GroupRepresentation**](GroupRepresentation.md)| groupRepresentation | + +### Return type + +[**GroupRepresentation**](GroupRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AdminTenantsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/AdminTenantsApi.md new file mode 100644 index 0000000000..a91038e82d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AdminTenantsApi.md @@ -0,0 +1,322 @@ +# AdmintenantsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createTenant**](AdminTenantsApi.md#createTenant) | **POST** /enterprise/admin/tenants | Create a tenant +[**deleteTenant**](AdminTenantsApi.md#deleteTenant) | **DELETE** /enterprise/admin/tenants/{tenantId} | Delete a tenant +[**getTenantEvents**](AdminTenantsApi.md#getTenantEvents) | **GET** /enterprise/admin/tenants/{tenantId}/events | Get tenant events +[**getTenantLogo**](AdminTenantsApi.md#getTenantLogo) | **GET** /enterprise/admin/tenants/{tenantId}/logo | Get a tenant's logo +[**getTenant**](AdminTenantsApi.md#getTenant) | **GET** /enterprise/admin/tenants/{tenantId} | Get a tenant +[**getTenants**](AdminTenantsApi.md#getTenants) | **GET** /enterprise/admin/tenants | List tenants +[**update**](AdminTenantsApi.md#update) | **PUT** /enterprise/admin/tenants/{tenantId} | Update a tenant +[**uploadTenantLogo**](AdminTenantsApi.md#uploadTenantLogo) | **POST** /enterprise/admin/tenants/{tenantId}/logo | Update a tenant's logo + + +<a name="createTenant"></a> +# **createTenant** +> LightTenantRepresentation createTenant(createTenantRepresentation) + +Create a tenant + +Only a tenant manager may access this endpoint + +### Example + +```javascript +import AdmintenantsApi from 'src/api/activiti-rest-api/docs/AdminTenantsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admintenantsApi = new AdmintenantsApi(this.alfrescoApi); + + +admintenantsApi.createTenant(createTenantRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createTenantRepresentation** | [**CreateTenantRepresentation**](CreateTenantRepresentation.md)| createTenantRepresentation | + +### Return type + +[**LightTenantRepresentation**](LightTenantRepresentation.md) + +<a name="deleteTenant"></a> +# **deleteTenant** +> deleteTenant(tenantId) + +Delete a tenant + +### Example + +```javascript +import AdmintenantsApi from 'src/api/activiti-rest-api/docs/AdminTenantsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admintenantsApi = new AdmintenantsApi(this.alfrescoApi); + + +admintenantsApi.deleteTenant(tenantId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + +### Return type + +null (empty response body) + +<a name="getTenantEvents"></a> +# **getTenantEvents** +> TenantEvent getTenantEvents(tenantId) + +Get tenant events + +### Example + +```javascript +import AdmintenantsApi from 'src/api/activiti-rest-api/docs/AdminTenantsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admintenantsApi = new AdmintenantsApi(this.alfrescoApi); + + +admintenantsApi.getTenantEvents(tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + +### Return type + +[**TenantEvent**](TenantEvent.md) + +<a name="getTenantLogo"></a> +# **getTenantLogo** +> getTenantLogo(tenantId) + +Get a tenant's logo + +### Example + +```javascript +import AdmintenantsApi from 'src/api/activiti-rest-api/docs/AdminTenantsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admintenantsApi = new AdmintenantsApi(this.alfrescoApi); + + +admintenantsApi.getTenantLogo(tenantId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + +### Return type + +null (empty response body) + +<a name="getTenant"></a> +# **getTenant** +> TenantRepresentation getTenant(tenantId) + +Get a tenant + +### Example + +```javascript +import AdmintenantsApi from 'src/api/activiti-rest-api/docs/AdminTenantsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admintenantsApi = new AdmintenantsApi(this.alfrescoApi); + + +admintenantsApi.getTenant(tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + +### Return type + +[**TenantRepresentation**](TenantRepresentation.md) + +<a name="getTenants"></a> +# **getTenants** +> LightTenantRepresentation getTenants() + +List tenants + +Only a tenant manager may access this endpoint + +### Example + +```javascript +import AdmintenantsApi from 'src/api/activiti-rest-api/docs/AdminTenantsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admintenantsApi = new AdmintenantsApi(this.alfrescoApi); + +admintenantsApi.getTenants().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**LightTenantRepresentation**](LightTenantRepresentation.md) + +<a name="update"></a> +# **update** +> TenantRepresentation update(tenantIdcreateTenantRepresentation) + +Update a tenant + +### Example + +```javascript +import AdmintenantsApi from 'src/api/activiti-rest-api/docs/AdminTenantsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admintenantsApi = new AdmintenantsApi(this.alfrescoApi); + + +admintenantsApi.update(tenantIdcreateTenantRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + **createTenantRepresentation** | [**CreateTenantRepresentation**](CreateTenantRepresentation.md)| createTenantRepresentation | + +### Return type + +[**TenantRepresentation**](TenantRepresentation.md) + +<a name="uploadTenantLogo"></a> +# **uploadTenantLogo** +> ImageUploadRepresentation uploadTenantLogo(tenantIdfile) + +Update a tenant's logo + +### Example + +```javascript +import AdmintenantsApi from 'src/api/activiti-rest-api/docs/AdminTenantsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let admintenantsApi = new AdmintenantsApi(this.alfrescoApi); + + +admintenantsApi.uploadTenantLogo(tenantIdfile).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + **file** | **Blob**| file | + +### Return type + +[**ImageUploadRepresentation**](ImageUploadRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AdminUsersApi.md b/lib/js-api/src/api/activiti-rest-api/docs/AdminUsersApi.md new file mode 100644 index 0000000000..b26883bbf8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AdminUsersApi.md @@ -0,0 +1,231 @@ +# AdminusersApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**bulkUpdateUsers**](AdminUsersApi.md#bulkUpdateUsers) | **PUT** /enterprise/admin/users | Bulk update a list of users +[**createNewUser**](AdminUsersApi.md#createNewUser) | **POST** /enterprise/admin/users | Create a user +[**getUser**](AdminUsersApi.md#getUser) | **GET** /enterprise/admin/users/{userId} | Get a user +[**getUsers**](AdminUsersApi.md#getUsers) | **GET** /enterprise/admin/users | Query users +[**updateUserDetails**](AdminUsersApi.md#updateUserDetails) | **PUT** /enterprise/admin/users/{userId} | Update a user + + +<a name="bulkUpdateUsers"></a> +# **bulkUpdateUsers** +> bulkUpdateUsers(update) + +Bulk update a list of users + +### Example + +```javascript +import AdminusersApi from 'src/api/activiti-rest-api/docs/AdminUsersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let adminusersApi = new AdminusersApi(this.alfrescoApi); + + +adminusersApi.bulkUpdateUsers(update).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update** | [**BulkUserUpdateRepresentation**](BulkUserUpdateRepresentation.md)| update | + +### Return type + +null (empty response body) + +<a name="createNewUser"></a> +# **createNewUser** +> UserRepresentation createNewUser(userRepresentation) + +Create a user + +### Example + +```javascript +import AdminusersApi from 'src/api/activiti-rest-api/docs/AdminUsersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let adminusersApi = new AdminusersApi(this.alfrescoApi); + + +adminusersApi.createNewUser(userRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userRepresentation** | [**UserRepresentation**](UserRepresentation.md)| userRepresentation | + +### Return type + +[**UserRepresentation**](UserRepresentation.md) + +<a name="getUser"></a> +# **getUser** +> AbstractUserRepresentation getUser(userIdopts) + +Get a user + +### Example + +```javascript +import AdminusersApi from 'src/api/activiti-rest-api/docs/AdminUsersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let adminusersApi = new AdminusersApi(this.alfrescoApi); + +let opts = { + 'summary': true // | summary +}; + +adminusersApi.getUser(userIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + **summary** | **boolean**| summary | [optional] + +### Return type + +[**AbstractUserRepresentation**](AbstractUserRepresentation.md) + +<a name="getUsers"></a> +# **getUsers** +> ResultListDataRepresentationAbstractUserRepresentation getUsers(opts) + +Query users + +### Example + +```javascript +import AdminusersApi from 'src/api/activiti-rest-api/docs/AdminUsersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let adminusersApi = new AdminusersApi(this.alfrescoApi); + +let opts = { + 'filter': filter_example // | filter + 'status': status_example // | status + 'accountType': accountType_example // | accountType + 'sort': sort_example // | sort + 'company': company_example // | company + 'start': 56 // | start + 'page': 56 // | page + 'size': 56 // | size + 'groupId': 789 // | groupId + 'tenantId': 789 // | tenantId + 'summary': true // | summary +}; + +adminusersApi.getUsers(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | **string**| filter | [optional] + **status** | **string**| status | [optional] + **accountType** | **string**| accountType | [optional] + **sort** | **string**| sort | [optional] + **company** | **string**| company | [optional] + **start** | **number**| start | [optional] + **page** | **number**| page | [optional] + **size** | **number**| size | [optional] + **groupId** | **number**| groupId | [optional] + **tenantId** | **number**| tenantId | [optional] + **summary** | **boolean**| summary | [optional] + +### Return type + +[**ResultListDataRepresentationAbstractUserRepresentation**](ResultListDataRepresentationAbstractUserRepresentation.md) + +<a name="updateUserDetails"></a> +# **updateUserDetails** +> updateUserDetails(userIduserRepresentation) + +Update a user + +### Example + +```javascript +import AdminusersApi from 'src/api/activiti-rest-api/docs/AdminUsersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let adminusersApi = new AdminusersApi(this.alfrescoApi); + + +adminusersApi.updateUserDetails(userIduserRepresentation).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + **userRepresentation** | [**UserRepresentation**](UserRepresentation.md)| userRepresentation | + +### Return type + +null (empty response body) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoContentRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoContentRepresentation.md new file mode 100644 index 0000000000..bcff9427cc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoContentRepresentation.md @@ -0,0 +1,11 @@ +# AlfrescoContentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**folder** | **boolean** | | [optional] [default to null] +**id** | **string** | | [optional] [default to null] +**simpleType** | **string** | | [optional] [default to null] +**title** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoEndpointRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoEndpointRepresentation.md new file mode 100644 index 0000000000..34c20adfa0 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoEndpointRepresentation.md @@ -0,0 +1,19 @@ +# AlfrescoEndpointRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountUsername** | **string** | | [optional] [default to null] +**alfrescoTenantId** | **string** | | [optional] [default to null] +**created** | [**Date**](Date.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastUpdated** | [**Date**](Date.md) | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**repositoryUrl** | **string** | | [optional] [default to null] +**secret** | **string** | | [optional] [default to null] +**shareUrl** | **string** | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] +**useShareConnector** | **boolean** | | [optional] [default to null] +**version** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoNetworkRepresenation.md b/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoNetworkRepresenation.md new file mode 100644 index 0000000000..0d8c1b11fc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoNetworkRepresenation.md @@ -0,0 +1,8 @@ +# AlfrescoNetworkRepresenation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoSiteRepresenation.md b/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoSiteRepresenation.md new file mode 100644 index 0000000000..84f8fdf2d8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AlfrescoSiteRepresenation.md @@ -0,0 +1,9 @@ +# AlfrescoSiteRepresenation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**title** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AppDefinition.md b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinition.md new file mode 100644 index 0000000000..9db378afb2 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinition.md @@ -0,0 +1,11 @@ +# AppDefinition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**icon** | **string** | | [optional] [default to null] +**models** | [**AppModelDefinition[]**](AppModelDefinition.md) | | [optional] [default to null] +**publishIdentityInfo** | [**PublishIdentityInfoRepresentation[]**](PublishIdentityInfoRepresentation.md) | | [optional] [default to null] +**theme** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionPublishRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionPublishRepresentation.md new file mode 100644 index 0000000000..88ea1ff246 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionPublishRepresentation.md @@ -0,0 +1,9 @@ +# AppDefinitionPublishRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment** | **string** | | [optional] [default to null] +**force** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionRepresentation.md new file mode 100644 index 0000000000..d1d390654d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionRepresentation.md @@ -0,0 +1,16 @@ +# AppDefinitionRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**defaultAppId** | **string** | | [optional] [default to null] +**deploymentId** | **string** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**icon** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**modelId** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] +**theme** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionSaveRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionSaveRepresentation.md new file mode 100644 index 0000000000..22e730860e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionSaveRepresentation.md @@ -0,0 +1,10 @@ +# AppDefinitionSaveRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinition** | [**AppDefinitionRepresentation**](AppDefinitionRepresentation.md) | | [optional] [default to null] +**force** | **boolean** | | [optional] [default to null] +**publish** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionUpdateResultRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionUpdateResultRepresentation.md new file mode 100644 index 0000000000..0bfafbb403 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionUpdateResultRepresentation.md @@ -0,0 +1,14 @@ +# AppDefinitionUpdateResultRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinition** | [**AppDefinitionRepresentation**](AppDefinitionRepresentation.md) | | [optional] [default to null] +**customData** | **any** | | [optional] [default to null] +**error** | **boolean** | | [optional] [default to null] +**errorDescription** | **string** | | [optional] [default to null] +**errorType** | **number** | | [optional] [default to null] +**message** | **string** | | [optional] [default to null] +**messageKey** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionsApi.md new file mode 100644 index 0000000000..b3925776af --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AppDefinitionsApi.md @@ -0,0 +1,375 @@ +# AppdefinitionsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteAppDefinition**](AppDefinitionsApi.md#deleteAppDefinition) | **DELETE** /enterprise/app-definitions/{appDefinitionId} | deleteAppDefinition +[**exportAppDefinition**](AppDefinitionsApi.md#exportAppDefinition) | **GET** /enterprise/app-definitions/{modelId}/export | Export an app definition +[**getAppDefinition**](AppDefinitionsApi.md#getAppDefinition) | **GET** /enterprise/app-definitions/{modelId} | Get an app definition +[**importAndPublishApp**](AppDefinitionsApi.md#importAndPublishApp) | **POST** /enterprise/app-definitions/publish-app | importAndPublishApp +[**importAndPublishApp**](AppDefinitionsApi.md#importAndPublishApp) | **POST** /enterprise/app-definitions/{modelId}/publish-app | importAndPublishApp +[**importAppDefinition**](AppDefinitionsApi.md#importAppDefinition) | **POST** /enterprise/app-definitions/import | Import a new app definition +[**updateAppDefinition**](AppDefinitionsApi.md#importAppDefinition) | **POST** /enterprise/app-definitions/{modelId}/import | Update the content of an existing app +[**publishAppDefinition**](AppDefinitionsApi.md#publishAppDefinition) | **POST** /enterprise/app-definitions/{modelId}/publish | Publish an app definition +[**updateAppDefinition**](AppDefinitionsApi.md#updateAppDefinition) | **PUT** /enterprise/app-definitions/{modelId} | Update an app definition + + +<a name="deleteAppDefinition"></a> +# **deleteAppDefinition** +> deleteAppDefinition(appDefinitionId) + +deleteAppDefinition + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + + +appdefinitionsApi.deleteAppDefinition(appDefinitionId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appDefinitionId** | **number**| appDefinitionId | + +### Return type + +null (empty response body) + +<a name="exportAppDefinition"></a> +# **exportAppDefinition** +> exportAppDefinition(modelId) + +Export an app definition + +This will return a zip file containing the app definition model and all related models (process definitions and forms). + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + + +appdefinitionsApi.exportAppDefinition(modelId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId from a runtime app or the id of an app definition model | + +### Return type + +null (empty response body) + +<a name="getAppDefinition"></a> +# **getAppDefinition** +> AppDefinitionRepresentation getAppDefinition(modelId) + +Get an app definition + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + + +appdefinitionsApi.getAppDefinition(modelId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| Application definition ID | + +### Return type + +[**AppDefinitionRepresentation**](AppDefinitionRepresentation.md) + +<a name="importAndPublishApp"></a> +# **importAndPublishApp** +> AppDefinitionUpdateResultRepresentation importAndPublishApp(file) + +importAndPublishApp + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + + +appdefinitionsApi.importAndPublishApp(file).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **Blob**| file | + +### Return type + +[**AppDefinitionUpdateResultRepresentation**](AppDefinitionUpdateResultRepresentation.md) + +<a name="importAndPublishApp"></a> +# **importAndPublishApp** +> AppDefinitionUpdateResultRepresentation importAndPublishApp(modelIdfile) + +importAndPublishApp + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + + +appdefinitionsApi.importAndPublishApp(modelIdfile).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **file** | **Blob**| file | + +### Return type + +[**AppDefinitionUpdateResultRepresentation**](AppDefinitionUpdateResultRepresentation.md) + +<a name="importAppDefinition"></a> +# **importAppDefinition** +> AppDefinitionRepresentation importAppDefinition(fileopts) + +Import a new app definition + +Allows a zip file to be uploaded containing an app definition and any number of included models.<p>This is useful to bootstrap an environment (for users or continuous integration).<p>Before using any processes included in the import the app must be published and deployed. + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + +let opts = { + 'renewIdmEntries': renewIdmEntries_example // | Whether to renew user and group identifiers +}; + +appdefinitionsApi.importAppDefinition(fileopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **Blob**| file | + **renewIdmEntries** | **string**| Whether to renew user and group identifiers | [optional] [default to false] + +### Return type + +[**AppDefinitionRepresentation**](AppDefinitionRepresentation.md) + +<a name="updateAppDefinition"></a> +# **importAppDefinition** +> updateAppDefinition importAppDefinition(modelIdfile) + +Update the content of an existing app + +Imports an app inside an existing app definition and creates a new version<p>Before using any new or updated processes included in the import the app must be (re-)published and deployed. + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + + +appdefinitionsApi.updateAppDefinition(modelIdfile).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **file** | **Blob**| file | + +### Return type + +[**AppDefinitionRepresentation**](AppDefinitionRepresentation.md) + +<a name="publishAppDefinition"></a> +# **publishAppDefinition** +> AppDefinitionUpdateResultRepresentation publishAppDefinition(modelIdpublishModel) + +Publish an app definition + +Publishing an app definition makes it available for use. The application must not have any validation errors or an error will be returned.<p>Before an app definition can be used by other users, it must also be deployed for their use + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + + +appdefinitionsApi.publishAppDefinition(modelIdpublishModel).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **publishModel** | [**AppDefinitionPublishRepresentation**](AppDefinitionPublishRepresentation.md)| publishModel | + +### Return type + +[**AppDefinitionUpdateResultRepresentation**](AppDefinitionUpdateResultRepresentation.md) + +<a name="updateAppDefinition"></a> +# **updateAppDefinition** +> AppDefinitionUpdateResultRepresentation updateAppDefinition(modelIdupdatedModel) + +Update an app definition + +### Example + +```javascript +import AppdefinitionsApi from 'src/api/activiti-rest-api/docs/AppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let appdefinitionsApi = new AppdefinitionsApi(this.alfrescoApi); + + +appdefinitionsApi.updateAppDefinition(modelIdupdatedModel).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| Application definition ID | + **updatedModel** | [**AppDefinitionSaveRepresentation**](AppDefinitionSaveRepresentation.md)| updatedModel | + +### Return type + +[**AppDefinitionUpdateResultRepresentation**](AppDefinitionUpdateResultRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AppDeploymentRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AppDeploymentRepresentation.md new file mode 100644 index 0000000000..6842ded994 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AppDeploymentRepresentation.md @@ -0,0 +1,13 @@ +# AppDeploymentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinition** | [**AppDefinitionRepresentation**](AppDefinitionRepresentation.md) | | [optional] [default to null] +**created** | [**Date**](Date.md) | | [optional] [default to null] +**createdBy** | [**LightUserRepresentation**](LightUserRepresentation.md) | | [optional] [default to null] +**deploymentId** | **string** | | [optional] [default to null] +**dmnDeploymentId** | **number** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AppModelDefinition.md b/lib/js-api/src/api/activiti-rest-api/docs/AppModelDefinition.md new file mode 100644 index 0000000000..ee88064a83 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AppModelDefinition.md @@ -0,0 +1,18 @@ +# AppModelDefinition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdBy** | **number** | | [optional] [default to null] +**createdByFullName** | **string** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastUpdated** | [**Date**](Date.md) | | [optional] [default to null] +**lastUpdatedBy** | **number** | | [optional] [default to null] +**lastUpdatedByFullName** | **string** | | [optional] [default to null] +**modelType** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**stencilSetId** | **number** | | [optional] [default to null] +**version** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AssigneeIdentifierRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AssigneeIdentifierRepresentation.md new file mode 100644 index 0000000000..e99916de0f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AssigneeIdentifierRepresentation.md @@ -0,0 +1,9 @@ +# AssigneeIdentifierRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | **string** | | [optional] [default to null] +**email** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AuditCalculatedValueRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AuditCalculatedValueRepresentation.md new file mode 100644 index 0000000000..04af43044f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AuditCalculatedValueRepresentation.md @@ -0,0 +1,9 @@ +# AuditCalculatedValueRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] +**value** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionExpressionInfoRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionExpressionInfoRepresentation.md new file mode 100644 index 0000000000..7b4bcf0335 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionExpressionInfoRepresentation.md @@ -0,0 +1,10 @@ +# AuditDecisionExpressionInfoRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | [optional] [default to null] +**value** | **any** | | [optional] [default to null] +**variable** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionInfoRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionInfoRepresentation.md new file mode 100644 index 0000000000..2b739ee2f7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionInfoRepresentation.md @@ -0,0 +1,9 @@ +# AuditDecisionInfoRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appliedRules** | [**AuditDecisionRuleInfoRepresentation[]**](AuditDecisionRuleInfoRepresentation.md) | | [optional] [default to null] +**calculatedValues** | [**AuditCalculatedValueRepresentation[]**](AuditCalculatedValueRepresentation.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionRuleInfoRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionRuleInfoRepresentation.md new file mode 100644 index 0000000000..cc3a145c5d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AuditDecisionRuleInfoRepresentation.md @@ -0,0 +1,9 @@ +# AuditDecisionRuleInfoRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expressions** | [**AuditDecisionExpressionInfoRepresentation[]**](AuditDecisionExpressionInfoRepresentation.md) | | [optional] [default to null] +**title** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AuditLogEntryRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AuditLogEntryRepresentation.md new file mode 100644 index 0000000000..116e141f8b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AuditLogEntryRepresentation.md @@ -0,0 +1,19 @@ +# AuditLogEntryRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activityId** | **string** | | [optional] [default to null] +**activityName** | **string** | | [optional] [default to null] +**activityType** | **string** | | [optional] [default to null] +**durationInMillis** | **number** | | [optional] [default to null] +**endTime** | **string** | | [optional] [default to null] +**formData** | [**AuditLogFormDataRepresentation[]**](AuditLogFormDataRepresentation.md) | | [optional] [default to null] +**index** | **number** | | [optional] [default to null] +**selectedOutcome** | **string** | | [optional] [default to null] +**startTime** | **string** | | [optional] [default to null] +**taskAssignee** | **string** | | [optional] [default to null] +**taskName** | **string** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/AuditLogFormDataRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/AuditLogFormDataRepresentation.md new file mode 100644 index 0000000000..6b62df254f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/AuditLogFormDataRepresentation.md @@ -0,0 +1,10 @@ +# AuditLogFormDataRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fieldId** | **string** | | [optional] [default to null] +**fieldName** | **string** | | [optional] [default to null] +**value** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/BoxContent.md b/lib/js-api/src/api/activiti-rest-api/docs/BoxContent.md new file mode 100644 index 0000000000..9db5f67406 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/BoxContent.md @@ -0,0 +1,12 @@ +# BoxContent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**folder** | **boolean** | | [optional] [default to null] +**id** | **string** | | [optional] [default to null] +**mimeType** | **string** | | [optional] [default to null] +**simpleType** | **string** | | [optional] [default to null] +**title** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/BoxUserAccountCredentialsRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/BoxUserAccountCredentialsRepresentation.md new file mode 100644 index 0000000000..99935f0109 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/BoxUserAccountCredentialsRepresentation.md @@ -0,0 +1,10 @@ +# BoxUserAccountCredentialsRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authenticationURL** | **string** | | [optional] [default to null] +**expireDate** | [**Date**](Date.md) | | [optional] [default to null] +**ownerEmail** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/BulkUserUpdateRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/BulkUserUpdateRepresentation.md new file mode 100644 index 0000000000..00a0729d88 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/BulkUserUpdateRepresentation.md @@ -0,0 +1,14 @@ +# BulkUserUpdateRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountType** | **string** | | [optional] [default to null] +**password** | **string** | | [optional] [default to null] +**primaryGroupId** | **number** | | [optional] [default to null] +**sendNotifications** | **boolean** | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] +**users** | **number[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ChangePasswordRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ChangePasswordRepresentation.md new file mode 100644 index 0000000000..13dac26350 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ChangePasswordRepresentation.md @@ -0,0 +1,9 @@ +# ChangePasswordRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**newPassword** | **string** | | [optional] [default to null] +**oldPassword** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ChecklistOrderRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ChecklistOrderRepresentation.md new file mode 100644 index 0000000000..ef59e0f16d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ChecklistOrderRepresentation.md @@ -0,0 +1,8 @@ +# ChecklistOrderRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order** | **string[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ChecklistsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ChecklistsApi.md new file mode 100644 index 0000000000..9160008618 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ChecklistsApi.md @@ -0,0 +1,124 @@ +# ChecklistsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addSubtask**](ChecklistsApi.md#addSubtask) | **POST** /enterprise/tasks/{taskId}/checklist | Create a task checklist +[**getChecklist**](ChecklistsApi.md#getChecklist) | **GET** /enterprise/tasks/{taskId}/checklist | Get checklist for a task +[**orderChecklist**](ChecklistsApi.md#orderChecklist) | **PUT** /enterprise/tasks/{taskId}/checklist | Change the order of items on a checklist + + +<a name="addSubtask"></a> +# **addSubtask** +> TaskRepresentation addSubtask(taskIdtaskRepresentation) + +Create a task checklist + +### Example +```javascript +import ChecklistsApi from 'ChecklistsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let checklistsApi = new ChecklistsApi(this.alfrescoApi); + + +checklistsApi.addSubtask(taskIdtaskRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **taskRepresentation** | [**TaskRepresentation**](TaskRepresentation.md)| taskRepresentation | + +### Return type + +[**TaskRepresentation**](TaskRepresentation.md) + +<a name="getChecklist"></a> +# **getChecklist** +> ResultListDataRepresentationTaskRepresentation getChecklist(taskId) + +Get checklist for a task + +### Example +```javascript +import ChecklistsApi from 'ChecklistsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let checklistsApi = new ChecklistsApi(this.alfrescoApi); + + +checklistsApi.getChecklist(taskId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +[**ResultListDataRepresentationTaskRepresentation**](ResultListDataRepresentationTaskRepresentation.md) + +<a name="orderChecklist"></a> +# **orderChecklist** +> orderChecklist(taskIdorderRepresentation) + +Change the order of items on a checklist + +### Example +```javascript +import ChecklistsApi from 'ChecklistsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let checklistsApi = new ChecklistsApi(this.alfrescoApi); + + +checklistsApi.orderChecklist(taskIdorderRepresentation).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **orderRepresentation** | [**ChecklistOrderRepresentation**](ChecklistOrderRepresentation.md)| orderRepresentation | + +### Return type + +null (empty response body) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/CommentAuditInfo.md b/lib/js-api/src/api/activiti-rest-api/docs/CommentAuditInfo.md new file mode 100644 index 0000000000..6ca6230e06 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/CommentAuditInfo.md @@ -0,0 +1,9 @@ +# CommentAuditInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | **string** | | [optional] [default to null] +**message** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/CommentRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/CommentRepresentation.md new file mode 100644 index 0000000000..2583fa4972 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/CommentRepresentation.md @@ -0,0 +1,11 @@ +# CommentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | [**Date**](Date.md) | | [optional] [default to null] +**createdBy** | [**LightUserRepresentation**](LightUserRepresentation.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**message** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/CommentsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/CommentsApi.md new file mode 100644 index 0000000000..4375d471d6 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/CommentsApi.md @@ -0,0 +1,170 @@ +# CommentsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addProcessInstanceComment**](CommentsApi.md#addProcessInstanceComment) | **POST** /enterprise/process-instances/{processInstanceId}/comments | Add a comment to a process instance +[**addTaskComment**](CommentsApi.md#addTaskComment) | **POST** /enterprise/tasks/{taskId}/comments | Add a comment to a task +[**getProcessInstanceComments**](CommentsApi.md#getProcessInstanceComments) | **GET** /enterprise/process-instances/{processInstanceId}/comments | Get comments for a process +[**getTaskComments**](CommentsApi.md#getTaskComments) | **GET** /enterprise/tasks/{taskId}/comments | Get comments for a task + + +<a name="addProcessInstanceComment"></a> +# **addProcessInstanceComment** +> CommentRepresentation addProcessInstanceComment(commentRequestprocessInstanceId) + +Add a comment to a process instance + +### Example +```javascript +import CommentsApi from 'CommentsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let commentsApi = new CommentsApi(this.alfrescoApi); + + +commentsApi.addProcessInstanceComment(commentRequestprocessInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **commentRequest** | [**CommentRepresentation**](CommentRepresentation.md)| commentRequest | + **processInstanceId** | **string**| processInstanceId | + +### Return type + +[**CommentRepresentation**](CommentRepresentation.md) + +<a name="addTaskComment"></a> +# **addTaskComment** +> CommentRepresentation addTaskComment(commentRequesttaskId) + +Add a comment to a task + +### Example +```javascript +import CommentsApi from 'CommentsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let commentsApi = new CommentsApi(this.alfrescoApi); + + +commentsApi.addTaskComment(commentRequesttaskId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **commentRequest** | [**CommentRepresentation**](CommentRepresentation.md)| commentRequest | + **taskId** | **string**| taskId | + +### Return type + +[**CommentRepresentation**](CommentRepresentation.md) + +<a name="getProcessInstanceComments"></a> +# **getProcessInstanceComments** +> ResultListDataRepresentationCommentRepresentation getProcessInstanceComments(processInstanceIdopts) + +Get comments for a process + +### Example +```javascript +import CommentsApi from 'CommentsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let commentsApi = new CommentsApi(this.alfrescoApi); + +let opts = { + 'latestFirst': true // | latestFirst +}; + +commentsApi.getProcessInstanceComments(processInstanceIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| processInstanceId | + **latestFirst** | **boolean**| latestFirst | [optional] + +### Return type + +[**ResultListDataRepresentationCommentRepresentation**](ResultListDataRepresentationCommentRepresentation.md) + +<a name="getTaskComments"></a> +# **getTaskComments** +> ResultListDataRepresentationCommentRepresentation getTaskComments(taskIdopts) + +Get comments for a task + +### Example +```javascript +import CommentsApi from 'CommentsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let commentsApi = new CommentsApi(this.alfrescoApi); + +let opts = { + 'latestFirst': true // | latestFirst +}; + +commentsApi.getTaskComments(taskIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **latestFirst** | **boolean**| latestFirst | [optional] + +### Return type + +[**ResultListDataRepresentationCommentRepresentation**](ResultListDataRepresentationCommentRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/CompleteFormRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/CompleteFormRepresentation.md new file mode 100644 index 0000000000..1bc43a2166 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/CompleteFormRepresentation.md @@ -0,0 +1,9 @@ +# CompleteFormRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**outcome** | **string** | | [optional] [default to null] +**values** | **any** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ConditionRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ConditionRepresentation.md new file mode 100644 index 0000000000..c3a0eadda3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ConditionRepresentation.md @@ -0,0 +1,16 @@ +# ConditionRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leftFormFieldId** | **string** | | [optional] [default to null] +**leftRestResponseId** | **string** | | [optional] [default to null] +**nextCondition** | [**ConditionRepresentation**](ConditionRepresentation.md) | | [optional] [default to null] +**nextConditionOperator** | **string** | | [optional] [default to null] +**operator** | **string** | | [optional] [default to null] +**rightFormFieldId** | **string** | | [optional] [default to null] +**rightRestResponseId** | **string** | | [optional] [default to null] +**rightType** | **string** | | [optional] [default to null] +**rightValue** | **any** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ContentApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ContentApi.md new file mode 100644 index 0000000000..0c06566f1b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ContentApi.md @@ -0,0 +1,534 @@ +# ContentApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createRelatedContentOnProcessInstance**](ContentApi.md#createRelatedContentOnProcessInstance) | **POST** /enterprise/process-instances/{processInstanceId}/content | Attach existing content to a process instance +[**createRelatedContentOnProcessInstance**](ContentApi.md#createRelatedContentOnProcessInstance) | **POST** /enterprise/process-instances/{processInstanceId}/raw-content | Upload content and attach to a process instance +[**createRelatedContentOnTask**](ContentApi.md#createRelatedContentOnTask) | **POST** /enterprise/tasks/{taskId}/content | Attach existing content to a task +[**createRelatedContentOnTask**](ContentApi.md#createRelatedContentOnTask) | **POST** /enterprise/tasks/{taskId}/raw-content | Upload content and attach to a task +[**createTemporaryRawRelatedContent**](ContentApi.md#createTemporaryRawRelatedContent) | **POST** /enterprise/content/raw | Upload content and create a local representation +[**createTemporaryRelatedContent**](ContentApi.md#createTemporaryRelatedContent) | **POST** /enterprise/content | Create a local representation of content from a remote repository +[**deleteContent**](ContentApi.md#deleteContent) | **DELETE** /enterprise/content/{contentId} | Remove a local content representation +[**getContent**](ContentApi.md#getContent) | **GET** /enterprise/content/{contentId} | Get a local content representation +[**getRawContent**](ContentApi.md#getRawContent) | **GET** /enterprise/content/{contentId}/rendition/{renditionType} | Stream content rendition +[**getRawContent**](ContentApi.md#getRawContent) | **GET** /enterprise/content/{contentId}/raw | Stream content from a local content representation +[**getRelatedContentForProcessInstance**](ContentApi.md#getRelatedContentForProcessInstance) | **GET** /enterprise/process-instances/{processInstanceId}/content | List content attached to a process instance +[**getRelatedContentForTask**](ContentApi.md#getRelatedContentForTask) | **GET** /enterprise/tasks/{taskId}/content | List content attached to a task +[**getProcessesAndTasksOnContent**](ContentApi.md#getProcessesAndTasksOnContent) | **GET** enterprise/content/document-runtime | Lists processes and tasks on workflow started with provided document + +<a name="createRelatedContentOnProcessInstance"></a> +# **createRelatedContentOnProcessInstance** +> RelatedContentRepresentation createRelatedContentOnProcessInstance(processInstanceIdrelatedContentopts) + +Attach existing content to a process instance + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + +let opts = { + 'isRelatedContent': true // | isRelatedContent +}; + +contentApi.createRelatedContentOnProcessInstance(processInstanceIdrelatedContentopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| processInstanceId | + **relatedContent** | [**RelatedContentRepresentation**](RelatedContentRepresentation.md)| relatedContent | + **isRelatedContent** | **boolean**| isRelatedContent | [optional] + +### Return type + +[**RelatedContentRepresentation**](RelatedContentRepresentation.md) + +<a name="createRelatedContentOnProcessInstance"></a> +# **createRelatedContentOnProcessInstance** +> RelatedContentRepresentation createRelatedContentOnProcessInstance(processInstanceIdfileopts) + +Upload content and attach to a process instance + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + +let opts = { + 'isRelatedContent': true // | isRelatedContent +}; + +contentApi.createRelatedContentOnProcessInstance(processInstanceIdfileopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| processInstanceId | + **file** | **Blob**| file | + **isRelatedContent** | **boolean**| isRelatedContent | [optional] + +### Return type + +[**RelatedContentRepresentation**](RelatedContentRepresentation.md) + +<a name="createRelatedContentOnTask"></a> +# **createRelatedContentOnTask** +> RelatedContentRepresentation createRelatedContentOnTask(taskIdrelatedContentopts) + +Attach existing content to a task + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + +let opts = { + 'isRelatedContent': true // | isRelatedContent +}; + +contentApi.createRelatedContentOnTask(taskIdrelatedContentopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **relatedContent** | [**RelatedContentRepresentation**](RelatedContentRepresentation.md)| relatedContent | + **isRelatedContent** | **boolean**| isRelatedContent | [optional] + +### Return type + +[**RelatedContentRepresentation**](RelatedContentRepresentation.md) + +<a name="createRelatedContentOnTask"></a> +# **createRelatedContentOnTask** +> RelatedContentRepresentation createRelatedContentOnTask(taskIdfileopts) + +Upload content and attach to a task + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + +let opts = { + 'isRelatedContent': true // | isRelatedContent +}; + +contentApi.createRelatedContentOnTask(taskIdfileopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **file** | **Blob**| file | + **isRelatedContent** | **boolean**| isRelatedContent | [optional] + +### Return type + +[**RelatedContentRepresentation**](RelatedContentRepresentation.md) + +<a name="createTemporaryRawRelatedContent"></a> +# **createTemporaryRawRelatedContent** +> RelatedContentRepresentation createTemporaryRawRelatedContent(file) + +Upload content and create a local representation + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + + +contentApi.createTemporaryRawRelatedContent(file).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **Blob**| file | + +### Return type + +[**RelatedContentRepresentation**](RelatedContentRepresentation.md) + +<a name="createTemporaryRelatedContent"></a> +# **createTemporaryRelatedContent** +> RelatedContentRepresentation createTemporaryRelatedContent(relatedContent) + +Create a local representation of content from a remote repository + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + + +contentApi.createTemporaryRelatedContent(relatedContent).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **relatedContent** | [**RelatedContentRepresentation**](RelatedContentRepresentation.md)| relatedContent | + +### Return type + +[**RelatedContentRepresentation**](RelatedContentRepresentation.md) + +<a name="deleteContent"></a> +# **deleteContent** +> deleteContent(contentId) + +Remove a local content representation + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + + +contentApi.deleteContent(contentId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentId** | **number**| contentId | + +### Return type + +null (empty response body) + +<a name="getContent"></a> +# **getContent** +> RelatedContentRepresentation getContent(contentId) + +Get a local content representation + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + + +contentApi.getContent(contentId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentId** | **number**| contentId | + +### Return type + +[**RelatedContentRepresentation**](RelatedContentRepresentation.md) + +<a name="getRawContent"></a> +# **getRawContent** +> getRawContent(contentIdrenditionType) + +Stream content rendition + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + + +contentApi.getRawContent(contentIdrenditionType).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentId** | **number**| contentId | + **renditionType** | **string**| renditionType | + +### Return type + +null (empty response body) + +<a name="getRawContent"></a> +# **getRawContent** +> getRawContent(contentId) + +Stream content from a local content representation + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + + +contentApi.getRawContent(contentId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentId** | **number**| contentId | + +### Return type + +null (empty response body) + +<a name="getRelatedContentForProcessInstance"></a> +# **getRelatedContentForProcessInstance** +> ResultListDataRepresentationRelatedContentRepresentation getRelatedContentForProcessInstance(processInstanceIdopts) + +List content attached to a process instance + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + +let opts = { + 'isRelatedContent': true // | isRelatedContent +}; + +contentApi.getRelatedContentForProcessInstance(processInstanceIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| processInstanceId | + **isRelatedContent** | **boolean**| isRelatedContent | [optional] + +### Return type + +[**ResultListDataRepresentationRelatedContentRepresentation**](ResultListDataRepresentationRelatedContentRepresentation.md) + +<a name="getRelatedContentForTask"></a> +# **getRelatedContentForTask** +> ResultListDataRepresentationRelatedContentRepresentation getRelatedContentForTask(taskIdopts) + +List content attached to a task + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let contentApi = new ContentApi(this.alfrescoApi); + +let opts = { + 'isRelatedContent': true // | isRelatedContent +}; + +contentApi.getRelatedContentForTask(taskIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **isRelatedContent** | **boolean**| isRelatedContent | [optional] + +### Return type + +[**ResultListDataRepresentationRelatedContentRepresentation**](ResultListDataRepresentationRelatedContentRepresentation.md) + +<a name="getProcessesAndTasksOnContent"></a> +# **getProcessesAndTasksOnContent** +> ResultListDataRepresentationRelatedProcessTask getProcessesAndTasksOnContent(sourceId, source, size, page) + +Lists processes and tasks on workflow started with provided document + +### Example +```javascript +import ContentApi from 'ContentApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(); +alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const contentApi = new ContentApi(alfrescoApi); + +contentApi.getProcessesAndTasksOnContent('sourceId', 'source').then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **sourceId** | **string** | id of the document that workflow or task was started with | | +| **source** | **string** | source of the document that workflow or task was started with | | +| **sourceId** | **number** | size of the entries to get | optional param | +| **sourceId** | **number** | page number | optional param | + +### Return type + +[**ResultListDataRepresentationRelatedProcessTask**](ResultListDataRepresentationRelatedProcessTask.md) + + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/CreateProcessInstanceRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/CreateProcessInstanceRepresentation.md new file mode 100644 index 0000000000..a60e8cc940 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/CreateProcessInstanceRepresentation.md @@ -0,0 +1,14 @@ +# CreateProcessInstanceRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**businessKey** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**outcome** | **string** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**values** | **any** | | [optional] [default to null] +**variables** | [**RestVariable[]**](RestVariable.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/CreateTenantRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/CreateTenantRepresentation.md new file mode 100644 index 0000000000..8736656334 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/CreateTenantRepresentation.md @@ -0,0 +1,12 @@ +# CreateTenantRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **boolean** | | [optional] [default to null] +**configuration** | **string** | | [optional] [default to null] +**domain** | **string** | | [optional] [default to null] +**maxUsers** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/DataSourcesApi.md b/lib/js-api/src/api/activiti-rest-api/docs/DataSourcesApi.md new file mode 100644 index 0000000000..910cb0fa03 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/DataSourcesApi.md @@ -0,0 +1,75 @@ +# DataSourcesApi + +All URIs are relative to */activiti-app/api* + +| Method | HTTP request | Description | +|-----------------------------------|-----------------------------------------|------------------| +| [getDataSources](#getDataSources) | **GET** /enterprise/editor/data-sources | Get data sources | + +# getDataSources + +Get data sources + +**Parameters** + +| Name | Type | +|----------|--------| +| tenantId | number | + +**Return type**: [ResultListDataRepresentationDataSourceRepresentation](#ResultListDataRepresentationDataSourceRepresentation) + +**Example** + +```javascript +import { AlfrescoApi, DataSourcesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const dataSourcesApi = new DataSourcesApi(alfrescoApi); + +const opts = { + tenantId: 789 +}; + +datasourcesApi.getDataSources(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## ResultListDataRepresentationDataSourceRepresentation + +**Properties** + +| Name | Type | +|-------|---------------------------------------------------------| +| data | [DataSourceRepresentation[]](#DataSourceRepresentation) | +| size | number | +| start | number | +| total | number | + +## DataSourceRepresentation + +**Properties** + +| Name | Type | +|----------|-------------------------------------------------------------------| +| config | [DataSourceConfigRepresentation](#DataSourceConfigRepresentation) | +| id | number | +| name | string | +| tenantId | number | + +## DataSourceConfigRepresentation + +**Properties** + +| Name | Type | +|-------------|--------| +| driverClass | string | +| jdbcUrl | string | +| password | string | +| username | string | + + + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/DecisionAuditRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/DecisionAuditRepresentation.md new file mode 100644 index 0000000000..bd68d4e19b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/DecisionAuditRepresentation.md @@ -0,0 +1,21 @@ +# DecisionAuditRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activityId** | **string** | | [optional] [default to null] +**activityName** | **string** | | [optional] [default to null] +**auditTrailJson** | **string** | | [optional] [default to null] +**created** | [**Date**](Date.md) | | [optional] [default to null] +**decisionExecutionFailed** | **boolean** | | [optional] [default to null] +**decisionKey** | **string** | | [optional] [default to null] +**decisionModelJson** | **string** | | [optional] [default to null] +**decisionName** | **string** | | [optional] [default to null] +**dmnDeploymentId** | **number** | | [optional] [default to null] +**executionId** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] +**renderedVariables** | **any** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/DecisionAuditsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/DecisionAuditsApi.md new file mode 100644 index 0000000000..5290d6156c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/DecisionAuditsApi.md @@ -0,0 +1,97 @@ +# DecisionAuditsApi + +All URIs are relative to */activiti-app/api* + +| Method | HTTP request | Description | +|-----------------------------------|-----------------------------------------------------|-----------------------------------| +| [getAuditTrail](#getAuditTrail) | **GET** /enterprise/decisions/audits/{auditTrailId} | Get an audit trail | +| [getAuditTrails](#getAuditTrails) | **GET** /enterprise/decisions/audits | Query decision table audit trails | + +# getAuditTrail + +Get an audit trail + +**Parameters** + +| Name | Type | +|------------------|--------| +| **auditTrailId** | number | + +**Return type**: [DecisionAuditRepresentation](#DecisionAuditRepresentation) + +**Example** + +```javascript +import { AlfrescoApi, DecisionAuditsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const decisionAuditsApi = new DecisionAuditsApi(this.alfrescoApi); +const auditTrailId = 0; + +decisionauditsApi.getAuditTrail(auditTrailId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# getAuditTrails + +Query decision table audit trails + +**Parameters** + +| Name | Type | +|---------------------|--------| +| **decisionKey** | string | +| **dmnDeploymentId** | number | + +**Return type**: [ResultListDataRepresentationDecisionAuditRepresentation](#ResultListDataRepresentationDecisionAuditRepresentation) + +**Example** + +```javascript +import { AlfrescoApi, DecisionAuditsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const decisionAuditsApi = new DecisionAuditsApi(this.alfrescoApi); +const dmnDeploymentId = 0; + +decisionauditsApi.getAuditTrails(`<decisionKey>`, dmnDeploymentId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## ResultListDataRepresentationDecisionAuditRepresentation + +**Properties** + +| Name | Type | +|-------|---------------------------------------------------------------| +| data | [DecisionAuditRepresentation[]](#DecisionAuditRepresentation) | +| size | number | +| start | number | +| total | number | + +## DecisionAuditRepresentation + +**Properties** + +| Name | Type | +|-------------------------|---------| +| activityId | string | +| activityName | string | +| auditTrailJson | string | +| created | Date | +| decisionExecutionFailed | boolean | +| decisionKey | string | +| decisionModelJson | string | +| decisionName | string | +| dmnDeploymentId | number | +| executionId | string | +| id | number | +| processDefinitionId | string | +| processInstanceId | string | +| renderedVariables | any | + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/DecisionTablesApi.md b/lib/js-api/src/api/activiti-rest-api/docs/DecisionTablesApi.md new file mode 100644 index 0000000000..72d5d5e32d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/DecisionTablesApi.md @@ -0,0 +1,136 @@ +# DecisionTablesApi + +All URIs are relative to */activiti-app/api* + +| Method | HTTP request | Description | +|-----------------------------------------------------------|----------------------------------------------------------------------------|-------------------------------------| +| [getDecisionTableEditorJson](#getDecisionTableEditorJson) | **GET** /enterprise/decisions/decision-tables/{decisionTableId}/editorJson | Get definition for a decision table | +| [getDecisionTable](#getDecisionTable) | **GET** /enterprise/decisions/decision-tables/{decisionTableId} | Get a decision table | +| [getDecisionTables](#getDecisionTables) | **GET** /enterprise/decisions/decision-tables | Query decision tables | + +# getDecisionTableEditorJson + +Get definition for a decision table + +**Parameters** + +| Name | Type | +|---------------------|--------| +| **decisionTableId** | number | + +**Return type**: [JsonNode](#JsonNode) + +**Example** + +```javascript +import { AlfrescoApi, DecisionTablesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const decisionTablesApi = new DecisionTablesApi(alfrescoApi); +const decisionTableId = 0; + +decisionTablesApi.getDecisionTableEditorJson(decisionTableId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# getDecisionTable + +Get a decision table + +**Parameters** + +| Name | Type | +|---------------------|--------| +| **decisionTableId** | number | + +**Return type**: [RuntimeDecisionTableRepresentation](RuntimeDecisionTableRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, DecisionTablesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const decisionTablesApi = new DecisionTablesApi(alfrescoApi); +const decisionTableId = 0; + +decisionTablesApi.getDecisionTable(decisionTableId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# getDecisionTables + +Query decision tables + +**Parameters** + +| Name | Type | +|--------------|--------| +| nameLike | string | +| keyLike | string | +| tenantIdLike | string | +| deploymentId | number | +| sort | string | +| order | string | +| start | number | +| size | number | + +**Return type**: [ResultListDataRepresentationRuntimeDecisionTableRepresentation](ResultListDataRepresentationRuntimeDecisionTableRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, DecisionTablesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const decisionTablesApi = new DecisionTablesApi(alfrescoApi); +const opts = {}; + +decisionTablesApi.getDecisionTables(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## JsonNode + +**Properties** + +| Name | Type | +|---------------------|---------| +| array | boolean | +| bigDecimal | boolean | +| bigInteger | boolean | +| binary | boolean | +| boolean | boolean | +| containerNode | boolean | +| double | boolean | +| float | boolean | +| floatingPointNumber | boolean | +| int | boolean | +| integralNumber | boolean | +| long | boolean | +| missingNode | boolean | +| nodeType | string | +| null | boolean | +| number | boolean | +| object | boolean | +| pojo | boolean | +| short | boolean | +| textual | boolean | +| valueNode | boolean | + +### JsonNode.NodeTypeEnum + +* `ARRAY` (value: `'ARRAY'`) +* `BINARY` (value: `'BINARY'`) +* `BOOLEAN` (value: `'BOOLEAN'`) +* `MISSING` (value: `'MISSING'`) +* `NULL` (value: `'NULL'`) +* `NUMBER` (value: `'NUMBER'`) +* `OBJECT` (value: `'OBJECT'`) +* `POJO` (value: `'POJO'`) +* `STRING` (value: `'STRING'`) diff --git a/lib/js-api/src/api/activiti-rest-api/docs/DecisionTaskRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/DecisionTaskRepresentation.md new file mode 100644 index 0000000000..a45461ec1d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/DecisionTaskRepresentation.md @@ -0,0 +1,19 @@ +# DecisionTaskRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activityId** | **string** | | [optional] [default to null] +**activityName** | **string** | | [optional] [default to null] +**decisionExecutionEnded** | [**Date**](Date.md) | | [optional] [default to null] +**decisionExecutionFailed** | **boolean** | | [optional] [default to null] +**decisionKey** | **string** | | [optional] [default to null] +**decisionName** | **string** | | [optional] [default to null] +**dmnDeploymentId** | **number** | | [optional] [default to null] +**executionId** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/EndpointConfigurationRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/EndpointConfigurationRepresentation.md new file mode 100644 index 0000000000..1d99cab1aa --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/EndpointConfigurationRepresentation.md @@ -0,0 +1,17 @@ +# EndpointConfigurationRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**basicAuthId** | **number** | | [optional] [default to null] +**basicAuthName** | **string** | | [optional] [default to null] +**host** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**path** | **string** | | [optional] [default to null] +**port** | **string** | | [optional] [default to null] +**protocol** | **string** | | [optional] [default to null] +**requestHeaders** | [**EndpointRequestHeaderRepresentation[]**](EndpointRequestHeaderRepresentation.md) | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/EndpointRequestHeaderRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/EndpointRequestHeaderRepresentation.md new file mode 100644 index 0000000000..db94fc10fe --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/EndpointRequestHeaderRepresentation.md @@ -0,0 +1,9 @@ +# EndpointRequestHeaderRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] +**value** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/EndpointsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/EndpointsApi.md new file mode 100644 index 0000000000..7b7254f324 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/EndpointsApi.md @@ -0,0 +1,80 @@ +# EndpointsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getEndpointConfiguration**](EndpointsApi.md#getEndpointConfiguration) | **GET** /enterprise/editor/endpoints/{endpointConfigurationId} | Get an endpoint configuration +[**getEndpointConfigurations**](EndpointsApi.md#getEndpointConfigurations) | **GET** /enterprise/editor/endpoints | List endpoint configurations + + +<a name="getEndpointConfiguration"></a> +# **getEndpointConfiguration** +> EndpointConfigurationRepresentation getEndpointConfiguration(endpointConfigurationId) + +Get an endpoint configuration + +### Example +```javascript +import EndpointsApi from 'EndpointsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let endpointsApi = new EndpointsApi(this.alfrescoApi); + + +endpointsApi.getEndpointConfiguration(endpointConfigurationId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **endpointConfigurationId** | **number**| endpointConfigurationId | + +### Return type + +[**EndpointConfigurationRepresentation**](EndpointConfigurationRepresentation.md) + +<a name="getEndpointConfigurations"></a> +# **getEndpointConfigurations** +> EndpointConfigurationRepresentation getEndpointConfigurations() + +List endpoint configurations + +### Example +```javascript +import EndpointsApi from 'EndpointsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let endpointsApi = new EndpointsApi(this.alfrescoApi); + +endpointsApi.getEndpointConfigurations().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**EndpointConfigurationRepresentation**](EndpointConfigurationRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/EntityAttributeScopeRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/EntityAttributeScopeRepresentation.md new file mode 100644 index 0000000000..33dd70a2db --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/EntityAttributeScopeRepresentation.md @@ -0,0 +1,9 @@ +# EntityAttributeScopeRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/EntityVariableScopeRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/EntityVariableScopeRepresentation.md new file mode 100644 index 0000000000..acdd95e820 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/EntityVariableScopeRepresentation.md @@ -0,0 +1,11 @@ +# EntityVariableScopeRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**EntityAttributeScopeRepresentation[]**](EntityAttributeScopeRepresentation.md) | | [optional] [default to null] +**entityName** | **string** | | [optional] [default to null] +**mappedDataModel** | **number** | | [optional] [default to null] +**mappedVariableName** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FieldValueInfo.md b/lib/js-api/src/api/activiti-rest-api/docs/FieldValueInfo.md new file mode 100644 index 0000000000..85f6b0a08a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FieldValueInfo.md @@ -0,0 +1,9 @@ +# FieldValueInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | [optional] [default to null] +**value** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/File.md b/lib/js-api/src/api/activiti-rest-api/docs/File.md new file mode 100644 index 0000000000..253a961e81 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/File.md @@ -0,0 +1,22 @@ +# File + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**absolute** | **boolean** | | [optional] [default to null] +**absoluteFile** | **Blob** | | [optional] [default to null] +**absolutePath** | **string** | | [optional] [default to null] +**canonicalFile** | **Blob** | | [optional] [default to null] +**canonicalPath** | **string** | | [optional] [default to null] +**directory** | **boolean** | | [optional] [default to null] +**file** | **boolean** | | [optional] [default to null] +**freeSpace** | **number** | | [optional] [default to null] +**hidden** | **boolean** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**parent** | **string** | | [optional] [default to null] +**parentFile** | **Blob** | | [optional] [default to null] +**path** | **string** | | [optional] [default to null] +**totalSpace** | **number** | | [optional] [default to null] +**usableSpace** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormDefinitionRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormDefinitionRepresentation.md new file mode 100644 index 0000000000..9c8aef5fde --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormDefinitionRepresentation.md @@ -0,0 +1,29 @@ +# FormDefinitionRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **string** | | [optional] [default to null] +**customFieldTemplates** | **{ [key: string]: string; }** | | [optional] [default to null] +**customFieldsValueInfo** | [**{ [key: string]: FieldValueInfo; }**](FieldValueInfo.md) | | [optional] [default to null] +**fields** | [**FormFieldRepresentation[]**](FormFieldRepresentation.md) | | [optional] [default to null] +**globalDateFormat** | **string** | | [optional] [default to null] +**gridsterForm** | **boolean** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**javascriptEvents** | [**FormJavascriptEventRepresentation[]**](FormJavascriptEventRepresentation.md) | | [optional] [default to null] +**metadata** | **{ [key: string]: string; }** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**outcomeTarget** | **string** | | [optional] [default to null] +**outcomes** | [**FormOutcomeRepresentation[]**](FormOutcomeRepresentation.md) | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**processDefinitionName** | **string** | | [optional] [default to null] +**selectedOutcome** | **string** | | [optional] [default to null] +**style** | **string** | | [optional] [default to null] +**tabs** | [**FormTabRepresentation[]**](FormTabRepresentation.md) | | [optional] [default to null] +**taskDefinitionKey** | **string** | | [optional] [default to null] +**taskId** | **string** | | [optional] [default to null] +**taskName** | **string** | | [optional] [default to null] +**variables** | [**FormVariableRepresentation[]**](FormVariableRepresentation.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormFieldRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormFieldRepresentation.md new file mode 100644 index 0000000000..8b396a1709 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormFieldRepresentation.md @@ -0,0 +1,38 @@ +# FormFieldRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **string** | | [optional] [default to null] +**col** | **number** | | [optional] [default to null] +**colspan** | **number** | | [optional] [default to null] +**dateDisplayFormat** | **string** | | [optional] [default to null] +**hasEmptyValue** | **boolean** | | [optional] [default to null] +**id** | **string** | | [optional] [default to null] +**layout** | [**LayoutRepresentation**](LayoutRepresentation.md) | | [optional] [default to null] +**maxLength** | **number** | | [optional] [default to null] +**maxValue** | **string** | | [optional] [default to null] +**minLength** | **number** | | [optional] [default to null] +**minValue** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**optionType** | **string** | | [optional] [default to null] +**options** | [**OptionRepresentation[]**](OptionRepresentation.md) | | [optional] [default to null] +**overrideId** | **boolean** | | [optional] [default to null] +**params** | **any** | | [optional] [default to null] +**placeholder** | **string** | | [optional] [default to null] +**readOnly** | **boolean** | | [optional] [default to null] +**regexPattern** | **string** | | [optional] [default to null] +**required** | **boolean** | | [optional] [default to null] +**restIdProperty** | **string** | | [optional] [default to null] +**restLabelProperty** | **string** | | [optional] [default to null] +**restResponsePath** | **string** | | [optional] [default to null] +**restUrl** | **string** | | [optional] [default to null] +**row** | **number** | | [optional] [default to null] +**sizeX** | **number** | | [optional] [default to null] +**sizeY** | **number** | | [optional] [default to null] +**tab** | **string** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] +**value** | **any** | | [optional] [default to null] +**visibilityCondition** | [**ConditionRepresentation**](ConditionRepresentation.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormIdentifierRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormIdentifierRepresentation.md new file mode 100644 index 0000000000..75523fc101 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormIdentifierRepresentation.md @@ -0,0 +1,8 @@ +# FormIdentifierRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**formId** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormJavascriptEventRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormJavascriptEventRepresentation.md new file mode 100644 index 0000000000..a10b1776ae --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormJavascriptEventRepresentation.md @@ -0,0 +1,9 @@ +# FormJavascriptEventRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event** | **string** | | [optional] [default to null] +**javascriptLogic** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormModelsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/FormModelsApi.md new file mode 100644 index 0000000000..51f332c338 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormModelsApi.md @@ -0,0 +1,223 @@ +# Form Models Api + +All URIs are relative to */activiti-app/api* + +| Method | HTTP request | Description | +|-----------------------------------------|-------------------------------------------------------------------------|-----------------------------| +| [getFormEditorJson](#getFormEditorJson) | **GET** /enterprise/forms/{formId}/editorJson | Get form content | +| [getFormHistory](#getFormHistory) | **GET** /enterprise/editor/form-models/{formId}/history/{formHistoryId} | Get form history | +| [getForm](#getForm) | **GET** /enterprise/editor/form-models/{formId} | Get a form model | +| [getForm](#getForm) | **GET** /enterprise/forms/{formId} | Get a form | +| [getForms](#getForms) | **GET** /enterprise/editor/form-models/values | Get forms | +| [getForms](#getForms) | **GET** /enterprise/editor/form-models | List form models | +| [getForms](#getForms) | **GET** /enterprise/forms | Query forms | +| [saveForm](#saveForm) | **PUT** /enterprise/editor/form-models/{formId} | Update form model content | +| [validateModel](#validateModel) | **PUT** /enterprise/editor/form-models/{formId}/validate | Validate form model content | + + +# **getFormEditorJson** + +Get form content + +**Parameters** + +| Name | Type | Description | +|------------|------------|-------------| +| **formId** | **number** | formId | + +**Return type**: [FormDefinitionRepresentation](FormDefinitionRepresentation.md) + +**Example** + +```javascript +import {AlfrescoApi, FormModelsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const formModelsApi = new FormModelsApi(alfrescoApi); + +formModelsApi.getFormEditorJson(formId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# **getFormHistory** + +Get form history + +**Parameters** + +| Name | Type | Description | +|-------------------|--------|---------------| +| **formId** | number | formId | +| **formHistoryId** | number | formHistoryId | + +**Return type**: [FormRepresentation](FormRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, FormModelsApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const formModelsApi = new FormModelsApi(alfrescoApi); + +formModelsApi.getFormHistory(formIdformHistoryId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# **getForm** + +Get a form model + +**Parameters** + +| Name | Type | Description | +|------------|--------|-------------| +| **formId** | number | formId | + +**Return type**: [FormRepresentation](FormRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, FormModelsApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const formModelsApi = new FormModelsApi(alfrescoApi); + +formModelsApi.getForm(formId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# **getForms** + +Get forms + +**Parameters** + +| Name | Type | Description | +|------------|--------|-------------| +| **formId** | string | formId | + +**Return type**: [**FormRepresentation**](FormRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, FormModelsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const formModelsApi = new FormModelsApi(alfrescoApi); + +formModelsApi.getForms(formId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# **getForms** + +List form models + +**Return type**: [ResultListDataRepresentationFormRepresentation](ResultListDataRepresentationFormRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, FormModelsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const formModelsApi = new FormModelsApi(alfrescoApi); + +formModelsApi.getForms().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# **getForms** + +Query forms + +**Parameters** + +| Name | Type | Description | +|----------|--------|-------------| +| nameLike | string | nameLike | +| appId | number | appId | +| tenantId | number | tenantId | +| start | number | start | +| sort | string | sort | +| order | string | order | +| size | number | size | + +**Return type**: [ResultListDataRepresentationRuntimeFormRepresentation](ResultListDataRepresentationRuntimeFormRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, FormModelsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const formModelsApi = new FormModelsApi(alfrescoApi); +const opts = {/*...*/}; + +formModelsApi.getForms(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# **saveForm** + +Update form model content + +**Parameters** + +| Name | Type | Description | +|------------------------|-----------------------------------------------------|--------------------------| +| **formId** | number | ID of the form to update | +| **saveRepresentation** | [FormSaveRepresentation](FormSaveRepresentation.md) | saveRepresentation | + +**Return type**: [FormRepresentation](FormRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, FormModelsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const formModelsApi = new FormModelsApi(alfrescoApi); + +formModelsApi.saveForm(formIdsaveRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# **validateModel** + +Validate form model content + +The model content to be validated must be specified in the POST body + +**Parameters** + +| Name | Type | Description | +|------------------------|-----------------------------------------------------|--------------------| +| **formId** | number | formId | +| **saveRepresentation** | [FormSaveRepresentation](FormSaveRepresentation.md) | saveRepresentation | + +**Return type**: [ValidationErrorRepresentation](ValidationErrorRepresentation.md) + +**Example** + +```javascript +import { AlfrescoApi, FormModelsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const formModelsApi = new FormModelsApi(alfrescoApi); +const payload = {/*...*/}; + +formModelsApi.validateModel(payload).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` \ No newline at end of file diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormOutcomeRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormOutcomeRepresentation.md new file mode 100644 index 0000000000..1891978fb3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormOutcomeRepresentation.md @@ -0,0 +1,9 @@ +# FormOutcomeRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormRepresentation.md new file mode 100644 index 0000000000..de82d0dec7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormRepresentation.md @@ -0,0 +1,17 @@ +# FormRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | | [optional] [default to null] +**formDefinition** | [**FormDefinitionRepresentation**](FormDefinitionRepresentation.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastUpdated** | [**Date**](Date.md) | | [optional] [default to null] +**lastUpdatedBy** | **number** | | [optional] [default to null] +**lastUpdatedByFullName** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**referenceId** | **number** | | [optional] [default to null] +**stencilSetId** | **number** | | [optional] [default to null] +**version** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormSaveRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormSaveRepresentation.md new file mode 100644 index 0000000000..339fa32da9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormSaveRepresentation.md @@ -0,0 +1,13 @@ +# FormSaveRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment** | **string** | | [optional] [default to null] +**formImageBase64** | **string** | | [optional] [default to null] +**formRepresentation** | [**FormRepresentation**](FormRepresentation.md) | | [optional] [default to null] +**newVersion** | **boolean** | | [optional] [default to null] +**processScopeIdentifiers** | [**ProcessScopeIdentifierRepresentation[]**](ProcessScopeIdentifierRepresentation.md) | | [optional] [default to null] +**reusable** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormScopeRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormScopeRepresentation.md new file mode 100644 index 0000000000..cbba22977d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormScopeRepresentation.md @@ -0,0 +1,13 @@ +# FormScopeRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | | [optional] [default to null] +**fieldVariables** | [**FormFieldRepresentation[]**](FormFieldRepresentation.md) | | [optional] [default to null] +**fields** | [**FormFieldRepresentation[]**](FormFieldRepresentation.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**outcomes** | [**FormOutcomeRepresentation[]**](FormOutcomeRepresentation.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormTabRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormTabRepresentation.md new file mode 100644 index 0000000000..90f452b957 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormTabRepresentation.md @@ -0,0 +1,10 @@ +# FormTabRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**title** | **string** | | [optional] [default to null] +**visibilityCondition** | [**ConditionRepresentation**](ConditionRepresentation.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormValueRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormValueRepresentation.md new file mode 100644 index 0000000000..450849db13 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormValueRepresentation.md @@ -0,0 +1,9 @@ +# FormValueRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/FormVariableRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/FormVariableRepresentation.md new file mode 100644 index 0000000000..d3acf8fc46 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/FormVariableRepresentation.md @@ -0,0 +1,10 @@ +# FormVariableRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] +**value** | **any** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/GlobalDateFormatRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/GlobalDateFormatRepresentation.md new file mode 100644 index 0000000000..e86a9b0afd --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/GlobalDateFormatRepresentation.md @@ -0,0 +1,8 @@ +# GlobalDateFormatRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**globalDateFormat** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/GoogleDriveContent.md b/lib/js-api/src/api/activiti-rest-api/docs/GoogleDriveContent.md new file mode 100644 index 0000000000..1875224431 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/GoogleDriveContent.md @@ -0,0 +1,12 @@ +# GoogleDriveContent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**folder** | **boolean** | | [optional] [default to null] +**id** | **string** | | [optional] [default to null] +**mimeType** | **string** | | [optional] [default to null] +**simpleType** | **string** | | [optional] [default to null] +**title** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/GroupCapabilityRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/GroupCapabilityRepresentation.md new file mode 100644 index 0000000000..0077115fa7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/GroupCapabilityRepresentation.md @@ -0,0 +1,9 @@ +# GroupCapabilityRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/GroupRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/GroupRepresentation.md new file mode 100644 index 0000000000..1d9bb71a66 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/GroupRepresentation.md @@ -0,0 +1,20 @@ +# GroupRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capabilities** | [**GroupCapabilityRepresentation[]**](GroupCapabilityRepresentation.md) | | [optional] [default to null] +**externalId** | **string** | | [optional] [default to null] +**groups** | [**GroupRepresentation[]**](GroupRepresentation.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastSyncTimeStamp** | [**Date**](Date.md) | | [optional] [default to null] +**manager** | [**UserRepresentation**](UserRepresentation.md) | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**parentGroupId** | **number** | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] +**type** | **number** | | [optional] [default to null] +**userCount** | **number** | | [optional] [default to null] +**users** | [**UserRepresentation[]**](UserRepresentation.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/GroupsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/GroupsApi.md new file mode 100644 index 0000000000..525bd84abb --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/GroupsApi.md @@ -0,0 +1,95 @@ +# GroupsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getGroups**](GroupsApi.md#getGroups) | **GET** /enterprise/groups | Query groups +[**getUsersForGroup**](GroupsApi.md#getUsersForGroup) | **GET** /enterprise/groups/{groupId}/users | List members of a group + + +<a name="getGroups"></a> +# **getGroups** +> ResultListDataRepresentationLightGroupRepresentation getGroups(opts) + +Query groups + +### Example +```javascript +import GroupsApi from 'GroupsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let groupsApi = new GroupsApi(this.alfrescoApi); + +let opts = { + 'filter': filter_example // | filter + 'groupId': 789 // | groupId + 'externalId': externalId_example // | externalId + 'externalIdCaseInsensitive': externalIdCaseInsensitive_example // | externalIdCaseInsensitive + 'tenantId': 789 // | tenantId +}; + +groupsApi.getGroups(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | **string**| filter | [optional] + **groupId** | **number**| groupId | [optional] + **externalId** | **string**| externalId | [optional] + **externalIdCaseInsensitive** | **string**| externalIdCaseInsensitive | [optional] + **tenantId** | **number**| tenantId | [optional] + +### Return type + +[**ResultListDataRepresentationLightGroupRepresentation**](ResultListDataRepresentationLightGroupRepresentation.md) + +<a name="getUsersForGroup"></a> +# **getUsersForGroup** +> ResultListDataRepresentationLightUserRepresentation getUsersForGroup(groupId) + +List members of a group + +### Example +```javascript +import GroupsApi from 'GroupsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let groupsApi = new GroupsApi(this.alfrescoApi); + + +groupsApi.getUsersForGroup(groupId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **groupId** | **number**| groupId | + +### Return type + +[**ResultListDataRepresentationLightUserRepresentation**](ResultListDataRepresentationLightUserRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/HistoricProcessInstanceQueryRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/HistoricProcessInstanceQueryRepresentation.md new file mode 100644 index 0000000000..e10bb327f1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/HistoricProcessInstanceQueryRepresentation.md @@ -0,0 +1,30 @@ +# HistoricProcessInstanceQueryRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**excludeSubprocesses** | **boolean** | | [optional] [default to null] +**finished** | **boolean** | | [optional] [default to null] +**finishedAfter** | [**Date**](Date.md) | | [optional] [default to null] +**finishedBefore** | [**Date**](Date.md) | | [optional] [default to null] +**includeProcessVariables** | **boolean** | | [optional] [default to null] +**involvedUser** | **string** | | [optional] [default to null] +**order** | **string** | | [optional] [default to null] +**processBusinessKey** | **string** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] +**processInstanceIds** | **string[]** | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**sort** | **string** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**startedAfter** | [**Date**](Date.md) | | [optional] [default to null] +**startedBefore** | [**Date**](Date.md) | | [optional] [default to null] +**startedBy** | **string** | | [optional] [default to null] +**superProcessInstanceId** | **string** | | [optional] [default to null] +**tenantId** | **string** | | [optional] [default to null] +**tenantIdLike** | **string** | | [optional] [default to null] +**variables** | [**QueryVariable[]**](QueryVariable.md) | | [optional] [default to null] +**withoutTenantId** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/HistoricTaskInstanceQueryRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/HistoricTaskInstanceQueryRepresentation.md new file mode 100644 index 0000000000..01e8e32407 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/HistoricTaskInstanceQueryRepresentation.md @@ -0,0 +1,58 @@ +# HistoricTaskInstanceQueryRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dueDate** | [**Date**](Date.md) | | [optional] [default to null] +**dueDateAfter** | [**Date**](Date.md) | | [optional] [default to null] +**dueDateBefore** | [**Date**](Date.md) | | [optional] [default to null] +**executionId** | **string** | | [optional] [default to null] +**finished** | **boolean** | | [optional] [default to null] +**includeProcessVariables** | **boolean** | | [optional] [default to null] +**includeTaskLocalVariables** | **boolean** | | [optional] [default to null] +**order** | **string** | | [optional] [default to null] +**parentTaskId** | **string** | | [optional] [default to null] +**processBusinessKey** | **string** | | [optional] [default to null] +**processBusinessKeyLike** | **string** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**processDefinitionKeyLike** | **string** | | [optional] [default to null] +**processDefinitionName** | **string** | | [optional] [default to null] +**processDefinitionNameLike** | **string** | | [optional] [default to null] +**processFinished** | **boolean** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] +**processVariables** | [**QueryVariable[]**](QueryVariable.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**sort** | **string** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**taskAssignee** | **string** | | [optional] [default to null] +**taskAssigneeLike** | **string** | | [optional] [default to null] +**taskCandidateGroup** | **string** | | [optional] [default to null] +**taskCompletedAfter** | [**Date**](Date.md) | | [optional] [default to null] +**taskCompletedBefore** | [**Date**](Date.md) | | [optional] [default to null] +**taskCompletedOn** | [**Date**](Date.md) | | [optional] [default to null] +**taskCreatedAfter** | [**Date**](Date.md) | | [optional] [default to null] +**taskCreatedBefore** | [**Date**](Date.md) | | [optional] [default to null] +**taskCreatedOn** | [**Date**](Date.md) | | [optional] [default to null] +**taskDefinitionKey** | **string** | | [optional] [default to null] +**taskDefinitionKeyLike** | **string** | | [optional] [default to null] +**taskDeleteReason** | **string** | | [optional] [default to null] +**taskDeleteReasonLike** | **string** | | [optional] [default to null] +**taskDescription** | **string** | | [optional] [default to null] +**taskDescriptionLike** | **string** | | [optional] [default to null] +**taskId** | **string** | | [optional] [default to null] +**taskInvolvedUser** | **string** | | [optional] [default to null] +**taskMaxPriority** | **number** | | [optional] [default to null] +**taskMinPriority** | **number** | | [optional] [default to null] +**taskName** | **string** | | [optional] [default to null] +**taskNameLike** | **string** | | [optional] [default to null] +**taskOwner** | **string** | | [optional] [default to null] +**taskOwnerLike** | **string** | | [optional] [default to null] +**taskPriority** | **number** | | [optional] [default to null] +**taskVariables** | [**QueryVariable[]**](QueryVariable.md) | | [optional] [default to null] +**tenantId** | **string** | | [optional] [default to null] +**tenantIdLike** | **string** | | [optional] [default to null] +**withoutDueDate** | **boolean** | | [optional] [default to null] +**withoutTenantId** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/IDMSyncApi.md b/lib/js-api/src/api/activiti-rest-api/docs/IDMSyncApi.md new file mode 100644 index 0000000000..8fa6bda0ce --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/IDMSyncApi.md @@ -0,0 +1,95 @@ +# IdmsyncApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getLogFile**](IDMSyncApi.md#getLogFile) | **GET** /enterprise/idm-sync-log-entries/{syncLogEntryId}/logfile | Get log file for a sync log entry +[**getSyncLogEntries**](IDMSyncApi.md#getSyncLogEntries) | **GET** /enterprise/idm-sync-log-entries | List sync log entries + + +<a name="getLogFile"></a> +# **getLogFile** +> getLogFile(syncLogEntryId) + +Get log file for a sync log entry + +### Example + +```javascript +import IdmsyncApi from 'src/api/activiti-rest-api/docs/IDMSyncApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let idmsyncApi = new IdmsyncApi(this.alfrescoApi); + + +idmsyncApi.getLogFile(syncLogEntryId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **syncLogEntryId** | **number**| syncLogEntryId | + +### Return type + +null (empty response body) + +<a name="getSyncLogEntries"></a> +# **getSyncLogEntries** +> SyncLogEntryRepresentation getSyncLogEntries(opts) + +List sync log entries + +### Example + +```javascript +import IdmsyncApi from 'src/api/activiti-rest-api/docs/IDMSyncApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let idmsyncApi = new IdmsyncApi(this.alfrescoApi); + +let opts = { + 'tenantId': 789 // | tenantId + 'page': 56 // | page + 'start': 56 // | start + 'size': 56 // | size +}; + +idmsyncApi.getSyncLogEntries(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | [optional] + **page** | **number**| page | [optional] + **start** | **number**| start | [optional] + **size** | **number**| size | [optional] + +### Return type + +[**SyncLogEntryRepresentation**](SyncLogEntryRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/IdentityLinkRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/IdentityLinkRepresentation.md new file mode 100644 index 0000000000..11e2d9999b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/IdentityLinkRepresentation.md @@ -0,0 +1,10 @@ +# IdentityLinkRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | **string** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] +**user** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ImageUploadRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ImageUploadRepresentation.md new file mode 100644 index 0000000000..f71301a5d3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ImageUploadRepresentation.md @@ -0,0 +1,11 @@ +# ImageUploadRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | [**Date**](Date.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**userId** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi.md b/lib/js-api/src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi.md new file mode 100644 index 0000000000..604057a687 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi.md @@ -0,0 +1,250 @@ +# IntegrationalfrescocloudApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**confirmAuthorisation**](IntegrationAlfrescoCloudApi.md#confirmAuthorisation) | **GET** /enterprise/integration/alfresco-cloud/confirm-auth-request | Alfresco Cloud Authorization +[**getAllNetworks**](IntegrationAlfrescoCloudApi.md#getAllNetworks) | **GET** /enterprise/integration/alfresco-cloud/networks | List Alfresco networks +[**getAllSites**](IntegrationAlfrescoCloudApi.md#getAllSites) | **GET** /enterprise/integration/alfresco-cloud/networks/{networkId}/sites | List Alfresco sites +[**getContentInFolderPath**](IntegrationAlfrescoCloudApi.md#getContentInFolderPath) | **GET** /enterprise/integration/alfresco-cloud/networks/{networkId}/sites/{siteId}/folderpath/{folderPath}/content | List files and folders inside a specific folder identified by path +[**getContentInFolder**](IntegrationAlfrescoCloudApi.md#getContentInFolder) | **GET** /enterprise/integration/alfresco-cloud/networks/{networkId}/folders/{folderId}/content | List files and folders inside a specific folder +[**getContentInSite**](IntegrationAlfrescoCloudApi.md#getContentInSite) | **GET** /enterprise/integration/alfresco-cloud/networks/{networkId}/sites/{siteId}/content | List files and folders inside a specific site + + +<a name="confirmAuthorisation"></a> +# **confirmAuthorisation** +> confirmAuthorisation(code) + +Alfresco Cloud Authorization + +Returns Alfresco OAuth HTML Page + +### Example + +```javascript +import IntegrationalfrescocloudApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescocloudApi = new IntegrationalfrescocloudApi(this.alfrescoApi); + + +integrationalfrescocloudApi.confirmAuthorisation(code).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **string**| code | + +### Return type + +null (empty response body) + +<a name="getAllNetworks"></a> +# **getAllNetworks** +> ResultListDataRepresentationAlfrescoNetworkRepresenation getAllNetworks() + +List Alfresco networks + +### Example + +```javascript +import IntegrationalfrescocloudApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescocloudApi = new IntegrationalfrescocloudApi(this.alfrescoApi); + +integrationalfrescocloudApi.getAllNetworks().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ResultListDataRepresentationAlfrescoNetworkRepresenation**](ResultListDataRepresentationAlfrescoNetworkRepresenation.md) + +<a name="getAllSites"></a> +# **getAllSites** +> ResultListDataRepresentationAlfrescoSiteRepresenation getAllSites(networkId) + +List Alfresco sites + +Returns ALL Sites + +### Example + +```javascript +import IntegrationalfrescocloudApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescocloudApi = new IntegrationalfrescocloudApi(this.alfrescoApi); + + +integrationalfrescocloudApi.getAllSites(networkId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **networkId** | **string**| networkId | + +### Return type + +[**ResultListDataRepresentationAlfrescoSiteRepresenation**](ResultListDataRepresentationAlfrescoSiteRepresenation.md) + +<a name="getContentInFolderPath"></a> +# **getContentInFolderPath** +> ResultListDataRepresentationAlfrescoContentRepresentation getContentInFolderPath(networkIdopts) + +List files and folders inside a specific folder identified by path + +### Example + +```javascript +import IntegrationalfrescocloudApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescocloudApi = new IntegrationalfrescocloudApi(this.alfrescoApi); + +let opts = { + 'siteId': siteId_example // | siteId + 'path': path_example // | path +}; + +integrationalfrescocloudApi.getContentInFolderPath(networkIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **networkId** | **string**| networkId | + **siteId** | **string**| siteId | [optional] + **path** | **string**| path | [optional] + +### Return type + +[**ResultListDataRepresentationAlfrescoContentRepresentation**](ResultListDataRepresentationAlfrescoContentRepresentation.md) + +<a name="getContentInFolder"></a> +# **getContentInFolder** +> ResultListDataRepresentationAlfrescoContentRepresentation getContentInFolder(networkIdfolderId) + +List files and folders inside a specific folder + +### Example + +```javascript +import IntegrationalfrescocloudApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescocloudApi = new IntegrationalfrescocloudApi(this.alfrescoApi); + + +integrationalfrescocloudApi.getContentInFolder(networkIdfolderId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **networkId** | **string**| networkId | + **folderId** | **string**| folderId | + +### Return type + +[**ResultListDataRepresentationAlfrescoContentRepresentation**](ResultListDataRepresentationAlfrescoContentRepresentation.md) + +<a name="getContentInSite"></a> +# **getContentInSite** +> ResultListDataRepresentationAlfrescoContentRepresentation getContentInSite(networkIdsiteId) + +List files and folders inside a specific site + +### Example + +```javascript +import IntegrationalfrescocloudApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoCloudApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescocloudApi = new IntegrationalfrescocloudApi(this.alfrescoApi); + + +integrationalfrescocloudApi.getContentInSite(networkIdsiteId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **networkId** | **string**| networkId | + **siteId** | **string**| siteId | + +### Return type + +[**ResultListDataRepresentationAlfrescoContentRepresentation**](ResultListDataRepresentationAlfrescoContentRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi.md b/lib/js-api/src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi.md new file mode 100644 index 0000000000..9851d7d384 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi.md @@ -0,0 +1,216 @@ +# IntegrationalfrescoonpremiseApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getAllSites**](IntegrationAlfrescoOnPremiseApi.md#getAllSites) | **GET** /enterprise/integration/alfresco/{repositoryId}/sites | List Alfresco sites +[**getContentInFolderPath**](IntegrationAlfrescoOnPremiseApi.md#getContentInFolderPath) | **GET** /enterprise/rest/integration/alfresco/{repositoryId}/sites/{siteId}/folderpath/{folderPath}/content | List files and folders inside a specific folder identified by folder path +[**getContentInFolder**](IntegrationAlfrescoOnPremiseApi.md#getContentInFolder) | **GET** /enterprise/integration/alfresco/{repositoryId}/folders/{folderId}/content | List files and folders inside a specific folder +[**getContentInSite**](IntegrationAlfrescoOnPremiseApi.md#getContentInSite) | **GET** /enterprise/integration/alfresco/{repositoryId}/sites/{siteId}/content | List files and folders inside a specific site +[**getRepositories**](IntegrationAlfrescoOnPremiseApi.md#getRepositories) | **GET** /enterprise/profile/accounts/alfresco | List Alfresco repositories + + +<a name="getAllSites"></a> +# **getAllSites** +> ResultListDataRepresentationAlfrescoSiteRepresenation getAllSites(repositoryId) + +List Alfresco sites + +Returns ALL Sites + +### Example + +```javascript +import IntegrationalfrescoonpremiseApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescoonpremiseApi = new IntegrationalfrescoonpremiseApi(this.alfrescoApi); + + +integrationalfrescoonpremiseApi.getAllSites(repositoryId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repositoryId** | **string**| repositoryId | + +### Return type + +[**ResultListDataRepresentationAlfrescoSiteRepresenation**](ResultListDataRepresentationAlfrescoSiteRepresenation.md) + +<a name="getContentInFolderPath"></a> +# **getContentInFolderPath** +> ResultListDataRepresentationAlfrescoContentRepresentation getContentInFolderPath(repositoryIdsiteIdfolderPath) + +List files and folders inside a specific folder identified by folder path + +### Example + +```javascript +import IntegrationalfrescoonpremiseApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescoonpremiseApi = new IntegrationalfrescoonpremiseApi(this.alfrescoApi); + + +integrationalfrescoonpremiseApi.getContentInFolderPath(repositoryIdsiteIdfolderPath).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repositoryId** | **string**| repositoryId | + **siteId** | **string**| siteId | + **folderPath** | **string**| folderPath | + +### Return type + +[**ResultListDataRepresentationAlfrescoContentRepresentation**](ResultListDataRepresentationAlfrescoContentRepresentation.md) + +<a name="getContentInFolder"></a> +# **getContentInFolder** +> ResultListDataRepresentationAlfrescoContentRepresentation getContentInFolder(repositoryIdfolderId) + +List files and folders inside a specific folder + +### Example + +```javascript +import IntegrationalfrescoonpremiseApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescoonpremiseApi = new IntegrationalfrescoonpremiseApi(this.alfrescoApi); + + +integrationalfrescoonpremiseApi.getContentInFolder(repositoryIdfolderId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repositoryId** | **string**| repositoryId | + **folderId** | **string**| folderId | + +### Return type + +[**ResultListDataRepresentationAlfrescoContentRepresentation**](ResultListDataRepresentationAlfrescoContentRepresentation.md) + +<a name="getContentInSite"></a> +# **getContentInSite** +> ResultListDataRepresentationAlfrescoContentRepresentation getContentInSite(repositoryIdsiteId) + +List files and folders inside a specific site + +### Example + +```javascript +import IntegrationalfrescoonpremiseApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescoonpremiseApi = new IntegrationalfrescoonpremiseApi(this.alfrescoApi); + + +integrationalfrescoonpremiseApi.getContentInSite(repositoryIdsiteId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repositoryId** | **string**| repositoryId | + **siteId** | **string**| siteId | + +### Return type + +[**ResultListDataRepresentationAlfrescoContentRepresentation**](ResultListDataRepresentationAlfrescoContentRepresentation.md) + +<a name="getRepositories"></a> +# **getRepositories** +> ResultListDataRepresentationAlfrescoEndpointRepresentation getRepositories(opts) + +List Alfresco repositories + +A tenant administrator can configure one or more Alfresco repositories to use when working with content. + +### Example + +```javascript +import IntegrationalfrescoonpremiseApi from 'src/api/activiti-rest-api/docs/IntegrationAlfrescoOnPremiseApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationalfrescoonpremiseApi = new IntegrationalfrescoonpremiseApi(this.alfrescoApi); + +let opts = { + 'tenantId': 789 // | tenantId + 'includeAccounts': true // | includeAccounts +}; + +integrationalfrescoonpremiseApi.getRepositories(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | [optional] + **includeAccounts** | **boolean**| includeAccounts | [optional] [default to true] + +### Return type + +[**ResultListDataRepresentationAlfrescoEndpointRepresentation**](ResultListDataRepresentationAlfrescoEndpointRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/IntegrationBoxApi.md b/lib/js-api/src/api/activiti-rest-api/docs/IntegrationBoxApi.md new file mode 100644 index 0000000000..6c34ef2515 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/IntegrationBoxApi.md @@ -0,0 +1,282 @@ +# IntegrationboxApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**confirmAuthorisation**](IntegrationBoxApi.md#confirmAuthorisation) | **GET** /enterprise/integration/box/confirm-auth-request | Box Authorization +[**createRepositoryAccount**](IntegrationBoxApi.md#createRepositoryAccount) | **POST** /enterprise/integration/box/{userId}/account | Add Box account +[**deleteRepositoryAccount**](IntegrationBoxApi.md#deleteRepositoryAccount) | **DELETE** /enterprise/integration/box/{userId}/account | Delete account information +[**getBoxPluginStatus**](IntegrationBoxApi.md#getBoxPluginStatus) | **GET** /enterprise/integration/box/status | Get status information +[**getFiles**](IntegrationBoxApi.md#getFiles) | **GET** /enterprise/integration/box/files | List file and folders +[**getRepositoryAccount**](IntegrationBoxApi.md#getRepositoryAccount) | **GET** /enterprise/integration/box/{userId}/account | Get account information +[**updateRepositoryAccount**](IntegrationBoxApi.md#updateRepositoryAccount) | **PUT** /enterprise/integration/box/{userId}/account | Update account information + + +<a name="confirmAuthorisation"></a> +# **confirmAuthorisation** +> confirmAuthorisation() + +Box Authorization + +Returns Box OAuth HTML Page + +### Example + +```javascript +import IntegrationboxApi from 'src/api/activiti-rest-api/docs/IntegrationBoxApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationboxApi = new IntegrationboxApi(this.alfrescoApi); + +integrationboxApi.confirmAuthorisation().then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +<a name="createRepositoryAccount"></a> +# **createRepositoryAccount** +> createRepositoryAccount(userIdcredentials) + +Add Box account + +### Example + +```javascript +import IntegrationboxApi from 'src/api/activiti-rest-api/docs/IntegrationBoxApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationboxApi = new IntegrationboxApi(this.alfrescoApi); + + +integrationboxApi.createRepositoryAccount(userIdcredentials).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + **credentials** | [**UserAccountCredentialsRepresentation**](UserAccountCredentialsRepresentation.md)| credentials | + +### Return type + +null (empty response body) + +<a name="deleteRepositoryAccount"></a> +# **deleteRepositoryAccount** +> deleteRepositoryAccount(userId) + +Delete account information + +### Example + +```javascript +import IntegrationboxApi from 'src/api/activiti-rest-api/docs/IntegrationBoxApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationboxApi = new IntegrationboxApi(this.alfrescoApi); + + +integrationboxApi.deleteRepositoryAccount(userId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + +### Return type + +null (empty response body) + +<a name="getBoxPluginStatus"></a> +# **getBoxPluginStatus** +> boolean getBoxPluginStatus() + +Get status information + +### Example + +```javascript +import IntegrationboxApi from 'src/api/activiti-rest-api/docs/IntegrationBoxApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationboxApi = new IntegrationboxApi(this.alfrescoApi); + +integrationboxApi.getBoxPluginStatus().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**boolean** + +<a name="getFiles"></a> +# **getFiles** +> ResultListDataRepresentationBoxContent getFiles(opts) + +List file and folders + +### Example + +```javascript +import IntegrationboxApi from 'src/api/activiti-rest-api/docs/IntegrationBoxApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationboxApi = new IntegrationboxApi(this.alfrescoApi); + +let opts = { + 'filter': filter_example // | filter + 'parent': parent_example // | parent +}; + +integrationboxApi.getFiles(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | **string**| filter | [optional] + **parent** | **string**| parent | [optional] + +### Return type + +[**ResultListDataRepresentationBoxContent**](ResultListDataRepresentationBoxContent.md) + +<a name="getRepositoryAccount"></a> +# **getRepositoryAccount** +> getRepositoryAccount(userId) + +Get account information + +### Example + +```javascript +import IntegrationboxApi from 'src/api/activiti-rest-api/docs/IntegrationBoxApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationboxApi = new IntegrationboxApi(this.alfrescoApi); + + +integrationboxApi.getRepositoryAccount(userId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + +### Return type + +null (empty response body) + +<a name="updateRepositoryAccount"></a> +# **updateRepositoryAccount** +> updateRepositoryAccount(userIdcredentials) + +Update account information + +### Example + +```javascript +import IntegrationboxApi from 'src/api/activiti-rest-api/docs/IntegrationBoxApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationboxApi = new IntegrationboxApi(this.alfrescoApi); + + +integrationboxApi.updateRepositoryAccount(userIdcredentials).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + **credentials** | [**UserAccountCredentialsRepresentation**](UserAccountCredentialsRepresentation.md)| credentials | + +### Return type + +null (empty response body) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/IntegrationDriveApi.md b/lib/js-api/src/api/activiti-rest-api/docs/IntegrationDriveApi.md new file mode 100644 index 0000000000..2b2f570983 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/IntegrationDriveApi.md @@ -0,0 +1,91 @@ +# IntegrationdriveApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**confirmAuthorisation**](IntegrationDriveApi.md#confirmAuthorisation) | **GET** /enterprise/integration/google-drive/confirm-auth-request | Drive Authorization +[**getFiles**](IntegrationDriveApi.md#getFiles) | **GET** /enterprise/integration/google-drive/files | List files and folders + + +<a name="confirmAuthorisation"></a> +# **confirmAuthorisation** +> confirmAuthorisation() + +Drive Authorization + +Returns Drive OAuth HTML Page + +### Example + +```javascript +import IntegrationdriveApi from 'src/api/activiti-rest-api/docs/IntegrationDriveApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationdriveApi = new IntegrationdriveApi(this.alfrescoApi); + +integrationdriveApi.confirmAuthorisation().then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +<a name="getFiles"></a> +# **getFiles** +> ResultListDataRepresentationGoogleDriveContent getFiles(opts) + +List files and folders + +### Example + +```javascript +import IntegrationdriveApi from 'src/api/activiti-rest-api/docs/IntegrationDriveApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let integrationdriveApi = new IntegrationdriveApi(this.alfrescoApi); + +let opts = { + 'filter': filter_example // | filter + 'parent': parent_example // | parent + 'currentFolderOnly': true // | currentFolderOnly +}; + +integrationdriveApi.getFiles(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | **string**| filter | [optional] + **parent** | **string**| parent | [optional] + **currentFolderOnly** | **boolean**| currentFolderOnly | [optional] + +### Return type + +[**ResultListDataRepresentationGoogleDriveContent**](ResultListDataRepresentationGoogleDriveContent.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/LayoutRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/LayoutRepresentation.md new file mode 100644 index 0000000000..8125f19df7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/LayoutRepresentation.md @@ -0,0 +1,10 @@ +# LayoutRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**colspan** | **number** | | [optional] [default to null] +**column** | **number** | | [optional] [default to null] +**row** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/LightAppRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/LightAppRepresentation.md new file mode 100644 index 0000000000..2934ae9e8f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/LightAppRepresentation.md @@ -0,0 +1,12 @@ +# LightAppRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | | [optional] [default to null] +**icon** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**theme** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/LightGroupRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/LightGroupRepresentation.md new file mode 100644 index 0000000000..ce722a0895 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/LightGroupRepresentation.md @@ -0,0 +1,12 @@ +# LightGroupRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**externalId** | **string** | | [optional] [default to null] +**groups** | [**LightGroupRepresentation[]**](LightGroupRepresentation.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/LightTenantRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/LightTenantRepresentation.md new file mode 100644 index 0000000000..5c7939d4de --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/LightTenantRepresentation.md @@ -0,0 +1,9 @@ +# LightTenantRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/LightUserRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/LightUserRepresentation.md new file mode 100644 index 0000000000..017ee472dc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/LightUserRepresentation.md @@ -0,0 +1,14 @@ +# LightUserRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company** | **string** | | [optional] [default to null] +**email** | **string** | | [optional] [default to null] +**externalId** | **string** | | [optional] [default to null] +**firstName** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastName** | **string** | | [optional] [default to null] +**pictureId** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ModelJsonBpmnApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ModelJsonBpmnApi.md new file mode 100644 index 0000000000..dd4736a7b5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ModelJsonBpmnApi.md @@ -0,0 +1,147 @@ +# ActivitiPublicRestApi.ModelJsonBpmnApi + +All URIs are relative to *https://localhost:8080/activiti-app* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getHistoricEditorDisplayJsonClient**](ModelJsonBpmnApi.md#getHistoricEditorDisplayJsonClient) | **GET** /app/rest/process-instances/{processModelId}/history/{processModelHistoryId}/model-json | Export a previous process definition model to JSON +[**getEditorDisplayJsonClient**](ModelJsonBpmnApi.md#getEditorDisplayJsonClient) | **GET** app/rest/models/{processModelId}/model-json | Export a process definition model to JSON +[**getModelJSON**](ModelJsonBpmnApi.md#getModelJSON) | **GET** /app/rest/process-definitions/{processDefinitionId}/model-json | Export a process definition model to JSON +[**getModelJSONForProcessDefinition**](ModelJsonBpmnApi.md#getModelJSONForProcessDefinition) | **GET** /app/rest/process-instances/{processInstanceId}/model-json | Export a process instances model to JSON + +<a name="getEditorDisplayJsonClient"></a> +# **getEditorDisplayJsonClient** +> getEditorDisplayJsonClient(processModelId, processModelHistoryId) + +Export a previous process definition model to JSON + +### Example +```javascript + +var processModelId = 789; // Integer | processModelId + +var processModelHistoryId = 789; // Integer | processModelHistoryId + +this.alfrescoJsApi.activiti.modelJsonBpmnApi.getHistoricEditorDisplayJsonClient(processModelId, processModelHistoryId); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processModelId** | **Integer**| processModelId | + **processModelHistoryId** | **Integer**| processModelHistoryId | + +### Return type + +JSON definition model + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="getEditorDisplayJsonClient"></a> +# **getEditorDisplayJsonClient** +> getEditorDisplayJsonClient(processModelId) + +Export a process instances model to a BPMN 2.0 xml file + +### Example +```javascript + +var processModelId = 789; // Integer | processModelId + +this.alfrescoJsApi.activiti.modelJsonBpmnApi.getEditorDisplayJsonClient(processModelId); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processModelId** | **Integer**| processModelId | + +### Return type + +JSON definition model + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +<a name="getModelJSON"></a> +# **getModelJSON** +> getModelJSON(processDefinitionId) + +Export a process definition model to a BPMN 2.0 xml file + +### Example +```javascript + +var processDefinitionId = 789; // Stringg | processDefinitionId + +this.alfrescoJsApi.activiti.modelJsonBpmnApi.getModelJSON(processDefinitionId); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processDefinitionId** | **String**| processDefinitionId | + +### Return type + +JSON definition model + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +<a name="getModelJSONForProcessDefinition"></a> +# **getModelJSONForProcessDefinition** +> getModelJSONForProcessDefinition(processInstanceId) + +Export a process definition model to a BPMN 2.0 xml file + +### Example +```javascript + +var processInstanceId = 789; // String | processInstanceId + +this.alfrescoJsApi.activiti.modelJsonBpmnApi.getModelJSONForProcessDefinition(processInstanceId); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **String**| processInstanceId | + +### Return type + +JSON definition model + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ModelRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ModelRepresentation.md new file mode 100644 index 0000000000..03086a5c5e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ModelRepresentation.md @@ -0,0 +1,24 @@ +# ModelRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comment** | **string** | | [optional] [default to null] +**createdBy** | **number** | | [optional] [default to null] +**createdByFullName** | **string** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**favorite** | **boolean** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastUpdated** | [**Date**](Date.md) | | [optional] [default to null] +**lastUpdatedBy** | **number** | | [optional] [default to null] +**lastUpdatedByFullName** | **string** | | [optional] [default to null] +**latestVersion** | **boolean** | | [optional] [default to null] +**modelType** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**permission** | **string** | | [optional] [default to null] +**referenceId** | **number** | | [optional] [default to null] +**stencilSet** | **number** | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] +**version** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ModelsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ModelsApi.md new file mode 100644 index 0000000000..b594b6f19b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ModelsApi.md @@ -0,0 +1,529 @@ +# ModelsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createModel**](ModelsApi.md#createModel) | **POST** /enterprise/models | Create a new model +[**deleteModel**](ModelsApi.md#deleteModel) | **DELETE** /enterprise/models/{modelId} | Delete a model +[**duplicateModel**](ModelsApi.md#duplicateModel) | **POST** /enterprise/models/{modelId}/clone | Duplicate an existing model +[**getModelJSON**](ModelsApi.md#getModelJSON) | **GET** /enterprise/models/{modelId}/editor/json | Get model content +[**getModelThumbnail**](ModelsApi.md#getModelThumbnail) | **GET** /enterprise/models/{modelId}/thumbnail | Get a model's thumbnail image +[**getModel**](ModelsApi.md#getModel) | **GET** /enterprise/models/{modelId} | Get a model +[**getModelsToIncludeInAppDefinition**](ModelsApi.md#getModelsToIncludeInAppDefinition) | **GET** /enterprise/models-for-app-definition | List process definition models shared with the current user +[**getModels**](ModelsApi.md#getModels) | **GET** /enterprise/models | List models (process, form, decision rule or app) +[**importNewVersion**](ModelsApi.md#importNewVersion) | **POST** /enterprise/models/{modelId}/newversion | Create a new version of a model +[**importProcessModel**](ModelsApi.md#importProcessModel) | **POST** /enterprise/process-models/import | Import a BPMN 2.0 XML file +[**saveModel**](ModelsApi.md#saveModel) | **POST** /enterprise/models/{modelId}/editor/json | Update model content +[**updateModel**](ModelsApi.md#updateModel) | **PUT** /enterprise/models/{modelId} | Update a model +[**validateModel**](ModelsApi.md#validateModel) | **POST** /enterprise/models/{modelId}/editor/validate | Validate model content + + +<a name="createModel"></a> +# **createModel** +> ModelRepresentation createModel(modelRepresentation) + +Create a new model + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + + +modelsApi.createModel(modelRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelRepresentation** | [**ModelRepresentation**](ModelRepresentation.md)| modelRepresentation | + +### Return type + +[**ModelRepresentation**](ModelRepresentation.md) + +<a name="deleteModel"></a> +# **deleteModel** +> deleteModel(modelIdopts) + +Delete a model + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + +let opts = { + 'cascade': true // | cascade + 'deleteRuntimeApp': true // | deleteRuntimeApp +}; + +modelsApi.deleteModel(modelIdopts).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **cascade** | **boolean**| cascade | [optional] + **deleteRuntimeApp** | **boolean**| deleteRuntimeApp | [optional] + +### Return type + +null (empty response body) + +<a name="duplicateModel"></a> +# **duplicateModel** +> ModelRepresentation duplicateModel(modelIdmodelRepresentation) + +Duplicate an existing model + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + + +modelsApi.duplicateModel(modelIdmodelRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **modelRepresentation** | [**ModelRepresentation**](ModelRepresentation.md)| modelRepresentation | + +### Return type + +[**ModelRepresentation**](ModelRepresentation.md) + +<a name="getModelJSON"></a> +# **getModelJSON** +> ObjectNode getModelJSON(modelId) + +Get model content + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + + +modelsApi.getModelJSON(modelId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + +### Return type + +[**ObjectNode**](ObjectNode.md) + +<a name="getModelThumbnail"></a> +# **getModelThumbnail** +> string getModelThumbnail(modelId) + +Get a model's thumbnail image + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + + +modelsApi.getModelThumbnail(modelId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + +### Return type + +**string** + +<a name="getModel"></a> +# **getModel** +> ModelRepresentation getModel(modelIdopts) + +Get a model + +Models act as containers for process, form, decision table and app definitions + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + +let opts = { + 'includePermissions': true // | includePermissions +}; + +modelsApi.getModel(modelIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **includePermissions** | **boolean**| includePermissions | [optional] + +### Return type + +[**ModelRepresentation**](ModelRepresentation.md) + +<a name="getModelsToIncludeInAppDefinition"></a> +# **getModelsToIncludeInAppDefinition** +> ResultListDataRepresentationModelRepresentation getModelsToIncludeInAppDefinition() + +List process definition models shared with the current user + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + +modelsApi.getModelsToIncludeInAppDefinition().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ResultListDataRepresentationModelRepresentation**](ResultListDataRepresentationModelRepresentation.md) + +<a name="getModels"></a> +# **getModels** +> ResultListDataRepresentationModelRepresentation getModels(opts) + +List models (process, form, decision rule or app) + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + +let opts = { + 'filter': filter_example // | filter + 'sort': sort_example // | sort + 'modelType': 56 // | modelType + 'referenceId': 789 // | referenceId +}; + +modelsApi.getModels(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | **string**| filter | [optional] + **sort** | **string**| sort | [optional] + **modelType** | **number**| modelType | [optional] + **referenceId** | **number**| referenceId | [optional] + +### Return type + +[**ResultListDataRepresentationModelRepresentation**](ResultListDataRepresentationModelRepresentation.md) + +<a name="importNewVersion"></a> +# **importNewVersion** +> ModelRepresentation importNewVersion(modelIdfile) + +Create a new version of a model + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + + +modelsApi.importNewVersion(modelIdfile).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **file** | **Blob**| file | + +### Return type + +[**ModelRepresentation**](ModelRepresentation.md) + +<a name="importProcessModel"></a> +# **importProcessModel** +> ModelRepresentation importProcessModel(file) + +Import a BPMN 2.0 XML file + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + + +modelsApi.importProcessModel(file).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **Blob**| file | + +### Return type + +[**ModelRepresentation**](ModelRepresentation.md) + +<a name="saveModel"></a> +# **saveModel** +> ModelRepresentation saveModel(modelIdvalues) + +Update model content + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + + +modelsApi.saveModel(modelIdvalues).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **values** | **any**| values | + +### Return type + +[**ModelRepresentation**](ModelRepresentation.md) + +<a name="updateModel"></a> +# **updateModel** +> ModelRepresentation updateModel(modelIdupdatedModel) + +Update a model + +This method allows you to update the metadata of a model. In order to update the content of the model you will need to call the specific endpoint for that model type. + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + + +modelsApi.updateModel(modelIdupdatedModel).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **updatedModel** | [**ModelRepresentation**](ModelRepresentation.md)| updatedModel | + +### Return type + +[**ModelRepresentation**](ModelRepresentation.md) + +<a name="validateModel"></a> +# **validateModel** +> ValidationErrorRepresentation validateModel(modelIdopts) + +Validate model content + +### Example +```javascript +import ModelsApi from 'ModelsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsApi = new ModelsApi(this.alfrescoApi); + +let opts = { + 'values': // | values +}; + +modelsApi.validateModel(modelIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **values** | **any**| values | [optional] + +### Return type + +[**ValidationErrorRepresentation**](ValidationErrorRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ModelsBpmnApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ModelsBpmnApi.md new file mode 100644 index 0000000000..f79fe41fa7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ModelsBpmnApi.md @@ -0,0 +1,87 @@ +# ModelsbpmnApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getHistoricProcessModelBpmn20Xml**](ModelsBpmnApi.md#getHistoricProcessModelBpmn20Xml) | **GET** /enterprise/models/{processModelId}/history/{processModelHistoryId}/bpmn20 | Export a historic version of a process definition as BPMN 2.0 XML +[**getProcessModelBpmn20Xml**](ModelsBpmnApi.md#getProcessModelBpmn20Xml) | **GET** /enterprise/models/{processModelId}/bpmn20 | Export a process definition as BPMN 2.0 XML + + +<a name="getHistoricProcessModelBpmn20Xml"></a> +# **getHistoricProcessModelBpmn20Xml** +> getHistoricProcessModelBpmn20Xml(processModelIdprocessModelHistoryId) + +Export a historic version of a process definition as BPMN 2.0 XML + +### Example + +```javascript +import ModelsbpmnApi from 'src/api/activiti-rest-api/docs/ModelsBpmnApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsbpmnApi = new ModelsbpmnApi(this.alfrescoApi); + + +modelsbpmnApi.getHistoricProcessModelBpmn20Xml(processModelIdprocessModelHistoryId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processModelId** | **number**| processModelId | + **processModelHistoryId** | **number**| processModelHistoryId | + +### Return type + +null (empty response body) + +<a name="getProcessModelBpmn20Xml"></a> +# **getProcessModelBpmn20Xml** +> getProcessModelBpmn20Xml(processModelId) + +Export a process definition as BPMN 2.0 XML + +### Example + +```javascript +import ModelsbpmnApi from 'src/api/activiti-rest-api/docs/ModelsBpmnApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelsbpmnApi = new ModelsbpmnApi(this.alfrescoApi); + + +modelsbpmnApi.getProcessModelBpmn20Xml(processModelId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processModelId** | **number**| processModelId | + +### Return type + +null (empty response body) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ModelsHistoryApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ModelsHistoryApi.md new file mode 100644 index 0000000000..633f687d6a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ModelsHistoryApi.md @@ -0,0 +1,91 @@ +# ModelshistoryApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getModelHistoryCollection**](ModelsHistoryApi.md#getModelHistoryCollection) | **GET** /enterprise/models/{modelId}/history | List a model's historic versions +[**getProcessModelHistory**](ModelsHistoryApi.md#getProcessModelHistory) | **GET** /enterprise/models/{modelId}/history/{modelHistoryId} | Get a historic version of a model + + +<a name="getModelHistoryCollection"></a> +# **getModelHistoryCollection** +> ResultListDataRepresentationModelRepresentation getModelHistoryCollection(modelIdopts) + +List a model's historic versions + +### Example + +```javascript +import ModelshistoryApi from 'src/api/activiti-rest-api/docs/ModelsHistoryApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelshistoryApi = new ModelshistoryApi(this.alfrescoApi); + +let opts = { + 'includeLatestVersion': true // | includeLatestVersion +}; + +modelshistoryApi.getModelHistoryCollection(modelIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **includeLatestVersion** | **boolean**| includeLatestVersion | [optional] + +### Return type + +[**ResultListDataRepresentationModelRepresentation**](ResultListDataRepresentationModelRepresentation.md) + +<a name="getProcessModelHistory"></a> +# **getProcessModelHistory** +> ModelRepresentation getProcessModelHistory(modelIdmodelHistoryId) + +Get a historic version of a model + +### Example + +```javascript +import ModelshistoryApi from 'src/api/activiti-rest-api/docs/ModelsHistoryApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let modelshistoryApi = new ModelshistoryApi(this.alfrescoApi); + + +modelshistoryApi.getProcessModelHistory(modelIdmodelHistoryId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelId** | **number**| modelId | + **modelHistoryId** | **number**| modelHistoryId | + +### Return type + +[**ModelRepresentation**](ModelRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/NamedObject.md b/lib/js-api/src/api/activiti-rest-api/docs/NamedObject.md new file mode 100644 index 0000000000..308085f7e5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/NamedObject.md @@ -0,0 +1,9 @@ +# NamedObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ObjectNode.md b/lib/js-api/src/api/activiti-rest-api/docs/ObjectNode.md new file mode 100644 index 0000000000..da9c983399 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ObjectNode.md @@ -0,0 +1,53 @@ +# ObjectNode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array** | **boolean** | | [optional] [default to null] +**bigDecimal** | **boolean** | | [optional] [default to null] +**bigInteger** | **boolean** | | [optional] [default to null] +**binary** | **boolean** | | [optional] [default to null] +**boolean** | **boolean** | | [optional] [default to null] +**containerNode** | **boolean** | | [optional] [default to null] +**double** | **boolean** | | [optional] [default to null] +**float** | **boolean** | | [optional] [default to null] +**floatingPointNumber** | **boolean** | | [optional] [default to null] +**int** | **boolean** | | [optional] [default to null] +**integralNumber** | **boolean** | | [optional] [default to null] +**long** | **boolean** | | [optional] [default to null] +**missingNode** | **boolean** | | [optional] [default to null] +**nodeType** | **string** | | [optional] [default to null] +**null** | **boolean** | | [optional] [default to null] +**number** | **boolean** | | [optional] [default to null] +**object** | **boolean** | | [optional] [default to null] +**pojo** | **boolean** | | [optional] [default to null] +**short** | **boolean** | | [optional] [default to null] +**textual** | **boolean** | | [optional] [default to null] +**valueNode** | **boolean** | | [optional] [default to null] + + +<a name="ObjectNode.NodeTypeEnum"></a> +## Enum: ObjectNode.NodeTypeEnum + + +* `ARRAY` (value: `'ARRAY'`) + +* `BINARY` (value: `'BINARY'`) + +* `BOOLEAN` (value: `'BOOLEAN'`) + +* `MISSING` (value: `'MISSING'`) + +* `NULL` (value: `'NULL'`) + +* `NUMBER` (value: `'NUMBER'`) + +* `OBJECT` (value: `'OBJECT'`) + +* `POJO` (value: `'POJO'`) + +* `STRING` (value: `'STRING'`) + + + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/OptionRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/OptionRepresentation.md new file mode 100644 index 0000000000..e557be8d45 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/OptionRepresentation.md @@ -0,0 +1,9 @@ +# OptionRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/PasswordValidationConstraints.md b/lib/js-api/src/api/activiti-rest-api/docs/PasswordValidationConstraints.md new file mode 100644 index 0000000000..097a808ab3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/PasswordValidationConstraints.md @@ -0,0 +1,10 @@ +# PasswordValidationConstraints + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**minLength** | **number** | | [optional] [default to null] +**passwordCriteriaMessage** | **string** | | [optional] [default to null] +**regularExpression** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessContentRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessContentRepresentation.md new file mode 100644 index 0000000000..09a21a65d3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessContentRepresentation.md @@ -0,0 +1,9 @@ +# ProcessContentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | [**RelatedContentRepresentation[]**](RelatedContentRepresentation.md) | | [optional] [default to null] +**field** | [**NamedObject**](NamedObject.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionMetaDataRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionMetaDataRepresentation.md new file mode 100644 index 0000000000..e60fc4c1c1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionMetaDataRepresentation.md @@ -0,0 +1,9 @@ +# ProcessDefinitionMetaDataRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | | [optional] [default to null] +**value** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionRepresentation.md new file mode 100644 index 0000000000..695f7179f1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionRepresentation.md @@ -0,0 +1,17 @@ +# ProcessDefinitionRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **string** | | [optional] [default to null] +**deploymentId** | **string** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**hasStartForm** | **boolean** | | [optional] [default to null] +**id** | **string** | | [optional] [default to null] +**key** | **string** | | [optional] [default to null] +**metaDataValues** | [**ProcessDefinitionMetaDataRepresentation[]**](ProcessDefinitionMetaDataRepresentation.md) | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**tenantId** | **string** | | [optional] [default to null] +**version** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionsApi.md new file mode 100644 index 0000000000..7295d85445 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessDefinitionsApi.md @@ -0,0 +1,440 @@ +# ProcessdefinitionsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createIdentityLink**](ProcessDefinitionsApi.md#createIdentityLink) | **POST** /enterprise/process-definitions/{processDefinitionId}/identitylinks | Add a user or group involvement to a process definition +[**deleteIdentityLink**](ProcessDefinitionsApi.md#deleteIdentityLink) | **DELETE** /enterprise/process-definitions/{processDefinitionId}/identitylinks/{family}/{identityId} | Remove a user or group involvement from a process definition +[**getIdentityLinkType**](ProcessDefinitionsApi.md#getIdentityLinkType) | **GET** /enterprise/process-definitions/{processDefinitionId}/identitylinks/{family}/{identityId} | Get a user or group involvement with a process definition +[**getIdentityLinksForFamily**](ProcessDefinitionsApi.md#getIdentityLinksForFamily) | **GET** /enterprise/process-definitions/{processDefinitionId}/identitylinks/{family} | List either the users or groups involved with a process definition +[**getIdentityLinks**](ProcessDefinitionsApi.md#getIdentityLinks) | **GET** /enterprise/process-definitions/{processDefinitionId}/identitylinks | List the users and groups involved with a process definition +[**getProcessDefinitionDecisionTables**](ProcessDefinitionsApi.md#getProcessDefinitionDecisionTables) | **GET** /enterprise/process-definitions/{processDefinitionId}/decision-tables | List the decision tables associated with a process definition +[**getProcessDefinitionForms**](ProcessDefinitionsApi.md#getProcessDefinitionForms) | **GET** /enterprise/process-definitions/{processDefinitionId}/forms | List the forms associated with a process definition +[**getProcessDefinitionStartForm**](ProcessDefinitionsApi.md#getProcessDefinitionStartForm) | **GET** /enterprise/process-definitions/{processDefinitionId}/start-form | Retrieve the start form for a process definition +[**getProcessDefinitions**](ProcessDefinitionsApi.md#getProcessDefinitions) | **GET** /enterprise/process-definitions | Retrieve a list of process definitions +[**getRestFieldValues**](ProcessDefinitionsApi.md#getRestFieldValues) | **GET** /enterprise/process-definitions/{processDefinitionId}/start-form-values/{field} | Retrieve field values (eg. the typeahead field) +[**getRestTableFieldValues**](ProcessDefinitionsApi.md#getRestTableFieldValues) | **GET** /enterprise/process-definitions/{processDefinitionId}/start-form-values/{field}/{column} | Retrieve field values (eg. the table field) + + +<a name="createIdentityLink"></a> +# **createIdentityLink** +> IdentityLinkRepresentation createIdentityLink(processDefinitionIdidentityLinkRepresentation) + +Add a user or group involvement to a process definition + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + + +processdefinitionsApi.createIdentityLink(processDefinitionIdidentityLinkRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processDefinitionId** | **string**| processDefinitionId | + **identityLinkRepresentation** | [**IdentityLinkRepresentation**](IdentityLinkRepresentation.md)| identityLinkRepresentation | + +### Return type + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="deleteIdentityLink"></a> +# **deleteIdentityLink** +> deleteIdentityLink(processDefinitionIdfamilyidentityId) + +Remove a user or group involvement from a process definition + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + + +processdefinitionsApi.deleteIdentityLink(processDefinitionIdfamilyidentityId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processDefinitionId** | **string**| Process definition ID | + **family** | **string**| Identity type | + **identityId** | **string**| User or group ID | + +### Return type + +null (empty response body) + +<a name="getIdentityLinkType"></a> +# **getIdentityLinkType** +> IdentityLinkRepresentation getIdentityLinkType(processDefinitionIdfamilyidentityId) + +Get a user or group involvement with a process definition + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + + +processdefinitionsApi.getIdentityLinkType(processDefinitionIdfamilyidentityId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processDefinitionId** | **string**| Process definition ID | + **family** | **string**| Identity type | + **identityId** | **string**| User or group ID | + +### Return type + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getIdentityLinksForFamily"></a> +# **getIdentityLinksForFamily** +> IdentityLinkRepresentation getIdentityLinksForFamily(processDefinitionIdfamily) + +List either the users or groups involved with a process definition + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + + +processdefinitionsApi.getIdentityLinksForFamily(processDefinitionIdfamily).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processDefinitionId** | **string**| processDefinitionId | + **family** | **string**| Identity type | + +### Return type + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getIdentityLinks"></a> +# **getIdentityLinks** +> IdentityLinkRepresentation getIdentityLinks(processDefinitionId) + +List the users and groups involved with a process definition + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + + +processdefinitionsApi.getIdentityLinks(processDefinitionId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processDefinitionId** | **string**| processDefinitionId | + +### Return type + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getProcessDefinitionDecisionTables"></a> +# **getProcessDefinitionDecisionTables** +> ResultListDataRepresentationRuntimeDecisionTableRepresentation getProcessDefinitionDecisionTables(processDefinitionId) + +List the decision tables associated with a process definition + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + + +processdefinitionsApi.getProcessDefinitionDecisionTables(processDefinitionId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processDefinitionId** | **string**| processDefinitionId | + +### Return type + +[**ResultListDataRepresentationRuntimeDecisionTableRepresentation**](ResultListDataRepresentationRuntimeDecisionTableRepresentation.md) + +<a name="getProcessDefinitionForms"></a> +# **getProcessDefinitionForms** +> ResultListDataRepresentationRuntimeFormRepresentation getProcessDefinitionForms(processDefinitionId) + +List the forms associated with a process definition + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + + +processdefinitionsApi.getProcessDefinitionForms(processDefinitionId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processDefinitionId** | **string**| processDefinitionId | + +### Return type + +[**ResultListDataRepresentationRuntimeFormRepresentation**](ResultListDataRepresentationRuntimeFormRepresentation.md) + +<a name="getProcessDefinitionStartForm"></a> +# **getProcessDefinitionStartForm** +> FormDefinitionRepresentation getProcessDefinitionStartForm(processDefinitionId) + +Retrieve the start form for a process definition + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + +processdefinitionsApi.getProcessDefinitionStartForm(processDefinitionId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FormDefinitionRepresentation**](FormDefinitionRepresentation.md) + +<a name="getProcessDefinitions"></a> +# **getProcessDefinitions** +> ResultListDataRepresentationProcessDefinitionRepresentation getProcessDefinitions(opts) + +Retrieve a list of process definitions + +Get a list of process definitions (visible within the tenant of the user) + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + +let opts = { + 'latest': true // | latest + 'appDefinitionId': 789 // | appDefinitionId + 'deploymentId': deploymentId_example // | deploymentId +}; + +processdefinitionsApi.getProcessDefinitions(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **latest** | **boolean**| latest | [optional] + **appDefinitionId** | **number**| appDefinitionId | [optional] + **deploymentId** | **string**| deploymentId | [optional] + +### Return type + +[**ResultListDataRepresentationProcessDefinitionRepresentation**](ResultListDataRepresentationProcessDefinitionRepresentation.md) + +<a name="getRestFieldValues"></a> +# **getRestFieldValues** +> FormValueRepresentation getRestFieldValues() + +Retrieve field values (eg. the typeahead field) + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + +processdefinitionsApi.getRestFieldValues().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FormValueRepresentation**](FormValueRepresentation.md) + +<a name="getRestTableFieldValues"></a> +# **getRestTableFieldValues** +> FormValueRepresentation getRestTableFieldValues() + +Retrieve field values (eg. the table field) + +### Example + +```javascript +import ProcessdefinitionsApi from 'src/api/activiti-rest-api/docs/ProcessDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processdefinitionsApi = new ProcessdefinitionsApi(this.alfrescoApi); + +processdefinitionsApi.getRestTableFieldValues().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FormValueRepresentation**](FormValueRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceAuditInfoRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceAuditInfoRepresentation.md new file mode 100644 index 0000000000..d768eada63 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceAuditInfoRepresentation.md @@ -0,0 +1,17 @@ +# ProcessInstanceAuditInfoRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**decisionInfo** | [**AuditDecisionInfoRepresentation**](AuditDecisionInfoRepresentation.md) | | [optional] [default to null] +**entries** | [**AuditLogEntryRepresentation[]**](AuditLogEntryRepresentation.md) | | [optional] [default to null] +**processDefinitionName** | **string** | | [optional] [default to null] +**processDefinitionVersion** | **string** | | [optional] [default to null] +**processInstanceDurationInMillis** | **number** | | [optional] [default to null] +**processInstanceEndTime** | **string** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] +**processInstanceInitiator** | **string** | | [optional] [default to null] +**processInstanceName** | **string** | | [optional] [default to null] +**processInstanceStartTime** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceFilterRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceFilterRepresentation.md new file mode 100644 index 0000000000..02d1ef132f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceFilterRepresentation.md @@ -0,0 +1,13 @@ +# ProcessInstanceFilterRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asc** | **boolean** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**sort** | **string** | | [optional] [default to null] +**state** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceFilterRequestRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceFilterRequestRepresentation.md new file mode 100644 index 0000000000..8b93f159fa --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceFilterRequestRepresentation.md @@ -0,0 +1,12 @@ +# ProcessInstanceFilterRequestRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinitionId** | **number** | | [optional] [default to null] +**filter** | [**ProcessInstanceFilterRepresentation**](ProcessInstanceFilterRepresentation.md) | | [optional] [default to null] +**filterId** | **number** | | [optional] [default to null] +**page** | **number** | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceQueryRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceQueryRepresentation.md new file mode 100644 index 0000000000..5b128e05d6 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceQueryRepresentation.md @@ -0,0 +1,43 @@ +# ProcessInstanceQueryRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinitionId** | **number** | | [optional] [default to null] +**page** | **number** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**sort** | **string** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**state** | **string** | | [optional] [default to null] + + +<a name="ProcessInstanceQueryRepresentation.SortEnum"></a> +## Enum: ProcessInstanceQueryRepresentation.SortEnum + + +* `CreatedDesc` (value: `'created-desc'`) + +* `CreatedAsc` (value: `'created-asc'`) + +* `EndedDesc` (value: `'ended-desc'`) + +* `EndedAsc` (value: `'ended-asc'`) + + + + +<a name="ProcessInstanceQueryRepresentation.StateEnum"></a> +## Enum: ProcessInstanceQueryRepresentation.StateEnum + + +* `Running` (value: `'running'`) + +* `Completed` (value: `'completed'`) + +* `All` (value: `'all'`) + + + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceRepresentation.md new file mode 100644 index 0000000000..e08dcb0aa5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceRepresentation.md @@ -0,0 +1,25 @@ +# ProcessInstanceRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**businessKey** | **string** | | [optional] [default to null] +**ended** | [**Date**](Date.md) | | [optional] [default to null] +**graphicalNotationDefined** | **boolean** | | [optional] [default to null] +**id** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**processDefinitionCategory** | **string** | | [optional] [default to null] +**processDefinitionDeploymentId** | **string** | | [optional] [default to null] +**processDefinitionDescription** | **string** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**processDefinitionName** | **string** | | [optional] [default to null] +**processDefinitionVersion** | **number** | | [optional] [default to null] +**startFormDefined** | **boolean** | | [optional] [default to null] +**started** | [**Date**](Date.md) | | [optional] [default to null] +**startedBy** | [**LightUserRepresentation**](LightUserRepresentation.md) | | [optional] [default to null] +**suspended** | **boolean** | | [optional] [default to null] +**tenantId** | **string** | | [optional] [default to null] +**variables** | [**RestVariable[]**](RestVariable.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceVariableRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceVariableRepresentation.md new file mode 100644 index 0000000000..1f1ed11d07 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceVariableRepresentation.md @@ -0,0 +1,10 @@ +# ProcessInstanceVariableRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] +**value** | **any** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi.md new file mode 100644 index 0000000000..1bbca892ec --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi.md @@ -0,0 +1,208 @@ +# ProcessinstancevariablesApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createOrUpdateProcessInstanceVariables**](ProcessInstanceVariablesApi.md#createOrUpdateProcessInstanceVariables) | **PUT** /enterprise/process-instances/{processInstanceId}/variables | Create or update variables +[**deleteProcessInstanceVariable**](ProcessInstanceVariablesApi.md#deleteProcessInstanceVariable) | **DELETE** /enterprise/process-instances/{processInstanceId}/variables/{variableName} | Delete a variable +[**getProcessInstanceVariable**](ProcessInstanceVariablesApi.md#getProcessInstanceVariable) | **GET** /enterprise/process-instances/{processInstanceId}/variables/{variableName} | Get a variable +[**getProcessInstanceVariables**](ProcessInstanceVariablesApi.md#getProcessInstanceVariables) | **GET** /enterprise/process-instances/{processInstanceId}/variables | List variables +[**updateProcessInstanceVariable**](ProcessInstanceVariablesApi.md#updateProcessInstanceVariable) | **PUT** /enterprise/process-instances/{processInstanceId}/variables/{variableName} | Update a variable + + +<a name="createOrUpdateProcessInstanceVariables"></a> +# **createOrUpdateProcessInstanceVariables** +> RestVariable createOrUpdateProcessInstanceVariables(processInstanceIdrestVariables) + +Create or update variables + +### Example + +```javascript +import ProcessinstancevariablesApi from 'src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processinstancevariablesApi = new ProcessinstancevariablesApi(this.alfrescoApi); + + +processinstancevariablesApi.createOrUpdateProcessInstanceVariables(processInstanceIdrestVariables).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| Process instance ID | + **restVariables** | [**RestVariable**](RestVariable.md)| restVariables | + +### Return type + +[**RestVariable**](RestVariable.md) + +<a name="deleteProcessInstanceVariable"></a> +# **deleteProcessInstanceVariable** +> deleteProcessInstanceVariable(processInstanceIdvariableName) + +Delete a variable + +### Example + +```javascript +import ProcessinstancevariablesApi from 'src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processinstancevariablesApi = new ProcessinstancevariablesApi(this.alfrescoApi); + + +processinstancevariablesApi.deleteProcessInstanceVariable(processInstanceIdvariableName).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| processInstanceId | + **variableName** | **string**| variableName | + +### Return type + +null (empty response body) + +<a name="getProcessInstanceVariable"></a> +# **getProcessInstanceVariable** +> RestVariable getProcessInstanceVariable(processInstanceIdvariableName) + +Get a variable + +### Example + +```javascript +import ProcessinstancevariablesApi from 'src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processinstancevariablesApi = new ProcessinstancevariablesApi(this.alfrescoApi); + + +processinstancevariablesApi.getProcessInstanceVariable(processInstanceIdvariableName).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| processInstanceId | + **variableName** | **string**| variableName | + +### Return type + +[**RestVariable**](RestVariable.md) + +<a name="getProcessInstanceVariables"></a> +# **getProcessInstanceVariables** +> RestVariable getProcessInstanceVariables(processInstanceId) + +List variables + +### Example + +```javascript +import ProcessinstancevariablesApi from 'src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processinstancevariablesApi = new ProcessinstancevariablesApi(this.alfrescoApi); + + +processinstancevariablesApi.getProcessInstanceVariables(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| Process instance ID | + +### Return type + +[**RestVariable**](RestVariable.md) + +<a name="updateProcessInstanceVariable"></a> +# **updateProcessInstanceVariable** +> RestVariable updateProcessInstanceVariable(processInstanceIdvariableNamerestVariable) + +Update a variable + +### Example + +```javascript +import ProcessinstancevariablesApi from 'src/api/activiti-rest-api/docs/ProcessInstanceVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processinstancevariablesApi = new ProcessinstancevariablesApi(this.alfrescoApi); + + +processinstancevariablesApi.updateProcessInstanceVariable(processInstanceIdvariableNamerestVariable).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processInstanceId** | **string**| processInstanceId | + **variableName** | **string**| variableName | + **restVariable** | [**RestVariable**](RestVariable.md)| restVariable | + +### Return type + +[**RestVariable**](RestVariable.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstancesApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstancesApi.md new file mode 100644 index 0000000000..651724cdb5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessInstancesApi.md @@ -0,0 +1,725 @@ +# Process Instances Api + +All URIs are relative to */activiti-app/api* + +| Method | HTTP request | Description | +|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|------------------------------------------------------------------| +| [activateProcessInstance](ProcessInstancesApi.md#activateProcessInstance) | **PUT** /enterprise/process-instances/{processInstanceId}/activate | Activate a process instance | +| [createIdentityLink](ProcessInstancesApi.md#createIdentityLink) | **POST** /enterprise/process-instances/{processInstanceId}/identitylinks | Add a user or group involvement to a process instance | +| [deleteIdentityLink](ProcessInstancesApi.md#deleteIdentityLink) | **DELETE** /enterprise/process-instances/{processInstanceId}/identitylinks/{family}/{identityId}/{type} | Remove a user or group involvement from a process instance | +| [deleteProcessInstance](ProcessInstancesApi.md#deleteProcessInstance) | **DELETE** /enterprise/process-instances/{processInstanceId} | Cancel or remove a process instance | +| [filterProcessInstances](ProcessInstancesApi.md#filterProcessInstances) | **POST** /enterprise/process-instances/filter | List process instances using a filter | +| [getHistoricProcessInstanceDecisionTasks](ProcessInstancesApi.md#getHistoricProcessInstanceDecisionTasks) | **GET** /enterprise/process-instances/{processInstanceId}/decision-tasks | Get decision tasks in a process instance | +| [getHistoricProcessInstanceVariables](ProcessInstancesApi.md#getHistoricProcessInstanceVariables) | **GET** /enterprise/process-instances/{processInstanceId}/historic-variables | Get historic variables for a process instance | +| [getHistoricProcessInstances](ProcessInstancesApi.md#getHistoricProcessInstances) | **POST** /enterprise/historic-process-instances/query | Query historic process instances | +| [getIdentityLinkType](ProcessInstancesApi.md#getIdentityLinkType) | **GET** /enterprise/process-instances/{processInstanceId}/identitylinks/{family}/{identityId}/{type} | Get a user or group involvement with a process instance | +| [getIdentityLinksForFamily](ProcessInstancesApi.md#getIdentityLinksForFamily) | **GET** /enterprise/process-instances/{processInstanceId}/identitylinks/{family} | List either the users or groups involved with a process instance | +| [getIdentityLinks](ProcessInstancesApi.md#getIdentityLinks) | **GET** /enterprise/process-instances/{processInstanceId}/identitylinks | List the users and groups involved with a process instance | +| [getProcessInstanceContent](ProcessInstancesApi.md#getProcessInstanceContent) | **GET** /enterprise/process-instances/{processInstanceId}/field-content | List content attached to process instance fields | +| [getProcessInstanceDiagram](ProcessInstancesApi.md#getProcessInstanceDiagram) | **GET** /enterprise/process-instances/{processInstanceId}/diagram | Get the process diagram for the process instance | +| [getProcessInstanceStartForm](ProcessInstancesApi.md#getProcessInstanceStartForm) | **GET** /enterprise/process-instances/{processInstanceId}/start-form | Get a process instance start form | +| [getProcessInstance](ProcessInstancesApi.md#getProcessInstance) | **GET** /enterprise/process-instances/{processInstanceId} | Get a process instance | +| [getProcessInstances](ProcessInstancesApi.md#getProcessInstances) | **POST** /enterprise/process-instances/query | Query process instances | +| [getTaskAuditLog](ProcessInstancesApi.md#getTaskAuditLog) | **GET** /enterprise/process-instances/{processInstanceId}/audit-log | Get the audit log for a process instance | +| [startNewProcessInstance](ProcessInstancesApi.md#startNewProcessInstance) | **POST** /enterprise/process-instances | Start a process instance | +| [suspendProcessInstance](ProcessInstancesApi.md#suspendProcessInstance) | **PUT** /enterprise/process-instances/{processInstanceId}/suspend | Suspend a process instance | +| [getProcessAuditPdf](ProcessInstancesApi.md#getProcessAuditPdf) | **GET** /app/rest/process-instances/{processId}/audit | Retrieve the process audit infromation in pdf format | + + +<a name="activateProcessInstance"></a> +# **activateProcessInstance** +> ProcessInstanceRepresentation activateProcessInstance(processInstanceId) + +Activate a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessiIstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessiIstancesApi(alfrescoApi); + +processinstancesApi.activateProcessInstance(processInstanceId).then( + (data) => { + console.log('API called successfully. Returned data: ' + data); + }, + (error) => { + console.error(error); + }); +``` + +**Parameters** + +| Name | Type | Description | +|-------------------|--------|-------------------| +| processInstanceId | string | processInstanceId | + +**Return type** + +[**ProcessInstanceRepresentation**](ProcessInstanceRepresentation.md) + +<a name="createIdentityLink"></a> +# **createIdentityLink** +> IdentityLinkRepresentation createIdentityLink(processInstanceIdidentityLinkRepresentation) + +Add a user or group involvement to a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(alfrescoApi); + +processInstancesApi.createIdentityLink(processInstanceIdidentityLinkRepresentation).then( + (data) => { + console.log('API called successfully. Returned data: ' + data); + }, + (error) => { + console.error(error); + }); +``` + +**Parameters** + +| Name | Type | Description | +|----------------------------|-------------------------------------------------------------|----------------------------| +| processInstanceId | String | processInstanceId | +| identityLinkRepresentation | [IdentityLinkRepresentation](IdentityLinkRepresentation.md) | identityLinkRepresentation | + +**Return type** + +[IdentityLinkRepresentation](IdentityLinkRepresentation.md) + +<a name="deleteIdentityLink"></a> +# **deleteIdentityLink** +> deleteIdentityLink(processInstanceId,family, identityId, type) + +Remove a user or group involvement from a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(alfrescoApi); + +processInstancesApi.deleteIdentityLink(processInstanceIdfamilyidentityIdtype).then( + () => { + console.log('API called successfully.'); + }, + (error) => { + console.error(error); + }); +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | +| **family** | **string** | family | +| **identityId** | **string** | identityId | +| **type** | **string** | type | + +<a name="deleteProcessInstance"></a> +# **deleteProcessInstance** +> deleteProcessInstance(processInstanceId) + +Cancel or remove a process instance + +If the process instance has not yet been completed, it will be cancelled. If it has already finished or been cancelled then the process instance will be removed and will no longer appear in queries. + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(alfrescoApi); + +processInstancesApi.deleteProcessInstance(processInstanceId).then(() => { + console.log('API called successfully.'); +}, (error) => { + console.error(error); +}); +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +<a name="filterProcessInstances"></a> +# **filterProcessInstances** +> ResultListDataRepresentationProcessInstanceRepresentation filterProcessInstances(filterRequest) + +List process instances using a filter + +The request body provided must define either a valid filterId value or filter object + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(alfrescoApi); + +processInstancesApi.filterProcessInstances(filterRequest).then( + (data) => { + console.log('API called successfully. Returned data: ' + data); + }, (error) => { + console.error(error); + }); +``` + +**Parameters** + +| Name | Type | Description | +|-------------------|-------------------------------------------------------------------------------------------------|---------------| +| **filterRequest** | [**ProcessInstanceFilterRequestRepresentation**](ProcessInstanceFilterRequestRepresentation.md) | filterRequest | + +**Return type** + +[**ResultListDataRepresentationProcessInstanceRepresentation**](ResultListDataRepresentationProcessInstanceRepresentation.md) + +<a name="getHistoricProcessInstanceDecisionTasks"></a> +# **getHistoricProcessInstanceDecisionTasks** +> ResultListDataRepresentationDecisionTaskRepresentation getHistoricProcessInstanceDecisionTasks(processInstanceId) + +Get decision tasks in a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(alfrescoApi); + +processInstancesApi.getHistoricProcessInstanceDecisionTasks(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +[**ResultListDataRepresentationDecisionTaskRepresentation**](ResultListDataRepresentationDecisionTaskRepresentation.md) + +<a name="getHistoricProcessInstanceVariables"></a> +# **getHistoricProcessInstanceVariables** +> ProcessInstanceVariableRepresentation getHistoricProcessInstanceVariables(processInstanceId) + +Get historic variables for a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(alfrescoApi); + +processInstancesApi.getHistoricProcessInstanceVariables(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +[**ProcessInstanceVariableRepresentation**](ProcessInstanceVariableRepresentation.md) + +<a name="getHistoricProcessInstances"></a> +# **getHistoricProcessInstances** +> ResultListDataRepresentationProcessInstanceRepresentation getHistoricProcessInstances(queryRequest) + +Query historic process instances + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.getHistoricProcessInstances(queryRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|------------------|-------------------------------------------------------------------------------------------------|--------------| +| **queryRequest** | [**HistoricProcessInstanceQueryRepresentation**](HistoricProcessInstanceQueryRepresentation.md) | queryRequest | + +**Return type** + +[**ResultListDataRepresentationProcessInstanceRepresentation**](ResultListDataRepresentationProcessInstanceRepresentation.md) + +<a name="getIdentityLinkType"></a> +# **getIdentityLinkType** +> IdentityLinkRepresentation getIdentityLinkType(processInstanceIdfamilyidentityIdtype) + +Get a user or group involvement with a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.getIdentityLinkType(processInstanceIdfamilyidentityIdtype).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | +| **family** | **string** | family | +| **identityId** | **string** | identityId | +| **type** | **string** | type | + +**Return type** + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getIdentityLinksForFamily"></a> +# **getIdentityLinksForFamily** +> IdentityLinkRepresentation getIdentityLinksForFamily(processInstanceIdfamily) + +List either the users or groups involved with a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.getIdentityLinksForFamily(processInstanceIdfamily).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | +| **family** | **string** | family | + +**Return type** + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getIdentityLinks"></a> +# **getIdentityLinks** +> IdentityLinkRepresentation getIdentityLinks(processInstanceId) + +List the users and groups involved with a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.getIdentityLinks(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getProcessInstanceContent"></a> +# **getProcessInstanceContent** +> ResultListDataRepresentationProcessContentRepresentation getProcessInstanceContent(processInstanceId) + +List content attached to process instance fields + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.getProcessInstanceContent(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +[**ResultListDataRepresentationProcessContentRepresentation**](ResultListDataRepresentationProcessContentRepresentation.md) + +<a name="getProcessInstanceDiagram"></a> +# **getProcessInstanceDiagram** +> string getProcessInstanceDiagram(processInstanceId) + +Get the process diagram for the process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.getProcessInstanceDiagram(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +**string** + +<a name="getProcessInstanceStartForm"></a> +# **getProcessInstanceStartForm** +> FormDefinitionRepresentation getProcessInstanceStartForm(processInstanceId) + +Get a process instance start form + +The start form for a process instance can be retrieved when the process definition has a start form defined (hasStartForm = true on the process instance) + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.getProcessInstanceStartForm(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +[**FormDefinitionRepresentation**](FormDefinitionRepresentation.md) + +<a name="getProcessInstance"></a> +# **getProcessInstance** +> ProcessInstanceRepresentation getProcessInstance(processInstanceId) + +Get a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processInstancesApi.getProcessInstance(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +[**ProcessInstanceRepresentation**](ProcessInstanceRepresentation.md) + +<a name="getProcessInstances"></a> +# **getProcessInstances** +> ResultListDataRepresentationProcessInstanceRepresentation getProcessInstances(processInstancesQuery) + +Query process instances + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processInstancesApi.getProcessInstances(processInstancesQuery).then( + (data) => { + console.log('API called successfully. Returned data: ' + data); + }, + (error) => { + console.error(error); + }); +``` + +**Parameters** + +| Name | Type | Description | Notes | +|-----------------------|-----------------------------------------------------------------------------|-----------------------|-------| +| processInstancesQuery | [ProcessInstanceQueryRepresentation](ProcessInstanceQueryRepresentation.md) | processInstancesQuery | + +**Return type** + +[ResultListDataRepresentationProcessInstanceRepresentation](ResultListDataRepresentationProcessInstanceRepresentation.md) + +<a name="getTaskAuditLog"></a> +# **getTaskAuditLog** +> ProcessInstanceAuditInfoRepresentation getTaskAuditLog(processInstanceId) + +Get the audit log for a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processInstancesApi.getTaskAuditLog(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +[**ProcessInstanceAuditInfoRepresentation**](ProcessInstanceAuditInfoRepresentation.md) + +<a name="startNewProcessInstance"></a> +# **startNewProcessInstance** +> ProcessInstanceRepresentation startNewProcessInstance(startRequest) + +Start a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.startNewProcessInstance(startRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|------------------|-----------------------------------------------------------------------------------|--------------| +| **startRequest** | [**CreateProcessInstanceRepresentation**](CreateProcessInstanceRepresentation.md) | startRequest | + +**Return type** + +[**ProcessInstanceRepresentation**](ProcessInstanceRepresentation.md) + +<a name="suspendProcessInstance"></a> +# **suspendProcessInstance** +> ProcessInstanceRepresentation suspendProcessInstance(processInstanceId) + +Suspend a process instance + +**Example** + +```javascript +import { AlfrescoApi, ProcessInstancesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const processInstancesApi = new ProcessInstancesApi(this.alfrescoApi); + +processinstancesApi.suspendProcessInstance(processInstanceId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|------------|-------------------| +| **processInstanceId** | **string** | processInstanceId | + +**Return type** + +[**ProcessInstanceRepresentation**](ProcessInstanceRepresentation.md) + +<a name="getProcessAuditPdf"></a> +# **getProcessAuditPdf** +> Blob getProcessAuditPdf(processId) + +Retrieve process audit information in pdf format + +**Example** + +```javascript +const processId = "processId_example"; + +processInstancesApi.getProcessAuditPdf(processId); +``` + +**Parameters** + +| Name | Type | Description | +|---------------|------------|-------------| +| **processId** | **String** | processId | + +**Return type** + +[Blob] \ No newline at end of file diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopeIdentifierRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopeIdentifierRepresentation.md new file mode 100644 index 0000000000..1cd7fcc847 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopeIdentifierRepresentation.md @@ -0,0 +1,9 @@ +# ProcessScopeIdentifierRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**processActivityId** | **string** | | [optional] [default to null] +**processModelId** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopeRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopeRepresentation.md new file mode 100644 index 0000000000..777057f7a6 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopeRepresentation.md @@ -0,0 +1,23 @@ +# ProcessScopeRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activityIds** | **string[]** | | [optional] [default to null] +**activityIdsByCollapsedSubProcessIdMap** | [**{ [key: string]: string; }**](.md) | | [optional] [default to null] +**activityIdsByDecisionTableIdMap** | [**{ [key: string]: string; }**](.md) | | [optional] [default to null] +**activityIdsByFormIdMap** | [**{ [key: string]: string; }**](.md) | | [optional] [default to null] +**activityIdsWithExcludedSubProcess** | **string[]** | | [optional] [default to null] +**activitySidsByActivityIdMap** | **{ [key: string]: string; }** | | [optional] [default to null] +**customStencilVariables** | [**{ [key: string]: VariableScopeRepresentation; }**](.md) | | [optional] [default to null] +**entityVariables** | [**{ [key: string]: EntityVariableScopeRepresentation; }**](.md) | | [optional] [default to null] +**executionVariables** | [**{ [key: string]: VariableScopeRepresentation; }**](.md) | | [optional] [default to null] +**fieldToVariableMappings** | [**{ [key: string]: VariableScopeRepresentation; }**](.md) | | [optional] [default to null] +**forms** | [**{ [key: string]: FormScopeRepresentation; }**](.md) | | [optional] [default to null] +**metadataVariables** | [**{ [key: string]: VariableScopeRepresentation; }**](.md) | | [optional] [default to null] +**modelId** | **number** | | [optional] [default to null] +**processModelType** | **number** | | [optional] [default to null] +**responseVariables** | [**{ [key: string]: VariableScopeRepresentation; }**](.md) | | [optional] [default to null] +**reusableFieldMapping** | [**{ [key: string]: VariableMappingRepresentation; }**](.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopesApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopesApi.md new file mode 100644 index 0000000000..2fffbd9ac4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopesApi.md @@ -0,0 +1,47 @@ +# ProcessscopesApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getRuntimeProcessScopes**](ProcessScopesApi.md#getRuntimeProcessScopes) | **POST** /enterprise/process-scopes | List runtime process scopes + + +<a name="getRuntimeProcessScopes"></a> +# **getRuntimeProcessScopes** +> ProcessScopeRepresentation getRuntimeProcessScopes(processScopesRequest) + +List runtime process scopes + +### Example + +```javascript +import ProcessscopesApi from 'src/api/activiti-rest-api/docs/ProcessScopesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let processscopesApi = new ProcessscopesApi(this.alfrescoApi); + + +processscopesApi.getRuntimeProcessScopes(processScopesRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processScopesRequest** | [**ProcessScopesRequestRepresentation**](ProcessScopesRequestRepresentation.md)| processScopesRequest | + +### Return type + +[**ProcessScopeRepresentation**](ProcessScopeRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopesRequestRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopesRequestRepresentation.md new file mode 100644 index 0000000000..80f8f85de8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ProcessScopesRequestRepresentation.md @@ -0,0 +1,9 @@ +# ProcessScopesRequestRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifiers** | [**ProcessScopeIdentifierRepresentation[]**](ProcessScopeIdentifierRepresentation.md) | | [optional] [default to null] +**overriddenModel** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/PublishIdentityInfoRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/PublishIdentityInfoRepresentation.md new file mode 100644 index 0000000000..c0cd52da63 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/PublishIdentityInfoRepresentation.md @@ -0,0 +1,10 @@ +# PublishIdentityInfoRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | [**LightGroupRepresentation**](LightGroupRepresentation.md) | | [optional] [default to null] +**person** | [**LightUserRepresentation**](LightUserRepresentation.md) | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/QueryVariable.md b/lib/js-api/src/api/activiti-rest-api/docs/QueryVariable.md new file mode 100644 index 0000000000..73981dcb50 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/QueryVariable.md @@ -0,0 +1,39 @@ +# QueryVariable + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] +**operation** | **string** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] +**value** | **any** | | [optional] [default to null] +**variableOperation** | **string** | | [optional] [default to null] + + +<a name="QueryVariable.VariableOperationEnum"></a> +## Enum: QueryVariable.VariableOperationEnum + + +* `EQUALS` (value: `'EQUALS'`) + +* `NOTEQUALS` (value: `'NOT_EQUALS'`) + +* `EQUALSIGNORECASE` (value: `'EQUALS_IGNORE_CASE'`) + +* `NOTEQUALSIGNORECASE` (value: `'NOT_EQUALS_IGNORE_CASE'`) + +* `LIKE` (value: `'LIKE'`) + +* `LIKEIGNORECASE` (value: `'LIKE_IGNORE_CASE'`) + +* `GREATERTHAN` (value: `'GREATER_THAN'`) + +* `GREATERTHANOREQUALS` (value: `'GREATER_THAN_OR_EQUALS'`) + +* `LESSTHAN` (value: `'LESS_THAN'`) + +* `LESSTHANOREQUALS` (value: `'LESS_THAN_OR_EQUALS'`) + + + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/RelatedContentRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/RelatedContentRepresentation.md new file mode 100644 index 0000000000..843a17b303 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/RelatedContentRepresentation.md @@ -0,0 +1,21 @@ +# RelatedContentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contentAvailable** | **boolean** | | [optional] [default to null] +**created** | [**Date**](Date.md) | | [optional] [default to null] +**createdBy** | [**LightUserRepresentation**](LightUserRepresentation.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**link** | **boolean** | | [optional] [default to null] +**linkUrl** | **string** | | [optional] [default to null] +**mimeType** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**previewStatus** | **string** | | [optional] [default to null] +**relatedContent** | **boolean** | | [optional] [default to null] +**simpleType** | **string** | | [optional] [default to null] +**source** | **string** | | [optional] [default to null] +**sourceId** | **string** | | [optional] [default to null] +**thumbnailStatus** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/RelatedProcessTask.md b/lib/js-api/src/api/activiti-rest-api/docs/RelatedProcessTask.md new file mode 100644 index 0000000000..44f1290097 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/RelatedProcessTask.md @@ -0,0 +1,7 @@ +# RelatedProcessTask + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **processId** | **string** | | [optional] [default to undefined] | +| **taskId** | **string** | | [optional] [default to undefined] | diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ReportApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ReportApi.md new file mode 100755 index 0000000000..53495c2df1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ReportApi.md @@ -0,0 +1,360 @@ +# ActivitiPublicRestApi.ReportApi + +All URIs are relative to *https://localhost:8080/activiti-app* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createDefaultReports**](ReportApi.md#createDefaultReports) | **POST** /app/rest/reporting/default-reports | Create the default reports +[**getReportList**](ReportApi.md#getReportList) | **GET** /app/rest/reporting/reports | Retrieve the available report list. +[**getReportParams**](ReportApi.md#getReportParams) | **GET** /app/rest/reporting/report-params/{reportId} | Retrieve the parameters referring to the reportId. +[**getProcessDefinitions**](ReportApi.md#getProcessDefinitions) | **GET** /app/rest/reporting/process-definitions | Retrieve the process definition list for all the apps. +[**getTasksByProcessDefinitionId**](ReportApi.md#getTasksByProcessDefinitionId) | **GET** /app/rest/reporting/report-params/{reportId}/tasks | Retrieves all tasks that refer to the processDefinitionId +[**getReportsByParams**](ReportApi.md#getReportsByParams) | **GET** /app/rest/reporting/report-params/{reportId} | Generate the reports +[**updateReport**](ReportApi.md#updateReport) | **PUT** /app/rest/reporting/reports/{reportId} | Update the report +[**exportToCsv**](ReportApi.md#exportToCsv) | **POST** /app/rest/reporting/reports/{reportId}/export-to-csv | Export a report as csv +[**saveReport**](ReportApi.md#saveReport) | **POST** /app/rest/reporting/reports/{reportId} | Save the report +[**deleteReport**](ReportApi.md#deleteReport) | **DELETE** /app/rest/reporting/reports/{reportId} | Delete a report + +<a name="createDefaultReports"></a> +# **createDefaultReports** +> createDefaultReports() + +Create the default reports + +### Example +```javascript + +this.alfrescoJsApi.activiti.reportApi.createDefaultReports(); +``` + +### Parameters +No parameters required. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="getReportList"></a> +# **getReportList** +> [ReportParametersDefinition] getReportList() + +Retrieve the available report list. + +### Example +```javascript + +this.alfrescoJsApi.activiti.reportApi.getReportList(); +``` + +### Parameters +No parameters required. + +### Return type + +[**[ReportParametersDefinition]**](ReportParametersDefinition.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +<a name="getReportParams"></a> +# **getReportParams** +> ReportParametersDefinition getReportParams(reportId) + +Retrieve the parameters referring to the reportId. + +### Example +```javascript + +var reportId = "1"; // String | reportId + +this.alfrescoJsApi.activiti.reportApi.getReportParams(reportId); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reportId** | **String**| reportId | + +### Return type + +[**ReportParametersDefinition**](ReportParametersDefinition.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="getProcessDefinitions"></a> +# **getProcessDefinitions** +> ParameterValueRepresentation getProcessDefinitions() + +Retrieve the process definition list for all the apps. + +### Example +```javascript + +this.alfrescoJsApi.activiti.reportApi.getProcessDefinitions(); +``` + +### Parameters +No parameters required. + +### Return type + +[**ParameterValueRepresentation**](ParameterValueRepresentation.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="getTasksByProcessDefinitionId"></a> +# **getTasksByProcessDefinitionId** +> ['String'] getTasksByProcessDefinitionId(reportId, processDefinitionId) + +Retrieves all tasks that refer to the processDefinitionId + +### Example +```javascript + +var reportId = "1"; // String | reportId +var processDefinitionId = "1"; // String | processDefinitionId + +this.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reportId** | **String**| reportId | + **processDefinitionId** | **String**| process definition id | + +### Return type + +**['String']** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="getReportsByParams"></a> +# **getReportsByParams** +> ReportCharts getReportsByParams(reportId, paramsQuery) + +Generate the reports based on the input parameters + +### Example +```javascript + +var reportId = "1"; // String | reportId +var paramsQuery = {status: 'ALL'}; // Object | paramsQuery + +this.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reportId** | **String**| reportId | + **paramsQuery** | **Object**| Query parameters | + +### Return type + +[**ReportCharts**](ReportCharts.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="updateReport"></a> +# **updateReport** +> updateReport(reportId, name) + +Update the report details + +### Example +```javascript + +var reportId = "1"; // String | reportId +var name = "new Fake name"; // String | name + +this.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reportId** | **String**| reportId | + **name** | **String**| The report name | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="exportToCsv"></a> +# **exportToCsv** +> exportToCsv(reportId, queryParams) + +Export a report as csv + +### Example +```javascript + +var reportId = "1"; // String | reportId +var queryParams = { + 'processDefinitionId': 'TEST:99:999', + 'dateRange': { + 'startDate': '2017-01-01T00:00:00.000Z', + 'endDate': '2017-01-24T23:59:59.999Z', + 'rangeId': 'currentYear' + }, + 'slowProcessInstanceInteger': 10, + 'status': 'All', + '__reportName': 'FAKE_REPORT_NAME' + }; + +this.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParams); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reportId** | **String**| reportId | + **queryParams** | **Object**| Query parameters | + +### Return type + +**['String']** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="saveReport"></a> +# **saveReport** +> saveReport(reportId, queryParams) + +Save a report + +### Example +```javascript + +var reportId = "1"; // String | reportId +var queryParams = { + 'processDefinitionId': 'TEST:99:999', + 'dateRange': { + 'startDate': '2017-01-01T00:00:00.000Z', + 'endDate': '2017-01-24T23:59:59.999Z', + 'rangeId': 'currentYear' + }, + 'slowProcessInstanceInteger': 10, + 'status': 'All', + '__reportName': 'FAKE_REPORT_NAME' + }; + +this.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParams); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reportId** | **String**| reportId | + **queryParams** | **Object**| Query parameters | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="deleteReport"></a> +# **deleteReport** +> deleteReport(reportId) + +Delete a report + +### Example +```javascript + +var reportId = "1"; // String | reportId + +this.alfrescoJsApi.activiti.reportApi.deleteReport(reportId); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reportId** | **String**| reportId | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResetPasswordRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ResetPasswordRepresentation.md new file mode 100644 index 0000000000..a5978243e4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResetPasswordRepresentation.md @@ -0,0 +1,8 @@ +# ResetPasswordRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/RestVariable.md b/lib/js-api/src/api/activiti-rest-api/docs/RestVariable.md new file mode 100644 index 0000000000..d603344cd8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/RestVariable.md @@ -0,0 +1,11 @@ +# RestVariable + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] +**scope** | **string** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] +**value** | **any** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentationRelatedProcessTask.md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentationRelatedProcessTask.md new file mode 100644 index 0000000000..04df3904d8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentationRelatedProcessTask.md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationRelatedProcessTask + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**RelatedProcessTask[]**](RelatedProcessTask.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AbstractUserRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AbstractUserRepresentation».md new file mode 100644 index 0000000000..05f1b67ffc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AbstractUserRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationAbstractUserRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AbstractUserRepresentation[]**](AbstractUserRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoContentRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoContentRepresentation».md new file mode 100644 index 0000000000..f590edaa86 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoContentRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationAlfrescoContentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AlfrescoContentRepresentation[]**](AlfrescoContentRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoEndpointRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoEndpointRepresentation».md new file mode 100644 index 0000000000..cd2b90fe2d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoEndpointRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationAlfrescoEndpointRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AlfrescoEndpointRepresentation[]**](AlfrescoEndpointRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoNetworkRepresenation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoNetworkRepresenation».md new file mode 100644 index 0000000000..249c34b44c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoNetworkRepresenation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationAlfrescoNetworkRepresenation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AlfrescoNetworkRepresenation[]**](AlfrescoNetworkRepresenation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoSiteRepresenation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoSiteRepresenation».md new file mode 100644 index 0000000000..a3db13df15 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AlfrescoSiteRepresenation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationAlfrescoSiteRepresenation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AlfrescoSiteRepresenation[]**](AlfrescoSiteRepresenation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AppDefinitionRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AppDefinitionRepresentation».md new file mode 100644 index 0000000000..400713d002 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AppDefinitionRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationAppDefinitionRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AppDefinitionRepresentation[]**](AppDefinitionRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AppDeploymentRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AppDeploymentRepresentation».md new file mode 100644 index 0000000000..2991696576 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«AppDeploymentRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationAppDeploymentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**AppDeploymentRepresentation[]**](AppDeploymentRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«BoxContent».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«BoxContent».md new file mode 100644 index 0000000000..cc2781326e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«BoxContent».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationBoxContent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**BoxContent[]**](BoxContent.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«CommentRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«CommentRepresentation».md new file mode 100644 index 0000000000..0a5f1ca4e3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«CommentRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationCommentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**CommentRepresentation[]**](CommentRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«DecisionTaskRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«DecisionTaskRepresentation».md new file mode 100644 index 0000000000..3fc52e97a2 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«DecisionTaskRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationDecisionTaskRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**DecisionTaskRepresentation[]**](DecisionTaskRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«FormRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«FormRepresentation».md new file mode 100644 index 0000000000..5edfcce35e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«FormRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationFormRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**FormRepresentation[]**](FormRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«GoogleDriveContent».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«GoogleDriveContent».md new file mode 100644 index 0000000000..b37b9c40a0 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«GoogleDriveContent».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationGoogleDriveContent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**GoogleDriveContent[]**](GoogleDriveContent.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«LightGroupRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«LightGroupRepresentation».md new file mode 100644 index 0000000000..f97ddd3623 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«LightGroupRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationLightGroupRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**LightGroupRepresentation[]**](LightGroupRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«LightUserRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«LightUserRepresentation».md new file mode 100644 index 0000000000..e37a98c67b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«LightUserRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationLightUserRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**LightUserRepresentation[]**](LightUserRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ModelRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ModelRepresentation».md new file mode 100644 index 0000000000..e4f572f6a7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ModelRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationModelRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ModelRepresentation[]**](ModelRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessContentRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessContentRepresentation».md new file mode 100644 index 0000000000..8582bd5a11 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessContentRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationProcessContentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ProcessContentRepresentation[]**](ProcessContentRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessDefinitionRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessDefinitionRepresentation».md new file mode 100644 index 0000000000..30185e934f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessDefinitionRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationProcessDefinitionRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ProcessDefinitionRepresentation[]**](ProcessDefinitionRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessInstanceRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessInstanceRepresentation».md new file mode 100644 index 0000000000..b3eb085c12 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«ProcessInstanceRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationProcessInstanceRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ProcessInstanceRepresentation[]**](ProcessInstanceRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RelatedContentRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RelatedContentRepresentation».md new file mode 100644 index 0000000000..1b8a7064d3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RelatedContentRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationRelatedContentRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**RelatedContentRepresentation[]**](RelatedContentRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RuntimeDecisionTableRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RuntimeDecisionTableRepresentation».md new file mode 100644 index 0000000000..df5fa23723 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RuntimeDecisionTableRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationRuntimeDecisionTableRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**RuntimeDecisionTableRepresentation[]**](RuntimeDecisionTableRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RuntimeFormRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RuntimeFormRepresentation».md new file mode 100644 index 0000000000..a8f6e8eb2c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«RuntimeFormRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationRuntimeFormRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**RuntimeFormRepresentation[]**](RuntimeFormRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«SubmittedFormRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«SubmittedFormRepresentation».md new file mode 100644 index 0000000000..b1d8ec5fe3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«SubmittedFormRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationSubmittedFormRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**SubmittedFormRepresentation[]**](SubmittedFormRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«TaskRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«TaskRepresentation».md new file mode 100644 index 0000000000..9bfa6bfb38 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«TaskRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationTaskRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**TaskRepresentation[]**](TaskRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«UserProcessInstanceFilterRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«UserProcessInstanceFilterRepresentation».md new file mode 100644 index 0000000000..a19b3c6c9a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«UserProcessInstanceFilterRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationUserProcessInstanceFilterRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**UserProcessInstanceFilterRepresentation[]**](UserProcessInstanceFilterRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«UserTaskFilterRepresentation».md b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«UserTaskFilterRepresentation».md new file mode 100644 index 0000000000..f423b2aa7b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ResultListDataRepresentation«UserTaskFilterRepresentation».md @@ -0,0 +1,11 @@ +# ResultListDataRepresentationUserTaskFilterRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**UserTaskFilterRepresentation[]**](UserTaskFilterRepresentation.md) | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**total** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDefinitionSaveRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDefinitionSaveRepresentation.md new file mode 100644 index 0000000000..8baca41dd3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDefinitionSaveRepresentation.md @@ -0,0 +1,8 @@ +# RuntimeAppDefinitionSaveRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinitions** | [**AppDefinitionRepresentation[]**](AppDefinitionRepresentation.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDefinitionsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDefinitionsApi.md new file mode 100644 index 0000000000..7fad42a1a2 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDefinitionsApi.md @@ -0,0 +1,125 @@ +# RuntimeappdefinitionsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deployAppDefinitions**](RuntimeAppDefinitionsApi.md#deployAppDefinitions) | **POST** /enterprise/runtime-app-definitions | Deploy a published app +[**getAppDefinition**](RuntimeAppDefinitionsApi.md#getAppDefinition) | **GET** /enterprise/runtime-app-definitions/{appDefinitionId} | Get a runtime app +[**getAppDefinitions**](RuntimeAppDefinitionsApi.md#getAppDefinitions) | **GET** /enterprise/runtime-app-definitions | List runtime apps + + +<a name="deployAppDefinitions"></a> +# **deployAppDefinitions** +> deployAppDefinitions(saveObject) + +Deploy a published app + +Deploying an app allows the user to see it on his/her landing page. Apps must be published before they can be deployed. + +### Example + +```javascript +import RuntimeappdefinitionsApi from 'src/api/activiti-rest-api/docs/RuntimeAppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let runtimeappdefinitionsApi = new RuntimeappdefinitionsApi(this.alfrescoApi); + + +runtimeappdefinitionsApi.deployAppDefinitions(saveObject).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **saveObject** | [**RuntimeAppDefinitionSaveRepresentation**](RuntimeAppDefinitionSaveRepresentation.md)| saveObject | + +### Return type + +null (empty response body) + +<a name="getAppDefinition"></a> +# **getAppDefinition** +> AppDefinitionRepresentation getAppDefinition(appDefinitionId) + +Get a runtime app + +### Example + +```javascript +import RuntimeappdefinitionsApi from 'src/api/activiti-rest-api/docs/RuntimeAppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let runtimeappdefinitionsApi = new RuntimeappdefinitionsApi(this.alfrescoApi); + + +runtimeappdefinitionsApi.getAppDefinition(appDefinitionId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appDefinitionId** | **number**| appDefinitionId | + +### Return type + +[**AppDefinitionRepresentation**](AppDefinitionRepresentation.md) + +<a name="getAppDefinitions"></a> +# **getAppDefinitions** +> ResultListDataRepresentationAppDefinitionRepresentation getAppDefinitions() + +List runtime apps + +When a user logs in into Alfresco Process Services Suite, a landing page is displayed containing all the apps that the user is allowed to see and use. These are referred to as runtime apps. + +### Example + +```javascript +import RuntimeappdefinitionsApi from 'src/api/activiti-rest-api/docs/RuntimeAppDefinitionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let runtimeappdefinitionsApi = new RuntimeappdefinitionsApi(this.alfrescoApi); + +runtimeappdefinitionsApi.getAppDefinitions().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ResultListDataRepresentationAppDefinitionRepresentation**](ResultListDataRepresentationAppDefinitionRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi.md new file mode 100644 index 0000000000..127219c176 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi.md @@ -0,0 +1,225 @@ +# RuntimeappdeploymentsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteAppDeployment**](RuntimeAppDeploymentsApi.md#deleteAppDeployment) | **DELETE** /enterprise/runtime-app-deployments/{appDeploymentId} | Remove an app deployment +[**exportAppDefinition**](RuntimeAppDeploymentsApi.md#exportAppDefinition) | **GET** /enterprise/export-app-deployment/{deploymentId} | Export the app archive for a deployment +[**getAppDefinitions**](RuntimeAppDeploymentsApi.md#getAppDefinitions) | **GET** /enterprise/runtime-app-deployments | Query app deployments +[**getAppDeployment**](RuntimeAppDeploymentsApi.md#getAppDeployment) | **GET** /enterprise/runtime-app-deployments/{appDeploymentId} | Get an app deployment +[**getRuntimeAppDeploymentByDeployment**](RuntimeAppDeploymentsApi.md#getRuntimeAppDeploymentByDeployment) | **GET** /enterprise/runtime-app-deployment | Get an app by deployment ID or DMN deployment ID + + +<a name="deleteAppDeployment"></a> +# **deleteAppDeployment** +> deleteAppDeployment(appDeploymentId) + +Remove an app deployment + +### Example + +```javascript +import RuntimeappdeploymentsApi from 'src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let runtimeappdeploymentsApi = new RuntimeappdeploymentsApi(this.alfrescoApi); + + +runtimeappdeploymentsApi.deleteAppDeployment(appDeploymentId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appDeploymentId** | **number**| appDeploymentId | + +### Return type + +null (empty response body) + +<a name="exportAppDefinition"></a> +# **exportAppDefinition** +> exportAppDefinition(deploymentId) + +Export the app archive for a deployment + +### Example + +```javascript +import RuntimeappdeploymentsApi from 'src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let runtimeappdeploymentsApi = new RuntimeappdeploymentsApi(this.alfrescoApi); + + +runtimeappdeploymentsApi.exportAppDefinition(deploymentId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deploymentId** | **string**| deploymentId | + +### Return type + +null (empty response body) + +<a name="getAppDefinitions"></a> +# **getAppDefinitions** +> ResultListDataRepresentationAppDeploymentRepresentation getAppDefinitions(opts) + +Query app deployments + +### Example + +```javascript +import RuntimeappdeploymentsApi from 'src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let runtimeappdeploymentsApi = new RuntimeappdeploymentsApi(this.alfrescoApi); + +let opts = { + 'nameLike': nameLike_example // | nameLike + 'tenantId': 789 // | tenantId + 'latest': true // | latest + 'start': 56 // | start + 'sort': sort_example // | sort + 'order': order_example // | order + 'size': 56 // | size +}; + +runtimeappdeploymentsApi.getAppDefinitions(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **nameLike** | **string**| nameLike | [optional] + **tenantId** | **number**| tenantId | [optional] + **latest** | **boolean**| latest | [optional] + **start** | **number**| start | [optional] + **sort** | **string**| sort | [optional] + **order** | **string**| order | [optional] + **size** | **number**| size | [optional] + +### Return type + +[**ResultListDataRepresentationAppDeploymentRepresentation**](ResultListDataRepresentationAppDeploymentRepresentation.md) + +<a name="getAppDeployment"></a> +# **getAppDeployment** +> AppDeploymentRepresentation getAppDeployment(appDeploymentId) + +Get an app deployment + +### Example + +```javascript +import RuntimeappdeploymentsApi from 'src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let runtimeappdeploymentsApi = new RuntimeappdeploymentsApi(this.alfrescoApi); + + +runtimeappdeploymentsApi.getAppDeployment(appDeploymentId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appDeploymentId** | **number**| appDeploymentId | + +### Return type + +[**AppDeploymentRepresentation**](AppDeploymentRepresentation.md) + +<a name="getRuntimeAppDeploymentByDeployment"></a> +# **getRuntimeAppDeploymentByDeployment** +> AppDeploymentRepresentation getRuntimeAppDeploymentByDeployment(opts) + +Get an app by deployment ID or DMN deployment ID + +Either a deploymentId or a dmnDeploymentId must be provided + +### Example + +```javascript +import RuntimeappdeploymentsApi from 'src/api/activiti-rest-api/docs/RuntimeAppDeploymentsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let runtimeappdeploymentsApi = new RuntimeappdeploymentsApi(this.alfrescoApi); + +let opts = { + 'deploymentId': deploymentId_example // | deploymentId + 'dmnDeploymentId': 789 // | dmnDeploymentId +}; + +runtimeappdeploymentsApi.getRuntimeAppDeploymentByDeployment(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deploymentId** | **string**| deploymentId | [optional] + **dmnDeploymentId** | **number**| dmnDeploymentId | [optional] + +### Return type + +[**AppDeploymentRepresentation**](AppDeploymentRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/RuntimeDecisionTableRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeDecisionTableRepresentation.md new file mode 100644 index 0000000000..4e0d0d7b19 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeDecisionTableRepresentation.md @@ -0,0 +1,16 @@ +# RuntimeDecisionTableRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **string** | | [optional] [default to null] +**deploymentId** | **number** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**key** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**resourceName** | **string** | | [optional] [default to null] +**tenantId** | **string** | | [optional] [default to null] +**version** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/RuntimeFormRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeFormRepresentation.md new file mode 100644 index 0000000000..61d5f3e7e3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/RuntimeFormRepresentation.md @@ -0,0 +1,14 @@ +# RuntimeFormRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinitionId** | **number** | | [optional] [default to null] +**appDeploymentId** | **number** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**modelId** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/SaveFormRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/SaveFormRepresentation.md new file mode 100644 index 0000000000..38d113ef9a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/SaveFormRepresentation.md @@ -0,0 +1,8 @@ +# SaveFormRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | **any** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ScriptFilesApi.md b/lib/js-api/src/api/activiti-rest-api/docs/ScriptFilesApi.md new file mode 100644 index 0000000000..f78078ac6a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ScriptFilesApi.md @@ -0,0 +1,78 @@ +# ScriptfilesApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getControllers**](ScriptFilesApi.md#getControllers) | **GET** /enterprise/script-files/controllers | getControllers +[**getLibraries**](ScriptFilesApi.md#getLibraries) | **GET** /enterprise/script-files/libraries | getLibraries + + +<a name="getControllers"></a> +# **getControllers** +> string getControllers() + +getControllers + +### Example + +```javascript +import ScriptfilesApi from 'src/api/activiti-rest-api/docs/ScriptFilesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let scriptfilesApi = new ScriptfilesApi(this.alfrescoApi); + +scriptfilesApi.getControllers().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**string** + +<a name="getLibraries"></a> +# **getLibraries** +> string getLibraries() + +getLibraries + +### Example + +```javascript +import ScriptfilesApi from 'src/api/activiti-rest-api/docs/ScriptFilesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let scriptfilesApi = new ScriptfilesApi(this.alfrescoApi); + +scriptfilesApi.getLibraries().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**string** + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/SubmittedFormRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/SubmittedFormRepresentation.md new file mode 100644 index 0000000000..fd37ef68a8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/SubmittedFormRepresentation.md @@ -0,0 +1,15 @@ +# SubmittedFormRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**form** | [**FormDefinitionRepresentation**](FormDefinitionRepresentation.md) | | [optional] [default to null] +**formId** | **number** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**processId** | **string** | | [optional] [default to null] +**submitted** | [**Date**](Date.md) | | [optional] [default to null] +**submittedBy** | [**LightUserRepresentation**](LightUserRepresentation.md) | | [optional] [default to null] +**taskId** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/SubmittedFormsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/SubmittedFormsApi.md new file mode 100644 index 0000000000..05328b7b6f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/SubmittedFormsApi.md @@ -0,0 +1,172 @@ +# SubmittedformsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getFormSubmittedForms**](SubmittedFormsApi.md#getFormSubmittedForms) | **GET** /enterprise/form-submitted-forms/{formId} | List submissions for a form +[**getProcessSubmittedForms**](SubmittedFormsApi.md#getProcessSubmittedForms) | **GET** /enterprise/process-submitted-forms/{processId} | List submissions for a process instance +[**getSubmittedFrom**](SubmittedFormsApi.md#getSubmittedFrom) | **GET** /enterprise/submitted-forms/{submittedFormId} | Get a form submission +[**getTaskSubmittedForms**](SubmittedFormsApi.md#getTaskSubmittedForms) | **GET** /enterprise/task-submitted-form/{taskId} | Get the submitted form for a task + + +<a name="getFormSubmittedForms"></a> +# **getFormSubmittedForms** +> ResultListDataRepresentationSubmittedFormRepresentation getFormSubmittedForms(formIdopts) + +List submissions for a form + +### Example + +```javascript +import SubmittedformsApi from 'src/api/activiti-rest-api/docs/SubmittedFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let submittedformsApi = new SubmittedformsApi(this.alfrescoApi); + +let opts = { + 'submittedBy': 789 // | submittedBy + 'start': 56 // | start + 'size': 56 // | size +}; + +submittedformsApi.getFormSubmittedForms(formIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **formId** | **number**| formId | + **submittedBy** | **number**| submittedBy | [optional] + **start** | **number**| start | [optional] + **size** | **number**| size | [optional] + +### Return type + +[**ResultListDataRepresentationSubmittedFormRepresentation**](ResultListDataRepresentationSubmittedFormRepresentation.md) + +<a name="getProcessSubmittedForms"></a> +# **getProcessSubmittedForms** +> ResultListDataRepresentationSubmittedFormRepresentation getProcessSubmittedForms(processId) + +List submissions for a process instance + +### Example + +```javascript +import SubmittedformsApi from 'src/api/activiti-rest-api/docs/SubmittedFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let submittedformsApi = new SubmittedformsApi(this.alfrescoApi); + + +submittedformsApi.getProcessSubmittedForms(processId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **processId** | **string**| processId | + +### Return type + +[**ResultListDataRepresentationSubmittedFormRepresentation**](ResultListDataRepresentationSubmittedFormRepresentation.md) + +<a name="getSubmittedFrom"></a> +# **getSubmittedFrom** +> SubmittedFormRepresentation getSubmittedFrom(submittedFormId) + +Get a form submission + +### Example + +```javascript +import SubmittedformsApi from 'src/api/activiti-rest-api/docs/SubmittedFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let submittedformsApi = new SubmittedformsApi(this.alfrescoApi); + + +submittedformsApi.getSubmittedFrom(submittedFormId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **submittedFormId** | **number**| submittedFormId | + +### Return type + +[**SubmittedFormRepresentation**](SubmittedFormRepresentation.md) + +<a name="getTaskSubmittedForms"></a> +# **getTaskSubmittedForms** +> SubmittedFormRepresentation getTaskSubmittedForms(taskId) + +Get the submitted form for a task + +### Example + +```javascript +import SubmittedformsApi from 'src/api/activiti-rest-api/docs/SubmittedFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let submittedformsApi = new SubmittedformsApi(this.alfrescoApi); + + +submittedformsApi.getTaskSubmittedForms(taskId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +[**SubmittedFormRepresentation**](SubmittedFormRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/SyncLogEntryRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/SyncLogEntryRepresentation.md new file mode 100644 index 0000000000..7eb9b07f7b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/SyncLogEntryRepresentation.md @@ -0,0 +1,10 @@ +# SyncLogEntryRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **number** | | [optional] [default to null] +**timeStamp** | [**Date**](Date.md) | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/SystemPropertiesApi.md b/lib/js-api/src/api/activiti-rest-api/docs/SystemPropertiesApi.md new file mode 100644 index 0000000000..90a81275f4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/SystemPropertiesApi.md @@ -0,0 +1,162 @@ +# SystempropertiesApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getGlobalDateFormat**](SystemPropertiesApi.md#getGlobalDateFormat) | **GET** /enterprise/system/properties/global-date-format/{tenantId} | Get global date format +[**getPasswordValidationConstraints**](SystemPropertiesApi.md#getPasswordValidationConstraints) | **GET** /enterprise/system/properties/password-validation-constraints/{tenantId} | Get password validation constraints +[**getProperties**](SystemPropertiesApi.md#getProperties) | **GET** /enterprise/system/properties | Retrieve system properties +[**involvedUsersCanEditForms**](SystemPropertiesApi.md#involvedUsersCanEditForms) | **GET** /enterprise/system/properties/involved-users-can-edit-forms/{tenantId} | Get involved users who can edit forms + + +<a name="getGlobalDateFormat"></a> +# **getGlobalDateFormat** +> GlobalDateFormatRepresentation getGlobalDateFormat(tenantId) + +Get global date format + +### Example + +```javascript +import SystempropertiesApi from 'src/api/activiti-rest-api/docs/SystemPropertiesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let systempropertiesApi = new SystempropertiesApi(this.alfrescoApi); + + +systempropertiesApi.getGlobalDateFormat(tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + +### Return type + +[**GlobalDateFormatRepresentation**](GlobalDateFormatRepresentation.md) + +<a name="getPasswordValidationConstraints"></a> +# **getPasswordValidationConstraints** +> PasswordValidationConstraints getPasswordValidationConstraints(tenantId) + +Get password validation constraints + +### Example + +```javascript +import SystempropertiesApi from 'src/api/activiti-rest-api/docs/SystemPropertiesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let systempropertiesApi = new SystempropertiesApi(this.alfrescoApi); + + +systempropertiesApi.getPasswordValidationConstraints(tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + +### Return type + +[**PasswordValidationConstraints**](PasswordValidationConstraints.md) + +<a name="getProperties"></a> +# **getProperties** +> SystemPropertiesRepresentation getProperties() + +Retrieve system properties + +Typical value is AllowInvolveByEmail + +### Example + +```javascript +import SystempropertiesApi from 'src/api/activiti-rest-api/docs/SystemPropertiesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let systempropertiesApi = new SystempropertiesApi(this.alfrescoApi); + +systempropertiesApi.getProperties().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**SystemPropertiesRepresentation**](SystemPropertiesRepresentation.md) + +<a name="involvedUsersCanEditForms"></a> +# **involvedUsersCanEditForms** +> boolean involvedUsersCanEditForms(tenantId) + +Get involved users who can edit forms + +### Example + +```javascript +import SystempropertiesApi from 'src/api/activiti-rest-api/docs/SystemPropertiesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let systempropertiesApi = new SystempropertiesApi(this.alfrescoApi); + + +systempropertiesApi.involvedUsersCanEditForms(tenantId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tenantId** | **number**| tenantId | + +### Return type + +**boolean** + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/SystemPropertiesRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/SystemPropertiesRepresentation.md new file mode 100644 index 0000000000..6bbb1f820d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/SystemPropertiesRepresentation.md @@ -0,0 +1,9 @@ +# SystemPropertiesRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowInvolveByEmail** | **boolean** | | [optional] [default to null] +**disableJavaScriptEventsInFormEditor** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskActionsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskActionsApi.md new file mode 100644 index 0000000000..5240c5d489 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskActionsApi.md @@ -0,0 +1,489 @@ +# TaskactionsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**assignTask**](TaskActionsApi.md#assignTask) | **PUT** /enterprise/tasks/{taskId}/action/assign | Assign a task to a user +[**attachForm**](TaskActionsApi.md#attachForm) | **PUT** /enterprise/tasks/{taskId}/action/attach-form | Attach a form to a task +[**claimTask**](TaskActionsApi.md#claimTask) | **PUT** /enterprise/tasks/{taskId}/action/claim | Claim a task +[**completeTask**](TaskActionsApi.md#completeTask) | **PUT** /enterprise/tasks/{taskId}/action/complete | Complete a task +[**delegateTask**](TaskActionsApi.md#delegateTask) | **PUT** /enterprise/tasks/{taskId}/action/delegate | Delegate a task +[**involveGroup**](TaskActionsApi.md#involveGroup) | **POST** /enterprise/tasks/{taskId}/groups/{groupId} | Involve a group with a task +[**involveUser**](TaskActionsApi.md#involveUser) | **PUT** /enterprise/tasks/{taskId}/action/involve | Involve a user with a task +[**removeForm**](TaskActionsApi.md#removeForm) | **DELETE** /enterprise/tasks/{taskId}/action/remove-form | Remove a form from a task +[**removeInvolvedUser**](TaskActionsApi.md#removeInvolvedUser) | **DELETE** /enterprise/tasks/{taskId}/groups/{groupId} | Remove an involved group from a task +[**removeInvolvedUser**](TaskActionsApi.md#removeInvolvedUser) | **PUT** /enterprise/tasks/{taskId}/action/remove-involved | Remove an involved user from a task +[**resolveTask**](TaskActionsApi.md#resolveTask) | **PUT** /enterprise/tasks/{taskId}/action/resolve | Resolve a task +[**unclaimTask**](TaskActionsApi.md#unclaimTask) | **PUT** /enterprise/tasks/{taskId}/action/unclaim | Unclaim a task + + +<a name="assignTask"></a> +# **assignTask** +> TaskRepresentation assignTask(taskIduserIdentifier) + +Assign a task to a user + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.assignTask(taskIduserIdentifier).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **userIdentifier** | [**AssigneeIdentifierRepresentation**](AssigneeIdentifierRepresentation.md)| userIdentifier | + +### Return type + +[**TaskRepresentation**](TaskRepresentation.md) + +<a name="attachForm"></a> +# **attachForm** +> attachForm(taskIdformIdentifier) + +Attach a form to a task + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.attachForm(taskIdformIdentifier).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **formIdentifier** | [**FormIdentifierRepresentation**](FormIdentifierRepresentation.md)| formIdentifier | + +### Return type + +null (empty response body) + +<a name="claimTask"></a> +# **claimTask** +> claimTask(taskId) + +Claim a task + +To claim a task (in case the task is assigned to a group) + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.claimTask(taskId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +null (empty response body) + +<a name="completeTask"></a> +# **completeTask** +> completeTask(taskId) + +Complete a task + +Use this endpoint to complete a standalone task or task without a form + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.completeTask(taskId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +null (empty response body) + +<a name="delegateTask"></a> +# **delegateTask** +> delegateTask(taskIduserIdentifier) + +Delegate a task + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.delegateTask(taskIduserIdentifier).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **userIdentifier** | [**UserIdentifierRepresentation**](UserIdentifierRepresentation.md)| userIdentifier | + +### Return type + +null (empty response body) + +<a name="involveGroup"></a> +# **involveGroup** +> involveGroup(taskIdgroupId) + +Involve a group with a task + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.involveGroup(taskIdgroupId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **groupId** | **string**| groupId | + +### Return type + +null (empty response body) + +<a name="involveUser"></a> +# **involveUser** +> involveUser(taskIduserIdentifier) + +Involve a user with a task + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.involveUser(taskIduserIdentifier).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **userIdentifier** | [**UserIdentifierRepresentation**](UserIdentifierRepresentation.md)| userIdentifier | + +### Return type + +null (empty response body) + +<a name="removeForm"></a> +# **removeForm** +> removeForm(taskId) + +Remove a form from a task + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.removeForm(taskId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +null (empty response body) + +<a name="removeInvolvedUser"></a> +# **removeInvolvedUser** +> removeInvolvedUser(taskIdgroupId) + +Remove an involved group from a task + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.removeInvolvedUser(taskIdgroupId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **groupId** | **string**| groupId | + +### Return type + +null (empty response body) + +<a name="removeInvolvedUser"></a> +# **removeInvolvedUser** +> removeInvolvedUser(taskIduserIdentifier) + +Remove an involved user from a task + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.removeInvolvedUser(taskIduserIdentifier).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **userIdentifier** | [**UserIdentifierRepresentation**](UserIdentifierRepresentation.md)| userIdentifier | + +### Return type + +null (empty response body) + +<a name="resolveTask"></a> +# **resolveTask** +> resolveTask(taskId) + +Resolve a task + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.resolveTask(taskId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +null (empty response body) + +<a name="unclaimTask"></a> +# **unclaimTask** +> unclaimTask(taskId) + +Unclaim a task + +To unclaim a task (in case the task was assigned to a group) + +### Example + +```javascript +import TaskactionsApi from 'src/api/activiti-rest-api/docs/TaskActionsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskactionsApi = new TaskactionsApi(this.alfrescoApi); + + +taskactionsApi.unclaimTask(taskId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +null (empty response body) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskAuditInfoRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskAuditInfoRepresentation.md new file mode 100644 index 0000000000..fcce0fc9fb --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskAuditInfoRepresentation.md @@ -0,0 +1,18 @@ +# TaskAuditInfoRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | **string** | | [optional] [default to null] +**comments** | [**CommentAuditInfo[]**](CommentAuditInfo.md) | | [optional] [default to null] +**endTime** | **string** | | [optional] [default to null] +**formData** | [**AuditLogFormDataRepresentation[]**](AuditLogFormDataRepresentation.md) | | [optional] [default to null] +**processDefinitionName** | **string** | | [optional] [default to null] +**processDefinitionVersion** | **number** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] +**selectedOutcome** | **string** | | [optional] [default to null] +**startTime** | **string** | | [optional] [default to null] +**taskId** | **string** | | [optional] [default to null] +**taskName** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskFilterRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskFilterRepresentation.md new file mode 100644 index 0000000000..d1b7350ff1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskFilterRepresentation.md @@ -0,0 +1,29 @@ +# TaskFilterRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asc** | **boolean** | | [optional] [default to null] +**assignment** | **string** | | [optional] [default to null] +**dueAfter** | [**Date**](Date.md) | | [optional] [default to null] +**dueBefore** | [**Date**](Date.md) | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**sort** | **string** | | [optional] [default to null] +**state** | **string** | | [optional] [default to null] + + +<a name="TaskFilterRepresentation.StateEnum"></a> +## Enum: TaskFilterRepresentation.StateEnum + + +* `Active` (value: `'active'`) + +* `Completed` (value: `'completed'`) + +* `All` (value: `'all'`) + + + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskFilterRequestRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskFilterRequestRepresentation.md new file mode 100644 index 0000000000..6246b8cbcb --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskFilterRequestRepresentation.md @@ -0,0 +1,12 @@ +# TaskFilterRequestRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinitionId** | **number** | | [optional] [default to null] +**filter** | [**TaskFilterRepresentation**](TaskFilterRepresentation.md) | | [optional] [default to null] +**filterId** | **number** | | [optional] [default to null] +**page** | **number** | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskFormsApi.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskFormsApi.md new file mode 100644 index 0000000000..60962e4b80 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskFormsApi.md @@ -0,0 +1,251 @@ +# TaskformsApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**completeTaskForm**](TaskFormsApi.md#completeTaskForm) | **POST** /enterprise/task-forms/{taskId} | Complete a task form +[**getProcessInstanceVariables**](TaskFormsApi.md#getProcessInstanceVariables) | **GET** /enterprise/task-forms/{taskId}/variables | Get task variables +[**getRestFieldValues**](TaskFormsApi.md#getRestFieldValues) | **GET** /enterprise/task-forms/{taskId}/form-values/{field}/{column} | Retrieve column field values +[**getRestFieldValues**](TaskFormsApi.md#getRestFieldValues) | **GET** /enterprise/task-forms/{taskId}/form-values/{field} | Retrieve populated field values +[**getTaskForm**](TaskFormsApi.md#getTaskForm) | **GET** /enterprise/task-forms/{taskId} | Get a task form +[**saveTaskForm**](TaskFormsApi.md#saveTaskForm) | **POST** /enterprise/task-forms/{taskId}/save-form | Save a task form + + +<a name="completeTaskForm"></a> +# **completeTaskForm** +> completeTaskForm(taskIdcompleteTaskFormRepresentation) + +Complete a task form + +### Example + +```javascript +import TaskformsApi from 'src/api/activiti-rest-api/docs/TaskFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskformsApi = new TaskformsApi(this.alfrescoApi); + + +taskformsApi.completeTaskForm(taskIdcompleteTaskFormRepresentation).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](CompleteFormRepresentation.md)| completeTaskFormRepresentation | + +### Return type + +null (empty response body) + +<a name="getProcessInstanceVariables"></a> +# **getProcessInstanceVariables** +> ProcessInstanceVariableRepresentation getProcessInstanceVariables(taskId) + +Get task variables + +### Example + +```javascript +import TaskformsApi from 'src/api/activiti-rest-api/docs/TaskFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskformsApi = new TaskformsApi(this.alfrescoApi); + + +taskformsApi.getProcessInstanceVariables(taskId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +[**ProcessInstanceVariableRepresentation**](ProcessInstanceVariableRepresentation.md) + +<a name="getRestFieldValues"></a> +# **getRestFieldValues** +> FormValueRepresentation getRestFieldValues(taskIdfieldcolumn) + +Retrieve column field values + +Specific case to retrieve information on a specific column + +### Example + +```javascript +import TaskformsApi from 'src/api/activiti-rest-api/docs/TaskFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskformsApi = new TaskformsApi(this.alfrescoApi); + + +taskformsApi.getRestFieldValues(taskIdfieldcolumn).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **field** | **string**| field | + **column** | **string**| column | + +### Return type + +[**FormValueRepresentation**](FormValueRepresentation.md) + +<a name="getRestFieldValues"></a> +# **getRestFieldValues** +> FormValueRepresentation getRestFieldValues(taskIdfield) + +Retrieve populated field values + +Form field values that are populated through a REST backend, can be retrieved via this service + +### Example + +```javascript +import TaskformsApi from 'src/api/activiti-rest-api/docs/TaskFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskformsApi = new TaskformsApi(this.alfrescoApi); + + +taskformsApi.getRestFieldValues(taskIdfield).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **field** | **string**| field | + +### Return type + +[**FormValueRepresentation**](FormValueRepresentation.md) + +<a name="getTaskForm"></a> +# **getTaskForm** +> FormDefinitionRepresentation getTaskForm(taskId) + +Get a task form + +### Example + +```javascript +import TaskformsApi from 'src/api/activiti-rest-api/docs/TaskFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskformsApi = new TaskformsApi(this.alfrescoApi); + + +taskformsApi.getTaskForm(taskId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +[**FormDefinitionRepresentation**](FormDefinitionRepresentation.md) + +<a name="saveTaskForm"></a> +# **saveTaskForm** +> saveTaskForm(taskIdsaveTaskFormRepresentation) + +Save a task form + +### Example + +```javascript +import TaskformsApi from 'src/api/activiti-rest-api/docs/TaskFormsApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskformsApi = new TaskformsApi(this.alfrescoApi); + + +taskformsApi.saveTaskForm(taskIdsaveTaskFormRepresentation).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **saveTaskFormRepresentation** | [**SaveFormRepresentation**](SaveFormRepresentation.md)| saveTaskFormRepresentation | + +### Return type + +null (empty response body) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskQueryRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskQueryRepresentation.md new file mode 100644 index 0000000000..43bb10948d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskQueryRepresentation.md @@ -0,0 +1,49 @@ +# TaskQueryRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appDefinitionId** | **number** | | [optional] [default to null] +**assignment** | **string** | | [optional] [default to null] +**dueAfter** | [**Date**](Date.md) | | [optional] [default to null] +**dueBefore** | [**Date**](Date.md) | | [optional] [default to null] +**includeProcessInstance** | **boolean** | | [optional] [default to null] +**page** | **number** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] +**size** | **number** | | [optional] [default to null] +**sort** | **string** | | [optional] [default to null] +**start** | **number** | | [optional] [default to null] +**state** | **string** | | [optional] [default to null] +**taskId** | **string** | | [optional] [default to null] +**text** | **string** | | [optional] [default to null] + + +<a name="TaskQueryRepresentation.SortEnum"></a> +## Enum: TaskQueryRepresentation.SortEnum + + +* `CreatedDesc` (value: `'created-desc'`) + +* `CreatedAsc` (value: `'created-asc'`) + +* `DueDesc` (value: `'due-desc'`) + +* `DueAsc` (value: `'due-asc'`) + + + + +<a name="TaskQueryRepresentation.StateEnum"></a> +## Enum: TaskQueryRepresentation.StateEnum + + +* `Active` (value: `'active'`) + +* `Completed` (value: `'completed'`) + +* `All` (value: `'all'`) + + + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskRepresentation.md new file mode 100644 index 0000000000..c296ce4910 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskRepresentation.md @@ -0,0 +1,40 @@ +# TaskRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**adhocTaskCanBeReassigned** | **boolean** | | [optional] [default to null] +**assignee** | [**LightUserRepresentation**](LightUserRepresentation.md) | | [optional] [default to null] +**category** | **string** | | [optional] [default to null] +**created** | [**Date**](Date.md) | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**dueDate** | [**Date**](Date.md) | | [optional] [default to null] +**duration** | **number** | | [optional] [default to null] +**endDate** | [**Date**](Date.md) | | [optional] [default to null] +**executionId** | **string** | | [optional] [default to null] +**formKey** | **string** | | [optional] [default to null] +**id** | **string** | | [optional] [default to null] +**initiatorCanCompleteTask** | **boolean** | | [optional] [default to null] +**involvedGroups** | [**LightGroupRepresentation[]**](LightGroupRepresentation.md) | | [optional] [default to null] +**involvedPeople** | [**LightUserRepresentation[]**](LightUserRepresentation.md) | | [optional] [default to null] +**managerOfCandidateGroup** | **boolean** | | [optional] [default to null] +**memberOfCandidateGroup** | **boolean** | | [optional] [default to null] +**memberOfCandidateUsers** | **boolean** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**parentTaskId** | **string** | | [optional] [default to null] +**parentTaskName** | **string** | | [optional] [default to null] +**priority** | **number** | | [optional] [default to null] +**processDefinitionCategory** | **string** | | [optional] [default to null] +**processDefinitionDeploymentId** | **string** | | [optional] [default to null] +**processDefinitionDescription** | **string** | | [optional] [default to null] +**processDefinitionId** | **string** | | [optional] [default to null] +**processDefinitionKey** | **string** | | [optional] [default to null] +**processDefinitionName** | **string** | | [optional] [default to null] +**processDefinitionVersion** | **number** | | [optional] [default to null] +**processInstanceId** | **string** | | [optional] [default to null] +**processInstanceName** | **string** | | [optional] [default to null] +**processInstanceStartUserId** | **string** | | [optional] [default to null] +**taskDefinitionKey** | **string** | | [optional] [default to null] +**variables** | [**RestVariable[]**](RestVariable.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskUpdateRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskUpdateRepresentation.md new file mode 100644 index 0000000000..5a5b1d6daa --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskUpdateRepresentation.md @@ -0,0 +1,21 @@ +# TaskUpdateRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **string** | | [optional] [default to null] +**categorySet** | **boolean** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**descriptionSet** | **boolean** | | [optional] [default to null] +**dueDate** | [**Date**](Date.md) | | [optional] [default to null] +**dueDateSet** | **boolean** | | [optional] [default to null] +**formKey** | **string** | | [optional] [default to null] +**formKeySet** | **boolean** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**nameSet** | **boolean** | | [optional] [default to null] +**parentTaskId** | **string** | | [optional] [default to null] +**parentTaskIdSet** | **boolean** | | [optional] [default to null] +**priority** | **number** | | [optional] [default to null] +**prioritySet** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TaskVariablesApi.md b/lib/js-api/src/api/activiti-rest-api/docs/TaskVariablesApi.md new file mode 100644 index 0000000000..f5d40b3aae --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TaskVariablesApi.md @@ -0,0 +1,259 @@ +# TaskvariablesApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createTaskVariable**](TaskVariablesApi.md#createTaskVariable) | **POST** /enterprise/tasks/{taskId}/variables | Create variables +[**deleteAllLocalTaskVariables**](TaskVariablesApi.md#deleteAllLocalTaskVariables) | **DELETE** /enterprise/tasks/{taskId}/variables | Create or update variables +[**deleteVariable**](TaskVariablesApi.md#deleteVariable) | **DELETE** /enterprise/tasks/{taskId}/variables/{variableName} | Delete a variable +[**getVariable**](TaskVariablesApi.md#getVariable) | **GET** /enterprise/tasks/{taskId}/variables/{variableName} | Get a variable +[**getVariables**](TaskVariablesApi.md#getVariables) | **GET** /enterprise/tasks/{taskId}/variables | List variables +[**updateVariable**](TaskVariablesApi.md#updateVariable) | **PUT** /enterprise/tasks/{taskId}/variables/{variableName} | Update a variable + + +<a name="createTaskVariable"></a> +# **createTaskVariable** +> RestVariable createTaskVariable(taskIdrestVariables) + +Create variables + +### Example + +```javascript +import TaskvariablesApi from 'src/api/activiti-rest-api/docs/TaskVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskvariablesApi = new TaskvariablesApi(this.alfrescoApi); + + +taskvariablesApi.createTaskVariable(taskIdrestVariables).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **restVariables** | [**RestVariable**](RestVariable.md)| restVariables | + +### Return type + +[**RestVariable**](RestVariable.md) + +<a name="deleteAllLocalTaskVariables"></a> +# **deleteAllLocalTaskVariables** +> deleteAllLocalTaskVariables(taskId) + +Create or update variables + +### Example + +```javascript +import TaskvariablesApi from 'src/api/activiti-rest-api/docs/TaskVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskvariablesApi = new TaskvariablesApi(this.alfrescoApi); + + +taskvariablesApi.deleteAllLocalTaskVariables(taskId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +null (empty response body) + +<a name="deleteVariable"></a> +# **deleteVariable** +> deleteVariable(taskIdvariableNameopts) + +Delete a variable + +### Example + +```javascript +import TaskvariablesApi from 'src/api/activiti-rest-api/docs/TaskVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskvariablesApi = new TaskvariablesApi(this.alfrescoApi); + +let opts = { + 'scope': scope_example // | scope +}; + +taskvariablesApi.deleteVariable(taskIdvariableNameopts).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **variableName** | **string**| variableName | + **scope** | **string**| scope | [optional] + +### Return type + +null (empty response body) + +<a name="getVariable"></a> +# **getVariable** +> RestVariable getVariable(taskIdvariableNameopts) + +Get a variable + +### Example + +```javascript +import TaskvariablesApi from 'src/api/activiti-rest-api/docs/TaskVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskvariablesApi = new TaskvariablesApi(this.alfrescoApi); + +let opts = { + 'scope': scope_example // | scope +}; + +taskvariablesApi.getVariable(taskIdvariableNameopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **variableName** | **string**| variableName | + **scope** | **string**| scope | [optional] + +### Return type + +[**RestVariable**](RestVariable.md) + +<a name="getVariables"></a> +# **getVariables** +> RestVariable getVariables(taskIdopts) + +List variables + +### Example + +```javascript +import TaskvariablesApi from 'src/api/activiti-rest-api/docs/TaskVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskvariablesApi = new TaskvariablesApi(this.alfrescoApi); + +let opts = { + 'scope': scope_example // | scope +}; + +taskvariablesApi.getVariables(taskIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **scope** | **string**| scope | [optional] + +### Return type + +[**RestVariable**](RestVariable.md) + +<a name="updateVariable"></a> +# **updateVariable** +> RestVariable updateVariable(taskIdvariableNamerestVariable) + +Update a variable + +### Example + +```javascript +import TaskvariablesApi from 'src/api/activiti-rest-api/docs/TaskVariablesApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let taskvariablesApi = new TaskvariablesApi(this.alfrescoApi); + + +taskvariablesApi.updateVariable(taskIdvariableNamerestVariable).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **variableName** | **string**| variableName | + **restVariable** | [**RestVariable**](RestVariable.md)| restVariable | + +### Return type + +[**RestVariable**](RestVariable.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TasksApi.md b/lib/js-api/src/api/activiti-rest-api/docs/TasksApi.md new file mode 100644 index 0000000000..b051ce5bc5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TasksApi.md @@ -0,0 +1,515 @@ +# TasksApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createIdentityLink**](TasksApi.md#createIdentityLink) | **POST** /enterprise/tasks/{taskId}/identitylinks | List the users and groups involved with a task +[**createNewTask**](TasksApi.md#createNewTask) | **POST** /enterprise/tasks | Create a standalone task +[**deleteIdentityLink**](TasksApi.md#deleteIdentityLink) | **DELETE** /enterprise/tasks/{taskId}/identitylinks/{family}/{identityId}/{type} | Remove a user or group involvement from a task +[**deleteTask**](TasksApi.md#deleteTask) | **DELETE** /enterprise/tasks/{taskId} | Delete a task +[**filterTasks**](TasksApi.md#filterTasks) | **POST** /enterprise/tasks/filter | Filter a list of tasks +[**getIdentityLinkType**](TasksApi.md#getIdentityLinkType) | **GET** /enterprise/tasks/{taskId}/identitylinks/{family}/{identityId}/{type} | Get a user or group involvement with a task +[**getIdentityLinksForFamily**](TasksApi.md#getIdentityLinksForFamily) | **GET** /enterprise/tasks/{taskId}/identitylinks/{family} | List either the users or groups involved with a process instance +[**getIdentityLinks**](TasksApi.md#getIdentityLinks) | **GET** /enterprise/tasks/{taskId}/identitylinks | getIdentityLinks +[**getTaskAuditLog**](TasksApi.md#getTaskAuditLog) | **GET** /enterprise/tasks/{taskId}/audit | Get the audit log for a task +[**getTask**](TasksApi.md#getTask) | **GET** /enterprise/tasks/{taskId} | Get a task +[**listHistoricTasks**](TasksApi.md#listHistoricTasks) | **POST** /enterprise/historic-tasks/query | Query historic tasks +[**listTasks**](TasksApi.md#listTasks) | **POST** /enterprise/tasks/query | List tasks +[**updateTask**](TasksApi.md#updateTask) | **PUT** /enterprise/tasks/{taskId} | Update a task + + +<a name="createIdentityLink"></a> +# **createIdentityLink** +> IdentityLinkRepresentation createIdentityLink(taskIdidentityLinkRepresentation) + +List the users and groups involved with a task + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.createIdentityLink(taskIdidentityLinkRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **identityLinkRepresentation** | [**IdentityLinkRepresentation**](IdentityLinkRepresentation.md)| identityLinkRepresentation | + +### Return type + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="createNewTask"></a> +# **createNewTask** +> TaskRepresentation createNewTask(taskRepresentation) + +Create a standalone task + +A standalone task is one which is not associated with any process instance. + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.createNewTask(taskRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskRepresentation** | [**TaskRepresentation**](TaskRepresentation.md)| taskRepresentation | + +### Return type + +[**TaskRepresentation**](TaskRepresentation.md) + +<a name="deleteIdentityLink"></a> +# **deleteIdentityLink** +> deleteIdentityLink(taskIdfamilyidentityIdtype) + +Remove a user or group involvement from a task + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.deleteIdentityLink(taskIdfamilyidentityIdtype).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **family** | **string**| family | + **identityId** | **string**| identityId | + **type** | **string**| type | + +### Return type + +null (empty response body) + +<a name="deleteTask"></a> +# **deleteTask** +> deleteTask(taskId) + +Delete a task + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.deleteTask(taskId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +null (empty response body) + +<a name="filterTasks"></a> +# **filterTasks** +> ResultListDataRepresentationTaskRepresentation filterTasks(tasksFilter) + +Filter a list of tasks + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.filterTasks(tasksFilter).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tasksFilter** | [**TaskFilterRequestRepresentation**](TaskFilterRequestRepresentation.md)| tasksFilter | + +### Return type + +[**ResultListDataRepresentationTaskRepresentation**](ResultListDataRepresentationTaskRepresentation.md) + +<a name="getIdentityLinkType"></a> +# **getIdentityLinkType** +> IdentityLinkRepresentation getIdentityLinkType(taskIdfamilyidentityIdtype) + +Get a user or group involvement with a task + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.getIdentityLinkType(taskIdfamilyidentityIdtype).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **family** | **string**| family | + **identityId** | **string**| identityId | + **type** | **string**| type | + +### Return type + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getIdentityLinksForFamily"></a> +# **getIdentityLinksForFamily** +> IdentityLinkRepresentation getIdentityLinksForFamily(taskIdfamily) + +List either the users or groups involved with a process instance + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.getIdentityLinksForFamily(taskIdfamily).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **family** | **string**| family | + +### Return type + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getIdentityLinks"></a> +# **getIdentityLinks** +> IdentityLinkRepresentation getIdentityLinks(taskId) + +getIdentityLinks + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.getIdentityLinks(taskId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +[**IdentityLinkRepresentation**](IdentityLinkRepresentation.md) + +<a name="getTaskAuditLog"></a> +# **getTaskAuditLog** +> TaskAuditInfoRepresentation getTaskAuditLog(taskId) + +Get the audit log for a task + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.getTaskAuditLog(taskId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +[**TaskAuditInfoRepresentation**](TaskAuditInfoRepresentation.md) + +<a name="getTask"></a> +# **getTask** +> TaskRepresentation getTask(taskId) + +Get a task + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.getTask(taskId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + +### Return type + +[**TaskRepresentation**](TaskRepresentation.md) + +<a name="listHistoricTasks"></a> +# **listHistoricTasks** +> ResultListDataRepresentationTaskRepresentation listHistoricTasks(queryRequest) + +Query historic tasks + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.listHistoricTasks(queryRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryRequest** | [**HistoricTaskInstanceQueryRepresentation**](HistoricTaskInstanceQueryRepresentation.md)| queryRequest | + +### Return type + +[**ResultListDataRepresentationTaskRepresentation**](ResultListDataRepresentationTaskRepresentation.md) + +<a name="listTasks"></a> +# **listTasks** +> ResultListDataRepresentationTaskRepresentation listTasks(tasksQuery) + +List tasks + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.listTasks(tasksQuery).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tasksQuery** | [**TaskQueryRepresentation**](TaskQueryRepresentation.md)| tasksQuery | + +### Return type + +[**ResultListDataRepresentationTaskRepresentation**](ResultListDataRepresentationTaskRepresentation.md) + +<a name="updateTask"></a> +# **updateTask** +> TaskRepresentation updateTask(taskIdupdated) + +Update a task + +You can edit only name, description and dueDate (ISO 8601 string). + +### Example +```javascript +import TasksApi from 'TasksApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let tasksApi = new TasksApi(this.alfrescoApi); + + +tasksApi.updateTask(taskIdupdated).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| taskId | + **updated** | [**TaskUpdateRepresentation**](TaskUpdateRepresentation.md)| updated | + +### Return type + +[**TaskRepresentation**](TaskRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TemporaryApi.md b/lib/js-api/src/api/activiti-rest-api/docs/TemporaryApi.md new file mode 100755 index 0000000000..8162a188c3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TemporaryApi.md @@ -0,0 +1,140 @@ +# ActivitiPublicRestApi.TemporaryApi + +All URIs are relative to *https://localhost:8080/activiti-app* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**completeTasks**](TemporaryApi.md#completeTasks) | **GET** /api/enterprise/temporary/generate-report-data/complete-tasks | completeTasks +[**generateData**](TemporaryApi.md#generateData) | **GET** /api/enterprise/temporary/generate-report-data/start-process | generateData +[**getHeaders**](TemporaryApi.md#getHeaders) | **GET** /api/enterprise/temporary/example-headers | getHeaders +[**getOptions**](TemporaryApi.md#getOptions) | **GET** /api/enterprise/temporary/example-options | getOptions + + +<a name="completeTasks"></a> +# **completeTasks** +> completeTasks(userId, processDefinitionKey) + +completeTasks + +### Example +```javascript + +var userId = 789; // Integer | userId + +var processDefinitionKey = "processDefinitionKey_example"; // String | processDefinitionKey + +this.alfrescoJsApi.activiti.temporaryApi.completeTasks(userId, processDefinitionKey); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **Integer**| userId | + **processDefinitionKey** | **String**| processDefinitionKey | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="generateData"></a> +# **generateData** +> generateData(userId, processDefinitionKey) + +generateData + +### Example +```javascript + +var userId = 789; // Integer | userId + +var processDefinitionKey = "processDefinitionKey_example"; // String | processDefinitionKey + +this.alfrescoJsApi.activiti.temporaryApi.generateData(userId, processDefinitionKey); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **Integer**| userId | + **processDefinitionKey** | **String**| processDefinitionKey | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="getHeaders"></a> +# **getHeaders** +> ArrayNode getHeaders() + +getHeaders + +### Example +```javascript + +this.alfrescoJsApi.activiti.temporaryApi.getHeaders(); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ArrayNode**](ArrayNode.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +<a name="getOptions"></a> +# **getOptions** +> ArrayNode getOptions() + +getOptions + +### Example +```javascript + +this.alfrescoJsApi.activiti.temporaryApi.getOptions(); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ArrayNode**](ArrayNode.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TenantEvent.md b/lib/js-api/src/api/activiti-rest-api/docs/TenantEvent.md new file mode 100644 index 0000000000..40bb9d78c7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TenantEvent.md @@ -0,0 +1,14 @@ +# TenantEvent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**eventTime** | [**Date**](Date.md) | | [optional] [default to null] +**eventType** | **string** | | [optional] [default to null] +**extraInfo** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] +**userId** | **number** | | [optional] [default to null] +**userName** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/TenantRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/TenantRepresentation.md new file mode 100644 index 0000000000..38d81200c3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/TenantRepresentation.md @@ -0,0 +1,15 @@ +# TenantRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | **boolean** | | [optional] [default to null] +**created** | [**Date**](Date.md) | | [optional] [default to null] +**domain** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastUpdate** | [**Date**](Date.md) | | [optional] [default to null] +**logoId** | **number** | | [optional] [default to null] +**maxUsers** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserAccountCredentialsRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/UserAccountCredentialsRepresentation.md new file mode 100644 index 0000000000..d36ab19729 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserAccountCredentialsRepresentation.md @@ -0,0 +1,9 @@ +# UserAccountCredentialsRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**password** | **string** | | [optional] [default to null] +**username** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserActionRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/UserActionRepresentation.md new file mode 100644 index 0000000000..bf6bc4e126 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserActionRepresentation.md @@ -0,0 +1,10 @@ +# UserActionRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | | [optional] [default to null] +**newPassword** | **string** | | [optional] [default to null] +**oldPassword** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserFilterOrderRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/UserFilterOrderRepresentation.md new file mode 100644 index 0000000000..442bb81754 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserFilterOrderRepresentation.md @@ -0,0 +1,9 @@ +# UserFilterOrderRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appId** | **number** | | [optional] [default to null] +**order** | **number[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserFiltersApi.md b/lib/js-api/src/api/activiti-rest-api/docs/UserFiltersApi.md new file mode 100644 index 0000000000..e4c17abde5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserFiltersApi.md @@ -0,0 +1,488 @@ +# UserfiltersApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUserProcessInstanceFilter**](UserFiltersApi.md#createUserProcessInstanceFilter) | **POST** /enterprise/filters/processes | Create a process instance filter +[**createUserTaskFilter**](UserFiltersApi.md#createUserTaskFilter) | **POST** /enterprise/filters/tasks | Create a task filter +[**deleteUserProcessInstanceFilter**](UserFiltersApi.md#deleteUserProcessInstanceFilter) | **DELETE** /enterprise/filters/processes/{userFilterId} | Delete a process instance filter +[**deleteUserTaskFilter**](UserFiltersApi.md#deleteUserTaskFilter) | **DELETE** /enterprise/filters/tasks/{userFilterId} | Delete a task filter +[**getUserProcessInstanceFilter**](UserFiltersApi.md#getUserProcessInstanceFilter) | **GET** /enterprise/filters/processes/{userFilterId} | Get a process instance filter +[**getUserProcessInstanceFilters**](UserFiltersApi.md#getUserProcessInstanceFilters) | **GET** /enterprise/filters/processes | List process instance filters +[**getUserTaskFilter**](UserFiltersApi.md#getUserTaskFilter) | **GET** /enterprise/filters/tasks/{userFilterId} | Get a task filter +[**getUserTaskFilters**](UserFiltersApi.md#getUserTaskFilters) | **GET** /enterprise/filters/tasks | List task filters +[**orderUserProcessInstanceFilters**](UserFiltersApi.md#orderUserProcessInstanceFilters) | **PUT** /enterprise/filters/processes | Re-order the list of user process instance filters +[**orderUserTaskFilters**](UserFiltersApi.md#orderUserTaskFilters) | **PUT** /enterprise/filters/tasks | Re-order the list of user task filters +[**updateUserProcessInstanceFilter**](UserFiltersApi.md#updateUserProcessInstanceFilter) | **PUT** /enterprise/filters/processes/{userFilterId} | Update a process instance filter +[**updateUserTaskFilter**](UserFiltersApi.md#updateUserTaskFilter) | **PUT** /enterprise/filters/tasks/{userFilterId} | Update a task filter + + +<a name="createUserProcessInstanceFilter"></a> +# **createUserProcessInstanceFilter** +> UserProcessInstanceFilterRepresentation createUserProcessInstanceFilter(userProcessInstanceFilterRepresentation) + +Create a process instance filter + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.createUserProcessInstanceFilter(userProcessInstanceFilterRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userProcessInstanceFilterRepresentation** | [**UserProcessInstanceFilterRepresentation**](UserProcessInstanceFilterRepresentation.md)| userProcessInstanceFilterRepresentation | + +### Return type + +[**UserProcessInstanceFilterRepresentation**](UserProcessInstanceFilterRepresentation.md) + +<a name="createUserTaskFilter"></a> +# **createUserTaskFilter** +> UserTaskFilterRepresentation createUserTaskFilter(userTaskFilterRepresentation) + +Create a task filter + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.createUserTaskFilter(userTaskFilterRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userTaskFilterRepresentation** | [**UserTaskFilterRepresentation**](UserTaskFilterRepresentation.md)| userTaskFilterRepresentation | + +### Return type + +[**UserTaskFilterRepresentation**](UserTaskFilterRepresentation.md) + +<a name="deleteUserProcessInstanceFilter"></a> +# **deleteUserProcessInstanceFilter** +> deleteUserProcessInstanceFilter(userFilterId) + +Delete a process instance filter + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.deleteUserProcessInstanceFilter(userFilterId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userFilterId** | **number**| userFilterId | + +### Return type + +null (empty response body) + +<a name="deleteUserTaskFilter"></a> +# **deleteUserTaskFilter** +> deleteUserTaskFilter(userFilterId) + +Delete a task filter + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.deleteUserTaskFilter(userFilterId).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userFilterId** | **number**| userFilterId | + +### Return type + +null (empty response body) + +<a name="getUserProcessInstanceFilter"></a> +# **getUserProcessInstanceFilter** +> UserProcessInstanceFilterRepresentation getUserProcessInstanceFilter(userFilterId) + +Get a process instance filter + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.getUserProcessInstanceFilter(userFilterId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userFilterId** | **number**| userFilterId | + +### Return type + +[**UserProcessInstanceFilterRepresentation**](UserProcessInstanceFilterRepresentation.md) + +<a name="getUserProcessInstanceFilters"></a> +# **getUserProcessInstanceFilters** +> ResultListDataRepresentationUserProcessInstanceFilterRepresentation getUserProcessInstanceFilters(opts) + +List process instance filters + +Returns filters for the current user, optionally filtered by *appId*. + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + +let opts = { + 'appId': 789 // | appId +}; + +userfiltersApi.getUserProcessInstanceFilters(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **number**| appId | [optional] + +### Return type + +[**ResultListDataRepresentationUserProcessInstanceFilterRepresentation**](ResultListDataRepresentationUserProcessInstanceFilterRepresentation.md) + +<a name="getUserTaskFilter"></a> +# **getUserTaskFilter** +> UserTaskFilterRepresentation getUserTaskFilter(userFilterId) + +Get a task filter + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.getUserTaskFilter(userFilterId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userFilterId** | **number**| userFilterId | + +### Return type + +[**UserTaskFilterRepresentation**](UserTaskFilterRepresentation.md) + +<a name="getUserTaskFilters"></a> +# **getUserTaskFilters** +> ResultListDataRepresentationUserTaskFilterRepresentation getUserTaskFilters(opts) + +List task filters + +Returns filters for the current user, optionally filtered by *appId*. + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + +let opts = { + 'appId': 789 // | appId +}; + +userfiltersApi.getUserTaskFilters(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **appId** | **number**| appId | [optional] + +### Return type + +[**ResultListDataRepresentationUserTaskFilterRepresentation**](ResultListDataRepresentationUserTaskFilterRepresentation.md) + +<a name="orderUserProcessInstanceFilters"></a> +# **orderUserProcessInstanceFilters** +> orderUserProcessInstanceFilters(filterOrderRepresentation) + +Re-order the list of user process instance filters + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.orderUserProcessInstanceFilters(filterOrderRepresentation).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filterOrderRepresentation** | [**UserFilterOrderRepresentation**](UserFilterOrderRepresentation.md)| filterOrderRepresentation | + +### Return type + +null (empty response body) + +<a name="orderUserTaskFilters"></a> +# **orderUserTaskFilters** +> orderUserTaskFilters(filterOrderRepresentation) + +Re-order the list of user task filters + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.orderUserTaskFilters(filterOrderRepresentation).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filterOrderRepresentation** | [**UserFilterOrderRepresentation**](UserFilterOrderRepresentation.md)| filterOrderRepresentation | + +### Return type + +null (empty response body) + +<a name="updateUserProcessInstanceFilter"></a> +# **updateUserProcessInstanceFilter** +> UserProcessInstanceFilterRepresentation updateUserProcessInstanceFilter(userFilterIduserProcessInstanceFilterRepresentation) + +Update a process instance filter + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.updateUserProcessInstanceFilter(userFilterIduserProcessInstanceFilterRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userFilterId** | **number**| userFilterId | + **userProcessInstanceFilterRepresentation** | [**UserProcessInstanceFilterRepresentation**](UserProcessInstanceFilterRepresentation.md)| userProcessInstanceFilterRepresentation | + +### Return type + +[**UserProcessInstanceFilterRepresentation**](UserProcessInstanceFilterRepresentation.md) + +<a name="updateUserTaskFilter"></a> +# **updateUserTaskFilter** +> UserTaskFilterRepresentation updateUserTaskFilter(userFilterIduserTaskFilterRepresentation) + +Update a task filter + +### Example + +```javascript +import UserfiltersApi from 'src/api/activiti-rest-api/docs/UserFiltersApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userfiltersApi = new UserfiltersApi(this.alfrescoApi); + + +userfiltersApi.updateUserTaskFilter(userFilterIduserTaskFilterRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userFilterId** | **number**| userFilterId | + **userTaskFilterRepresentation** | [**UserTaskFilterRepresentation**](UserTaskFilterRepresentation.md)| userTaskFilterRepresentation | + +### Return type + +[**UserTaskFilterRepresentation**](UserTaskFilterRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserIdentifierRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/UserIdentifierRepresentation.md new file mode 100644 index 0000000000..5c9f54e5ab --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserIdentifierRepresentation.md @@ -0,0 +1,9 @@ +# UserIdentifierRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | | [optional] [default to null] +**userId** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserProcessInstanceFilterRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/UserProcessInstanceFilterRepresentation.md new file mode 100644 index 0000000000..8808407e57 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserProcessInstanceFilterRepresentation.md @@ -0,0 +1,14 @@ +# UserProcessInstanceFilterRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appId** | **number** | | [optional] [default to null] +**filter** | [**ProcessInstanceFilterRepresentation**](ProcessInstanceFilterRepresentation.md) | | [optional] [default to null] +**icon** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**index** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**recent** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserProfileApi.md b/lib/js-api/src/api/activiti-rest-api/docs/UserProfileApi.md new file mode 100644 index 0000000000..01a9eb4e3e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserProfileApi.md @@ -0,0 +1,243 @@ +# UserprofileApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**changePassword**](UserProfileApi.md#changePassword) | **POST** /enterprise/profile-password | Change user password +[**getProfilePicture**](UserProfileApi.md#getProfilePicture) | **GET** /enterprise/profile-picture | Retrieve user profile picture +[**getProfile**](UserProfileApi.md#getProfile) | **GET** /enterprise/profile | Get user profile +[**updateProfile**](UserProfileApi.md#updateProfile) | **POST** /enterprise/profile | Update user profile +[**uploadProfilePicture**](UserProfileApi.md#uploadProfilePicture) | **POST** /enterprise/profile-picture | Change user profile picture +[**getProfilePictureUrl**](ProfileApi.md#getProfile) | **GET** /app/rest/admin/profile-picture | Retrieve Url user profile picture + + +<a name="changePassword"></a> +# **changePassword** +> changePassword(changePasswordRepresentation) + +Change user password + +### Example + +```javascript +import UserprofileApi from 'src/api/activiti-rest-api/docs/UserProfileApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userprofileApi = new UserprofileApi(this.alfrescoApi); + + +userprofileApi.changePassword(changePasswordRepresentation).then(() => { + console.log('API called successfully.'); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **changePasswordRepresentation** | [**ChangePasswordRepresentation**](ChangePasswordRepresentation.md)| changePasswordRepresentation | + +### Return type + +null (empty response body) + +<a name="getProfilePicture"></a> +# **getProfilePicture** +> Blob getProfilePicture() + +Retrieve user profile picture + +Generally returns an image file + +### Example + +```javascript +import UserprofileApi from 'src/api/activiti-rest-api/docs/UserProfileApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userprofileApi = new UserprofileApi(this.alfrescoApi); + +userprofileApi.getProfilePicture().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Blob** + +<a name="getProfile"></a> +# **getProfile** +> UserRepresentation getProfile() + +Get user profile + +This operation returns account information for the current user. This is useful to get the name, email, the groups that the user is part of, the user picture, etc. + +### Example + +```javascript +import UserprofileApi from 'src/api/activiti-rest-api/docs/UserProfileApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userprofileApi = new UserprofileApi(this.alfrescoApi); + +userprofileApi.getProfile().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UserRepresentation**](UserRepresentation.md) + +<a name="updateProfile"></a> +# **updateProfile** +> UserRepresentation updateProfile(userRepresentation) + +Update user profile + +Only a first name, last name, email and company can be updated + +### Example + +```javascript +import UserprofileApi from 'src/api/activiti-rest-api/docs/UserProfileApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userprofileApi = new UserprofileApi(this.alfrescoApi); + + +userprofileApi.updateProfile(userRepresentation).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userRepresentation** | [**UserRepresentation**](UserRepresentation.md)| userRepresentation | + +### Return type + +[**UserRepresentation**](UserRepresentation.md) + +<a name="uploadProfilePicture"></a> +# **uploadProfilePicture** +> ImageUploadRepresentation uploadProfilePicture(file) + +Change user profile picture + +### Example + +```javascript +import UserprofileApi from 'src/api/activiti-rest-api/docs/UserProfileApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userprofileApi = new UserprofileApi(this.alfrescoApi); + + +userprofileApi.uploadProfilePicture(file).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function (error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **Blob**| file | + +### Return type + +[**ImageUploadRepresentation**](ImageUploadRepresentation.md) + + +<a name="getProfilePictureUrl"></a> +# **getProfilePictureUrl** +> File getProfilePictureUrl() + +Retrieve user url profile picture + +Generally returns an URL image file + +### Example + +```javascript +import UserprofileApi from 'src/api/activiti-rest-api/docs/UserProfileApi'; +import {AlfrescoApi} from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let userprofileApi = new UserprofileApi(this.alfrescoApi); + +userprofileApi.getProfilePictureUrl(); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + \ No newline at end of file diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/UserRepresentation.md new file mode 100644 index 0000000000..c7dd3a1ce7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserRepresentation.md @@ -0,0 +1,28 @@ +# UserRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apps** | [**LightAppRepresentation[]**](LightAppRepresentation.md) | | [optional] [default to null] +**capabilities** | **string[]** | | [optional] [default to null] +**company** | **string** | | [optional] [default to null] +**created** | [**Date**](Date.md) | | [optional] [default to null] +**email** | **string** | | [optional] [default to null] +**externalId** | **string** | | [optional] [default to null] +**firstName** | **string** | | [optional] [default to null] +**fullname** | **string** | | [optional] [default to null] +**groups** | [**GroupRepresentation[]**](GroupRepresentation.md) | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**lastName** | **string** | | [optional] [default to null] +**lastUpdate** | [**Date**](Date.md) | | [optional] [default to null] +**latestSyncTimeStamp** | [**Date**](Date.md) | | [optional] [default to null] +**password** | **string** | | [optional] [default to null] +**pictureId** | **number** | | [optional] [default to null] +**primaryGroup** | [**GroupRepresentation**](GroupRepresentation.md) | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] +**tenantId** | **number** | | [optional] [default to null] +**tenantName** | **string** | | [optional] [default to null] +**tenantPictureId** | **number** | | [optional] [default to null] +**type** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UserTaskFilterRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/UserTaskFilterRepresentation.md new file mode 100644 index 0000000000..57b6918df7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UserTaskFilterRepresentation.md @@ -0,0 +1,14 @@ +# UserTaskFilterRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**appId** | **number** | | [optional] [default to null] +**filter** | [**TaskFilterRepresentation**](TaskFilterRepresentation.md) | | [optional] [default to null] +**icon** | **string** | | [optional] [default to null] +**id** | **number** | | [optional] [default to null] +**index** | **number** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**recent** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/UsersApi.md b/lib/js-api/src/api/activiti-rest-api/docs/UsersApi.md new file mode 100644 index 0000000000..5b571228be --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/UsersApi.md @@ -0,0 +1,259 @@ +# UsersApi + +All URIs are relative to */activiti-app/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**executeAction**](UsersApi.md#executeAction) | **POST** /enterprise/users/{userId} | Execute an action for a specific user +[**getProfilePicture**](UsersApi.md#getProfilePicture) | **GET** /enterprise/users/{userId}/picture | Stream user profile picture +[**getUser**](UsersApi.md#getUser) | **GET** /enterprise/users/{userId} | Get a user +[**getUsers**](UsersApi.md#getUsers) | **GET** /enterprise/users | Query users +[**requestPasswordReset**](UsersApi.md#requestPasswordReset) | **POST** /enterprise/idm/passwords | Request a password reset +[**updateUser**](UsersApi.md#updateUser) | **PUT** /enterprise/users/{userId} | Update a user + + +<a name="executeAction"></a> +# **executeAction** +> executeAction(userIdactionRequest) + +Execute an action for a specific user + +Typical action is updating/reset password + +### Example +```javascript +import UsersApi from 'UsersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let usersApi = new UsersApi(this.alfrescoApi); + + +usersApi.executeAction(userIdactionRequest).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + **actionRequest** | [**UserActionRepresentation**](UserActionRepresentation.md)| actionRequest | + +### Return type + +null (empty response body) + +<a name="getProfilePicture"></a> +# **getProfilePicture** +> getProfilePicture(userId) + +Stream user profile picture + +### Example +```javascript +import UsersApi from 'UsersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let usersApi = new UsersApi(this.alfrescoApi); + + +usersApi.getProfilePicture(userId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + +### Return type + +null (empty response body) + +<a name="getUser"></a> +# **getUser** +> UserRepresentation getUser(userId) + +Get a user + +### Example +```javascript +import UsersApi from 'UsersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let usersApi = new UsersApi(this.alfrescoApi); + + +usersApi.getUser(userId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + +### Return type + +[**UserRepresentation**](UserRepresentation.md) + +<a name="getUsers"></a> +# **getUsers** +> ResultListDataRepresentationLightUserRepresentation getUsers(opts) + +Query users + +A common use case is that a user wants to select another user (eg. when assigning a task) or group. + +### Example +```javascript +import UsersApi from 'UsersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let usersApi = new UsersApi(this.alfrescoApi); + +let opts = { + 'filter': filter_example // | filter + 'email': email_example // | email + 'externalId': externalId_example // | externalId + 'externalIdCaseInsensitive': externalIdCaseInsensitive_example // | externalIdCaseInsensitive + 'excludeTaskId': excludeTaskId_example // | excludeTaskId + 'excludeProcessId': excludeProcessId_example // | excludeProcessId + 'groupId': 789 // | groupId + 'tenantId': 789 // | tenantId +}; + +usersApi.getUsers(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | **string**| filter | [optional] + **email** | **string**| email | [optional] + **externalId** | **string**| externalId | [optional] + **externalIdCaseInsensitive** | **string**| externalIdCaseInsensitive | [optional] + **excludeTaskId** | **string**| excludeTaskId | [optional] + **excludeProcessId** | **string**| excludeProcessId | [optional] + **groupId** | **number**| groupId | [optional] + **tenantId** | **number**| tenantId | [optional] + +### Return type + +[**ResultListDataRepresentationLightUserRepresentation**](ResultListDataRepresentationLightUserRepresentation.md) + +<a name="requestPasswordReset"></a> +# **requestPasswordReset** +> requestPasswordReset(resetPassword) + +Request a password reset + +### Example +```javascript +import UsersApi from 'UsersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let usersApi = new UsersApi(this.alfrescoApi); + + +usersApi.requestPasswordReset(resetPassword).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resetPassword** | [**ResetPasswordRepresentation**](ResetPasswordRepresentation.md)| resetPassword | + +### Return type + +null (empty response body) + +<a name="updateUser"></a> +# **updateUser** +> UserRepresentation updateUser(userIduserRequest) + +Update a user + +### Example +```javascript +import UsersApi from 'UsersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let usersApi = new UsersApi(this.alfrescoApi); + + +usersApi.updateUser(userIduserRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userId** | **number**| userId | + **userRequest** | [**UserRepresentation**](UserRepresentation.md)| userRequest | + +### Return type + +[**UserRepresentation**](UserRepresentation.md) + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/ValidationErrorRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/ValidationErrorRepresentation.md new file mode 100644 index 0000000000..ce3944f9fb --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/ValidationErrorRepresentation.md @@ -0,0 +1,14 @@ +# ValidationErrorRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**defaultDescription** | **string** | | [optional] [default to null] +**id** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**problem** | **string** | | [optional] [default to null] +**problemReference** | **string** | | [optional] [default to null] +**validatorSetName** | **string** | | [optional] [default to null] +**warning** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/VariableMappingRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/VariableMappingRepresentation.md new file mode 100644 index 0000000000..da0a4f4521 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/VariableMappingRepresentation.md @@ -0,0 +1,13 @@ +# VariableMappingRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inProcessVariable** | **string** | | [optional] [default to null] +**inVariableType** | **string** | | [optional] [default to null] +**mappedVariable** | **string** | | [optional] [default to null] +**outProcessVariable** | **string** | | [optional] [default to null] +**outVariableType** | **string** | | [optional] [default to null] +**typeOfMapping** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/docs/VariableScopeRepresentation.md b/lib/js-api/src/api/activiti-rest-api/docs/VariableScopeRepresentation.md new file mode 100644 index 0000000000..9339b1ebe9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/docs/VariableScopeRepresentation.md @@ -0,0 +1,14 @@ +# VariableScopeRepresentation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapVariable** | **string** | | [optional] [default to null] +**mappedColumn** | **string** | | [optional] [default to null] +**mappedDataModel** | **number** | | [optional] [default to null] +**mappedEntity** | **string** | | [optional] [default to null] +**mappedVariableName** | **string** | | [optional] [default to null] +**processVariableName** | **string** | | [optional] [default to null] +**processVariableType** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/activiti-rest-api/index.ts b/lib/js-api/src/api/activiti-rest-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/activiti-rest-api/model/abstractGroupRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/abstractGroupRepresentation.ts new file mode 100644 index 0000000000..fe8d8b5910 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/abstractGroupRepresentation.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AbstractGroupRepresentation { + externalId?: string; + id?: number; + name?: string; + status?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/abstractUserRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/abstractUserRepresentation.ts new file mode 100644 index 0000000000..38dec1d645 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/abstractUserRepresentation.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AbstractUserRepresentation { + company?: string; + email?: string; + externalId?: string; + firstName?: string; + id?: number; + lastName?: string; + pictureId?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/accountRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/accountRepresentation.ts new file mode 100644 index 0000000000..62e89917ef --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/accountRepresentation.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AccountRepresentation { + authorizationUrl?: string; + authorized?: boolean; + metaDataAllowed?: boolean; + name?: string; + serviceId?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/addGroupCapabilitiesRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/addGroupCapabilitiesRepresentation.ts new file mode 100644 index 0000000000..7ae7b26931 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/addGroupCapabilitiesRepresentation.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AddGroupCapabilitiesRepresentation { + capabilities?: string[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/alfrescoContentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/alfrescoContentRepresentation.ts new file mode 100644 index 0000000000..19295c69f0 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/alfrescoContentRepresentation.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AlfrescoContentRepresentation { + folder?: boolean; + id?: string; + simpleType?: string; + title?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/alfrescoEndpointRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/alfrescoEndpointRepresentation.ts new file mode 100644 index 0000000000..8d2688d969 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/alfrescoEndpointRepresentation.ts @@ -0,0 +1,41 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class AlfrescoEndpointRepresentation { + accountUsername?: string; + alfrescoTenantId?: string; + created?: Date; + id?: number; + lastUpdated?: Date; + name?: string; + repositoryUrl?: string; + secret?: string; + shareUrl?: string; + tenantId?: number; + useShareConnector?: boolean; + version?: string; + + constructor(input?: Partial<AlfrescoEndpointRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + this.lastUpdated = input.lastUpdated ? DateAlfresco.parseDate(input.lastUpdated) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/alfrescoNetworkRepresenation.ts b/lib/js-api/src/api/activiti-rest-api/model/alfrescoNetworkRepresenation.ts new file mode 100644 index 0000000000..d56229fd6b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/alfrescoNetworkRepresenation.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AlfrescoNetworkRepresenation { + id?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/alfrescoSiteRepresenation.ts b/lib/js-api/src/api/activiti-rest-api/model/alfrescoSiteRepresenation.ts new file mode 100644 index 0000000000..38d61fac3d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/alfrescoSiteRepresenation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AlfrescoSiteRepresenation { + id?: string; + title?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/appDefinition.ts b/lib/js-api/src/api/activiti-rest-api/model/appDefinition.ts new file mode 100644 index 0000000000..c50258acaa --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/appDefinition.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppModelDefinition } from './appModelDefinition'; +import { PublishIdentityInfoRepresentation } from './publishIdentityInfoRepresentation'; + +export class AppDefinition { + icon?: string; + models?: AppModelDefinition[]; + publishIdentityInfo?: PublishIdentityInfoRepresentation[]; + theme?: string; + + constructor(input?: Partial<AppDefinition>) { + if (input) { + Object.assign(this, input); + if (input.models) { + this.models = input.models.map((item: any) => new AppModelDefinition(item)); + } + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/appDefinitionPublishRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/appDefinitionPublishRepresentation.ts new file mode 100644 index 0000000000..db544645dd --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/appDefinitionPublishRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AppDefinitionPublishRepresentation { + comment?: string; + force?: boolean; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/appDefinitionRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/appDefinitionRepresentation.ts new file mode 100644 index 0000000000..bf3212b8f4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/appDefinitionRepresentation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AppDefinitionRepresentation { + defaultAppId?: string; + deploymentId?: string; + description?: string; + icon?: string; + id?: number; + modelId?: number; + name?: string; + tenantId?: number; + theme?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/appDefinitionSaveRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/appDefinitionSaveRepresentation.ts new file mode 100644 index 0000000000..4dbfd8f84f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/appDefinitionSaveRepresentation.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppDefinitionRepresentation } from './appDefinitionRepresentation'; + +export interface AppDefinitionSaveRepresentation { + appDefinition?: AppDefinitionRepresentation; + force?: boolean; + publish?: boolean; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/appDefinitionUpdateResultRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/appDefinitionUpdateResultRepresentation.ts new file mode 100644 index 0000000000..29f2a986ea --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/appDefinitionUpdateResultRepresentation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppDefinitionRepresentation } from './appDefinitionRepresentation'; + +export interface AppDefinitionUpdateResultRepresentation { + appDefinition?: AppDefinitionRepresentation; + customData?: any; + error?: boolean; + errorDescription?: string; + errorType?: number; + message?: string; + messageKey?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/appDeploymentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/appDeploymentRepresentation.ts new file mode 100644 index 0000000000..4fbfcca058 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/appDeploymentRepresentation.ts @@ -0,0 +1,36 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppDefinitionRepresentation } from './appDefinitionRepresentation'; +import { DateAlfresco } from '../../content-custom-api'; +import { LightUserRepresentation } from './lightUserRepresentation'; + +export class AppDeploymentRepresentation { + appDefinition?: AppDefinitionRepresentation; + created?: Date; + createdBy?: LightUserRepresentation; + deploymentId?: string; + dmnDeploymentId?: number; + id?: number; + + constructor(input?: Partial<AppDeploymentRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/appModelDefinition.ts b/lib/js-api/src/api/activiti-rest-api/model/appModelDefinition.ts new file mode 100644 index 0000000000..8b1d3e4091 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/appModelDefinition.ts @@ -0,0 +1,39 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class AppModelDefinition { + createdBy?: number; + createdByFullName?: string; + description?: string; + id?: number; + lastUpdated?: Date; + lastUpdatedBy?: number; + lastUpdatedByFullName?: string; + modelType?: number; + name?: string; + stencilSetId?: number; + version?: number; + + constructor(input?: Partial<AppModelDefinition>) { + if (input) { + Object.assign(this, input); + this.lastUpdated = input.lastUpdated ? DateAlfresco.parseDate(input.lastUpdated) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/assigneeIdentifierRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/assigneeIdentifierRepresentation.ts new file mode 100644 index 0000000000..effd17942d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/assigneeIdentifierRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AssigneeIdentifierRepresentation { + assignee?: string; + email?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/auditCalculatedValueRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/auditCalculatedValueRepresentation.ts new file mode 100644 index 0000000000..b1450a22f4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/auditCalculatedValueRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AuditCalculatedValueRepresentation { + name?: string; + value?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/auditDecisionExpressionInfoRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/auditDecisionExpressionInfoRepresentation.ts new file mode 100644 index 0000000000..2e14fd6cbd --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/auditDecisionExpressionInfoRepresentation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AuditDecisionExpressionInfoRepresentation { + type?: string; + value?: any; + variable?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/auditDecisionInfoRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/auditDecisionInfoRepresentation.ts new file mode 100644 index 0000000000..b0c572c3f6 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/auditDecisionInfoRepresentation.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditCalculatedValueRepresentation } from './auditCalculatedValueRepresentation'; +import { AuditDecisionRuleInfoRepresentation } from './auditDecisionRuleInfoRepresentation'; + +export interface AuditDecisionInfoRepresentation { + appliedRules?: AuditDecisionRuleInfoRepresentation[]; + calculatedValues?: AuditCalculatedValueRepresentation[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/auditDecisionRuleInfoRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/auditDecisionRuleInfoRepresentation.ts new file mode 100644 index 0000000000..3d3a9db8b9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/auditDecisionRuleInfoRepresentation.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditDecisionExpressionInfoRepresentation } from './auditDecisionExpressionInfoRepresentation'; + +export interface AuditDecisionRuleInfoRepresentation { + expressions?: AuditDecisionExpressionInfoRepresentation[]; + title?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/auditLogEntryRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/auditLogEntryRepresentation.ts new file mode 100644 index 0000000000..0d5480cf66 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/auditLogEntryRepresentation.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditLogFormDataRepresentation } from './auditLogFormDataRepresentation'; + +export interface AuditLogEntryRepresentation { + activityId?: string; + activityName?: string; + activityType?: string; + durationInMillis?: number; + endTime?: string; + formData?: AuditLogFormDataRepresentation[]; + index?: number; + selectedOutcome?: string; + startTime?: string; + taskAssignee?: string; + taskName?: string; + type?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/auditLogFormDataRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/auditLogFormDataRepresentation.ts new file mode 100644 index 0000000000..357c08a3c4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/auditLogFormDataRepresentation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AuditLogFormDataRepresentation { + fieldId?: string; + fieldName?: string; + value?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/boxContent.ts b/lib/js-api/src/api/activiti-rest-api/model/boxContent.ts new file mode 100644 index 0000000000..3cca42d963 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/boxContent.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface BoxContent { + folder?: boolean; + id?: string; + mimeType?: string; + simpleType?: string; + title?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/boxUserAccountCredentialsRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/boxUserAccountCredentialsRepresentation.ts new file mode 100644 index 0000000000..5bdf7df6c3 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/boxUserAccountCredentialsRepresentation.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class BoxUserAccountCredentialsRepresentation { + authenticationURL?: string; + expireDate?: Date; + ownerEmail?: string; + + constructor(input?: Partial<BoxUserAccountCredentialsRepresentation>) { + if (input) { + Object.assign(this, input); + this.expireDate = input.expireDate ? DateAlfresco.parseDate(input.expireDate) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/bulkUserUpdateRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/bulkUserUpdateRepresentation.ts new file mode 100644 index 0000000000..b2dae93c57 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/bulkUserUpdateRepresentation.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface BulkUserUpdateRepresentation { + accountType?: string; + password?: string; + primaryGroupId?: number; + sendNotifications?: boolean; + status?: string; + tenantId?: number; + users?: number[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/changePasswordRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/changePasswordRepresentation.ts new file mode 100644 index 0000000000..947118a6dd --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/changePasswordRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ChangePasswordRepresentation { + newPassword?: string; + oldPassword?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/checklistOrderRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/checklistOrderRepresentation.ts new file mode 100644 index 0000000000..f986ca0e17 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/checklistOrderRepresentation.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ChecklistOrderRepresentation { + order?: string[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/commentAuditInfo.ts b/lib/js-api/src/api/activiti-rest-api/model/commentAuditInfo.ts new file mode 100644 index 0000000000..127e75aa53 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/commentAuditInfo.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface CommentAuditInfo { + author?: string; + message?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/commentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/commentRepresentation.ts new file mode 100644 index 0000000000..39e81ae090 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/commentRepresentation.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { LightUserRepresentation } from './lightUserRepresentation'; + +export class CommentRepresentation { + created?: Date; + createdBy?: LightUserRepresentation; + id?: number; + message?: string; + + constructor(input?: Partial<CommentRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/completeFormRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/completeFormRepresentation.ts new file mode 100644 index 0000000000..0e470ad71e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/completeFormRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface CompleteFormRepresentation { + outcome?: string; + values?: any; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/conditionRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/conditionRepresentation.ts new file mode 100644 index 0000000000..40a67ca2a6 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/conditionRepresentation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ConditionRepresentation { + leftFormFieldId?: string; + leftRestResponseId?: string; + nextCondition?: ConditionRepresentation; + nextConditionOperator?: string; + operator?: string; + rightFormFieldId?: string; + rightRestResponseId?: string; + rightType?: string; + rightValue?: any; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/createEndpointBasicAuthRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/createEndpointBasicAuthRepresentation.ts new file mode 100644 index 0000000000..a6d3fd8331 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/createEndpointBasicAuthRepresentation.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface CreateEndpointBasicAuthRepresentation { + name?: string; + password?: string; + tenantId?: number; + username?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/createProcessInstanceRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/createProcessInstanceRepresentation.ts new file mode 100644 index 0000000000..35583694eb --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/createProcessInstanceRepresentation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RestVariable } from './restVariable'; + +export interface CreateProcessInstanceRepresentation { + businessKey?: string; + name?: string; + outcome?: string; + processDefinitionId?: string; + processDefinitionKey?: string; + values?: any; + variables?: RestVariable[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/createTenantRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/createTenantRepresentation.ts new file mode 100644 index 0000000000..2662890975 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/createTenantRepresentation.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface CreateTenantRepresentation { + active?: boolean; + configuration?: string; + domain?: string; + maxUsers?: number; + name?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/dataSourceConfigRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/dataSourceConfigRepresentation.ts new file mode 100644 index 0000000000..905f32cd97 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/dataSourceConfigRepresentation.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface DataSourceConfigRepresentation { + driverClass?: string; + jdbcUrl?: string; + password?: string; + username?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/dataSourceRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/dataSourceRepresentation.ts new file mode 100644 index 0000000000..8c4728064d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/dataSourceRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DataSourceConfigRepresentation } from './dataSourceConfigRepresentation'; + +export interface DataSourceRepresentation { + config?: DataSourceConfigRepresentation; + id?: number; + name?: string; + tenantId?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/decisionAuditRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/decisionAuditRepresentation.ts new file mode 100644 index 0000000000..5edea3dfaa --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/decisionAuditRepresentation.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class DecisionAuditRepresentation { + activityId?: string; + activityName?: string; + auditTrailJson?: string; + created?: Date; + decisionExecutionFailed?: boolean; + decisionKey?: string; + decisionModelJson?: string; + decisionName?: string; + dmnDeploymentId?: number; + executionId?: string; + id?: number; + processDefinitionId?: string; + processInstanceId?: string; + renderedVariables?: any; + + constructor(input?: Partial<DecisionAuditRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/decisionTaskRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/decisionTaskRepresentation.ts new file mode 100644 index 0000000000..4464f12a7c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/decisionTaskRepresentation.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class DecisionTaskRepresentation { + activityId?: string; + activityName?: string; + decisionExecutionEnded?: Date; + decisionExecutionFailed?: boolean; + decisionKey?: string; + decisionName?: string; + dmnDeploymentId?: number; + executionId?: string; + id?: number; + processDefinitionId?: string; + processDefinitionKey?: string; + processInstanceId?: string; + + constructor(input?: Partial<DecisionTaskRepresentation>) { + if (input) { + Object.assign(this, input); + this.decisionExecutionEnded = input.decisionExecutionEnded ? DateAlfresco.parseDate(input.decisionExecutionEnded) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/endpointBasicAuthRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/endpointBasicAuthRepresentation.ts new file mode 100644 index 0000000000..c5ef1fb125 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/endpointBasicAuthRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class EndpointBasicAuthRepresentation { + created?: Date; + id?: number; + lastUpdated?: Date; + name?: string; + tenantId?: number; + username?: string; + + constructor(input?: Partial<EndpointBasicAuthRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + this.lastUpdated = input.lastUpdated ? DateAlfresco.parseDate(input.lastUpdated) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/endpointConfigurationRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/endpointConfigurationRepresentation.ts new file mode 100644 index 0000000000..08ea497e81 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/endpointConfigurationRepresentation.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { EndpointRequestHeaderRepresentation } from './endpointRequestHeaderRepresentation'; + +export interface EndpointConfigurationRepresentation { + basicAuthId?: number; + basicAuthName?: string; + host?: string; + id?: number; + name?: string; + path?: string; + port?: string; + protocol?: string; + requestHeaders?: EndpointRequestHeaderRepresentation[]; + tenantId?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/endpointRequestHeaderRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/endpointRequestHeaderRepresentation.ts new file mode 100644 index 0000000000..ed7ffb4b5c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/endpointRequestHeaderRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface EndpointRequestHeaderRepresentation { + name?: string; + value?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/entityAttributeScopeRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/entityAttributeScopeRepresentation.ts new file mode 100644 index 0000000000..0cfae6fd17 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/entityAttributeScopeRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface EntityAttributeScopeRepresentation { + name?: string; + type?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/entityVariableScopeRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/entityVariableScopeRepresentation.ts new file mode 100644 index 0000000000..b0d47760a6 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/entityVariableScopeRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { EntityAttributeScopeRepresentation } from './entityAttributeScopeRepresentation'; + +export interface EntityVariableScopeRepresentation { + attributes?: EntityAttributeScopeRepresentation[]; + entityName?: string; + mappedDataModel?: number; + mappedVariableName?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/fieldValueInfo.ts b/lib/js-api/src/api/activiti-rest-api/model/fieldValueInfo.ts new file mode 100644 index 0000000000..a06361bc82 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/fieldValueInfo.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FieldValueInfo { + type?: string; + value?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/file.ts b/lib/js-api/src/api/activiti-rest-api/model/file.ts new file mode 100644 index 0000000000..c16e182c16 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/file.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface File { + absolute?: boolean; + absoluteFile?: any; + absolutePath?: string; + canonicalFile?: any; + canonicalPath?: string; + directory?: boolean; + file?: boolean; + freeSpace?: number; + hidden?: boolean; + name?: string; + parent?: string; + parentFile?: any; + path?: string; + totalSpace?: number; + usableSpace?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formDefinitionRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formDefinitionRepresentation.ts new file mode 100644 index 0000000000..a89aef6ea8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formDefinitionRepresentation.ts @@ -0,0 +1,48 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FieldValueInfo } from './fieldValueInfo'; +import { FormFieldRepresentation } from './formFieldRepresentation'; +import { FormJavascriptEventRepresentation } from './formJavascriptEventRepresentation'; +import { FormOutcomeRepresentation } from './formOutcomeRepresentation'; +import { FormTabRepresentation } from './formTabRepresentation'; +import { FormVariableRepresentation } from './formVariableRepresentation'; + +export interface FormDefinitionRepresentation { + className?: string; + customFieldTemplates?: { [key: string]: string }; + customFieldsValueInfo?: { [key: string]: FieldValueInfo }; + fields?: FormFieldRepresentation[]; + globalDateFormat?: string; + gridsterForm?: boolean; + id?: number; + javascriptEvents?: FormJavascriptEventRepresentation[]; + metadata?: { [key: string]: string }; + name?: string; + outcomeTarget?: string; + outcomes?: FormOutcomeRepresentation[]; + processDefinitionId?: string; + processDefinitionKey?: string; + processDefinitionName?: string; + selectedOutcome?: string; + style?: string; + tabs?: FormTabRepresentation[]; + taskDefinitionKey?: string; + taskId?: string; + taskName?: string; + variables?: FormVariableRepresentation[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formFieldRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formFieldRepresentation.ts new file mode 100644 index 0000000000..8d554f7152 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formFieldRepresentation.ts @@ -0,0 +1,57 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ConditionRepresentation } from './conditionRepresentation'; +import { LayoutRepresentation } from './layoutRepresentation'; +import { OptionRepresentation } from './optionRepresentation'; + +export interface FormFieldRepresentation { + fieldType?: string; + /* Child fields, when `fieldType` is set to `ContainerRepresentation` */ + fields?: { [key: string]: Array<FormFieldRepresentation> }; + className?: string; + col?: number; + colspan?: number; + dateDisplayFormat?: string; + hasEmptyValue?: boolean; + id?: string; + layout?: LayoutRepresentation; + maxLength?: number; + maxValue?: string; + minLength?: number; + minValue?: string; + name?: string; + optionType?: string; + options?: OptionRepresentation[]; + overrideId?: boolean; + params?: any; + placeholder?: string; + readOnly?: boolean; + regexPattern?: string; + required?: boolean; + restIdProperty?: string; + restLabelProperty?: string; + restResponsePath?: string; + restUrl?: string; + row?: number; + sizeX?: number; + sizeY?: number; + tab?: string; + type?: string; + value?: any; + visibilityCondition?: ConditionRepresentation; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formIdentifierRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formIdentifierRepresentation.ts new file mode 100644 index 0000000000..a5c8cb4118 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formIdentifierRepresentation.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FormIdentifierRepresentation { + formId?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formJavascriptEventRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formJavascriptEventRepresentation.ts new file mode 100644 index 0000000000..29029d2b79 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formJavascriptEventRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FormJavascriptEventRepresentation { + event?: string; + javascriptLogic?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formOutcomeRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formOutcomeRepresentation.ts new file mode 100644 index 0000000000..3055cafd4d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formOutcomeRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FormOutcomeRepresentation { + id?: string; + name?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formRepresentation.ts new file mode 100644 index 0000000000..967b576ac9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formRepresentation.ts @@ -0,0 +1,39 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { FormDefinitionRepresentation } from './formDefinitionRepresentation'; + +export class FormRepresentation { + description?: string; + formDefinition?: FormDefinitionRepresentation; + id?: number; + lastUpdated?: Date; + lastUpdatedBy?: number; + lastUpdatedByFullName?: string; + name?: string; + referenceId?: number; + stencilSetId?: number; + version?: number; + + constructor(input?: Partial<FormRepresentation>) { + if (input) { + Object.assign(this, input); + this.lastUpdated = input.lastUpdated ? DateAlfresco.parseDate(input.lastUpdated) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formSaveRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formSaveRepresentation.ts new file mode 100644 index 0000000000..1fabbc8992 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formSaveRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FormRepresentation } from './formRepresentation'; +import { ProcessScopeIdentifierRepresentation } from './processScopeIdentifierRepresentation'; + +export class FormSaveRepresentation { + comment?: string; + formImageBase64?: string; + formRepresentation?: FormRepresentation; + newVersion?: boolean; + processScopeIdentifiers?: ProcessScopeIdentifierRepresentation[]; + reusable?: boolean; + + constructor(input?: Partial<FormSaveRepresentation>) { + if (input) { + Object.assign(this, input); + this.formRepresentation = input.formRepresentation ? new FormRepresentation(input.formRepresentation) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formScopeRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formScopeRepresentation.ts new file mode 100644 index 0000000000..88a9c9a360 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formScopeRepresentation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FormFieldRepresentation } from './formFieldRepresentation'; +import { FormOutcomeRepresentation } from './formOutcomeRepresentation'; + +export interface FormScopeRepresentation { + description?: string; + fieldVariables?: FormFieldRepresentation[]; + fields?: FormFieldRepresentation[]; + id?: number; + name?: string; + outcomes?: FormOutcomeRepresentation[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formTabRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formTabRepresentation.ts new file mode 100644 index 0000000000..194553a9ce --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formTabRepresentation.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ConditionRepresentation } from './conditionRepresentation'; + +export interface FormTabRepresentation { + id?: string; + title?: string; + visibilityCondition?: ConditionRepresentation; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formValueRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formValueRepresentation.ts new file mode 100644 index 0000000000..c6f4c75f35 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formValueRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FormValueRepresentation { + id?: string; + name?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/formVariableRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/formVariableRepresentation.ts new file mode 100644 index 0000000000..35ca182306 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/formVariableRepresentation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FormVariableRepresentation { + name?: string; + type?: string; + value?: any; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/globalDateFormatRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/globalDateFormatRepresentation.ts new file mode 100644 index 0000000000..9c72e1a9fd --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/globalDateFormatRepresentation.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface GlobalDateFormatRepresentation { + globalDateFormat?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/googleDriveContent.ts b/lib/js-api/src/api/activiti-rest-api/model/googleDriveContent.ts new file mode 100644 index 0000000000..797cbccc7c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/googleDriveContent.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface GoogleDriveContent { + folder?: boolean; + id?: string; + mimeType?: string; + simpleType?: string; + title?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/groupCapabilityRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/groupCapabilityRepresentation.ts new file mode 100644 index 0000000000..a151623e0b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/groupCapabilityRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface GroupCapabilityRepresentation { + id?: number; + name?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/groupRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/groupRepresentation.ts new file mode 100644 index 0000000000..36724bd104 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/groupRepresentation.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { GroupCapabilityRepresentation } from './groupCapabilityRepresentation'; +import { UserRepresentationGroup } from './userRepresentationGroup'; + +export class GroupRepresentation { + capabilities?: GroupCapabilityRepresentation[]; + externalId?: string; + groups?: any[]; + id?: number; + lastSyncTimeStamp?: Date; + manager?: UserRepresentationGroup; + name?: string; + parentGroupId?: number; + status?: string; + tenantId?: number; + type?: number; + userCount?: number; + users?: UserRepresentationGroup[]; + + constructor(input?: Partial<GroupRepresentation>) { + if (input) { + Object.assign(this, input); + + if (input.groups) { + this.groups = input.groups.map((item) => new GroupRepresentation(item)); + } + this.lastSyncTimeStamp = input.lastSyncTimeStamp ? DateAlfresco.parseDate(input.lastSyncTimeStamp) : undefined; + this.manager = input.manager ? new UserRepresentationGroup(input.manager) : undefined; + if (input.users) { + this.users = input.users.map((item) => new UserRepresentationGroup(item)); + } + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/historicProcessInstanceQueryRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/historicProcessInstanceQueryRepresentation.ts new file mode 100644 index 0000000000..3fe332b5b2 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/historicProcessInstanceQueryRepresentation.ts @@ -0,0 +1,55 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { QueryVariable } from './queryVariable'; + +export class HistoricProcessInstanceQueryRepresentation { + excludeSubprocesses?: boolean; + finished?: boolean; + finishedAfter?: Date; + finishedBefore?: Date; + includeProcessVariables?: boolean; + involvedUser?: string; + order?: string; + processBusinessKey?: string; + processDefinitionId?: string; + processDefinitionKey?: string; + processInstanceId?: string; + processInstanceIds?: string[]; + size?: number; + sort?: string; + start?: number; + startedAfter?: Date; + startedBefore?: Date; + startedBy?: string; + superProcessInstanceId?: string; + tenantId?: string; + tenantIdLike?: string; + variables?: QueryVariable[]; + withoutTenantId?: boolean; + + constructor(input?: Partial<HistoricProcessInstanceQueryRepresentation>) { + if (input) { + Object.assign(this, input); + this.finishedAfter = input.finishedAfter ? DateAlfresco.parseDate(input.finishedAfter) : undefined; + this.finishedBefore = input.finishedBefore ? DateAlfresco.parseDate(input.finishedBefore) : undefined; + this.startedAfter = input.startedAfter ? DateAlfresco.parseDate(input.startedAfter) : undefined; + this.startedBefore = input.startedBefore ? DateAlfresco.parseDate(input.startedBefore) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/historicTaskInstanceQueryRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/historicTaskInstanceQueryRepresentation.ts new file mode 100644 index 0000000000..8665be0216 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/historicTaskInstanceQueryRepresentation.ts @@ -0,0 +1,88 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { QueryVariable } from './queryVariable'; + +export class HistoricTaskInstanceQueryRepresentation { + dueDate?: Date; + dueDateAfter?: Date; + dueDateBefore?: Date; + executionId?: string; + finished?: boolean; + includeProcessVariables?: boolean; + includeTaskLocalVariables?: boolean; + order?: string; + parentTaskId?: string; + processBusinessKey?: string; + processBusinessKeyLike?: string; + processDefinitionId?: string; + processDefinitionKey?: string; + processDefinitionKeyLike?: string; + processDefinitionName?: string; + processDefinitionNameLike?: string; + processFinished?: boolean; + processInstanceId?: string; + processVariables?: QueryVariable[]; + size?: number; + sort?: string; + start?: number; + taskAssignee?: string; + taskAssigneeLike?: string; + taskCandidateGroup?: string; + taskCompletedAfter?: Date; + taskCompletedBefore?: Date; + taskCompletedOn?: Date; + taskCreatedAfter?: Date; + taskCreatedBefore?: Date; + taskCreatedOn?: Date; + taskDefinitionKey?: string; + taskDefinitionKeyLike?: string; + taskDeleteReason?: string; + taskDeleteReasonLike?: string; + taskDescription?: string; + taskDescriptionLike?: string; + taskId?: string; + taskInvolvedUser?: string; + taskMaxPriority?: number; + taskMinPriority?: number; + taskName?: string; + taskNameLike?: string; + taskOwner?: string; + taskOwnerLike?: string; + taskPriority?: number; + taskVariables?: QueryVariable[]; + tenantId?: string; + tenantIdLike?: string; + withoutDueDate?: boolean; + withoutTenantId?: boolean; + + constructor(input?: Partial<HistoricTaskInstanceQueryRepresentation>) { + if (input) { + Object.assign(this, input); + this.dueDate = input.dueDate ? DateAlfresco.parseDate(input.dueDate) : undefined; + this.dueDateAfter = input.dueDateAfter ? DateAlfresco.parseDate(input.dueDateAfter) : undefined; + this.dueDateBefore = input.dueDateBefore ? DateAlfresco.parseDate(input.dueDateBefore) : undefined; + this.taskCompletedAfter = input.taskCompletedAfter ? DateAlfresco.parseDate(input.taskCompletedAfter) : undefined; + this.taskCompletedBefore = input.taskCompletedBefore ? DateAlfresco.parseDate(input.taskCompletedBefore) : undefined; + this.taskCompletedOn = input.taskCompletedOn ? DateAlfresco.parseDate(input.taskCompletedOn) : undefined; + this.taskCreatedAfter = input.taskCreatedAfter ? DateAlfresco.parseDate(input.taskCreatedAfter) : undefined; + this.taskCreatedBefore = input.taskCreatedBefore ? DateAlfresco.parseDate(input.taskCreatedBefore) : undefined; + this.taskCreatedOn = input.taskCreatedOn ? DateAlfresco.parseDate(input.taskCreatedOn) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/identityLinkRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/identityLinkRepresentation.ts new file mode 100644 index 0000000000..ed8d2291de --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/identityLinkRepresentation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface IdentityLinkRepresentation { + group?: string; + type?: string; + user?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/imageUploadRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/imageUploadRepresentation.ts new file mode 100644 index 0000000000..0b62e14507 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/imageUploadRepresentation.ts @@ -0,0 +1,32 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class ImageUploadRepresentation { + created?: Date; + id?: number; + name?: string; + userId?: number; + + constructor(input?: Partial<ImageUploadRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/index.ts b/lib/js-api/src/api/activiti-rest-api/model/index.ts new file mode 100644 index 0000000000..5f82fd3049 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/index.ts @@ -0,0 +1,164 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './abstractGroupRepresentation'; +export * from './abstractUserRepresentation'; +export * from './accountRepresentation'; +export * from './addGroupCapabilitiesRepresentation'; +export * from './alfrescoContentRepresentation'; +export * from './alfrescoEndpointRepresentation'; +export * from './alfrescoNetworkRepresenation'; +export * from './alfrescoSiteRepresenation'; +export * from './appDefinition'; +export * from './appDefinitionPublishRepresentation'; +export * from './appDefinitionRepresentation'; +export * from './appDefinitionSaveRepresentation'; +export * from './appDefinitionUpdateResultRepresentation'; +export * from './appDeploymentRepresentation'; +export * from './appModelDefinition'; +export * from './assigneeIdentifierRepresentation'; +export * from './auditCalculatedValueRepresentation'; +export * from './auditDecisionExpressionInfoRepresentation'; +export * from './auditDecisionInfoRepresentation'; +export * from './auditDecisionRuleInfoRepresentation'; +export * from './auditLogEntryRepresentation'; +export * from './auditLogFormDataRepresentation'; +export * from './boxContent'; +export * from './boxUserAccountCredentialsRepresentation'; +export * from './bulkUserUpdateRepresentation'; +export * from './changePasswordRepresentation'; +export * from './checklistOrderRepresentation'; +export * from './commentAuditInfo'; +export * from './commentRepresentation'; +export * from './completeFormRepresentation'; +export * from './conditionRepresentation'; +export * from './createEndpointBasicAuthRepresentation'; +export * from './createProcessInstanceRepresentation'; +export * from './createTenantRepresentation'; +export * from './dataSourceConfigRepresentation'; +export * from './dataSourceRepresentation'; +export * from './decisionAuditRepresentation'; +export * from './decisionTaskRepresentation'; +export * from './endpointBasicAuthRepresentation'; +export * from './endpointConfigurationRepresentation'; +export * from './endpointRequestHeaderRepresentation'; +export * from './entityAttributeScopeRepresentation'; +export * from './entityVariableScopeRepresentation'; +export * from './fieldValueInfo'; +export * from './file'; +export * from './formDefinitionRepresentation'; +export * from './formFieldRepresentation'; +export * from './formIdentifierRepresentation'; +export * from './formJavascriptEventRepresentation'; +export * from './formOutcomeRepresentation'; +export * from './formRepresentation'; +export * from './formSaveRepresentation'; +export * from './formScopeRepresentation'; +export * from './formTabRepresentation'; +export * from './formValueRepresentation'; +export * from './formVariableRepresentation'; +export * from './globalDateFormatRepresentation'; +export * from './googleDriveContent'; +export * from './groupCapabilityRepresentation'; +export * from './groupRepresentation'; +export * from './historicProcessInstanceQueryRepresentation'; +export * from './historicTaskInstanceQueryRepresentation'; +export * from './identityLinkRepresentation'; +export * from './imageUploadRepresentation'; +export * from './jsonNode'; +export * from './layoutRepresentation'; +export * from './lightAppRepresentation'; +export * from './lightGroupRepresentation'; +export * from './lightTenantRepresentation'; +export * from './lightUserRepresentation'; +export * from './modelRepresentation'; +export * from './namedObject'; +export * from './objectNode'; +export * from './optionRepresentation'; +export * from './passwordValidationConstraints'; +export * from './processContentRepresentation'; +export * from './processDefinitionMetaDataRepresentation'; +export * from './processDefinitionRepresentation'; +export * from './processInstanceAuditInfoRepresentation'; +export * from './processInstanceFilterRepresentation'; +export * from './processInstanceFilterRequestRepresentation'; +export * from './processInstanceQueryRepresentation'; +export * from './processInstanceRepresentation'; +export * from './processInstanceVariableRepresentation'; +export * from './processScopeIdentifierRepresentation'; +export * from './processScopeRepresentation'; +export * from './processScopesRequestRepresentation'; +export * from './publishIdentityInfoRepresentation'; +export * from './queryVariable'; +export * from './relatedContentRepresentation'; +export * from './relatedProcessTask'; +export * from './resetPasswordRepresentation'; +export * from './restVariable'; +export * from './resultListDataRepresentationAbstractUserRepresentation'; +export * from './resultListDataRepresentationAccountRepresentation'; +export * from './resultListDataRepresentationAlfrescoContentRepresentation'; +export * from './resultListDataRepresentationAlfrescoEndpointRepresentation'; +export * from './resultListDataRepresentationAlfrescoNetworkRepresenation'; +export * from './resultListDataRepresentationAlfrescoSiteRepresenation'; +export * from './resultListDataRepresentationAppDefinitionRepresentation'; +export * from './resultListDataRepresentationAppDeploymentRepresentation'; +export * from './resultListDataRepresentationBoxContent'; +export * from './resultListDataRepresentationCommentRepresentation'; +export * from './resultListDataRepresentationDataSourceRepresentation'; +export * from './resultListDataRepresentationDecisionAuditRepresentation'; +export * from './resultListDataRepresentationDecisionTaskRepresentation'; +export * from './resultListDataRepresentationFormRepresentation'; +export * from './resultListDataRepresentationGoogleDriveContent'; +export * from './resultListDataRepresentationLightGroupRepresentation'; +export * from './resultListDataRepresentationLightUserRepresentation'; +export * from './resultListDataRepresentationModelRepresentation'; +export * from './resultListDataRepresentationProcessContentRepresentation'; +export * from './resultListDataRepresentationProcessDefinitionRepresentation'; +export * from './resultListDataRepresentationProcessInstanceRepresentation'; +export * from './resultListDataRepresentationRelatedContentRepresentation'; +export * from './resultListDataRepresentationRuntimeDecisionTableRepresentation'; +export * from './resultListDataRepresentationRuntimeFormRepresentation'; +export * from './resultListDataRepresentationSubmittedFormRepresentation'; +export * from './resultListDataRepresentationTaskRepresentation'; +export * from './resultListDataRepresentationUserProcessInstanceFilterRepresentation'; +export * from './resultListDataRepresentationUserTaskFilterRepresentation'; +export * from './resultListDataRepresentationRelatedProcessTask'; +export * from './runtimeAppDefinitionSaveRepresentation'; +export * from './runtimeDecisionTableRepresentation'; +export * from './runtimeFormRepresentation'; +export * from './saveFormRepresentation'; +export * from './submittedFormRepresentation'; +export * from './syncLogEntryRepresentation'; +export * from './systemPropertiesRepresentation'; +export * from './taskAuditInfoRepresentation'; +export * from './taskFilterRepresentation'; +export * from './taskFilterRequestRepresentation'; +export * from './taskQueryRepresentation'; +export * from './taskRepresentation'; +export * from './taskUpdateRepresentation'; +export * from './tenantEvent'; +export * from './tenantRepresentation'; +export * from './userAccountCredentialsRepresentation'; +export * from './userActionRepresentation'; +export * from './userFilterOrderRepresentation'; +export * from './userIdentifierRepresentation'; +export * from './userProcessInstanceFilterRepresentation'; +export * from './userRepresentation'; +export * from './userTaskFilterRepresentation'; +export * from './validationErrorRepresentation'; +export * from './variableMappingRepresentation'; +export * from './variableScopeRepresentation'; diff --git a/lib/js-api/src/api/activiti-rest-api/model/jsonNode.ts b/lib/js-api/src/api/activiti-rest-api/model/jsonNode.ts new file mode 100644 index 0000000000..6712a80ac0 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/jsonNode.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface JsonNode { + array?: boolean; + bigDecimal?: boolean; + bigInteger?: boolean; + binary?: boolean; + // eslint-disable-next-line id-blacklist + boolean?: boolean; + containerNode?: boolean; + double?: boolean; + float?: boolean; + floatingPointNumber?: boolean; + int?: boolean; + integralNumber?: boolean; + long?: boolean; + missingNode?: boolean; + nodeType?: 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'; + null?: boolean; + // eslint-disable-next-line id-blacklist + number?: boolean; + object?: boolean; + pojo?: boolean; + short?: boolean; + textual?: boolean; + valueNode?: boolean; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/layoutRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/layoutRepresentation.ts new file mode 100644 index 0000000000..b41c12b4c4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/layoutRepresentation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface LayoutRepresentation { + colspan?: number; + column?: number; + row?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/lightAppRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/lightAppRepresentation.ts new file mode 100644 index 0000000000..f941c3e396 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/lightAppRepresentation.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface LightAppRepresentation { + description?: string; + icon?: string; + id?: number; + name?: string; + theme?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/lightGroupRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/lightGroupRepresentation.ts new file mode 100644 index 0000000000..8b311a1e38 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/lightGroupRepresentation.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface LightGroupRepresentation { + externalId?: string; + groups?: LightGroupRepresentation[]; + id?: number; + name?: string; + status?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/lightTenantRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/lightTenantRepresentation.ts new file mode 100644 index 0000000000..b9ec873430 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/lightTenantRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface LightTenantRepresentation { + id?: number; + name?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/lightUserRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/lightUserRepresentation.ts new file mode 100644 index 0000000000..8b1ba763d2 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/lightUserRepresentation.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface LightUserRepresentation { + company?: string; + email?: string; + externalId?: string; + firstName?: string; + id?: number; + lastName?: string; + pictureId?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/modelRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/modelRepresentation.ts new file mode 100644 index 0000000000..8d1b02ea90 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/modelRepresentation.ts @@ -0,0 +1,45 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class ModelRepresentation { + comment?: string; + createdBy?: number; + createdByFullName?: string; + description?: string; + favorite?: boolean; + id?: number; + lastUpdated?: Date; + lastUpdatedBy?: number; + lastUpdatedByFullName?: string; + latestVersion?: boolean; + modelType?: number; + name?: string; + permission?: string; + referenceId?: number; + stencilSet?: number; + tenantId?: number; + version?: number; + + constructor(input?: Partial<ModelRepresentation>) { + if (input) { + Object.assign(this, input); + this.lastUpdated = input.lastUpdated ? DateAlfresco.parseDate(input.lastUpdated) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/namedObject.ts b/lib/js-api/src/api/activiti-rest-api/model/namedObject.ts new file mode 100644 index 0000000000..37898e7eaa --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/namedObject.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface NamedObject { + id?: string; + name?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/objectNode.ts b/lib/js-api/src/api/activiti-rest-api/model/objectNode.ts new file mode 100644 index 0000000000..1122d35e6e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/objectNode.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ObjectNode { + array?: boolean; + bigDecimal?: boolean; + bigInteger?: boolean; + binary?: boolean; + // eslint-disable-next-line id-blacklist + boolean?: boolean; + containerNode?: boolean; + double?: boolean; + float?: boolean; + floatingPointNumber?: boolean; + int?: boolean; + integralNumber?: boolean; + long?: boolean; + missingNode?: boolean; + nodeType?: 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'; + null?: boolean; + // eslint-disable-next-line id-blacklist + number?: boolean; + object?: boolean; + pojo?: boolean; + short?: boolean; + textual?: boolean; + valueNode?: boolean; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/optionRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/optionRepresentation.ts new file mode 100644 index 0000000000..df4436474f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/optionRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface OptionRepresentation { + id?: string; + name?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/passwordValidationConstraints.ts b/lib/js-api/src/api/activiti-rest-api/model/passwordValidationConstraints.ts new file mode 100644 index 0000000000..37f2192ac7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/passwordValidationConstraints.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface PasswordValidationConstraints { + minLength?: number; + passwordCriteriaMessage?: string; + regularExpression?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processContentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processContentRepresentation.ts new file mode 100644 index 0000000000..ce45df7bf8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processContentRepresentation.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NamedObject } from './namedObject'; +import { RelatedContentRepresentation } from './relatedContentRepresentation'; + +export class ProcessContentRepresentation { + content?: RelatedContentRepresentation[]; + field?: NamedObject; + + constructor(input?: Partial<ProcessContentRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.content) { + this.content = input.content.map((item) => new RelatedContentRepresentation(item)); + } + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processDefinitionMetaDataRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processDefinitionMetaDataRepresentation.ts new file mode 100644 index 0000000000..73e8169d75 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processDefinitionMetaDataRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ProcessDefinitionMetaDataRepresentation { + key?: string; + value?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processDefinitionRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processDefinitionRepresentation.ts new file mode 100644 index 0000000000..dce5e92b38 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processDefinitionRepresentation.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProcessDefinitionMetaDataRepresentation } from './processDefinitionMetaDataRepresentation'; + +export interface ProcessDefinitionRepresentation { + category?: string; + deploymentId?: string; + description?: string; + hasStartForm?: boolean; + id?: string; + key?: string; + metaDataValues?: ProcessDefinitionMetaDataRepresentation[]; + name?: string; + tenantId?: string; + version?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processInstanceAuditInfoRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processInstanceAuditInfoRepresentation.ts new file mode 100644 index 0000000000..924b731f17 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processInstanceAuditInfoRepresentation.ts @@ -0,0 +1,32 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditDecisionInfoRepresentation } from './auditDecisionInfoRepresentation'; +import { AuditLogEntryRepresentation } from './auditLogEntryRepresentation'; + +export interface ProcessInstanceAuditInfoRepresentation { + decisionInfo?: AuditDecisionInfoRepresentation; + entries?: AuditLogEntryRepresentation[]; + processDefinitionName?: string; + processDefinitionVersion?: string; + processInstanceDurationInMillis?: number; + processInstanceEndTime?: string; + processInstanceId?: string; + processInstanceInitiator?: string; + processInstanceName?: string; + processInstanceStartTime?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processInstanceFilterRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processInstanceFilterRepresentation.ts new file mode 100644 index 0000000000..a46ce018fc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processInstanceFilterRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ProcessInstanceFilterRepresentation { + asc?: boolean; + name?: string; + processDefinitionId?: string; + processDefinitionKey?: string; + sort?: string; + state?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processInstanceFilterRequestRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processInstanceFilterRequestRepresentation.ts new file mode 100644 index 0000000000..5fe6ff4fba --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processInstanceFilterRequestRepresentation.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProcessInstanceFilterRepresentation } from './processInstanceFilterRepresentation'; + +export interface ProcessInstanceFilterRequestRepresentation { + appDefinitionId?: number; + filter?: ProcessInstanceFilterRepresentation; + filterId?: number; + page?: number; + size?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processInstanceQueryRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processInstanceQueryRepresentation.ts new file mode 100644 index 0000000000..eab949ec9b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processInstanceQueryRepresentation.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ProcessInstanceQueryRepresentation { + appDefinitionId?: number; + page?: number; + processDefinitionId?: string; + processInstanceId?: string; + size?: number; + sort?: 'created-desc' | 'created-asc' | 'ended-desc' | 'ended-asc'; + start?: number; + state?: 'running' | 'completed' | 'all'; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processInstanceRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processInstanceRepresentation.ts new file mode 100644 index 0000000000..874a055b7e --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processInstanceRepresentation.ts @@ -0,0 +1,49 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { LightUserRepresentation } from './lightUserRepresentation'; +import { RestVariable } from './restVariable'; + +export class ProcessInstanceRepresentation { + businessKey?: string; + ended?: Date; + graphicalNotationDefined?: boolean; + id?: string; + name?: string; + processDefinitionCategory?: string; + processDefinitionDeploymentId?: string; + processDefinitionDescription?: string; + processDefinitionId?: string; + processDefinitionKey?: string; + processDefinitionName?: string; + processDefinitionVersion?: number; + startFormDefined?: boolean; + started?: Date; + startedBy?: LightUserRepresentation; + suspended?: boolean; + tenantId?: string; + variables?: RestVariable[]; + + constructor(input?: Partial<ProcessInstanceRepresentation>) { + if (input) { + Object.assign(this, input); + this.ended = input.ended ? DateAlfresco.parseDate(input.ended) : undefined; + this.started = input.started ? DateAlfresco.parseDate(input.started) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processInstanceVariableRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processInstanceVariableRepresentation.ts new file mode 100644 index 0000000000..ac44b654d9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processInstanceVariableRepresentation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ProcessInstanceVariableRepresentation { + id?: string; + type?: string; + value?: any; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processScopeIdentifierRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processScopeIdentifierRepresentation.ts new file mode 100644 index 0000000000..0bab0c560a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processScopeIdentifierRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ProcessScopeIdentifierRepresentation { + processActivityId?: string; + processModelId?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processScopeRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processScopeRepresentation.ts new file mode 100644 index 0000000000..e0174072a8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processScopeRepresentation.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { EntityVariableScopeRepresentation } from './entityVariableScopeRepresentation'; +import { FormScopeRepresentation } from './formScopeRepresentation'; +import { VariableMappingRepresentation } from './variableMappingRepresentation'; +import { VariableScopeRepresentation } from './variableScopeRepresentation'; + +export interface ProcessScopeRepresentation { + activityIds?: string[]; + activityIdsByCollapsedSubProcessIdMap?: { [key: string]: string }; + activityIdsByDecisionTableIdMap?: { [key: string]: string }; + activityIdsByFormIdMap?: { [key: string]: string }; + activityIdsWithExcludedSubProcess?: string[]; + activitySidsByActivityIdMap?: { [key: string]: string }; + customStencilVariables?: { [key: string]: VariableScopeRepresentation }; + entityVariables?: { [key: string]: EntityVariableScopeRepresentation }; + executionVariables?: { [key: string]: VariableScopeRepresentation }; + fieldToVariableMappings?: { [key: string]: VariableScopeRepresentation }; + forms?: { [key: string]: FormScopeRepresentation }; + metadataVariables?: { [key: string]: VariableScopeRepresentation }; + modelId?: number; + processModelType?: number; + responseVariables?: { [key: string]: VariableScopeRepresentation }; + reusableFieldMapping?: { [key: string]: VariableMappingRepresentation }; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/processScopesRequestRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/processScopesRequestRepresentation.ts new file mode 100644 index 0000000000..3e07d99550 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/processScopesRequestRepresentation.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProcessScopeIdentifierRepresentation } from './processScopeIdentifierRepresentation'; + +export interface ProcessScopesRequestRepresentation { + identifiers?: ProcessScopeIdentifierRepresentation[]; + overriddenModel?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/publishIdentityInfoRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/publishIdentityInfoRepresentation.ts new file mode 100644 index 0000000000..87e97d7dc8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/publishIdentityInfoRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LightGroupRepresentation } from './lightGroupRepresentation'; +import { LightUserRepresentation } from './lightUserRepresentation'; + +export interface PublishIdentityInfoRepresentation { + group?: LightGroupRepresentation; + person?: LightUserRepresentation; + type?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/queryVariable.ts b/lib/js-api/src/api/activiti-rest-api/model/queryVariable.ts new file mode 100644 index 0000000000..f222dc58cf --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/queryVariable.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface QueryVariable { + name?: string; + operation?: string; + type?: string; + value?: any; + variableOperation?: + | 'EQUALS' + | 'NOT_EQUALS' + | 'EQUALS_IGNORE_CASE' + | 'NOT_EQUALS_IGNORE_CASE' + | 'LIKE' + | 'LIKE_IGNORE_CASE' + | 'GREATER_THAN' + | 'GREATER_THAN_OR_EQUALS' + | 'LESS_THAN' + | 'LESS_THAN_OR_EQUALS'; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/relatedContentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/relatedContentRepresentation.ts new file mode 100644 index 0000000000..892e3c62d5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/relatedContentRepresentation.ts @@ -0,0 +1,44 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { LightUserRepresentation } from './lightUserRepresentation'; + +export class RelatedContentRepresentation { + contentAvailable?: boolean; + created?: Date; + createdBy?: LightUserRepresentation; + id?: number; + link?: boolean; + linkUrl?: string; + mimeType?: string; + name?: string; + previewStatus?: string; + relatedContent?: boolean; + simpleType?: string; + source?: string; + sourceId?: string; + thumbnailStatus?: string; + contentBlob?: Blob; + + constructor(input?: Partial<RelatedContentRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/relatedProcessTask.ts b/lib/js-api/src/api/activiti-rest-api/model/relatedProcessTask.ts new file mode 100644 index 0000000000..f61c5015fc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/relatedProcessTask.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RelatedProcessTask { + processId?: string; + taskId?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resetPasswordRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resetPasswordRepresentation.ts new file mode 100644 index 0000000000..bb416678e0 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resetPasswordRepresentation.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ResetPasswordRepresentation { + email?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/restVariable.ts b/lib/js-api/src/api/activiti-rest-api/model/restVariable.ts new file mode 100644 index 0000000000..950d511123 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/restVariable.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RestVariable { + name?: string; + scope?: string; + type?: string; + value?: any; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAbstractUserRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAbstractUserRepresentation.ts new file mode 100644 index 0000000000..df2f75f0bb --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAbstractUserRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbstractUserRepresentation } from './abstractUserRepresentation'; + +export interface ResultListDataRepresentationAbstractUserRepresentation { + data?: AbstractUserRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAccountRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAccountRepresentation.ts new file mode 100644 index 0000000000..0b4b4adc50 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAccountRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AccountRepresentation } from './accountRepresentation'; + +export interface ResultListDataRepresentationAccountRepresentation { + data?: AccountRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoContentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoContentRepresentation.ts new file mode 100644 index 0000000000..b97d471427 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoContentRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoContentRepresentation } from './alfrescoContentRepresentation'; + +export interface ResultListDataRepresentationAlfrescoContentRepresentation { + data?: AlfrescoContentRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoEndpointRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoEndpointRepresentation.ts new file mode 100644 index 0000000000..9de3c70378 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoEndpointRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoEndpointRepresentation } from './alfrescoEndpointRepresentation'; + +export class ResultListDataRepresentationAlfrescoEndpointRepresentation { + data?: AlfrescoEndpointRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationAlfrescoEndpointRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new AlfrescoEndpointRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoNetworkRepresenation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoNetworkRepresenation.ts new file mode 100644 index 0000000000..b5458b5f2b --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoNetworkRepresenation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoNetworkRepresenation } from './alfrescoNetworkRepresenation'; + +export interface ResultListDataRepresentationAlfrescoNetworkRepresenation { + data?: AlfrescoNetworkRepresenation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoSiteRepresenation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoSiteRepresenation.ts new file mode 100644 index 0000000000..90f2148f90 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAlfrescoSiteRepresenation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoSiteRepresenation } from './alfrescoSiteRepresenation'; + +export interface ResultListDataRepresentationAlfrescoSiteRepresenation { + data?: AlfrescoSiteRepresenation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAppDefinitionRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAppDefinitionRepresentation.ts new file mode 100644 index 0000000000..9ce3f4cb87 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAppDefinitionRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppDefinitionRepresentation } from './appDefinitionRepresentation'; + +export interface ResultListDataRepresentationAppDefinitionRepresentation { + data?: AppDefinitionRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAppDeploymentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAppDeploymentRepresentation.ts new file mode 100644 index 0000000000..9afd6ab410 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationAppDeploymentRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppDeploymentRepresentation } from './appDeploymentRepresentation'; + +export class ResultListDataRepresentationAppDeploymentRepresentation { + data?: AppDeploymentRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationAppDeploymentRepresentation>) { + + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new AppDeploymentRepresentation(item)); + } + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationBoxContent.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationBoxContent.ts new file mode 100644 index 0000000000..83552ee975 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationBoxContent.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BoxContent } from './boxContent'; + +export interface ResultListDataRepresentationBoxContent { + data?: BoxContent[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationCommentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationCommentRepresentation.ts new file mode 100644 index 0000000000..5cff143df9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationCommentRepresentation.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommentRepresentation } from './commentRepresentation'; + +export class ResultListDataRepresentationCommentRepresentation { + data?: CommentRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationCommentRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new CommentRepresentation(item)); + } + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDataSourceRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDataSourceRepresentation.ts new file mode 100644 index 0000000000..8e30a5b5b9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDataSourceRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DataSourceRepresentation } from './dataSourceRepresentation'; + +export interface ResultListDataRepresentationDataSourceRepresentation { + data?: DataSourceRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDecisionAuditRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDecisionAuditRepresentation.ts new file mode 100644 index 0000000000..8affe394cf --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDecisionAuditRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DecisionAuditRepresentation } from './decisionAuditRepresentation'; + +export class ResultListDataRepresentationDecisionAuditRepresentation { + data?: DecisionAuditRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationDecisionAuditRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new DecisionAuditRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDecisionTaskRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDecisionTaskRepresentation.ts new file mode 100644 index 0000000000..b426dc3d03 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationDecisionTaskRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DecisionTaskRepresentation } from './decisionTaskRepresentation'; + +export class ResultListDataRepresentationDecisionTaskRepresentation { + data?: DecisionTaskRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationDecisionTaskRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new DecisionTaskRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationFormRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationFormRepresentation.ts new file mode 100644 index 0000000000..61967e7703 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationFormRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FormRepresentation } from './formRepresentation'; + +export class ResultListDataRepresentationFormRepresentation { + data?: FormRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationFormRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new FormRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationGoogleDriveContent.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationGoogleDriveContent.ts new file mode 100644 index 0000000000..44b9b5ae68 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationGoogleDriveContent.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GoogleDriveContent } from './googleDriveContent'; + +export interface ResultListDataRepresentationGoogleDriveContent { + data?: GoogleDriveContent[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationLightGroupRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationLightGroupRepresentation.ts new file mode 100644 index 0000000000..30d5b3b143 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationLightGroupRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LightGroupRepresentation } from './lightGroupRepresentation'; + +export interface ResultListDataRepresentationLightGroupRepresentation { + data?: LightGroupRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationLightUserRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationLightUserRepresentation.ts new file mode 100644 index 0000000000..02400bfe9f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationLightUserRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LightUserRepresentation } from './lightUserRepresentation'; + +export interface ResultListDataRepresentationLightUserRepresentation { + data?: LightUserRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationModelRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationModelRepresentation.ts new file mode 100644 index 0000000000..ac4d1c6817 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationModelRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ModelRepresentation } from './modelRepresentation'; + +export class ResultListDataRepresentationModelRepresentation { + data?: ModelRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationModelRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new ModelRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessContentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessContentRepresentation.ts new file mode 100644 index 0000000000..3f240df30d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessContentRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProcessContentRepresentation } from './processContentRepresentation'; + +export class ResultListDataRepresentationProcessContentRepresentation { + data?: ProcessContentRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationProcessContentRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new ProcessContentRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessDefinitionRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessDefinitionRepresentation.ts new file mode 100644 index 0000000000..b674ca619a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessDefinitionRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProcessDefinitionRepresentation } from './processDefinitionRepresentation'; + +export interface ResultListDataRepresentationProcessDefinitionRepresentation { + data?: ProcessDefinitionRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessInstanceRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessInstanceRepresentation.ts new file mode 100644 index 0000000000..fd6a21b044 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationProcessInstanceRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProcessInstanceRepresentation } from './processInstanceRepresentation'; + +export class ResultListDataRepresentationProcessInstanceRepresentation { + data?: ProcessInstanceRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationProcessInstanceRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new ProcessInstanceRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRelatedContentRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRelatedContentRepresentation.ts new file mode 100644 index 0000000000..2b03603497 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRelatedContentRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RelatedContentRepresentation } from './relatedContentRepresentation'; + +export class ResultListDataRepresentationRelatedContentRepresentation { + data?: RelatedContentRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationRelatedContentRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new RelatedContentRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRelatedProcessTask.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRelatedProcessTask.ts new file mode 100644 index 0000000000..c01cefb0aa --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRelatedProcessTask.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RelatedProcessTask } from './relatedProcessTask'; + +export interface ResultListDataRepresentationRelatedProcessTask { + data?: RelatedProcessTask[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRuntimeDecisionTableRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRuntimeDecisionTableRepresentation.ts new file mode 100644 index 0000000000..1405f6e347 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRuntimeDecisionTableRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RuntimeDecisionTableRepresentation } from './runtimeDecisionTableRepresentation'; + +export interface ResultListDataRepresentationRuntimeDecisionTableRepresentation { + data?: RuntimeDecisionTableRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRuntimeFormRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRuntimeFormRepresentation.ts new file mode 100644 index 0000000000..e976fb0d68 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationRuntimeFormRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RuntimeFormRepresentation } from './runtimeFormRepresentation'; + +export interface ResultListDataRepresentationRuntimeFormRepresentation { + data?: RuntimeFormRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationSubmittedFormRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationSubmittedFormRepresentation.ts new file mode 100644 index 0000000000..14d8aa1e63 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationSubmittedFormRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SubmittedFormRepresentation } from './submittedFormRepresentation'; + +export class ResultListDataRepresentationSubmittedFormRepresentation { + data?: SubmittedFormRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationSubmittedFormRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new SubmittedFormRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationTaskRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationTaskRepresentation.ts new file mode 100644 index 0000000000..7d2d0075d4 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationTaskRepresentation.ts @@ -0,0 +1,36 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TaskRepresentation } from './taskRepresentation'; + +export class ResultListDataRepresentationTaskRepresentation { + data?: TaskRepresentation[]; + size?: number; + start?: number; + total?: number; + length?: number; + + constructor(input?: Partial<ResultListDataRepresentationTaskRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new TaskRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationUserProcessInstanceFilterRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationUserProcessInstanceFilterRepresentation.ts new file mode 100644 index 0000000000..72e475856c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationUserProcessInstanceFilterRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UserProcessInstanceFilterRepresentation } from './userProcessInstanceFilterRepresentation'; + +export interface ResultListDataRepresentationUserProcessInstanceFilterRepresentation { + data?: UserProcessInstanceFilterRepresentation[]; + size?: number; + start?: number; + total?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationUserTaskFilterRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationUserTaskFilterRepresentation.ts new file mode 100644 index 0000000000..099f7f277c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/resultListDataRepresentationUserTaskFilterRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UserTaskFilterRepresentation } from './userTaskFilterRepresentation'; + +export class ResultListDataRepresentationUserTaskFilterRepresentation { + data?: UserTaskFilterRepresentation[]; + size?: number; + start?: number; + total?: number; + + constructor(input?: Partial<ResultListDataRepresentationUserTaskFilterRepresentation>) { + if (input) { + Object.assign(this, input); + if (input.data) { + this.data = input.data.map((item) => new UserTaskFilterRepresentation(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/runtimeAppDefinitionSaveRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/runtimeAppDefinitionSaveRepresentation.ts new file mode 100644 index 0000000000..472210bbe9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/runtimeAppDefinitionSaveRepresentation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AppDefinitionRepresentation } from './appDefinitionRepresentation'; + +export interface RuntimeAppDefinitionSaveRepresentation { + appDefinitions?: AppDefinitionRepresentation[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/runtimeDecisionTableRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/runtimeDecisionTableRepresentation.ts new file mode 100644 index 0000000000..ed32e209ca --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/runtimeDecisionTableRepresentation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RuntimeDecisionTableRepresentation { + category?: string; + deploymentId?: number; + description?: string; + id?: number; + key?: string; + name?: string; + resourceName?: string; + tenantId?: string; + version?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/runtimeFormRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/runtimeFormRepresentation.ts new file mode 100644 index 0000000000..e3ca2e72c8 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/runtimeFormRepresentation.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RuntimeFormRepresentation { + appDefinitionId?: number; + appDeploymentId?: number; + description?: string; + id?: number; + modelId?: number; + name?: string; + tenantId?: number; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/saveFormRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/saveFormRepresentation.ts new file mode 100644 index 0000000000..72f00ae268 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/saveFormRepresentation.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SaveFormRepresentation { + values?: any; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/submittedFormRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/submittedFormRepresentation.ts new file mode 100644 index 0000000000..11fb4815f9 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/submittedFormRepresentation.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { FormDefinitionRepresentation } from './formDefinitionRepresentation'; +import { LightUserRepresentation } from './lightUserRepresentation'; + +export class SubmittedFormRepresentation { + form?: FormDefinitionRepresentation; + formId?: number; + id?: number; + name?: string; + processId?: string; + submitted?: Date; + submittedBy?: LightUserRepresentation; + taskId?: string; + + constructor(input?: Partial<SubmittedFormRepresentation>) { + if (input) { + Object.assign(this, input); + this.submitted = input.submitted ? DateAlfresco.parseDate(input.submitted) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/syncLogEntryRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/syncLogEntryRepresentation.ts new file mode 100644 index 0000000000..0cefa91948 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/syncLogEntryRepresentation.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class SyncLogEntryRepresentation { + id?: number; + timeStamp?: Date; + type?: string; + + constructor(input?: Partial<SyncLogEntryRepresentation>) { + if (input) { + Object.assign(this, input); + this.timeStamp = input.timeStamp ? DateAlfresco.parseDate(input.timeStamp) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/systemPropertiesRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/systemPropertiesRepresentation.ts new file mode 100644 index 0000000000..84b44a3260 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/systemPropertiesRepresentation.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SystemPropertiesRepresentation { + allowInvolveByEmail?: boolean; + disableJavaScriptEventsInFormEditor?: boolean; + logoutDisabled?: boolean; + authConfiguration: { authUrl: string; realm: string; clientId: string; useBrowserLogout: boolean }; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/taskAuditInfoRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/taskAuditInfoRepresentation.ts new file mode 100644 index 0000000000..ef89c3c07d --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/taskAuditInfoRepresentation.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditLogFormDataRepresentation } from './auditLogFormDataRepresentation'; +import { CommentAuditInfo } from './commentAuditInfo'; + +export interface TaskAuditInfoRepresentation { + assignee?: string; + comments?: CommentAuditInfo[]; + endTime?: string; + formData?: AuditLogFormDataRepresentation[]; + processDefinitionName?: string; + processDefinitionVersion?: number; + processInstanceId?: string; + selectedOutcome?: string; + startTime?: string; + taskId?: string; + taskName?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/taskFilterRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/taskFilterRepresentation.ts new file mode 100644 index 0000000000..ca062cf175 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/taskFilterRepresentation.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class TaskFilterRepresentation { + asc?: boolean; + assignment?: string; + dueAfter?: Date; + dueBefore?: Date; + name?: string; + processDefinitionId?: string; + processDefinitionKey?: string; + sort?: string; + state?: 'active' | 'completed' | 'all' | 'running' | string; + + constructor(input?: Partial<TaskFilterRepresentation>) { + if (input) { + Object.assign(this, input); + this.dueAfter = input.dueAfter ? DateAlfresco.parseDate(input.dueAfter) : undefined; + this.dueBefore = input.dueBefore ? DateAlfresco.parseDate(input.dueBefore) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/taskFilterRequestRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/taskFilterRequestRepresentation.ts new file mode 100644 index 0000000000..d4d53134dc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/taskFilterRequestRepresentation.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TaskFilterRepresentation } from './taskFilterRepresentation'; + +export class TaskFilterRequestRepresentation { + appDefinitionId?: number; + filter?: TaskFilterRepresentation; + filterId?: number; + page?: number; + size?: number; + + constructor(input?: Partial<TaskFilterRequestRepresentation>) { + if (input) { + Object.assign(this, input); + this.filter = input.filter ? new TaskFilterRepresentation(input.filter) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/taskQueryRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/taskQueryRepresentation.ts new file mode 100644 index 0000000000..5213c4c2ae --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/taskQueryRepresentation.ts @@ -0,0 +1,43 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class TaskQueryRepresentation { + appDefinitionId?: number; + assignment?: string; + dueAfter?: Date; + dueBefore?: Date; + includeProcessInstance?: boolean; + page?: number; + processDefinitionId?: string; + processInstanceId?: string; + size?: number; + sort?: 'created-desc' | 'created-asc' | 'due-desc' | 'due-asc' | string; + start?: number; + state?: 'active' | 'completed' | 'all' | 'open' | string; + taskId?: string; + text?: string; + + constructor(input?: Partial<TaskQueryRepresentation>) { + if (input) { + Object.assign(this, input); + this.dueAfter = input.dueAfter ? DateAlfresco.parseDate(input.dueAfter) : undefined; + this.dueBefore = input.dueBefore ? DateAlfresco.parseDate(input.dueBefore) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/taskRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/taskRepresentation.ts new file mode 100644 index 0000000000..b98c908e12 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/taskRepresentation.ts @@ -0,0 +1,83 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { LightGroupRepresentation } from './lightGroupRepresentation'; +import { LightUserRepresentation } from './lightUserRepresentation'; +import { RestVariable } from './restVariable'; + +export class TaskRepresentation { + adhocTaskCanBeReassigned?: boolean; + assignee?: LightUserRepresentation; + category?: string; + created?: Date; + description?: string; + dueDate?: Date; + duration?: number; + endDate?: Date; + executionId?: string; + formKey?: string; + id?: string; + initiatorCanCompleteTask?: boolean; + involvedGroups?: LightGroupRepresentation[]; + involvedPeople?: LightUserRepresentation[]; + managerOfCandidateGroup?: boolean; + memberOfCandidateGroup?: boolean; + memberOfCandidateUsers?: boolean; + name?: string; + parentTaskId?: string; + parentTaskName?: string; + priority?: number; + processDefinitionCategory?: string; + processDefinitionDeploymentId?: string; + processDefinitionDescription?: string; + processDefinitionId?: string; + processDefinitionKey?: string; + processDefinitionName?: string; + processDefinitionVersion?: number; + processInstanceId?: string; + processInstanceName?: string; + processInstanceStartUserId?: string; + taskDefinitionKey?: string; + variables?: RestVariable[]; + parentName?: string; + + constructor(input?: Partial<TaskRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + this.dueDate = input.dueDate ? DateAlfresco.parseDate(input.dueDate) : undefined; + this.endDate = input.endDate ? DateAlfresco.parseDate(input.endDate) : undefined; + } + } + + getFullName(): string { + let fullName = ''; + + if (this.assignee) { + const firstName: string = this.assignee.firstName ? this.assignee.firstName : ''; + const lastName: string = this.assignee.lastName ? this.assignee.lastName : ''; + fullName = `${firstName} ${lastName}`; + } + + return fullName.trim(); + } + + isCompleted(): boolean { + return !!this.endDate; + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/taskUpdateRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/taskUpdateRepresentation.ts new file mode 100644 index 0000000000..c9d537abd1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/taskUpdateRepresentation.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class TaskUpdateRepresentation { + category?: string; + categorySet?: boolean; + description?: string; + descriptionSet?: boolean; + dueDate?: Date; + dueDateSet?: boolean; + formKey?: string; + formKeySet?: boolean; + name?: string; + nameSet?: boolean; + parentTaskId?: string; + parentTaskIdSet?: boolean; + priority?: number; + prioritySet?: boolean; + + constructor(input?: Partial<TaskUpdateRepresentation>) { + if (input) { + Object.assign(this, input); + this.dueDate = input.dueDate ? DateAlfresco.parseDate(input.dueDate) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/tenantEvent.ts b/lib/js-api/src/api/activiti-rest-api/model/tenantEvent.ts new file mode 100644 index 0000000000..91df6380c1 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/tenantEvent.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class TenantEvent { + eventTime?: Date; + eventType?: string; + extraInfo?: string; + id?: number; + tenantId?: number; + userId?: number; + userName?: string; + + constructor(input?: Partial<TenantEvent>) { + if (input) { + Object.assign(this, input); + this.eventTime = input.eventTime ? DateAlfresco.parseDate(input.eventTime) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/tenantRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/tenantRepresentation.ts new file mode 100644 index 0000000000..c51400b56a --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/tenantRepresentation.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class TenantRepresentation { + active?: boolean; + created?: Date; + domain?: string; + id?: number; + lastUpdate?: Date; + logoId?: number; + maxUsers?: number; + name?: string; + + constructor(input?: Partial<TenantRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + this.lastUpdate = input.lastUpdate ? DateAlfresco.parseDate(input.lastUpdate) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/userAccountCredentialsRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/userAccountCredentialsRepresentation.ts new file mode 100644 index 0000000000..bc0267c97c --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/userAccountCredentialsRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface UserAccountCredentialsRepresentation { + password?: string; + username?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/userActionRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/userActionRepresentation.ts new file mode 100644 index 0000000000..583233f1bc --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/userActionRepresentation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface UserActionRepresentation { + action?: string; + newPassword?: string; + oldPassword?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/userFilterOrderRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/userFilterOrderRepresentation.ts new file mode 100644 index 0000000000..48d02acdd7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/userFilterOrderRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface UserFilterOrderRepresentation { + appId?: number; + order?: number[]; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/userIdentifierRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/userIdentifierRepresentation.ts new file mode 100644 index 0000000000..b9432d4f5f --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/userIdentifierRepresentation.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface UserIdentifierRepresentation { + email?: string; + userId?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/userProcessInstanceFilterRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/userProcessInstanceFilterRepresentation.ts new file mode 100644 index 0000000000..84288f51a0 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/userProcessInstanceFilterRepresentation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProcessInstanceFilterRepresentation } from './processInstanceFilterRepresentation'; + +export interface UserProcessInstanceFilterRepresentation { + appId?: number; + filter?: ProcessInstanceFilterRepresentation; + icon?: string; + id?: number; + index?: number; + name?: string; + recent?: boolean; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/userRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/userRepresentation.ts new file mode 100644 index 0000000000..93c057a7f5 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/userRepresentation.ts @@ -0,0 +1,57 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { GroupRepresentation } from './groupRepresentation'; +import { LightAppRepresentation } from './lightAppRepresentation'; + +export class UserRepresentation { + apps?: LightAppRepresentation[]; + capabilities?: string[]; + company?: string; + created?: Date; + email?: string; + externalId?: string; + firstName?: string; + fullname?: string; + groups?: GroupRepresentation[]; + id?: number; + lastName?: string; + lastUpdate?: Date; + latestSyncTimeStamp?: Date; + password?: string; + pictureId?: number; + primaryGroup?: GroupRepresentation; + status?: string; + tenantId?: number; + tenantName?: string; + tenantPictureId?: number; + type?: string; + + constructor(input?: Partial<UserRepresentation>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + if (input.groups) { + this.groups = input.groups.map((item) => new GroupRepresentation(item)); + } + this.lastUpdate = input.lastUpdate ? DateAlfresco.parseDate(input.lastUpdate) : undefined; + this.latestSyncTimeStamp = input.latestSyncTimeStamp ? DateAlfresco.parseDate(input.latestSyncTimeStamp) : undefined; + this.primaryGroup = input.primaryGroup ? new GroupRepresentation(input.primaryGroup) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/userRepresentationGroup.ts b/lib/js-api/src/api/activiti-rest-api/model/userRepresentationGroup.ts new file mode 100644 index 0000000000..6fa8f4fa57 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/userRepresentationGroup.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api/model/dateAlfresco'; +import { LightAppRepresentation } from './lightAppRepresentation'; + +export class UserRepresentationGroup { + apps?: LightAppRepresentation[]; + capabilities?: string[]; + company?: string; + created?: Date; + email?: string; + externalId?: string; + firstName?: string; + fullname?: string; + groups?: any[]; + id?: number; + lastName?: string; + lastUpdate?: Date; + latestSyncTimeStamp?: Date; + password?: string; + pictureId?: number; + primaryGroup?: any; + status?: string; + tenantId?: number; + tenantName?: string; + tenantPictureId?: number; + type?: string; + + constructor(input?: Partial<UserRepresentationGroup>) { + if (input) { + Object.assign(this, input); + this.created = input.created ? DateAlfresco.parseDate(input.created) : undefined; + this.lastUpdate = input.lastUpdate ? DateAlfresco.parseDate(input.lastUpdate) : undefined; + this.latestSyncTimeStamp = input.latestSyncTimeStamp ? DateAlfresco.parseDate(input.latestSyncTimeStamp) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/userTaskFilterRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/userTaskFilterRepresentation.ts new file mode 100644 index 0000000000..7a845e5caa --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/userTaskFilterRepresentation.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TaskFilterRepresentation } from './taskFilterRepresentation'; + +export class UserTaskFilterRepresentation { + appId?: number; + filter?: TaskFilterRepresentation; + icon?: string; + id?: number; + index?: number; + name?: string; + recent?: boolean; + + constructor(input?: Partial<UserTaskFilterRepresentation>) { + if (input) { + Object.assign(this, input); + this.filter = input.filter ? new TaskFilterRepresentation(input.filter) : undefined; + } + } +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/validationErrorRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/validationErrorRepresentation.ts new file mode 100644 index 0000000000..ea92201b78 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/validationErrorRepresentation.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ValidationErrorRepresentation { + defaultDescription?: string; + id?: string; + name?: string; + problem?: string; + problemReference?: string; + validatorSetName?: string; + warning?: boolean; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/variableMappingRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/variableMappingRepresentation.ts new file mode 100644 index 0000000000..9733cb66eb --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/variableMappingRepresentation.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface VariableMappingRepresentation { + inProcessVariable?: string; + inVariableType?: string; + mappedVariable?: string; + outProcessVariable?: string; + outVariableType?: string; + typeOfMapping?: string; +} diff --git a/lib/js-api/src/api/activiti-rest-api/model/variableScopeRepresentation.ts b/lib/js-api/src/api/activiti-rest-api/model/variableScopeRepresentation.ts new file mode 100644 index 0000000000..46d45f59d7 --- /dev/null +++ b/lib/js-api/src/api/activiti-rest-api/model/variableScopeRepresentation.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface VariableScopeRepresentation { + mapVariable?: string; + mappedColumn?: string; + mappedDataModel?: number; + mappedEntity?: string; + mappedVariableName?: string; + processVariableName?: string; + processVariableType?: string; +} diff --git a/lib/js-api/src/api/auth-rest-api/README.md b/lib/js-api/src/api/auth-rest-api/README.md new file mode 100644 index 0000000000..ccc42f5116 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/README.md @@ -0,0 +1,29 @@ +# **Authentication API** + +Provides access to the authentication features of Alfresco Content Services. + +> Documentation updated on: 2019-10-17T13:35:27.038+01:00 + +## Methods + +All URIs are relative to: + +```text +https://localhost/alfresco/api/-default-/public/authentication/versions/1 +``` + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +AuthenticationApi | [**createTicket**](docs/AuthenticationApi.md#createTicket) | **POST** /tickets | Create ticket (login) +AuthenticationApi | [**deleteTicket**](docs/AuthenticationApi.md#deleteTicket) | **DELETE** /tickets/-me- | Delete ticket (logout) +AuthenticationApi | [**validateTicket**](docs/AuthenticationApi.md#validateTicket) | **GET** /tickets/-me- | Validate ticket + +## Models + +- [ErrorError](docs/ErrorError.md) +- [ModelError](docs/ModelError.md) +- [Ticket](docs/Ticket.md) +- [TicketBody](docs/TicketBody.md) +- [TicketEntry](docs/TicketEntry.md) +- [ValidTicket](docs/ValidTicket.md) +- [ValidTicketEntry](docs/ValidTicketEntry.md) diff --git a/lib/js-api/src/api/auth-rest-api/api/authentication.api.ts b/lib/js-api/src/api/auth-rest-api/api/authentication.api.ts new file mode 100644 index 0000000000..0641df4673 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/api/authentication.api.ts @@ -0,0 +1,89 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TicketBody } from '../model/ticketBody'; +import { TicketEntry } from '../model/ticketEntry'; +import { ValidTicketEntry } from '../model/validTicketEntry'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Authentication service. + */ +export class AuthenticationApi extends BaseApi { + /** + * Create ticket (login) + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param ticketBodyCreate The user credential. + * @returns Promise<TicketEntry> + */ + createTicket(ticketBodyCreate: TicketBody): Promise<TicketEntry> { + throwIfNotDefined(ticketBodyCreate, 'ticketBodyCreate'); + + return this.post({ + path: '/tickets', + bodyParam: ticketBodyCreate, + returnType: TicketEntry + }); + } + + /** + * Get ticket (login) + * + * @returns Promise<TicketEntry> + */ + getTicket(): Promise<TicketEntry> { + return this.get({ + path: '/tickets/-me-', + returnType: TicketEntry + }); + } + + /** + * Delete ticket (logout) + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @returns Promise<{}> + */ + deleteTicket(): Promise<void> { + return this.delete({ + path: '/tickets/-me-' + }); + } + + /** + * Validate ticket + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Validates the specified ticket (derived from Authorization header) is still valid. + * For example, you can pass the Authorization request header using Javascript: + * Javascript + * request.setRequestHeader (\"Authorization\", \"Basic \" + btoa(ticket)); + * + * @returns Promise<ValidTicketEntry> + */ + validateTicket(): Promise<ValidTicketEntry> { + return this.get({ + path: '/tickets/-me-', + returnType: ValidTicketEntry + }); + } +} diff --git a/lib/js-api/src/api/auth-rest-api/api/base.api.ts b/lib/js-api/src/api/auth-rest-api/api/base.api.ts new file mode 100644 index 0000000000..999709a57c --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/api/base.api.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient } from '../../../api-clients/http-client.interface'; + +export abstract class BaseApi extends ApiClient { + override get apiClient(): LegacyHttpClient { + return this.httpClient ?? this.alfrescoApi.authClient; + } +} diff --git a/lib/js-api/src/api/auth-rest-api/api/index.ts b/lib/js-api/src/api/auth-rest-api/api/index.ts new file mode 100644 index 0000000000..2bdc302141 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/api/index.ts @@ -0,0 +1,18 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './authentication.api'; diff --git a/lib/js-api/src/api/auth-rest-api/docs/AuthenticationApi.md b/lib/js-api/src/api/auth-rest-api/docs/AuthenticationApi.md new file mode 100644 index 0000000000..9f84465a9c --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/docs/AuthenticationApi.md @@ -0,0 +1,141 @@ +# AuthenticationApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/authentication/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createTicket**](AuthenticationApi.md#createTicket) | **POST** /tickets | Create ticket (login) +[**deleteTicket**](AuthenticationApi.md#deleteTicket) | **DELETE** /tickets/-me- | Delete ticket (logout) +[**validateTicket**](AuthenticationApi.md#validateTicket) | **GET** /tickets/-me- | Validate ticket + + +<a name="createTicket"></a> +## createTicket +> TicketEntry createTicket(ticketBodyCreate) + +Create ticket (login) + +**Note:** this endpoint is available in Alfresco 5.2 and newer versions. + +Logs in and returns the new authentication ticket. + +The userId and password properties are mandatory in the request body. For example: +JSON +{ + \"userId\": \"jbloggs\", + \"password\": \"password\" +} + +To use the ticket in future requests you should pass it in the request header. +For example using Javascript: + Javascript + request.setRequestHeader (\"Authorization\", \"Basic \" + btoa(ticket)); + + + +### Example + +```javascript +import { AlfrescoApi, AuthenticationApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const authenticationApi = new AuthenticationApi(alfrescoApi); + + +authenticationApi.createTicket(ticketBodyCreate).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ticketBodyCreate** | [**TicketBody**](TicketBody.md)| The user credential. | + +### Return type + +[**TicketEntry**](TicketEntry.md) + +<a name="deleteTicket"></a> +## deleteTicket +> deleteTicket() + +Delete ticket (logout) + +**Note:** this endpoint is available in Alfresco 5.2 and newer versions. + +Deletes logged in ticket (logout). + + +### Example + +```javascript +import { AlfrescoApi, AuthenticationApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const authenticationApi = new AuthenticationApi(alfrescoApi); + +authenticationApi.deleteTicket().then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +<a name="validateTicket"></a> +## validateTicket +> ValidTicketEntry validateTicket() + +Validate ticket + +**Note:** this endpoint is available in Alfresco 5.2 and newer versions. + +Validates the specified ticket (derived from Authorization header) is still valid. + +For example, you can pass the Authorization request header using Javascript: + Javascript + request.setRequestHeader (\"Authorization\", \"Basic \" + btoa(ticket)); + + + +### Example + +```javascript +import { AlfrescoApi, AuthenticationApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const authenticationApi = new AuthenticationApi(alfrescoApi); + +authenticationApi.validateTicket().then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ValidTicketEntry**](ValidTicketEntry.md) + diff --git a/lib/js-api/src/api/auth-rest-api/docs/Error.md b/lib/js-api/src/api/auth-rest-api/docs/Error.md new file mode 100644 index 0000000000..9beb7f2852 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/docs/Error.md @@ -0,0 +1,8 @@ +# ModelError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorError**](ErrorError.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/auth-rest-api/docs/Error_error.md b/lib/js-api/src/api/auth-rest-api/docs/Error_error.md new file mode 100644 index 0000000000..f8b473d9af --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/docs/Error_error.md @@ -0,0 +1,13 @@ +# ErrorError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errorKey** | **string** | | [optional] [default to null] +**statusCode** | **number** | | [default to null] +**briefSummary** | **string** | | [default to null] +**stackTrace** | **string** | | [default to null] +**descriptionURL** | **string** | | [default to null] +**logId** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/auth-rest-api/docs/Ticket.md b/lib/js-api/src/api/auth-rest-api/docs/Ticket.md new file mode 100644 index 0000000000..26c2a39fe5 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/docs/Ticket.md @@ -0,0 +1,9 @@ +# Ticket + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**userId** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/auth-rest-api/docs/TicketBody.md b/lib/js-api/src/api/auth-rest-api/docs/TicketBody.md new file mode 100644 index 0000000000..bf25b4f385 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/docs/TicketBody.md @@ -0,0 +1,9 @@ +# TicketBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userId** | **string** | | [optional] [default to null] +**password** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/auth-rest-api/docs/TicketEntry.md b/lib/js-api/src/api/auth-rest-api/docs/TicketEntry.md new file mode 100644 index 0000000000..f492be4eb2 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/docs/TicketEntry.md @@ -0,0 +1,8 @@ +# TicketEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Ticket**](Ticket.md) | | [default to null] + + diff --git a/lib/js-api/src/api/auth-rest-api/docs/ValidTicket.md b/lib/js-api/src/api/auth-rest-api/docs/ValidTicket.md new file mode 100644 index 0000000000..7912c4aa9e --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/docs/ValidTicket.md @@ -0,0 +1,8 @@ +# ValidTicket + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/auth-rest-api/docs/ValidTicketEntry.md b/lib/js-api/src/api/auth-rest-api/docs/ValidTicketEntry.md new file mode 100644 index 0000000000..6ee54843ae --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/docs/ValidTicketEntry.md @@ -0,0 +1,8 @@ +# ValidTicketEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**ValidTicket**](ValidTicket.md) | | [default to null] + + diff --git a/lib/js-api/src/api/auth-rest-api/index.ts b/lib/js-api/src/api/auth-rest-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/auth-rest-api/model/index.ts b/lib/js-api/src/api/auth-rest-api/model/index.ts new file mode 100644 index 0000000000..c0a2f083cc --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/model/index.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './ticket'; +export * from './ticketBody'; +export * from './ticketEntry'; +export * from './validTicket'; +export * from './validTicketEntry'; diff --git a/lib/js-api/src/api/auth-rest-api/model/ticket.ts b/lib/js-api/src/api/auth-rest-api/model/ticket.ts new file mode 100644 index 0000000000..a79f65978b --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/model/ticket.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class Ticket { + id?: string; + userId?: string; + + constructor(input?: Partial<Ticket>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/auth-rest-api/model/ticketBody.ts b/lib/js-api/src/api/auth-rest-api/model/ticketBody.ts new file mode 100644 index 0000000000..9add2c0290 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/model/ticketBody.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class TicketBody { + userId?: string; + password?: string; + + constructor(input?: Partial<TicketBody>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/auth-rest-api/model/ticketEntry.ts b/lib/js-api/src/api/auth-rest-api/model/ticketEntry.ts new file mode 100644 index 0000000000..2b7aab241c --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/model/ticketEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Ticket } from './ticket'; + +export class TicketEntry { + entry: Ticket; + + constructor(input?: Partial<TicketEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Ticket(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/auth-rest-api/model/validTicket.ts b/lib/js-api/src/api/auth-rest-api/model/validTicket.ts new file mode 100644 index 0000000000..de90ad4e2a --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/model/validTicket.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ValidTicket { + id?: string; + + constructor(input?: Partial<ValidTicket>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/auth-rest-api/model/validTicketEntry.ts b/lib/js-api/src/api/auth-rest-api/model/validTicketEntry.ts new file mode 100644 index 0000000000..be64280726 --- /dev/null +++ b/lib/js-api/src/api/auth-rest-api/model/validTicketEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ValidTicket } from './validTicket'; + +export class ValidTicketEntry { + entry: ValidTicket; + + constructor(input?: Partial<ValidTicketEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new ValidTicket(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-custom-api/api/base.api.ts b/lib/js-api/src/api/content-custom-api/api/base.api.ts new file mode 100644 index 0000000000..f952ab8b32 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/api/base.api.ts @@ -0,0 +1,56 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient, RequestOptions } from '../../../api-clients/http-client.interface'; +import { AlfrescoApiType, LegacyTicketApi } from '../../../to-deprecate/alfresco-api-type'; + +export abstract class BaseApi extends ApiClient { + protected declare httpClient: LegacyHttpClient & LegacyTicketApi; + + /** @deprecated */ + constructor(legacyApi?: AlfrescoApiType); + constructor(httpClient: LegacyHttpClient & LegacyTicketApi); + constructor(httpClient?: AlfrescoApiType | (LegacyHttpClient & LegacyTicketApi)) { + super(httpClient as AlfrescoApiType); + } + + // TODO: Find a way to remove this hack from the legacy version :/ + get apiClientPrivate(): LegacyHttpClient & LegacyTicketApi { + return this.httpClient ?? this.alfrescoApi.contentPrivateClient; + } + + override get apiClient(): LegacyHttpClient & LegacyTicketApi { + return this.httpClient ?? this.alfrescoApi.contentClient; + } + + override post<T = any>(options: RequestOptions): Promise<T> { + return this.apiClientPrivate.post<T>(options); + } + + override put<T = any>(options: RequestOptions): Promise<T> { + return this.apiClientPrivate.put<T>(options); + } + + override get<T = any>(options: RequestOptions): Promise<T> { + return this.apiClientPrivate.get<T>(options); + } + + override delete<T = void>(options: RequestOptions): Promise<T> { + return this.apiClientPrivate.delete(options); + } +} diff --git a/lib/js-api/src/api/content-custom-api/api/classes.api.ts b/lib/js-api/src/api/content-custom-api/api/classes.api.ts new file mode 100755 index 0000000000..fd9934ff9e --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/api/classes.api.ts @@ -0,0 +1,58 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassDescription } from '../model/classDescription'; +import { BaseApi } from './base.api'; + +/** + * Constructs a new ClassesApi. + */ +export class ClassesApi extends BaseApi { + /** + * Gets the class information for the specified className. + * + * @param className The identifier of the class. + * @returns a Promise, with data of type ClassDescription + */ + getClass(className: string): Promise<ClassDescription> { + // verify the required parameter 'className' is set + if (className === undefined || className === null) { + throw new Error(`Missing param 'className' in getClass`); + } + + return this.get<ClassDescription>({ + path: '/api/classes/{className}', + pathParams: { className }, + returnType: ClassDescription, + contextRoot: this.apiClientPrivate.config.contextRoot + '/s' + }); + } + + getSubclasses(className: string): Promise<ClassDescription[]> { + // verify the required parameter 'className' is set + if (className === undefined || className === null) { + throw new Error(`Missing param 'className'`); + } + + return this.get({ + path: `/api/classes/{className}/subclasses`, + pathParams: { className }, + returnType: ClassDescription, + contextRoot: this.apiClientPrivate.config.contextRoot + '/s' + }); + } +} diff --git a/lib/js-api/src/api/content-custom-api/api/content.api.ts b/lib/js-api/src/api/content-custom-api/api/content.api.ts new file mode 100644 index 0000000000..42bea7ad92 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/api/content.api.ts @@ -0,0 +1,142 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; + +export class ContentApi extends BaseApi { + + /** + * Get thumbnail URL for the given nodeId + * + * @param nodeId The ID of the document node + * @param [attachment=false] Retrieve content as an attachment for download + * @param [ticket] Custom ticket to use for authentication + * @returns The URL address pointing to the content. + */ + getDocumentThumbnailUrl(nodeId: string, attachment?: boolean, ticket?: string): string { + return this.apiClient.basePath + '/nodes/' + nodeId + + '/renditions/doclib/content' + + '?attachment=' + (attachment ? 'true' : 'false') + + this.apiClient.getAlfTicket(ticket); + } + + /** + * Get preview URL for the given nodeId + * + * @param nodeId The ID of the document node + * @param [attachment=false] Retrieve content as an attachment for download + * @param [ticket] Custom ticket to use for authentication + * @returns The URL address pointing to the content. + */ + getDocumentPreviewUrl(nodeId: string, attachment?: boolean, ticket?: string): string { + return this.apiClient.basePath + '/nodes/' + nodeId + + '/renditions/imgpreview/content' + + '?attachment=' + (attachment ? 'true' : 'false') + + this.apiClient.getAlfTicket(ticket); + } + + /** + * Get content URL for the given nodeId + * + * @param nodeId The ID of the document node + * @param [attachment=false] Retrieve content as an attachment for download + * @param [ticket] Custom ticket to use for authentication + * @returns The URL address pointing to the content. + */ + getContentUrl(nodeId: string, attachment?: boolean, ticket?: string): string { + return this.apiClient.basePath + '/nodes/' + nodeId + + '/content' + + '?attachment=' + (attachment ? 'true' : 'false') + + this.apiClient.getAlfTicket(ticket); + } + + /** + * Get rendition URL for the given nodeId + * + * @param nodeId The ID of the document node + * @param encoding of the document + * @param [attachment=false] retrieve content as an attachment for download + * @param [ticket] Custom ticket to use for authentication + * @returns The URL address pointing to the content. + */ + getRenditionUrl(nodeId: string, encoding: string, attachment?: boolean, ticket?: string): string { + return this.apiClient.basePath + '/nodes/' + nodeId + + '/renditions/' + encoding + '/content' + + '?attachment=' + (attachment ? 'true' : 'false') + + this.apiClient.getAlfTicket(ticket); + } + + /** + * Get version's rendition URL for the given nodeId + * + * @param nodeId The ID of the document node + * @param versionId The ID of the version + * @param encoding of the document + * @param [attachment=false] retrieve content as an attachment for download + * @param [ticket] Custom ticket to use for authentication + * @returns The URL address pointing to the content. + */ + getVersionRenditionUrl(nodeId: string, versionId: string, encoding: string, attachment?: boolean, ticket?: string): string { + return this.apiClient.basePath + '/nodes/' + nodeId + '/versions/' + versionId + + '/renditions/' + encoding + '/content' + + '?attachment=' + (attachment ? 'true' : 'false') + + this.apiClient.getAlfTicket(ticket); + } + + /** + * Get content URL for the given nodeId and versionId + * + * @param nodeId The ID of the document node + * @param versionId The ID of the version + * @param [attachment=false] Retrieve content as an attachment for download + * @param [ticket] Custom ticket to use for authentication + * @returns The URL address pointing to the content. + */ + getVersionContentUrl(nodeId: string, versionId: string, attachment?: boolean, ticket?: string): string { + return this.apiClient.basePath + '/nodes/' + nodeId + + '/versions/' + versionId + '/content' + + '?attachment=' + (attachment ? 'true' : 'false') + + this.apiClient.getAlfTicket(ticket); + } + + /** + * Get content url for the given shared link id + * + * @param linkId - The ID of the shared link + * @param [attachment=false] Retrieve content as an attachment for download + * @returns The URL address pointing to the content. + */ + getSharedLinkContentUrl(linkId: string, attachment?: boolean): string { + return this.apiClient.basePath + '/shared-links/' + linkId + + '/content' + + '?attachment=' + (attachment ? 'true' : 'false'); + } + + /** + * Gets the rendition content for file with shared link identifier sharedId. + * + * @param sharedId - The identifier of a shared link to a file. + * @param renditionId - The name of a thumbnail rendition, for example doclib, or pdf. + * @param [attachment=false] Retrieve content as an attachment for download + * @returns The URL address pointing to the content. + */ + getSharedLinkRenditionUrl(sharedId: string, renditionId: string, attachment?: boolean): string { + return this.apiClient.basePath + '/shared-links/' + sharedId + + '/renditions/' + renditionId + '/content' + + '?attachment=' + (attachment ? 'true' : 'false'); + } +} diff --git a/lib/js-api/src/api/content-custom-api/api/customModel.api.ts b/lib/js-api/src/api/content-custom-api/api/customModel.api.ts new file mode 100644 index 0000000000..da2af52286 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/api/customModel.api.ts @@ -0,0 +1,577 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PaginatedList, PaginatedEntries } from '../model/pagination'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +export interface CustomModel { + name: string; + namespacePrefix: string; + description: string; + author: string; + namespaceUri: string; + status: 'ACTIVE' | 'DRAFT'; +} + +export interface CustomType { + name?: string; + parentName?: string; + prefixedName?: string; + description?: string; + properties?: CustomModelProperty[]; + title?: string; +} + +export interface CustomAspect { + description?: string; + name?: string; + parentName?: string; + prefixedName?: string; + properties?: CustomModelProperty[]; + title?: string; +} + +export interface CustomModelProperty { + name?: string; + prefixedName?: string; + title?: string; + dataType?: string; + facetable?: 'FALSE' | 'TRUE'; + indexTokenisationMode?: 'FALSE' | 'TRUE'; + constraints?: CustomModelPropertyConstraint[]; + multiValued?: boolean; + mandatoryEnforced?: boolean; + mandatory?: boolean; + indexed?: boolean; +} + +export interface CustomModelPropertyConstraint { + name: string; + prefixedName: string; + type: string; + parameters: any[]; +} + +/** + * Constructs a new CustomModelApi. + */ +export class CustomModelApi extends BaseApi { + private = true; + + /** + * create Custom Model + */ + createCustomModel(status: string, description: string, name: string, namespaceUri: string, namespacePrefix: string, author?: string): Promise<{ entry: CustomModel }> { + throwIfNotDefined(namespaceUri, 'namespaceUri'); + throwIfNotDefined(namespacePrefix, 'namespacePrefix'); + + const bodyParam = { + status, + description, + name, + namespaceUri, + namespacePrefix, + author + }; + + return this.post({ + path: 'cmm', + bodyParam + }); + } + + /** + * Create a custom type + */ + createCustomType(modelName: string, name: string, parentName?: string, title?: string, description?: string): Promise<{ entry: CustomType }> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(name, 'name'); + + const bodyParam = { + name, + parentName, + title, + description + }; + + const pathParams = { + modelName + }; + + return this.post({ + path: 'cmm/{modelName}/types', + bodyParam, + pathParams + }); + } + + /** + * Create a custom aspect + */ + createCustomAspect(modelName: string, name: string, parentName?: string, title?: string, description?: string): Promise<any> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(name, 'name'); + + const bodyParam = { + name, + parentName, + title, + description + }; + + const pathParams = { + modelName + }; + + return this.post({ + path: 'cmm/{modelName}/aspects', + bodyParam, + pathParams + }); + } + + /** + * Create a custom constraint + */ + createCustomConstraint(modelName: string, name: string, type: string, parameters?: any): Promise<any> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(type, 'type'); + throwIfNotDefined(name, 'name'); + + const bodyParam = { + name, + type, + parameters + }; + + const pathParams = { + modelName + }; + + return this.post({ + path: 'cmm/{modelName}/constraints', + bodyParam, + pathParams + }); + } + + /** + * Activate the custom model + */ + activateCustomModel(modelName: string): Promise<{ entry: CustomModel }> { + throwIfNotDefined(modelName, 'modelName'); + + const bodyParam = { + status: 'ACTIVE' + }; + + const pathParams = { + modelName + }; + + return this.put({ + path: 'cmm/{modelName}?select=status', + bodyParam, + pathParams + }); + } + + /** + * Deactivate the custom model + */ + deactivateCustomModel(modelName: string): Promise<{ entry: CustomModel }> { + throwIfNotDefined(modelName, 'modelName'); + + const bodyParam = { + status: 'DRAFT' + }; + + const pathParams = { + modelName + }; + + return this.put({ + path: 'cmm/{modelName}?select=status', + bodyParam, + pathParams + }); + } + + /** + * Add property into an existing aspect + */ + addPropertyToAspect(modelName: string, aspectName: string, properties?: CustomModelProperty[]): Promise<CustomAspect> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(aspectName, 'aspectName'); + + const bodyParam = { + name: aspectName, + properties + }; + + const pathParams = { + modelName, + aspectName + }; + + return this.put({ + path: 'cmm/{modelName}/aspects/{aspectName}?select=props', + bodyParam, + pathParams + }); + } + + /** + * Add Property into an existing type + */ + addPropertyToType(modelName: string, typeName: string, properties?: CustomModelProperty[]): Promise<CustomType> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(typeName, 'typeName'); + + const bodyParam = { + name: typeName, + properties + }; + + const pathParams = { + modelName, + typeName + }; + + return this.put({ + path: 'cmm/{modelName}/types/{typeName}?select=props', + bodyParam, + pathParams + }); + } + + /** + * Edit an existing custom model + */ + updateCustomModel(modelName: string, description?: string, namespaceUri?: string, namespacePrefix?: string, author?: string): Promise<any> { + throwIfNotDefined(modelName, 'modelName'); + + const bodyParam = { + name: modelName, + description, + namespaceUri, + namespacePrefix, + author + }; + + const pathParams = { + modelName + }; + + return this.put({ + path: 'cmm/{modelName}', + bodyParam, + pathParams + }); + } + + /** + * Edit an existing custom model type + */ + updateCustomType(modelName: string, typeName: string, description?: string, parentName?: string, title?: string): Promise<any> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(typeName, 'typeName'); + + const bodyParam = { + name: typeName, + parentName, + title, + description + }; + + const pathParams = { + modelName, + typeName + }; + + return this.put({ + path: 'cmm/{modelName}/types/{typeName}', + bodyParam, + pathParams + }); + } + + /** + * Edit an existing custom model aspect + */ + updateCustomAspect(modelName: string, aspectName: string, description?: string, parentName?: string, title?: string): Promise<any> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(aspectName, 'aspectName'); + + const bodyParam = { + name: aspectName, + parentName, + title, + description + }; + + const pathParams = { + modelName, + aspectName + }; + + return this.put({ + path: 'cmm/{modelName}/aspects/{aspectName}', + bodyParam, + pathParams + }); + } + + /** + * Get all custom models + */ + getAllCustomModel(): Promise<PaginatedEntries<CustomModel>> { + return this.get({ + path: 'cmm' + }); + } + + /** + * Get custom model + */ + getCustomModel(modelName: string, queryParams?: any): Promise<{ entry: CustomModel }> { + throwIfNotDefined(modelName, 'modelName'); + + const pathParams = { + modelName + }; + + return this.get({ + path: 'cmm/{modelName}', + pathParams, + queryParams + }); + } + + /** + * Get all custom model types + */ + getAllCustomType(modelName: string): Promise<PaginatedList<CustomType>> { + throwIfNotDefined(modelName, 'modelName'); + + const pathParams = { + modelName + }; + + return this.get({ + path: 'cmm/{modelName}/types', + pathParams + }); + } + + /** + * Get custom model type + */ + getCustomType(modelName: string, typeName?: string, queryParams?: any): Promise<{ entry: CustomType }> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(typeName, 'typeName'); + + const pathParams = { + modelName, + typeName + }; + + return this.get({ + path: 'cmm/{modelName}/types/{typeName}', + pathParams, + queryParams + }); + } + + /** + * Get all custom model aspect + */ + getAllCustomAspect(modelName: string, queryParams?: any): Promise<PaginatedList<CustomAspect>> { + throwIfNotDefined(modelName, 'modelName'); + + const pathParams = { + modelName + }; + + return this.get({ + path: 'cmm/{modelName}/aspects', + pathParams, + queryParams + }); + } + + /** + * Get custom model aspect + */ + getCustomAspect(modelName: string, aspectName: string, queryParams?: any): Promise<{ entry: CustomAspect }> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(aspectName, 'aspectName'); + + const pathParams = { + modelName, + aspectName + }; + + return this.get({ + path: 'cmm/{modelName}/aspects/{aspectName}', + pathParams, + queryParams + }); + } + + /** + * Get all custom model defined constraints + */ + getAllCustomConstraints(modelName: string, queryParams?: any): Promise<any> { + throwIfNotDefined(modelName, 'modelName'); + + const pathParams = { + modelName + }; + + return this.get({ + path: 'cmm/{modelName}/constraints', + pathParams, + queryParams + }); + } + + /** + * Get custom model defined constraints + */ + getCustomConstraints(modelName: string, constraintName: string, queryParams?: any): Promise<any> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(constraintName, 'constraintName'); + + const pathParams = { + modelName, + constraintName + }; + + return this.get({ + path: 'cmm/{modelName}/constraints{constraintName}', + pathParams, + queryParams + }); + } + + /** + * Delete the given custom model + */ + deleteCustomModel(modelName: string): Promise<void> { + throwIfNotDefined(modelName, 'modelName'); + + const pathParams = { + modelName + }; + + return this.delete({ + path: 'cmm/{modelName}', + pathParams + }); + } + + /** + * Delete the given custom type + */ + deleteCustomType(modelName: string, typeName: string): Promise<void> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(typeName, 'typeName'); + + const pathParams = { + modelName, + typeName + }; + + return this.delete({ + path: 'cmm/{modelName}/types/{typeName}', + pathParams + }); + } + + deleteCustomAspect(modelName: string, aspectName: string): Promise<void> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(aspectName, 'aspectName'); + + const pathParams = { + modelName, + aspectName + }; + + return this.delete({ + path: 'cmm/{modelName}/aspects/{aspectName}', + pathParams + }); + } + + deleteCustomAspectProperty(modelName: string, aspectName: string, propertyName: string): Promise<{ entry: CustomAspect }> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(aspectName, 'aspectName'); + throwIfNotDefined(propertyName, 'propertyName'); + + const bodyParam = { + name: aspectName + }; + + const pathParams = { + modelName, + aspectName + }; + + const queryParams = { + select: 'props', + delete: propertyName, + update: true + }; + + return this.put({ + path: 'cmm/{modelName}/aspects/{aspectName}', + bodyParam, + pathParams, + queryParams + }); + } + + deleteCustomTypeProperty(modelName: string, typeName: string, propertyName: string): Promise<{ entry: CustomType }> { + throwIfNotDefined(modelName, 'modelName'); + throwIfNotDefined(typeName, 'typeName'); + throwIfNotDefined(propertyName, 'propertyName'); + + const bodyParam = { + name: typeName + }; + + const pathParams = { + modelName, + typeName + }; + + const queryParams = { + select: 'props', + delete: propertyName, + update: true + }; + + return this.put({ + path: 'cmm/{modelName}/types/{typeName}', + bodyParam, + pathParams, + queryParams + }); + } +} diff --git a/lib/js-api/src/api/content-custom-api/api/index.ts b/lib/js-api/src/api/content-custom-api/api/index.ts new file mode 100644 index 0000000000..ead074fa07 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/api/index.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './webscript.api'; +export * from './classes.api'; +export * from './upload.api'; +export * from './content.api'; +export * from './customModel.api'; diff --git a/lib/js-api/src/api/content-custom-api/api/upload.api.ts b/lib/js-api/src/api/content-custom-api/api/upload.api.ts new file mode 100644 index 0000000000..6d4fd0a349 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/api/upload.api.ts @@ -0,0 +1,50 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodesApi } from '../../content-rest-api/api/nodes.api'; +import { NodeBodyCreate, NodeEntry, CreateNodeOpts } from '../../content-rest-api'; + +export interface UploadFileOpts extends CreateNodeOpts { + name?: string; + renditions?: string; +} + +export class UploadApi extends NodesApi { + uploadFile(fileDefinition: any, relativePath?: string, rootFolderId?: string, nodeBody?: NodeBodyCreate, opts?: UploadFileOpts): Promise<NodeEntry | any> { + rootFolderId = rootFolderId || '-root-'; + opts = opts || {}; + + const nodeBodyRequired = { + name: fileDefinition.name, + nodeType: 'cm:content', + relativePath + }; + + nodeBody = Object.assign(nodeBodyRequired, nodeBody); + + let formParam = Object.assign({}, nodeBody.properties || {}); + formParam.filedata = fileDefinition; + formParam.relativePath = relativePath; + if (opts.name) { + formParam.name = opts.name; + } + + formParam = Object.assign(formParam, opts); + + return this.createNode(rootFolderId, nodeBody, opts, formParam); + } +} diff --git a/lib/js-api/src/api/content-custom-api/api/webscript.api.ts b/lib/js-api/src/api/content-custom-api/api/webscript.api.ts new file mode 100644 index 0000000000..e644f6a048 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/api/webscript.api.ts @@ -0,0 +1,76 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; + +/** + * Constructs a new WebscriptApi. + */ +export class WebscriptApi extends BaseApi { + allowedMethod: string[] = ['GET', 'POST', 'PUT', 'DELETE']; + + /** + * Call a get on a Web Scripts see https://wiki.alfresco.com/wiki/Web_Scripts for more details about Web Scripts + * Url syntax definition : http[s]://<host>:<port>/[<contextPath>/]/<servicePath>[/<scriptPath>][?<scriptArgs>] + * example: http://localhost:8081/share/service/mytasks?priority=1 + * + * @param httpMethod GET, POST, PUT and DELETE + * @param scriptPath script path + * @param scriptArgs script arguments + * @param contextRoot default value alfresco + * @param servicePath default value service + * @param postBody post body + * @returns A promise that is resolved return the webScript data and {error} if rejected. + */ + executeWebScript( + httpMethod: string, + scriptPath: string, + scriptArgs?: any, + contextRoot?: string, + servicePath?: string, + postBody?: any + ): Promise<any> { + contextRoot = contextRoot || 'alfresco'; + servicePath = servicePath || 'service'; + postBody = postBody || null; + + if (!httpMethod || this.allowedMethod.indexOf(httpMethod) === -1) { + throw new Error('method allowed value GET, POST, PUT and DELETE'); + } + + if (!scriptPath) { + throw new Error('Missing param scriptPath in executeWebScript'); + } + + const contentTypes = ['application/json']; + const accepts = ['application/json', 'text/html']; + + return this.apiClient.callApi( + '/' + servicePath + '/' + scriptPath, + httpMethod, + {}, + scriptArgs, + {}, + {}, + postBody, + contentTypes, + accepts, + null, + contextRoot + ); + } +} diff --git a/lib/js-api/src/api/content-custom-api/docs/UploadApi.md b/lib/js-api/src/api/content-custom-api/docs/UploadApi.md new file mode 100644 index 0000000000..9c3628542b --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/docs/UploadApi.md @@ -0,0 +1,31 @@ +# UploadApi + + +| Method | Description | +|-------------------------------------------|---------------------| +| [**uploadFile**](UploadApi.md#uploadFile) | upload file content | + + +<a name="uploadFile"></a> +# **uploadFile** +> uploadFile(fileDefinition, relativePath: string, rootFolderId: string, nodeBody: any, opts?: any): Promise<NodeEntry | any> + + +**Example** + +```javascript +const alfrescoApi = new AlfrescoApi(/*...*/); +const fs = require('fs'); +const uploadApi = new UploadApi(alfrescoApi); +const fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt'); + +uploadApi.uploadFile(fileToUpload).then( + () => { + console.log('File Uploaded in the root'); + }, + (error) => { + console.log('Error during the upload' + error); + }); +``` + + diff --git a/lib/js-api/src/api/content-custom-api/docs/WebscriptApi.md b/lib/js-api/src/api/content-custom-api/docs/WebscriptApi.md new file mode 100644 index 0000000000..9667ea0f55 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/docs/WebscriptApi.md @@ -0,0 +1,58 @@ +# WebscriptApi + + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**executeWebScript**](WebscriptApi.md#executeWebScript) | | execute WebScript + + +<a name="executeWebScript"></a> +# **executeWebScript** +> executeWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath) + + +For mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples) + +> Anatomy of a Web Script URI **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)** +A Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts. + +### Parameters +Name | Type | Description | Notes| +------------- | ------------- | ------------- | ------------- +**httpMethod** | **String**| possible value GET, POST, PUT and DELETE || +**scriptPath** | **String**|path to Web Script (as defined by Web Script)|| +**scriptArgs** | **String**|arguments to pass to Web Script || +**contextRoot** | **String**|path where application is deployed default value 'alfresco'|| +**servicePath** | **String**|path where Web Script service is mapped default value 'service'|| +**postBody** | **Object**|post body|| + +### Example + +```javascript + +//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks + +this.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) { + console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data); +}, function (error) { + console.log('Error' + error); +}); + +//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks + +this.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) { + console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data); +}, function (error) { + console.log('Error' + error); +}); + +//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks + +this.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) { + console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data); +}, function (error) { + console.log('Error' + error); +}); + +``` + diff --git a/lib/js-api/src/api/content-custom-api/index.ts b/lib/js-api/src/api/content-custom-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/content-custom-api/model/classDescription.ts b/lib/js-api/src/api/content-custom-api/model/classDescription.ts new file mode 100644 index 0000000000..fbaec5e1c4 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/model/classDescription.ts @@ -0,0 +1,41 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassPropertyDescription } from './classPropertyDescription'; + +export class ClassDescription { + + associations?: any; + childassociations?: any; + defaultAspects?: any; + description?: string; + isAspect?: boolean; + isContainer?: boolean; + name?: string; + parent?: any; + properties?: { + [key: string]: ClassPropertyDescription; + }; + title?: string; + url?: string; + + constructor(input?: Partial<ClassDescription>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-custom-api/model/classPropertyDescription.ts b/lib/js-api/src/api/content-custom-api/model/classPropertyDescription.ts new file mode 100644 index 0000000000..0396670084 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/model/classPropertyDescription.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ClassPropertyDescription { + + dataType?: string; + defaultValue?: string; + description?: string; + enforced?: boolean; + indexed?: boolean; + mandatory?: boolean; + multiValued?: boolean; + name?: string; + protected?: boolean; + title?: string; + url?: string; + + constructor(input?: Partial<ClassPropertyDescription>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-custom-api/model/dateAlfresco.ts b/lib/js-api/src/api/content-custom-api/model/dateAlfresco.ts new file mode 100644 index 0000000000..586b8d20a0 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/model/dateAlfresco.ts @@ -0,0 +1,83 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class DateAlfresco extends Date { + /** + * Parses an ISO-8601 string representation of a date value. + * + * @param dateToConvert The date value as a string. + * @returns The parsed date object. + */ + static parseDate(dateToConvert: any): Date { + if (dateToConvert instanceof Date) { + return dateToConvert; + } else if (typeof dateToConvert === 'number') { + return new Date(dateToConvert); + } + + const dateLength = 10; + const separatorPos = dateToConvert.substring(dateLength).search(/[+-]/) + dateLength; + const dateStr = separatorPos > dateLength ? dateToConvert.substring(0, separatorPos) : dateToConvert; + const tzStr = separatorPos > dateLength ? dateToConvert.substring(separatorPos) : ''; + const parsedDate = this.parseDateTime(dateStr); + const tzOffsetMins = this.parseDateTimeZone(tzStr); + parsedDate.setTime(parsedDate.getTime() + tzOffsetMins * 60000); + return parsedDate; + } + + /** + * Parses the date component of a ISO-8601 string representation of a date value. + * + * @param dateToConvert The date value as a string. + * @returns The parsed date object. + */ + static parseDateTime(dateToConvert: string): Date { + // TODO: review when Safari 10 is released + // return new Date(str.replace(/T/i, ' ')); + + // Compatible with Safari 9.1.2 + const dateParts = dateToConvert.split(/[^0-9]/).map(function(s) { + return parseInt(s, 10); + }); + return new Date( + Date.UTC( + dateParts[0], + dateParts[1] - 1 || 0, + dateParts[2] || 1, + dateParts[3] || 0, + dateParts[4] || 0, + dateParts[5] || 0, + dateParts[6] || 0 + ) + ); + } + + /** + * Parses the timezone component of a ISO-8601 string representation of a date value. + * + * @param dateToConvert The timezone offset as a string, e.g. '+0000', '+2000' or '-0500'. + * @returns The number of minutes offset from UTC. + */ + static parseDateTimeZone(dateToConvert: string): number { + const match = /([+-])(\d{2}):?(\d{2})?/.exec(dateToConvert); + if (match !== null) { + return parseInt(match[1] + '1', 10) * -1 * (parseInt(match[2], 10) * 60) + parseInt(match[3] || '0', 10); + } else { + return 0; + } + } +} diff --git a/lib/js-api/src/api/content-custom-api/model/index.ts b/lib/js-api/src/api/content-custom-api/model/index.ts new file mode 100644 index 0000000000..f38a7169d8 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/model/index.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './dateAlfresco'; +export * from './classDescription'; +export * from './classPropertyDescription'; +export * from './pagination'; diff --git a/lib/js-api/src/api/content-custom-api/model/pagination.ts b/lib/js-api/src/api/content-custom-api/model/pagination.ts new file mode 100644 index 0000000000..50efbd7a86 --- /dev/null +++ b/lib/js-api/src/api/content-custom-api/model/pagination.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api/model/pagination'; + +export interface PaginatedList<T> { + list: { + entries: Array<{ entry: T }>; + pagination: Pagination; + }; +} + +export interface PaginatedEntries<T> { + entries: T[]; + pagination: Pagination; +} diff --git a/lib/js-api/src/api/content-rest-api/README.md b/lib/js-api/src/api/content-rest-api/README.md new file mode 100644 index 0000000000..30e58672a0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/README.md @@ -0,0 +1,32 @@ +# **Core API** + +Provides access to the core features of Alfresco Content Services. + +## Endpoint Clients + +All URIs are relative to: + +```text +https://localhost/alfresco/api/-default-/public/alfresco/versions/1 +``` + +- [ActionsApi](docs/ActionsApi.md) +- [ActivitiesApi](docs/ActivitiesApi.md) +- [AuditApi](docs/AuditApi.md) +- [CommentsApi](docs/CommentsApi.md) +- [DownloadsApi](docs/DownloadsApi.md) +- [FavoritesApi](docs/FavoritesApi.md) +- [GroupsApi](docs/GroupsApi.md) +- [NetworksApi](docs/NetworksApi.md) +- [NodesApi](docs/NodesApi.md) +- [PeopleApi](docs/PeopleApi.md) +- [PreferencesApi](docs/PreferencesApi.md) +- [ProbesApi](docs/ProbesApi.md) +- [QueriesApi](docs/QueriesApi.md) +- [RatingsApi](docs/RatingsApi.md) +- [RenditionsApi](docs/RenditionsApi.md) +- [SharedlinksApi](docs/SharedlinksApi.md) +- [SitesApi](docs/SitesApi.md) +- [TagsApi](docs/TagsApi.md) +- [TrashcanApi](docs/TrashcanApi.md) +- [VersionsApi](docs/VersionsApi.md) \ No newline at end of file diff --git a/lib/js-api/src/api/content-rest-api/api/actions.api.ts b/lib/js-api/src/api/content-rest-api/api/actions.api.ts new file mode 100644 index 0000000000..a3bd446247 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/actions.api.ts @@ -0,0 +1,149 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActionBodyExec, ActionDefinitionEntry, ActionDefinitionList, ActionExecResultEntry } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentPagingQuery } from './types'; + +/** + * Actions service. + */ +export class ActionsApi extends BaseApi { + /** + * Retrieve the details of an action definition + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param actionDefinitionId The identifier of an action definition. + * @returns Promise<ActionDefinitionEntry> + */ + actionDetails(actionDefinitionId: string): Promise<ActionDefinitionEntry> { + throwIfNotDefined(actionDefinitionId, 'actionDefinitionId'); + + const pathParams = { + actionDefinitionId + }; + + return this.get({ + path: '/action-definitions/{actionDefinitionId}', + pathParams + }); + } + + /** + * Execute an action + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param actionBodyExec Action execution details + * @returns Promise<ActionExecResultEntry> + */ + actionExec(actionBodyExec: ActionBodyExec): Promise<ActionExecResultEntry> { + throwIfNotDefined(actionBodyExec, 'actionBodyExec'); + + return this.post({ + path: '/action-executions', + bodyParam: actionBodyExec + }); + } + + /** + * Retrieve list of available actions + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * Gets a list of all available actions + * + * The default sort order for the returned list is for actions to be sorted by ascending name. + * You can override the default by using the **orderBy** parameter. + * + * You can use any of the following fields to order the results: + * - name + * - title + * + * + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @returns Promise<ActionDefinitionList> + */ + listActions(opts?: { orderBy?: string[] } & ContentPagingQuery & ContentFieldsQuery): Promise<ActionDefinitionList> { + opts = opts || {}; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/action-definitions', + queryParams, + returnType: ActionDefinitionList + }); + } + + /** + * Retrieve actions for a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Retrieve the list of actions that may be executed against the given **nodeId**. + * The default sort order for the returned list is for actions to be sorted by ascending name. + * You can override the default by using the **orderBy** parameter. + * You can use any of the following fields to order the results: + * - name + * - title + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @returns Promise<ActionDefinitionList> + */ + nodeActions(nodeId: string, opts?: { orderBy?: string[] } & ContentPagingQuery & ContentFieldsQuery): Promise<ActionDefinitionList> { + throwIfNotDefined(nodeId, 'nodeId'); + opts = opts || {}; + + const pathParams = { + nodeId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/action-definitions', + pathParams, + queryParams, + returnType: ActionDefinitionList + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/activities.api.ts b/lib/js-api/src/api/content-rest-api/api/activities.api.ts new file mode 100644 index 0000000000..2f6faab012 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/activities.api.ts @@ -0,0 +1,67 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActivityPaging } from '../model/activityPaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentPagingQuery } from './types'; + +/** + * Activities service. + */ +export class ActivitiesApi extends BaseApi { + /** + * List activities + * + * Gets a list of activities for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @param opts.who A filter to include the user's activities only me, other user's activities only others' + * @param opts.siteId Include only activity feed entries relating to this site. + * @returns Promise<ActivityPaging> + */ + listActivitiesForPerson( + personId: string, + opts?: { + who?: string; + siteId?: string; + } & ContentPagingQuery & + ContentFieldsQuery + ): Promise<ActivityPaging> { + throwIfNotDefined(personId, 'personId'); + opts = opts || {}; + + const pathParams = { + personId + }; + + const queryParams = { + ...opts, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/activities', + pathParams, + queryParams, + returnType: ActivityPaging + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/audit.api.ts b/lib/js-api/src/api/content-rest-api/api/audit.api.ts new file mode 100644 index 0000000000..834ae27bdb --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/audit.api.ts @@ -0,0 +1,347 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditApp, AuditAppPaging, AuditBodyUpdate, AuditEntryEntry, AuditEntryPaging } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +/** + * Audit service. + */ +export class AuditApi extends BaseApi { + /** + * Permanently delete audit entries for an audit application + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * Permanently delete audit entries for an audit application **auditApplicationId**. + * The **where** clause must be specified, either with an inclusive time period or for + * an inclusive range of ids. The delete is within the context of the given audit application. + * For example: + * - where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00') + * - where=(id BETWEEN ('1234', '4321') + * You must have admin rights to delete audit information. + * + * @param auditApplicationId The identifier of an audit application. + * @param where Audit entries to permanently delete for an audit application, given an inclusive time period or range of ids. For example: + * - where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00') + * - where=(id BETWEEN ('1234', '4321') + * @return Promise<{}> + */ + deleteAuditEntriesForAuditApp(auditApplicationId: string, where: string): Promise<void> { + throwIfNotDefined(auditApplicationId, 'auditApplicationId'); + throwIfNotDefined(where, 'where'); + + const pathParams = { + auditApplicationId + }; + + const queryParams = { + where + }; + + return this.delete({ + path: '/audit-applications/{auditApplicationId}/audit-entries', + pathParams, + queryParams + }); + } + + /** + * Permanently delete an audit entry + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * You must have admin rights to delete audit information. + * + * @param auditApplicationId The identifier of an audit application. + * @param auditEntryId The identifier of an audit entry. + * @return Promise<{}> + */ + deleteAuditEntry(auditApplicationId: string, auditEntryId: string): Promise<void> { + throwIfNotDefined(auditApplicationId, 'auditApplicationId'); + throwIfNotDefined(auditEntryId, 'auditEntryId'); + + const pathParams = { + auditApplicationId, + auditEntryId + }; + + return this.delete({ + path: '/audit-applications/{auditApplicationId}/audit-entries/{auditEntryId}', + pathParams + }); + } + + /** + * Get audit application info + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * You must have admin rights to retrieve audit information. + * + * You can use the **include** parameter to return the minimum and/or maximum audit record id for the application. + * + * @param auditApplicationId The identifier of an audit application. + * @param opts Optional parameters + * @return Promise<AuditApp> + */ + getAuditApp(auditApplicationId: string, opts?: ContentFieldsQuery & ContentIncludeQuery): Promise<AuditApp> { + throwIfNotDefined(auditApplicationId, 'auditApplicationId'); + + const pathParams = { + auditApplicationId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv'), + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.get({ + path: '/audit-applications/{auditApplicationId}', + pathParams, + queryParams + }); + } + + /** + * Get audit entry + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * You must have admin rights to access audit information. + * + * @param auditApplicationId The identifier of an audit application. + * @param auditEntryId The identifier of an audit entry. + * @param opts Optional parameters + * @return Promise<AuditEntryEntry> + */ + getAuditEntry(auditApplicationId: string, auditEntryId: string, opts?: ContentFieldsQuery): Promise<AuditEntryEntry> { + throwIfNotDefined(auditApplicationId, 'auditApplicationId'); + throwIfNotDefined(auditEntryId, 'auditEntryId'); + + const pathParams = { + auditApplicationId, + auditEntryId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/audit-applications/{auditApplicationId}/audit-entries/{auditEntryId}', + pathParams, + queryParams, + returnType: AuditEntryEntry + }); + } + + /** + * Gets a list of audit applications in this repository. + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * This list may include pre-configured audit applications, if enabled, such as: + * + * - alfresco-access + * - CMISChangeLog + * - Alfresco Tagging Service + * - Alfresco Sync Service (used by Enterprise Cloud Sync) + * + * You must have admin rights to retrieve audit information. + * + * @param opts Optional parameters + * @return Promise<AuditAppPaging> + */ + listAuditApps(opts?: ContentPagingQuery & ContentFieldsQuery): Promise<AuditAppPaging> { + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/audit-applications', + queryParams, + returnType: AuditAppPaging + }); + } + + /** + * List audit entries for an audit application + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * Gets a list of audit entries for audit application **auditApplicationId**. + * You can use the **include** parameter to return additional **values** information. + * The list can be filtered by one or more of: + * - **createdByUser** person id + * - **createdAt** inclusive time period + * - **id** inclusive range of ids + * - **valuesKey** audit entry values contains the exact matching key + * - **valuesValue** audit entry values contains the exact matching value + * + * The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC** + * modifier to specify an ascending or descending sort order. + * + * For example, specifying orderBy=createdAt DESC returns audit entries in descending **createdAt** order. + * You must have admin rights to retrieve audit information. + * + * @param auditApplicationId The identifier of an audit application. + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.where Optionally filter the list. Here are some examples: + * - where=(createdByUser='jbloggs') + * - where=(id BETWEEN ('1234', '4321') + * - where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00') + * - where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00') + * - where=(valuesKey='/alfresco-access/login/user') + * - where=(valuesKey='/alfresco-access/transaction/action' and valuesValue='DELETE') + * @returns Promise<AuditEntryPaging> + */ + listAuditEntriesForAuditApp( + auditApplicationId: string, + opts?: { + where?: string; + orderBy?: string[]; + } & ContentPagingQuery & + ContentFieldsQuery & + ContentIncludeQuery + ): Promise<AuditEntryPaging> { + throwIfNotDefined(auditApplicationId, 'auditApplicationId'); + opts = opts || {}; + + const pathParams = { + auditApplicationId + }; + + const queryParams = { + skipCount: opts?.skipCount, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + maxItems: opts?.maxItems, + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/audit-applications/{auditApplicationId}/audit-entries', + pathParams, + queryParams, + returnType: AuditEntryPaging + }); + } + + /** + * List audit entries for a node + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * The list can be filtered by **createdByUser** and for a given inclusive time period. + * The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC** + * modifier to specify an ascending or descending sort order. + * + * For example, specifying orderBy=createdAt DESC returns audit entries in descending **createdAt** order. + * This relies on the pre-configured 'alfresco-access' audit application. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.where Optionally filter the list. Here are some examples: + * - where=(createdByUser='-me-') + * - where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00') + * - where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00') + * @returns Promise<AuditEntryPaging> + */ + listAuditEntriesForNode( + nodeId: string, + opts?: { + orderBy?: string[]; + where?: string; + } & ContentPagingQuery & + ContentIncludeQuery & + ContentFieldsQuery + ): Promise<AuditEntryPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + opts = opts || {}; + + const pathParams = { + nodeId + }; + + const queryParams = { + skipCount: opts?.skipCount, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + maxItems: opts?.maxItems, + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/audit-entries', + pathParams, + queryParams, + returnType: AuditEntryPaging + }); + } + + /** + * Update audit application info + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * New audit entries will not be created for a disabled audit application until + * it is re-enabled (and system-wide auditing is also enabled). + * Note, it is still possible to query &/or delete any existing audit entries even + * if auditing is disabled for the audit application. + * You must have admin rights to update audit application. + * + * @param auditApplicationId The identifier of an audit application. + * @param auditAppBodyUpdate The audit application to update. + * @param opts Optional parameters + * @returns Promise<AuditApp> + */ + updateAuditApp(auditApplicationId: string, auditAppBodyUpdate: AuditBodyUpdate, opts?: ContentFieldsQuery): Promise<AuditApp> { + throwIfNotDefined(auditApplicationId, 'auditApplicationId'); + throwIfNotDefined(auditAppBodyUpdate, 'auditAppBodyUpdate'); + + const pathParams = { + auditApplicationId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/audit-applications/{auditApplicationId}', + pathParams, + queryParams, + bodyParam: auditAppBodyUpdate + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/base.api.ts b/lib/js-api/src/api/content-rest-api/api/base.api.ts new file mode 100644 index 0000000000..6af5830d9f --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/base.api.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient } from '../../../api-clients/http-client.interface'; + +export abstract class BaseApi extends ApiClient { + override get apiClient(): LegacyHttpClient { + return this.httpClient ?? this.alfrescoApi.contentClient; + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/categories.api.ts b/lib/js-api/src/api/content-rest-api/api/categories.api.ts new file mode 100644 index 0000000000..a4758907d0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/categories.api.ts @@ -0,0 +1,263 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { CategoryBody, CategoryEntry, CategoryLinkBody, CategoryPaging } from '../model'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +export type CategoryQuery = ContentFieldsQuery & ContentIncludeQuery; + +/** + * Categories service. + */ +export class CategoriesApi extends BaseApi { + /** + * List of subcategories within category + * + * Gets a list of subcategories with category **categoryId**. + * The parameter categoryId can be set to the alias -root- to obtain a list of top level categories. + * + * You can use the **include** parameter to return additional **values** information. + * + * @param categoryId The identifier of a category. + * @param opts Optional parameters + * @returns Promise<CategoryPaging> + */ + getSubcategories(categoryId: string, opts?: ContentPagingQuery & CategoryQuery): Promise<CategoryPaging> { + throwIfNotDefined(categoryId, 'categoryId'); + + const pathParams = { + categoryId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv'), + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.get({ + path: '/categories/{categoryId}/subcategories', + pathParams, + queryParams, + returnType: CategoryPaging + }); + } + + /** + * Get a category + * + * Get a specific category with categoryId. + * You can use the **include** parameter to return additional **values** information. + * + * @param categoryId The identifier of a category. + * @param opts Optional parameters + * @returns Promise<CategoryEntry> + */ + getCategory(categoryId: string, opts?: CategoryQuery): Promise<CategoryEntry> { + throwIfNotDefined(categoryId, 'categoryId'); + + const pathParams = { + categoryId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv'), + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.get({ + path: '/categories/{categoryId}', + pathParams, + queryParams, + returnType: CategoryEntry + }); + } + + /** + * List of categories that node is assigned to + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @returns Promise<CategoryPaging> + */ + getCategoryLinksForNode(nodeId: string, opts?: ContentPagingQuery & CategoryQuery): Promise<CategoryPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv'), + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/category-links', + pathParams, + queryParams, + returnType: CategoryPaging + }); + } + + /** + * Deletes the category **categoryId**. + * + * This will cause everything to be removed from the category. + * You must have admin rights to delete a category. + * + * @param categoryId The identifier of a category. + * @returns Promise<{}> + */ + deleteCategory(categoryId: string): Promise<void> { + throwIfNotDefined(categoryId, 'categoryId'); + + const pathParams = { + categoryId + }; + + return this.delete({ + path: '/categories/{categoryId}', + pathParams + }); + } + + /** + * Unassign a node from category + * + * @param nodeId The identifier of a node. + * @param categoryId The identifier of a category. + * @returns Promise<{}> + */ + unlinkNodeFromCategory(nodeId: string, categoryId: string): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(categoryId, 'categoryId'); + + const pathParams = { + nodeId, + categoryId + }; + + return this.delete({ + path: '/nodes/{nodeId}/category-links/{categoryId}', + pathParams + }); + } + + /** + * Update a category + * + * Updates the category **categoryId**. + * You must have admin rights to update a category. + * + * @param categoryId The identifier of a category. + * @param categoryBodyUpdate The updated category + * @param opts Optional parameters + * @returns Promise<CategoryEntry> + */ + updateCategory(categoryId: string, categoryBodyUpdate: CategoryBody, opts?: CategoryQuery): Promise<CategoryEntry> { + throwIfNotDefined(categoryId, 'categoryId'); + throwIfNotDefined(categoryBodyUpdate, 'categoryBodyUpdate'); + + const pathParams = { + categoryId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv'), + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.put({ + path: '/categories/{categoryId}', + pathParams, + queryParams, + bodyParam: categoryBodyUpdate, + returnType: CategoryEntry + }); + } + + /** + * Create new categories + * + * Creates new categories within the category **categoryId**. + * The parameter categoryId can be set to the alias -root- to create a new top level category. + * You must have admin rights to create a category. + * + * @param categoryId The identifier of a category. + * @param categoryBodyCreate List of categories to create. + * @param opts Optional parameters. + * @returns Promise<CategoryPaging | CategoryEntry> + */ + createSubcategories(categoryId: string, categoryBodyCreate: CategoryBody[], opts?: CategoryQuery): Promise<CategoryPaging | CategoryEntry> { + throwIfNotDefined(categoryId, 'categoryId'); + throwIfNotDefined(categoryBodyCreate, 'categoryBodyCreate'); + + const pathParams = { + categoryId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv'), + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.post({ + path: '/categories/{categoryId}/subcategories', + pathParams, + queryParams, + bodyParam: categoryBodyCreate, + returnType: CategoryEntry + }); + } + + /** + * Assign a node to a category + * + * @param nodeId The identifier of a node. + * @param categoryLinkBodyCreate The new category link + * @param opts Optional parameters + * @returns Promise<CategoryPaging | CategoryEntry> + */ + linkNodeToCategory(nodeId: string, categoryLinkBodyCreate: CategoryLinkBody[], opts?: CategoryQuery): Promise<CategoryPaging | CategoryEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(categoryLinkBodyCreate, 'categoryLinkBodyCreate'); + + const pathParams = { + nodeId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv'), + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/category-links', + pathParams, + queryParams, + bodyParam: categoryLinkBodyCreate, + returnType: CategoryEntry + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/comments.api.ts b/lib/js-api/src/api/content-rest-api/api/comments.api.ts new file mode 100644 index 0000000000..20011ff4d9 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/comments.api.ts @@ -0,0 +1,142 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommentBody } from '../model/commentBody'; +import { CommentEntry } from '../model/commentEntry'; +import { CommentPaging } from '../model/commentPaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentPagingQuery } from './types'; + +/** + * Comments service. + */ +export class CommentsApi extends BaseApi { + /** + * Create a comment + * + * @param nodeId The identifier of a node. + * @param commentBodyCreate The comment text. Note that you can also provide a list of comments. + * @param opts Optional parameters + * @returns Promise<CommentEntry> + */ + createComment(nodeId: string, commentBodyCreate: CommentBody, opts?: ContentFieldsQuery): Promise<CommentEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(commentBodyCreate, 'commentBodyCreate'); + + const pathParams = { + nodeId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/comments', + pathParams, + queryParams, + bodyParam: commentBodyCreate, + returnType: CommentEntry + }); + } + + /** + * Delete a comment + * + * @param nodeId The identifier of a node. + * @param commentId The identifier of a comment. + * @returns Promise<{}> + */ + deleteComment(nodeId: string, commentId: string): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(commentId, 'commentId'); + + const pathParams = { + nodeId, + commentId + }; + + return this.delete({ + path: '/nodes/{nodeId}/comments/{commentId}', + pathParams + }); + } + + /** + * List comments + * + * Gets a list of comments for the node **nodeId**, sorted chronologically with the newest comment first. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @returns Promise<CommentPaging> + */ + listComments(nodeId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<CommentPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/comments', + pathParams, + queryParams, + returnType: CommentPaging + }); + } + + /** + * Update a comment + * + * @param nodeId The identifier of a node. + * @param commentId The identifier of a comment. + * @param commentBodyUpdate The JSON representing the comment to be updated. + * @param opts Optional parameters + * @returns Promise<CommentEntry> + */ + updateComment(nodeId: string, commentId: string, commentBodyUpdate: CommentBody, opts?: ContentFieldsQuery): Promise<CommentEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(commentId, 'commentId'); + throwIfNotDefined(commentBodyUpdate, 'commentBodyUpdate'); + + const pathParams = { + nodeId, + commentId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/nodes/{nodeId}/comments/{commentId}', + pathParams, + queryParams, + bodyParam: commentBodyUpdate, + returnType: CommentEntry + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/downloads.api.ts b/lib/js-api/src/api/content-rest-api/api/downloads.api.ts new file mode 100644 index 0000000000..d6ef95123d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/downloads.api.ts @@ -0,0 +1,116 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DownloadBodyCreate, DownloadEntry } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; + +/** + * Downloads service. + */ +export class DownloadsApi extends BaseApi { + /** + * Cancel a download + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * Cancels the creation of a download request. + * + * **Note:** The download node can be deleted using the **DELETE /nodes/{downloadId}** endpoint + * + * By default, if the download node is not deleted it will be picked up by a cleaner job which removes download nodes older than a configurable amount of time (default is 1 hour) + * Information about the existing progress at the time of cancelling can be retrieved by calling the **GET /downloads/{downloadId}** endpoint + * The cancel operation is done asynchronously. + * + * @param downloadId The identifier of a download node. + * @returns Promise<{}> + */ + cancelDownload(downloadId: string): Promise<any> { + throwIfNotDefined(downloadId, 'downloadId'); + + const pathParams = { + downloadId + }; + + return this.delete({ + path: '/downloads/{downloadId}', + pathParams + }); + } + + /** + * Create a new download + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * **Note:** The content of the download node can be obtained using the **GET /nodes/{downloadId}/content** endpoint + * + * @param downloadBodyCreate The nodeIds the content of which will be zipped, which zip will be set as the content of our download node. + * @param opts Optional parameters + * @param opts.fields A list of field names. You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<DownloadEntry> + */ + createDownload(downloadBodyCreate: DownloadBodyCreate, opts?: { fields?: string[] }): Promise<DownloadEntry> { + throwIfNotDefined(downloadBodyCreate, 'downloadBodyCreate'); + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/downloads', + queryParams, + bodyParam: downloadBodyCreate + }); + } + + /** + * Get a download + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * @param downloadId The identifier of a download node. + * @param opts Optional parameters + * @param opts.fields A list of field names. You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<DownloadEntry> + */ + getDownload(downloadId: string, opts?: { fields?: string[] }): Promise<DownloadEntry> { + throwIfNotDefined(downloadId, 'downloadId'); + + const pathParams = { + downloadId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/downloads/{downloadId}', + pathParams, + queryParams + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/favorites.api.ts b/lib/js-api/src/api/content-rest-api/api/favorites.api.ts new file mode 100644 index 0000000000..4b299aeece --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/favorites.api.ts @@ -0,0 +1,311 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FavoriteBodyCreate, FavoriteEntry, FavoritePaging, FavoriteSiteBodyCreate, FavoriteSiteEntry, SiteEntry, SitePaging } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +/** + * Favorites service. + */ +export class FavoritesApi extends BaseApi { + /** + * Create a favorite + * + * Favorite a **site**, **file**, or **folder** in the repository. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param favoriteBodyCreate An object identifying the entity to be favorited. + * The object consists of a single property which is an object with the name site, file, or folder. + * The content of that object is the guid of the target entity. + * @param opts Optional parameters + * @param opts.include Returns additional information about favorites, the following optional fields can be requested: + * - path (note, this only applies to files and folders) + * - properties + * @param opts.fields A list of field names. You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<FavoriteEntry> + */ + createFavorite( + personId: string, + favoriteBodyCreate: FavoriteBodyCreate, + opts?: { include?: string[]; fields?: string[] } + ): Promise<FavoriteEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(favoriteBodyCreate, 'favoriteBodyCreate'); + + const pathParams = { + personId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/people/{personId}/favorites', + pathParams, + queryParams, + bodyParam: favoriteBodyCreate, + returnType: FavoriteEntry + }); + } + + /** + * Create a site favorite + * + * **Note:** this endpoint is deprecated as of Alfresco 4.2, and will be removed in the future. Use /people/{personId}/favorites instead. + * + * @param personId The identifier of a person. + * @param favoriteSiteBodyCreate The id of the site to favorite. + * @param opts Optional parameters + * @returns Promise<FavoriteSiteEntry> + */ + createSiteFavorite(personId: string, favoriteSiteBodyCreate: FavoriteSiteBodyCreate, opts?: ContentFieldsQuery): Promise<FavoriteSiteEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(favoriteSiteBodyCreate, 'favoriteSiteBodyCreate'); + + const pathParams = { + personId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/people/{personId}/favorite-sites', + pathParams, + queryParams, + bodyParam: favoriteSiteBodyCreate + }); + } + + /** + * Delete a favorite + * + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param favoriteId The identifier of a favorite. + * @returns Promise<{}> + */ + deleteFavorite(personId: string, favoriteId: string): Promise<void> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(favoriteId, 'favoriteId'); + + const pathParams = { + personId, + favoriteId + }; + + return this.delete({ + path: '/people/{personId}/favorites/{favoriteId}', + pathParams + }); + } + + /** + * Delete a site favorite + * + * **Note:** this endpoint is deprecated as of Alfresco 4.2, and will be removed in the future. + * Use /people/{personId}/favorites/{favoriteId} instead. + * + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param siteId The identifier of a site. + * @returns Promise<{}> + */ + deleteSiteFavorite(personId: string, siteId: string): Promise<void> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + personId, + siteId + }; + + return this.delete({ + path: '/people/{personId}/favorite-sites/{siteId}', + pathParams + }); + } + + /** + * Get a favorite + * + * Gets favorite **favoriteId** for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param favoriteId The identifier of a favorite. + * @param opts Optional parameters + * @param opts.include Returns additional information about favorites, the following optional fields can be requested: + * - path (note, this only applies to files and folders) + * - properties + * @param opts.fields A list of field names. You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<FavoriteEntry> + */ + getFavorite(personId: string, favoriteId: string, opts?: { include?: string[]; fields?: string[] }): Promise<FavoriteEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(favoriteId, 'favoriteId'); + + const pathParams = { + personId, + favoriteId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/favorites/{favoriteId}', + pathParams, + queryParams, + returnType: FavoriteEntry + }); + } + + /** + * Get a favorite site + * + * **Note:** this endpoint is deprecated as of Alfresco 4.2, and will be removed in the future. + * Use /people/{personId}/favorites/{favoriteId} instead. + * + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param siteId The identifier of a site. + * @param opts Optional parameters + * @param opts.fields A list of field names. You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<SiteEntry> + */ + getFavoriteSite(personId: string, siteId: string, opts?: { fields?: string[] }): Promise<SiteEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + personId, + siteId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/favorite-sites/{siteId}', + pathParams, + queryParams, + returnType: SiteEntry + }); + } + + /** + * List favorite sites + * + * **Note:** this endpoint is deprecated as of Alfresco 4.2, and will be removed in the future. + * Use /people/{personId}/favorites instead. + * + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @returns Promise<SitePaging> + */ + listFavoriteSitesForPerson(personId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<SitePaging> { + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + personId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/favorite-sites', + pathParams, + queryParams, + returnType: SitePaging + }); + } + + /** + * List favorites + * + * Gets a list of favorites for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param opts optional parameters + * @returns Promise<FavoritePaging> + */ + listFavorites( + personId: string, + opts?: { + orderBy?: string[]; + where?: string; + } & ContentPagingQuery & + ContentIncludeQuery & + ContentFieldsQuery + ): Promise<FavoritePaging> { + throwIfNotDefined(personId, 'personId'); + opts = opts || {}; + + const pathParams = { + personId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/favorites', + pathParams, + queryParams, + returnType: FavoritePaging + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/groups.api.ts b/lib/js-api/src/api/content-rest-api/api/groups.api.ts new file mode 100644 index 0000000000..b974dbc3cd --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/groups.api.ts @@ -0,0 +1,382 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GroupBodyCreate, GroupBodyUpdate, GroupEntry, GroupMemberEntry, GroupMemberPaging, GroupMembershipBodyCreate, GroupPaging } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +export interface ListGroupMembershipsOpts { + /** + * A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field + */ + orderBy?: string[]; + // A string to restrict the returned objects by using a predicate. + where?: string; +} + +export interface GroupPagingOpts { + /** + * A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + */ + orderBy?: string[]; + /** + * A string to restrict the returned objects by using a predicate. + */ + where?: string; +} + +export type DeleteGroupOpts = { cascade?: boolean }; + +/** + * Groups service. + */ +export class GroupsApi extends BaseApi { + /** + * Create a group + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * Create a group. + * + * The group id must start with \"GROUP\\_\". If this is omitted it will be added automatically. + * This format is also returned when listing groups or group memberships. It should be noted + * that the other group-related operations also expect the id to start with \"GROUP\\_\". + * + * If one or more parentIds are specified then the group will be created and become a member of each of the specified parent groups. + * If no parentIds are specified then the group will be created as a root group. + * The group will be created in the **APP.DEFAULT** and **AUTH.ALF** zones. + * + * You must have admin rights to create a group. + * + * @param groupBodyCreate The group to create. + * @param opts Optional parameters + * @returns Promise<GroupEntry> + */ + createGroup(groupBodyCreate: GroupBodyCreate, opts?: ContentIncludeQuery & ContentFieldsQuery): Promise<GroupEntry> { + throwIfNotDefined(groupBodyCreate, 'groupBodyCreate'); + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/groups', + queryParams, + bodyParam: groupBodyCreate + }); + } + + /** + * Create a group membership + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * Create a group membership (for an existing person or group) within a group **groupId**. + * If the added group was previously a root group then it becomes a non-root group since it now has a parent. + * It is an error to specify an **id** that does not exist. + * You must have admin rights to create a group membership. + * + * @param groupId The identifier of a group. + * @param groupMembershipBodyCreate The group membership to add (person or sub-group). + * @param opts Optional parameters + * @returns Promise<GroupMemberEntry> + */ + createGroupMembership( + groupId: string, + groupMembershipBodyCreate: GroupMembershipBodyCreate, + opts?: ContentFieldsQuery + ): Promise<GroupMemberEntry> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(groupMembershipBodyCreate, 'groupMembershipBodyCreate'); + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/groups/{groupId}/members', + pathParams: { groupId }, + queryParams, + bodyParam: groupMembershipBodyCreate + }); + } + + /** + * Delete a group + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * Delete group **groupId**. + * The option to cascade delete applies this recursively to any hierarchy of group members. + * In this case, removing a group member does not delete the person or sub-group itself. + * If a removed sub-group no longer has any parent groups then it becomes a root group. + * You must have admin rights to delete a group. + * + * @param groupId The identifier of a group. + * @param opts Optional parameters + * @returns Promise + */ + deleteGroup(groupId: string, opts?: DeleteGroupOpts): Promise<void> { + throwIfNotDefined(groupId, 'groupId'); + opts = opts || {}; + + const cascadeDelete = opts['cascade'] ? opts['cascade'] : false; + + const pathParams = { + groupId + }; + + const queryParams = { + cascade: cascadeDelete + }; + + return this.delete({ + path: '/groups/{groupId}', + pathParams, + queryParams + }); + } + + /** + * Delete a group membership + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * Delete group member **groupMemberId** (person or sub-group) from group **groupId**. + * Removing a group member does not delete the person or sub-group itself.\ + * If a removed sub-group no longer has any parent groups then it becomes a root group. + * + * @param groupId The identifier of a group. + * @param groupMemberId The identifier of a person or group. + * @returns Promise<{}> + */ + deleteGroupMembership(groupId: string, groupMemberId: string): Promise<void> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(groupMemberId, 'groupMemberId'); + + const pathParams = { + groupId, + groupMemberId + }; + + return this.delete({ + path: '/groups/{groupId}/members/{groupMemberId}', + pathParams + }); + } + + /** + * Get group details + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * Get details for group **groupId**. + * You can use the **include** parameter to return additional information. + * + * @param groupId The identifier of a group. + * @param opts Optional parameters + * @returns Promise<GroupEntry> + */ + getGroup(groupId: string, opts?: ContentIncludeQuery & ContentFieldsQuery): Promise<GroupEntry> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/groups/{groupId}', + pathParams, + queryParams + }); + } + + /** + * List memberships of a group + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * Gets a list of the group memberships for the group **groupId**. + * + * You can use the **where** parameter to filter the returned groups by **memberType**. + * Example to filter by **memberType**, use any one of: + * - (memberType='GROUP') + * - (memberType='PERSON') + * + * The default sort order for the returned list is for group members to be sorted by ascending displayName. + * You can override the default by using the **orderBy** parameter. You can specify one of the following fields in the **orderBy** parameter: + * - id + * - displayName + * + * @param groupId The identifier of a group. + * @param opts Optional parameters + * @returns Promise<GroupMemberPaging> + */ + listGroupMemberships(groupId: string, opts?: ListGroupMembershipsOpts & ContentPagingQuery & ContentFieldsQuery): Promise<GroupMemberPaging> { + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + groupId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + where: opts?.where, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/groups/{groupId}/members', + pathParams, + queryParams, + returnType: GroupMemberPaging + }); + } + + /** + * List group memberships + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @param opts.skipCount The number of entities that exist in the collection before those included in this list. + * If not supplied then the default value is 0. (default to 0) + * @param opts.maxItems The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100) + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.include Returns additional information about the group. The following optional fields can be requested: + * - parentIds + * - zones + * @param opts.where A string to restrict the returned objects by using a predicate. + * @param opts.fields A list of field names. + * You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<GroupPaging> + */ + listGroupMembershipsForPerson( + personId: string, + opts?: GroupPagingOpts & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery + ): Promise<GroupPaging> { + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + personId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + include: buildCollectionParam(opts?.include, 'csv'), + where: opts?.where, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/groups', + pathParams, + queryParams, + returnType: GroupPaging + }); + } + + /** + * List groups + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * + * @param opts Optional parameters + * @returns Promise<GroupPaging> + */ + listGroups(opts?: GroupPagingOpts & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<GroupPaging> { + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + include: buildCollectionParam(opts?.include, 'csv'), + where: opts?.where, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/groups', + queryParams, + returnType: GroupPaging + }); + } + + /** + * Update group details + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * You must have admin rights to update a group. + * + * @param groupId The identifier of a group. + * @param groupBodyUpdate The group information to update. + * @param opts Optional parameters + * @returns Promise<GroupEntry> + */ + updateGroup(groupId: string, groupBodyUpdate: GroupBodyUpdate, opts?: ContentIncludeQuery & ContentFieldsQuery): Promise<GroupEntry> { + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(groupBodyUpdate, 'groupBodyUpdate'); + + const pathParams = { + groupId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/groups/{groupId}', + pathParams, + queryParams, + bodyParam: groupBodyUpdate + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/index.ts b/lib/js-api/src/api/content-rest-api/api/index.ts new file mode 100644 index 0000000000..a3c2c47a6c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/index.ts @@ -0,0 +1,39 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './types'; +export * from './actions.api'; +export * from './activities.api'; +export * from './audit.api'; +export * from './categories.api'; +export * from './comments.api'; +export * from './downloads.api'; +export * from './favorites.api'; +export * from './groups.api'; +export * from './networks.api'; +export * from './nodes.api'; +export * from './people.api'; +export * from './preferences.api'; +export * from './probes.api'; +export * from './queries.api'; +export * from './ratings.api'; +export * from './renditions.api'; +export * from './sharedlinks.api'; +export * from './sites.api'; +export * from './tags.api'; +export * from './trashcan.api'; +export * from './versions.api'; diff --git a/lib/js-api/src/api/content-rest-api/api/networks.api.ts b/lib/js-api/src/api/content-rest-api/api/networks.api.ts new file mode 100644 index 0000000000..b9e594dda5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/networks.api.ts @@ -0,0 +1,116 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PersonNetworkEntry } from '../model/personNetworkEntry'; +import { PersonNetworkPaging } from '../model/personNetworkPaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentPagingQuery } from './types'; + +/** + * Networks service. + */ +export class NetworksApi extends BaseApi { + /** + * Get a network + * + * @param networkId The identifier of a network. + * @param opts Optional parameters + * @returns Promise<PersonNetworkEntry> + */ + getNetwork(networkId: string, opts?: ContentFieldsQuery): Promise<PersonNetworkEntry> { + throwIfNotDefined(networkId, 'networkId'); + + const pathParams = { + networkId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/networks/{networkId}', + pathParams, + queryParams, + returnType: PersonNetworkEntry + }); + } + + /** + * Get network information + * + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param networkId The identifier of a network. + * @param opts Optional parameters + * @returns Promise<PersonNetworkEntry> + */ + getNetworkForPerson(personId: string, networkId: string, opts?: ContentFieldsQuery): Promise<PersonNetworkEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(networkId, 'networkId'); + + const pathParams = { + personId, + networkId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/networks/{networkId}', + pathParams, + queryParams, + returnType: PersonNetworkEntry + }); + } + + /** + * List network membership + * + * Gets a list of network memberships for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @returns Promise<PersonNetworkPaging> + */ + listNetworksForPerson(personId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<PersonNetworkPaging> { + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + personId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/networks', + pathParams, + queryParams, + returnType: PersonNetworkPaging + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/nodes.api.ts b/lib/js-api/src/api/content-rest-api/api/nodes.api.ts new file mode 100644 index 0000000000..a42ebf52c7 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/nodes.api.ts @@ -0,0 +1,974 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + AssociationBody, + AssociationEntry, + ChildAssociationBody, + ChildAssociationEntry, + DirectAccessUrlEntry, + NodeAssociationPaging, + NodeBodyCopy, + NodeBodyCreate, + NodeBodyLock, + NodeBodyMove, + NodeBodyUpdate, + NodeChildAssociationPaging, + NodeEntry +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentPagingQuery } from './types'; + +export type NodesIncludeQuery = { + /** + * Returns additional information about the node. The following optional fields can be requested: + * - allowableOperations + * - association + * - isLink + * - isFavorite + * - isLocked + * - path + * - permissions + * - definition + */ + include?: string[]; + + /** + * A list of field names. + * + * You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * + * The list applies to a returned individual + * entity or entries within a collection. + * + * If the API method also supports the **include** + * parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + */ + fields?: string[]; +}; + +export interface CreateNodeOpts extends NodesIncludeQuery { + [key: string]: any; + // If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + autoRename?: boolean; + // If true, then created node will be version 1.0 MAJOR. If false, then created node will be version 0.1 MINOR. + majorVersion?: boolean; + // If true, then created node will be versioned. If false, then created node will be unversioned and auto-versioning disabled. + versioningEnabled?: boolean; +} + +/** + * Nodes service. + */ +export class NodesApi extends BaseApi { + /** + * Copy a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Copies the node **nodeId** to the parent folder node **targetParentId**. You specify the **targetParentId** in the request body. + * + * The new node has the same name as the source node unless you specify a new **name** in the request body. + * + * If the source **nodeId** is a folder, then all of its children are also copied. + * + * If the source **nodeId** is a file, it's properties, aspects and tags are copied, it's ratings, comments and locks are not. + * + * @param nodeId The identifier of a node. + * @param nodeBodyCopy The targetParentId and, optionally, a new name which should include the file extension. + * @param opts Optional parameters + * @returns Promise<NodeEntry> + */ + copyNode(nodeId: string, nodeBodyCopy: NodeBodyCopy, opts?: NodesIncludeQuery): Promise<NodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(nodeBodyCopy, 'nodeBodyCopy'); + + const pathParams = { + nodeId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/copy', + pathParams, + queryParams, + bodyParam: nodeBodyCopy, + returnType: NodeEntry + }); + } + + /** + * Create node association + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a source node. + * @param associationBodyCreate The target node id and assoc type. + * @param opts Optional parameters + * @param opts.fields A list of field names. + * You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<AssociationEntry> + */ + createAssociation(nodeId: string, associationBodyCreate: AssociationBody, opts?: { fields?: string[] }): Promise<AssociationEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(associationBodyCreate, 'associationBodyCreate'); + + const pathParams = { + nodeId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/targets', + pathParams, + queryParams, + bodyParam: associationBodyCreate + }); + } + + /** + * Create a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. You can also use one of these well-known aliases: + * -my- + * -shared- + * -root- + * @param nodeBodyCreate The node information to create. + * @param opts Optional parameters + * @param opts.autoRename If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + * @param opts.include Returns additional information about the node. The following optional fields can be requested: + * - allowableOperations + * - association + * - isLink + * - isFavorite + * - isLocked + * - path + * - permissions + * - definition + * @param opts.fields A list of field names. You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @param formParams parameters + * @returns Promise<NodeEntry> + */ + createNode(nodeId: string, nodeBodyCreate: NodeBodyCreate, opts?: CreateNodeOpts, formParams?: any): Promise<NodeEntry | any> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(nodeBodyCreate, 'nodeBodyCreate'); + + const pathParams = { + nodeId + }; + + const queryParams = { + autoRename: opts?.autoRename, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + formParams = formParams || {}; + + let contentTypes; + let returnType; + + if (formParams.filedata) { + contentTypes = ['multipart/form-data']; + } else { + contentTypes = ['application/json']; + returnType = NodeEntry; + } + + return this.post({ + path: '/nodes/{nodeId}/children', + pathParams, + queryParams, + formParams, + bodyParam: nodeBodyCreate, + contentTypes, + returnType + }); + } + + /** + * Create a folder + * + * @param name - folder name + * @param relativePath - The relativePath specifies the folder structure to create relative to the node identified by nodeId. + * @param nodeId default value root.The identifier of a node where add the folder. You can also use one of these well-known aliases: -my- | -shared- | -root- + * @param opts Optional parameters + * @returns A promise that is resolved if the folder is created and {error} if rejected. + */ + createFolder(name: string, relativePath: string, nodeId: string, opts?: CreateNodeOpts): Promise<NodeEntry> { + nodeId = nodeId || '-root-'; + + const nodeBody = new NodeBodyCreate({ + name, + relativePath, + nodeType: 'cm:folder' + }); + + return this.createNode(nodeId, nodeBody, opts); + } + + /** + * Create secondary child + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a parent node. + * @param secondaryChildAssociationBodyCreate The child node id and assoc type. + * @param opts Optional parameters + * @param opts.fields A list of field names. + * You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<ChildAssociationEntry> + */ + createSecondaryChildAssociation( + nodeId: string, + secondaryChildAssociationBodyCreate: ChildAssociationBody, + opts?: { + fields?: string[]; + } + ): Promise<ChildAssociationEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(secondaryChildAssociationBodyCreate, 'secondaryChildAssociationBodyCreate'); + + const pathParams = { + nodeId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/secondary-children', + pathParams, + queryParams, + bodyParam: secondaryChildAssociationBodyCreate, + returnType: ChildAssociationEntry + }); + } + /** + * Delete node association(s) + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Delete an association, or associations, from the source **nodeId* to a target node for the given association type. + * If the association type is **not** specified, then all peer associations, of any type, in the direction + * from source to target, are deleted. + * **Note:** After removal of the peer association, or associations, from source to target, the two nodes may still have peer associations in the other direction. + * + * @param nodeId The identifier of a source node. + * @param targetId The identifier of a target node. + * @param opts Optional parameters + * @param opts.assocType Only delete associations of this type. + * @returns Promise<{}> + */ + deleteAssociation(nodeId: string, targetId: string, opts?: { assocType?: string }): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(targetId, 'targetId'); + + const pathParams = { + nodeId, + targetId + }; + + const queryParams = { + assocType: opts?.assocType + }; + + return this.delete({ + path: '/nodes/{nodeId}/targets/{targetId}', + pathParams, + queryParams + }); + } + /** + * Delete a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * If **nodeId** is a folder, then its children are also deleted. + * Deleted nodes move to the trashcan unless the **permanent** query parameter is **true** and the current user is the owner of the node or an admin. + * + * Deleting a node deletes it from its primary parent and also from any secondary parents. Peer associations are also deleted, where the deleted + * node is either a source or target of an association. This applies recursively to any hierarchy of primary children of the deleted node. + * + * **Note:** If the node is not permanently deleted, and is later successfully restored to its former primary parent, then the primary + * child association is restored. This applies recursively for any primary children. No other secondary child associations or + * peer associations are restored for any of the nodes in the primary parent-child hierarchy of restored nodes, regardless of whether the original + * associations were to nodes inside or outside the restored hierarchy. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @param opts.permanent If **true** then the node is deleted permanently, without moving to the trashcan. + * Only the owner of the node or an admin can permanently delete the node. (default to false) + * @returns Promise<{}> + */ + deleteNode(nodeId: string, opts?: { permanent?: boolean }): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + permanent: opts?.permanent + }; + + return this.delete({ + path: '/nodes/{nodeId}', + pathParams, + queryParams + }); + } + /** + * Delete multiple nodes + * + * @param nodeIds The list of node IDs to delete. + * @param opts Optional parameters + * @param opts.permanent If **true** then nodes are deleted permanently, without moving to the trashcan. + * Only the owner of the node or an admin can permanently delete the node. (default to false) + * @returns Promise<[]> + */ + deleteNodes(nodeIds: string[], opts?: { permanent?: boolean }): Promise<void[]> { + throwIfNotDefined(nodeIds, 'nodeIds'); + + return Promise.all(nodeIds.map((id) => this.deleteNode(id, opts))); + } + + /** + * Delete secondary child or children + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Delete secondary child associations between the parent **nodeId** and child nodes for the given association type. + * + * If the association type is **not** specified, then all secondary child associations, of any type in the direction + * from parent to secondary child, will be deleted. The child will still have a primary parent and may still be + * associated as a secondary child with other secondary parents. + * + * @param nodeId The identifier of a parent node. + * @param childId The identifier of a child node. + * @param opts Optional parameters + * @param opts.assocType Only delete associations of this type. + * @returns Promise<{}> + */ + deleteSecondaryChildAssociation(nodeId: string, childId: string, opts?: { assocType?: string }): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(childId, 'childId'); + + const pathParams = { + nodeId, + childId + }; + + return this.delete({ + path: '/nodes/{nodeId}/secondary-children/{childId}', + pathParams, + queryParams: opts + }); + } + + /** + * Get a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * You can use the **include** parameter to return additional information. + * + * @param nodeId The identifier of a node. You can also use one of these well-known aliases: + * - -my- + * - -shared- + * - -root- + * @param opts Optional parameters + * @param opts.relativePath A path relative to the **nodeId**. If you set this, information is returned on the node resolved by this path. + * @returns Promise<NodeEntry> + */ + getNode(nodeId: string, opts?: { relativePath?: string } & NodesIncludeQuery): Promise<NodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + relativePath: opts?.relativePath, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}', + pathParams, + queryParams, + returnType: NodeEntry + }); + } + + /** + * Get node content + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; + * for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.range The Range header indicates the part of a document that the server should return. + * Single part request supported, for example: bytes=1-10. + * @returns Promise<Blob> + */ + getNodeContent( + nodeId: string, + opts?: { + attachment?: boolean; + ifModifiedSince?: string; + range?: string; + } + ): Promise<Blob> { + throwIfNotDefined(nodeId, 'nodeId'); + + opts = opts || {}; + + const pathParams = { + nodeId + }; + + const queryParams = { + attachment: opts?.attachment + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince, + Range: opts?.range + }; + + const accepts = ['application/octet-stream']; + + return this.get({ + path: '/nodes/{nodeId}/content', + pathParams, + queryParams, + headerParams, + accepts, + returnType: 'blob' + }); + } + + /** + * List node children + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of children of the parent node **nodeId**. + * Minimal information for each child is returned by default. + * You can use the **include** parameter to return additional information. + * The list of child nodes includes primary children and secondary children, if there are any. + * You can use the **include** parameter (include=association) to return child association details + * for each child, including the **assocTyp**e and the **isPrimary** flag. + * + * The default sort order for the returned list is for folders to be sorted before files, and by ascending name. + * + * You can override the default using **orderBy** to specify one or more fields to sort by. The default order is always ascending, but + * you can use an optional **ASC** or **DESC** modifier to specify an ascending or descending sort order. + * + * For example, specifying orderBy=name DESC returns a mixed folder/file list in descending **name** order. + * You can use any of the following fields to order the results: + * - isFolder + * - name + * - mimeType + * - nodeType + * - sizeInBytes + * - modifiedAt + * - createdAt + * - modifiedByUser + * - createdByUser + * + * @param nodeId The identifier of a node. You can also use one of these well-known aliases: + * - -my- + * - -shared- + * - -root- + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.where Optionally filter the list. Here are some examples: + * - where=(isFolder=true) + * - where=(isFile=true) + * - where=(nodeType='my:specialNodeType') + * - where=(nodeType='my:specialNodeType INCLUDESUBTYPES') + * - where=(isPrimary=true) + * - where=(assocType='my:specialAssocType') + * - where=(isPrimary=false and assocType='my:specialAssocType') + * @param opts.relativePath Return information on children in the folder resolved by this path. The path is relative to **nodeId**. + * @param opts.includeSource Also include **source** in addition to **entries** with folder information on the parent node – either the specified parent **nodeId**, or as resolved by **relativePath**. + * @returns Promise<NodeChildAssociationPaging> + */ + listNodeChildren( + nodeId: string, + opts?: { + orderBy?: string[]; + where?: string; + relativePath?: string; + includeSource?: boolean; + } & NodesIncludeQuery & + ContentPagingQuery + ): Promise<NodeChildAssociationPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + relativePath: opts?.relativePath, + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/children', + pathParams, + queryParams, + returnType: NodeChildAssociationPaging + }); + } + + /** + * List parents + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of parent nodes that are associated with the current child **nodeId**. + * The list includes both the primary parent and any secondary parents. + * + * @param nodeId The identifier of a child node. You can also use one of these well-known aliases: + * - -my- + * - -shared- + * - -root- + * @param opts Optional parameters + * @param opts.where Optionally filter the list by **assocType** and/or **isPrimary**. Here are some example filters: + * - where=(assocType='my:specialAssocType') + * - where=(isPrimary=true) + * - where=(isPrimary=false and assocType='my:specialAssocType') + * @param opts.includeSource Also include **source** (in addition to **entries**) with folder information on **nodeId** + * @returns Promise<NodeAssociationPaging> + */ + listParents( + nodeId: string, + opts?: { + where?: string; + includeSource?: boolean; + } & NodesIncludeQuery & + ContentPagingQuery + ): Promise<NodeAssociationPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + opts = opts || {}; + + const pathParams = { + nodeId + }; + + const queryParams = { + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/parents', + pathParams, + queryParams, + returnType: NodeAssociationPaging + }); + } + + /** + * List secondary children + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of secondary child nodes that are associated with the current parent **nodeId**, via a secondary child association. + * + * @param nodeId The identifier of a parent node. You can also use one of these well-known aliases: + * -my- + * -shared- + * -root- + * @param opts Optional parameters + * @param opts.where Optionally filter the list by assocType. Here's an example: + * - where=(assocType='my:specialAssocType') + * @param opts.includeSource Also include **source** (in addition to **entries**) with folder information on **nodeId** + * @returns Promise<NodeChildAssociationPaging> + */ + listSecondaryChildren( + nodeId: string, + opts?: { + where?: string; + includeSource?: boolean; + } & NodesIncludeQuery & + ContentPagingQuery + ): Promise<NodeChildAssociationPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + opts = opts || {}; + + const pathParams = { + nodeId + }; + + const queryParams = { + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/secondary-children', + pathParams, + queryParams, + returnType: NodeChildAssociationPaging + }); + } + + /** + * List source associations + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a target node. + * @param opts Optional parameters + * @param opts.where Optionally filter the list by **assocType**. Here's an example: + * - where=(assocType='my:specialAssocType') + * @returns Promise<NodeAssociationPaging> + */ + listSourceAssociations( + nodeId: string, + opts?: { + where?: string; + } & NodesIncludeQuery + ): Promise<NodeAssociationPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + opts = opts || {}; + + const pathParams = { + nodeId + }; + + const queryParams = { + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/sources', + pathParams, + queryParams, + returnType: NodeAssociationPaging + }); + } + + /** + * List target associations + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of target nodes that are associated with the current source **nodeId**. + * + * @param nodeId The identifier of a source node. + * @param opts Optional parameters + * @param opts.where Optionally filter the list by **assocType**. Here's an example: + * - where=(assocType='my:specialAssocType') + * @returns Promise<NodeAssociationPaging> + */ + listTargetAssociations( + nodeId: string, + opts?: { + where?: string; + } & NodesIncludeQuery & + ContentPagingQuery + ): Promise<NodeAssociationPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + opts = opts || {}; + + const pathParams = { + nodeId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/targets', + pathParams, + queryParams, + returnType: NodeAssociationPaging + }); + } + + /** + * Lock a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * If a lock on the node cannot be taken, then an error is returned. + * + * @param nodeId The identifier of a node. + * @param nodeBodyLock Lock details. + * @param opts Optional parameters + * @returns Promise<NodeEntry> + */ + lockNode(nodeId: string, nodeBodyLock: NodeBodyLock, opts?: NodesIncludeQuery): Promise<NodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(nodeBodyLock, 'nodeBodyLock'); + + const pathParams = { + nodeId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/lock', + pathParams, + queryParams, + bodyParam: nodeBodyLock, + returnType: NodeEntry + }); + } + + /** + * Move a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * The **targetParentId** is specified in the in request body. + * The moved node retains its name unless you specify a new **name** in the request body. + * If the source **nodeId** is a folder, then its children are also moved. + * The move will effectively change the primary parent. + * + * @param nodeId The identifier of a node. + * @param nodeBodyMove The targetParentId and, optionally, a new name which should include the file extension. + * @param opts Optional parameters + * @returns Promise<NodeEntry> + */ + moveNode(nodeId: string, nodeBodyMove: NodeBodyMove, opts?: NodesIncludeQuery): Promise<NodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(nodeBodyMove, 'nodeBodyMove'); + + const pathParams = { + nodeId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/move', + pathParams, + queryParams, + bodyParam: nodeBodyMove, + returnType: NodeEntry + }); + } + + /** + * Unlock a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * The current user must be the owner of the locks or have admin rights, otherwise an error is returned. + * If a lock on the node cannot be released, then an error is returned. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @returns Promise<NodeEntry> + */ + unlockNode(nodeId: string, opts?: NodesIncludeQuery): Promise<NodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/unlock', + pathParams, + queryParams, + returnType: NodeEntry + }); + } + + /** + * Update a node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param nodeBodyUpdate The node information to update. + * @param opts Optional parameters + * @returns Promise<NodeEntry> + */ + updateNode(nodeId: string, nodeBodyUpdate: NodeBodyUpdate, opts?: NodesIncludeQuery): Promise<NodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(nodeBodyUpdate, 'nodeBodyUpdate'); + + const pathParams = { + nodeId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/nodes/{nodeId}', + pathParams, + queryParams, + bodyParam: nodeBodyUpdate, + returnType: NodeEntry + }); + } + /** + * Update node content + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param contentBodyUpdate The binary content + * @param opts Optional parameters + * @param opts.majorVersion If **true**, create a major version. + * Setting this parameter also enables versioning of this node, if it is not already versioned. (default to false) + * @param opts.comment Add a version comment which will appear in version history. + * Setting this parameter also enables versioning of this node, if it is not already versioned. + * @param opts.name Optional new name. This should include the file extension. + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + * @returns Promise<NodeEntry> + */ + updateNodeContent( + nodeId: string, + contentBodyUpdate: string, + opts?: { + majorVersion?: boolean; + comment?: string; + name?: string; + } & NodesIncludeQuery + ): Promise<NodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate'); + opts = opts || {}; + + const pathParams = { + nodeId + }; + + const queryParams = { + majorVersion: opts?.majorVersion, + comment: opts?.comment, + name: opts?.name, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/nodes/{nodeId}/content', + pathParams, + queryParams, + contentTypes: ['application/octet-stream'], + bodyParam: contentBodyUpdate, + returnType: NodeEntry + }); + } + + /** + * Generate a direct access content url for a given node + * + * **Note:** this endpoint is available in Alfresco 7.1 and newer versions. + * + * @param nodeId The identifier of a node. + * @returns Promise<DirectAccessUrlEntry> + */ + requestDirectAccessUrl(nodeId: string): Promise<DirectAccessUrlEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + return this.post({ + path: '/nodes/{nodeId}/request-direct-access-url', + pathParams, + returnType: DirectAccessUrlEntry + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/people.api.ts b/lib/js-api/src/api/content-rest-api/api/people.api.ts new file mode 100644 index 0000000000..1990e0406a --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/people.api.ts @@ -0,0 +1,333 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClientBody, PasswordResetBody, PersonBodyCreate, PersonBodyUpdate, PersonEntry, PersonPaging } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +/** + * People service. + */ +export class PeopleApi extends BaseApi { + /** + * Create person + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * **Note:** setting properties of type d:content and d:category are not supported. + * + * @param personBodyCreate The person details. + * @param opts Optional parameters + * @returns Promise<PersonEntry> + */ + createPerson(personBodyCreate: PersonBodyCreate, opts?: ContentFieldsQuery): Promise<PersonEntry> { + throwIfNotDefined(personBodyCreate, 'personBodyCreate'); + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/people', + queryParams, + bodyParam: personBodyCreate, + returnType: PersonEntry + }); + } + + /** + * Delete avatar image + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * Deletes the avatar image related to person **personId**. + * You must be the person or have admin rights to update a person's avatar. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @returns Promise<{}> + */ + deleteAvatarImage(personId: string): Promise<void> { + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + personId + }; + + return this.delete({ + path: '/people/{personId}/avatar', + pathParams + }); + } + + /** + * Get avatar image + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * Gets the avatar image related to the person **personId**. If the person has no related avatar then + * the **placeholder** query parameter can be optionally used to request a placeholder image to be returned. + * + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; + * for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.placeholder If **true** and there is no avatar for this **personId** + * then the placeholder image is returned, rather than a 404 response. (default to true) + * @returns Promise<Blob> + */ + getAvatarImage(personId: string, opts?: { attachment?: boolean; placeholder?: boolean; ifModifiedSince?: string }): Promise<Blob> { + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + personId + }; + + const queryParams = { + attachment: opts?.attachment, + placeholder: opts?.placeholder + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince + }; + + const accepts = ['application/octet-stream']; + + return this.get({ + path: '/people/{personId}/avatar', + pathParams, + queryParams, + headerParams, + accepts, + returnType: 'blob' + }); + } + + /** + * Get a person + * + * You can use the `-me-` string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @returns Promise<PersonEntry> + */ + getPerson(personId: string, opts?: ContentFieldsQuery): Promise<PersonEntry> { + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + personId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}', + pathParams, + queryParams, + returnType: PersonEntry + }); + } + + /** + * List people + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * List people. + * + * You can use the **include** parameter to return any additional information. + * + * The default sort order for the returned list is for people to be sorted by ascending id. + * You can override the default by using the **orderBy** parameter. + * + * You can use any of the following fields to order the results: + * - id + * - firstName + * - lastName + * + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @returns Promise<PersonPaging> + */ + listPeople( + opts?: { + orderBy?: string[]; + } & ContentPagingQuery & + ContentIncludeQuery & + ContentFieldsQuery + ): Promise<PersonPaging> { + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people', + queryParams, + returnType: PersonPaging + }); + } + + /** + * Request password reset + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * **Note:** No authentication is required to call this endpoint. + * + * @param personId The identifier of a person. + * @param clientBody The client name to send email with app-specific url. + * @returns Promise<{}> + */ + requestPasswordReset(personId: string, clientBody: ClientBody): Promise<any> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(clientBody, 'clientBody'); + + const pathParams = { + personId + }; + + return this.post({ + path: '/people/{personId}/request-password-reset', + pathParams, + bodyParam: clientBody + }); + } + + /** + * Reset password + * + * **Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. + * **Note:** No authentication is required to call this endpoint. + * + * @param personId The identifier of a person. + * @param passwordResetBody The reset password details + * @returns Promise<{}> + */ + resetPassword(personId: string, passwordResetBody: PasswordResetBody): Promise<any> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(passwordResetBody, 'passwordResetBody'); + + const pathParams = { + personId + }; + + return this.post({ + path: '/people/{personId}/reset-password', + pathParams, + bodyParam: passwordResetBody + }); + } + + /** + * Update avatar image + * + * **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. + * + * Updates the avatar image related to the person **personId**. + * + * The request body should be the binary stream for the avatar image. The content type of the file + * should be an image file. This will be used to generate an \"avatar\" thumbnail rendition. + * + * You must be the person or have admin rights to update a person's avatar. + * + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param contentBodyUpdate The binary content + * @returns Promise<{}> + */ + updateAvatarImage(personId: string, contentBodyUpdate: string): Promise<any> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(contentBodyUpdate, 'contentBodyUpdate'); + + const pathParams = { + personId + }; + + const contentTypes = ['application/octet-stream']; + + return this.put({ + path: '/people/{personId}/avatar', + pathParams, + bodyParam: contentBodyUpdate, + contentTypes + }); + } + + /** + * Update person + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * You can use the `-me-` string in place of <personId> to specify the currently authenticated user. + * If applicable, the given person's login access can also be optionally disabled or re-enabled. + * You must have admin rights to update a person — unless updating your own details. + * If you are changing your password, as a non-admin user, then the existing password must also + * be supplied (using the oldPassword field in addition to the new password value). + * + * Admin users cannot be disabled by setting enabled to false. + * Non-admin users may not disable themselves. + * **Note:** setting properties of type d:content and d:category are not supported. + * + * @param personId The identifier of a person. + * @param personBodyUpdate The person details. + * @param opts Optional parameters + * @returns Promise<PersonEntry> + */ + updatePerson(personId: string, personBodyUpdate: PersonBodyUpdate, opts?: ContentFieldsQuery): Promise<PersonEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(personBodyUpdate, 'personBodyUpdate'); + + const pathParams = { + personId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/people/{personId}', + pathParams, + queryParams, + bodyParam: personBodyUpdate, + returnType: PersonEntry + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/preferences.api.ts b/lib/js-api/src/api/content-rest-api/api/preferences.api.ts new file mode 100644 index 0000000000..db9853f333 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/preferences.api.ts @@ -0,0 +1,89 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PreferenceEntry, PreferencePaging } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentPagingQuery } from './types'; + +/** + * Preferences service. + */ +export class PreferencesApi extends BaseApi { + /** + * Get a preference + * + * Gets a specific preference for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param preferenceName The name of the preference. + * @param opts Optional parameters + * @returns Promise<PreferenceEntry> + */ + getPreference(personId: string, preferenceName: string, opts?: ContentFieldsQuery): Promise<PreferenceEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(preferenceName, 'preferenceName'); + + const pathParams = { + personId, + preferenceName + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/preferences/{preferenceName}', + pathParams, + queryParams + }); + } + + /** + * List preferences + * + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * Note that each preference consists of an **id** and a **value**. + * + * The **value** can be of any JSON type. + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @returns Promise<PreferencePaging> + */ + listPreferences(personId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<PreferencePaging> { + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + personId + }; + + const queryParams = { + ...(opts || {}), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/preferences', + pathParams, + queryParams + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/probes.api.ts b/lib/js-api/src/api/content-rest-api/api/probes.api.ts new file mode 100644 index 0000000000..97544c1a3e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/probes.api.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProbeEntry } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Probes service. + */ +export class ProbesApi extends BaseApi { + /** + * Check readiness and liveness of the repository + * + * **Note:** this endpoint is available in Alfresco 6.0 and newer versions. + * + * Returns a status of 200 to indicate success and 503 for failure. + * The readiness probe is normally only used to check repository startup. + * The liveness probe should then be used to check the repository is still responding to requests. + * **Note:** No authentication is required to call this endpoint. + * + * @param probeId The name of the probe: + * - -ready- + * - -live- + * @returns Promise<ProbeEntry> + */ + getProbe(probeId: string): Promise<ProbeEntry> { + throwIfNotDefined(probeId, 'probeId'); + + const pathParams = { + probeId + }; + + return this.get({ + path: '/probes/{probeId}', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/queries.api.ts b/lib/js-api/src/api/content-rest-api/api/queries.api.ts new file mode 100644 index 0000000000..556f993b5d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/queries.api.ts @@ -0,0 +1,189 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodePaging } from '../model/nodePaging'; +import { PersonPaging } from '../model/personPaging'; +import { SitePaging } from '../model/sitePaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +export type FindQuery = { + /** + * The term to search for. + */ + term?: string; + /** + * A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + */ + orderBy?: string[]; +} & ContentPagingQuery & + ContentFieldsQuery; + +export type FindNodesQuery = { + /** + * The id of the node to start the search from. + * Supports the aliases **-my-**, **-root-** and **-shared-**. + */ + rootNodeId?: string; + /** + * Restrict the returned results to only those of the given node type and its sub-types + */ + nodeType?: string; +} & FindQuery; + +/** + * Queries service. + */ +export class QueriesApi extends BaseApi { + /** + * Find nodes + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of nodes that match the given search criteria. + * + * The search term is used to look for nodes that match against name, title, description, full text content or tags. + * + * The search term: + * - must contain a minimum of 3 alphanumeric characters + * - allows \"quoted term\" + * - can optionally use '*' for wildcard matching + * + * By default, file and folder types will be searched unless a specific type is provided as a query parameter. + * + * By default, the search will be across the repository unless a specific root node id is provided to start the search from. + * + * You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + * - name + * - modifiedAt + * - createdAt + * + * @param term The term to search for. + * @param opts Optional parameters + * @returns Promise<NodePaging> + */ + findNodes(term: string, opts?: FindNodesQuery & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<NodePaging> { + throwIfNotDefined(term, 'term'); + + const queryParams = { + term, + rootNodeId: opts?.rootNodeId, + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + nodeType: opts?.nodeType, + include: buildCollectionParam(opts?.include, 'csv'), + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/queries/nodes', + queryParams, + returnType: NodePaging + }); + } + + /** + * Find people + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of people that match the given search criteria. + * + * The search term is used to look for matches against person id, firstname and lastname. + * + * The search term: + * - must contain a minimum of 2 alphanumeric characters + * - can optionally use '*' for wildcard matching within the term + * + * You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + * - id + * - firstName + * - lastName + * + * @param term The term to search for. + * @param opts Optional parameters + * @returns Promise<PersonPaging> + */ + findPeople(term: string, opts?: FindQuery): Promise<PersonPaging> { + throwIfNotDefined(term, 'term'); + opts = opts || {}; + + const queryParams = { + term, + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv'), + orderBy: buildCollectionParam(opts?.orderBy, 'csv') + }; + + return this.get({ + path: '/queries/people', + queryParams, + returnType: PersonPaging + }); + } + + /** + * Find sites + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of sites that match the given search criteria. + * + * The search term is used to look for sites that match against site id, title or description. + * + * The search term: + * - must contain a minimum of 2 alphanumeric characters + * - can optionally use '*' for wildcard matching within the term + * + * The default sort order for the returned list is for sites to be sorted by ascending id. + * You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + * - id + * - title + * - description + * + * @param term The term to search for. + * @param opts Optional parameters + * @returns Promise<SitePaging> + */ + findSites(term: string, opts?: FindQuery): Promise<SitePaging> { + throwIfNotDefined(term, 'term'); + + const queryParams = { + term, + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/queries/sites', + queryParams, + returnType: SitePaging + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/ratings.api.ts b/lib/js-api/src/api/content-rest-api/api/ratings.api.ts new file mode 100644 index 0000000000..78532b055e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/ratings.api.ts @@ -0,0 +1,150 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RatingBody } from '../model/ratingBody'; +import { RatingEntry } from '../model/ratingEntry'; +import { RatingPaging } from '../model/ratingPaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentPagingQuery } from './types'; + +/** + * Ratings service. + */ +export class RatingsApi extends BaseApi { + /** + * Create a rating + * + * @param nodeId The identifier of a node. + * @param ratingBodyCreate For \"myRating\" the type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. + * For example, to \"like\" a file the following body would be used: + * + *JSON + *{ + * \"id\": \"likes\", + * \"myRating\": true + * } + * @param opts Optional parameters + * @returns Promise<RatingEntry> + */ + createRating(nodeId: string, ratingBodyCreate: RatingBody, opts?: ContentFieldsQuery): Promise<RatingEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(ratingBodyCreate, 'ratingBodyCreate'); + + const pathParams = { + nodeId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/ratings', + pathParams, + queryParams, + bodyParam: ratingBodyCreate, + returnType: RatingEntry + }); + } + + /** + * Delete a rating + * + * Deletes rating **ratingId** from node **nodeId**. + * + * @param nodeId The identifier of a node. + * @param ratingId The identifier of a rating. + * @returns Promise<{}> + */ + deleteRating(nodeId: string, ratingId: string): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(ratingId, 'ratingId'); + + const pathParams = { + nodeId, + ratingId + }; + + return this.delete({ + path: '/nodes/{nodeId}/ratings/{ratingId}', + pathParams + }); + } + + /** + * Get a rating + * + * Get the specific rating **ratingId** on node **nodeId**. + * + * @param nodeId The identifier of a node. + * @param ratingId The identifier of a rating. + * @param opts Optional parameters + * @returns Promise<RatingEntry> + */ + getRating(nodeId: string, ratingId: string, opts?: ContentFieldsQuery): Promise<RatingEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(ratingId, 'ratingId'); + + const pathParams = { + nodeId, + ratingId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/ratings/{ratingId}', + pathParams, + queryParams, + returnType: RatingEntry + }); + } + + /** + * List ratings + * + * Gets a list of ratings for node **nodeId**. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @returns Promise<RatingPaging> + */ + listRatings(nodeId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<RatingPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/ratings', + pathParams, + queryParams, + returnType: RatingPaging + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/renditions.api.ts b/lib/js-api/src/api/content-rest-api/api/renditions.api.ts new file mode 100644 index 0000000000..db94a4fb0d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/renditions.api.ts @@ -0,0 +1,191 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DirectAccessUrlEntry, RenditionBodyCreate, RenditionEntry, RenditionPaging } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * Renditions service. + */ +export class RenditionsApi extends BaseApi { + /** + * Create rendition + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param renditionBodyCreate The rendition \"id\". + * @returns Promise<{}> + */ + createRendition(nodeId: string, renditionBodyCreate: RenditionBodyCreate): Promise<any> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(renditionBodyCreate, 'renditionBodyCreate'); + + const pathParams = { + nodeId + }; + + return this.post({ + path: '/nodes/{nodeId}/renditions', + pathParams, + bodyParam: renditionBodyCreate + }); + } + + /** + * Get rendition information + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*. + * @returns Promise<RenditionEntry> + */ + getRendition(nodeId: string, renditionId: string): Promise<RenditionEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(renditionId, 'renditionId'); + + const pathParams = { + nodeId, + renditionId + }; + + return this.get({ + path: '/nodes/{nodeId}/renditions/{renditionId}', + pathParams, + returnType: RenditionEntry + }); + } + + /** + * Get rendition content + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.range The Range header indicates the part of a document that the server should return. + * Single part request supported, for example: bytes=1-10. + * @param opts.placeholder If **true** and there is no rendition for this **nodeId** and **renditionId**, + * then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. (default to false) + * @returns Promise<Blob> + */ + getRenditionContent( + nodeId: string, + renditionId: string, + opts?: { + attachment?: boolean; + placeholder?: boolean; + ifModifiedSince?: string; + range?: string; + } + ): Promise<Blob> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(renditionId, 'renditionId'); + + const pathParams = { + nodeId, + renditionId + }; + + const queryParams = { + attachment: opts?.attachment, + placeholder: opts?.placeholder + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince, + Range: opts?.range + }; + + const accepts = ['application/octet-stream']; + + return this.get({ + path: '/nodes/{nodeId}/renditions/{renditionId}/content', + pathParams, + queryParams, + headerParams, + accepts, + returnType: 'blob' + }); + } + + /** + * List renditions + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of the rendition information for each rendition of the the file **nodeId**, including the rendition id. + * Each rendition returned has a **status**: CREATED means it is available to view or download, NOT_CREATED means the rendition can be requested. + * You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where** + * clause will return just the CREATED renditions: + * - (status='CREATED') + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @param opts.where A string to restrict the returned objects by using a predicate. + * @returns Promise<RenditionPaging> + */ + listRenditions(nodeId: string, opts?: { where?: string }): Promise<RenditionPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + return this.get({ + path: '/nodes/{nodeId}/renditions', + pathParams, + queryParams: opts, + returnType: RenditionPaging + }); + } + + /** + * Generate a direct access content url for a given rendition of a node + * + * **Note:** this endpoint is available in Alfresco 7.1 and newer versions. + * + * @param nodeId The identifier of a node. + * @param renditionId The identifier of a version + * @returns Promise<DirectAccessUrlEntry> + */ + requestDirectAccessUrl(nodeId: string, renditionId: string): Promise<DirectAccessUrlEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(renditionId, 'renditionId'); + + const pathParams = { + nodeId, + renditionId + }; + + return this.post({ + path: '/nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url', + pathParams, + returnType: DirectAccessUrlEntry + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/sharedlinks.api.ts b/lib/js-api/src/api/content-rest-api/api/sharedlinks.api.ts new file mode 100644 index 0000000000..ae9ad4114d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/sharedlinks.api.ts @@ -0,0 +1,336 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenditionEntry } from '../model/renditionEntry'; +import { RenditionPaging } from '../model/renditionPaging'; +import { SharedLinkBodyCreate } from '../model/sharedLinkBodyCreate'; +import { SharedLinkBodyEmail } from '../model/sharedLinkBodyEmail'; +import { SharedLinkEntry } from '../model/sharedLinkEntry'; +import { SharedLinkPaging } from '../model/sharedLinkPaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +/** + * Sharedlinks service. + */ +export class SharedlinksApi extends BaseApi { + /** + * Create a shared link to a file + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param sharedLinkBodyCreate The nodeId to create a shared link for. + * @param opts Optional parameters + * @returns Promise<SharedLinkEntry> + */ + createSharedLink(sharedLinkBodyCreate: SharedLinkBodyCreate, opts?: ContentIncludeQuery & ContentFieldsQuery): Promise<SharedLinkEntry> { + throwIfNotDefined(sharedLinkBodyCreate, 'sharedLinkBodyCreate'); + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/shared-links', + queryParams, + bodyParam: sharedLinkBodyCreate, + returnType: SharedLinkEntry + }); + } + + /** + * Deletes a shared link + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param sharedId The identifier of a shared link to a file. + * @returns Promise<{}> + */ + deleteSharedLink(sharedId: string): Promise<void> { + throwIfNotDefined(sharedId, 'sharedId'); + + const pathParams = { + sharedId + }; + + return this.delete({ + path: '/shared-links/{sharedId}', + pathParams + }); + } + + /** + * Email shared link + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param sharedId The identifier of a shared link to a file. + * @param sharedLinkBodyEmail The shared link email to send. + * @returns Promise<{}> + */ + emailSharedLink(sharedId: string, sharedLinkBodyEmail: SharedLinkBodyEmail): Promise<any> { + throwIfNotDefined(sharedId, 'sharedId'); + throwIfNotDefined(sharedLinkBodyEmail, 'sharedLinkBodyEmail'); + + const pathParams = { + sharedId + }; + + return this.post({ + path: '/shared-links/{sharedId}/email', + pathParams, + bodyParam: sharedLinkBodyEmail + }); + } + + /** + * Get a shared link + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * **Note:** No authentication is required to call this endpoint. + * + * @param sharedId The identifier of a shared link to a file. + * @param opts Optional parameters + * @returns Promise<SharedLinkEntry> + */ + getSharedLink(sharedId: string, opts?: ContentFieldsQuery): Promise<SharedLinkEntry> { + throwIfNotDefined(sharedId, 'sharedId'); + + const pathParams = { + sharedId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/shared-links/{sharedId}', + pathParams, + queryParams, + returnType: SharedLinkEntry + }); + } + + /** + * Get shared link content + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * **Note:** No authentication is required to call this endpoint. + * + * @param sharedId The identifier of a shared link to a file. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. + * (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.range The Range header indicates the part of a document that the server should return. + * Single part request supported, for example: bytes=1-10. + * @returns Promise<Blob> + */ + getSharedLinkContent( + sharedId: string, + opts?: { + attachment?: boolean; + ifModifiedSince?: string; + range?: string; + } + ): Promise<Blob> { + throwIfNotDefined(sharedId, 'sharedId'); + + const pathParams = { + sharedId + }; + + const queryParams = { + attachment: opts?.attachment + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince, + Range: opts?.range + }; + + return this.get({ + path: '/shared-links/{sharedId}/content', + pathParams, + queryParams, + headerParams, + accepts: ['application/octet-stream'], + returnType: 'blob' + }); + } + + /** + * Get shared link rendition information + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * This API method returns rendition information where the rendition status is CREATED, + * which means the rendition is available to view/download. + * + * **Note:** No authentication is required to call this endpoint. + * + * @param sharedId The identifier of a shared link to a file. + * @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*. + * @returns Promise<RenditionEntry> + */ + getSharedLinkRendition(sharedId: string, renditionId: string): Promise<RenditionEntry> { + throwIfNotDefined(sharedId, 'sharedId'); + throwIfNotDefined(renditionId, 'renditionId'); + + const pathParams = { + sharedId, + renditionId + }; + + return this.get({ + path: '/shared-links/{sharedId}/renditions/{renditionId}', + pathParams, + returnType: RenditionEntry + }); + } + + /** + * Get shared link rendition content + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * **Note:** No authentication is required to call this endpoint. + * + * @param sharedId The identifier of a shared link to a file. + * @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; + * for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.range The Range header indicates the part of a document that the server should return. + * Single part request supported, for example: bytes=1-10. + * @returns Promise<Blob> + */ + getSharedLinkRenditionContent( + sharedId: string, + renditionId: string, + opts?: { + attachment?: boolean; + ifModifiedSince?: string; + range?: string; + } + ): Promise<Blob> { + throwIfNotDefined(sharedId, 'sharedId'); + throwIfNotDefined(renditionId, 'renditionId'); + + const pathParams = { + sharedId, + renditionId + }; + + const queryParams = { + attachment: opts?.attachment + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince, + Range: opts?.range + }; + + return this.get({ + path: '/shared-links/{sharedId}/renditions/{renditionId}/content', + pathParams, + queryParams, + headerParams, + accepts: ['application/octet-stream'], + returnType: 'blob' + }); + } + + /** + * List renditions for a shared link + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of the rendition information for the file with shared link identifier **sharedId**. + * This API method returns rendition information, including the rendition id, for each rendition + * where the rendition status is CREATED, which means the rendition is available to view/download. + * + * **Note:** No authentication is required to call this endpoint. + * + * @param sharedId The identifier of a shared link to a file. + * @returns Promise<RenditionPaging> + */ + listSharedLinkRenditions(sharedId: string): Promise<RenditionPaging> { + throwIfNotDefined(sharedId, 'sharedId'); + + const pathParams = { + sharedId + }; + + return this.get({ + path: '/shared-links/{sharedId}/renditions', + pathParams, + returnType: RenditionPaging + }); + } + + /** + * List shared links + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Get a list of links that the current user has read permission on source node. + * The list is ordered in descending modified order. + * + * **Note:** The list of links is eventually consistent so newly created shared links may not appear immediately. + * + * @param opts Optional parameters + * @param opts.where Optionally filter the list by \"sharedByUser\" `userId` of person who shared the link (can also use -me-) + * where=(sharedByUser='jbloggs') + * where=(sharedByUser='-me-') + * @returns Promise<SharedLinkPaging> + */ + listSharedLinks( + opts?: { + where?: string; + } & ContentPagingQuery & + ContentIncludeQuery & + ContentFieldsQuery + ): Promise<SharedLinkPaging> { + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/shared-links', + queryParams, + returnType: SharedLinkPaging + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/sites.api.ts b/lib/js-api/src/api/content-rest-api/api/sites.api.ts new file mode 100644 index 0000000000..4198790453 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/sites.api.ts @@ -0,0 +1,1013 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + SiteBodyCreate, + SiteBodyUpdate, + SiteContainerEntry, + SiteContainerPaging, + SiteEntry, + SiteGroupEntry, + SiteGroupPaging, + SiteMemberEntry, + SiteMemberPaging, + SiteMembershipBodyCreate, + SiteMembershipBodyUpdate, + SiteMembershipRequestBodyCreate, + SiteMembershipRequestBodyUpdate, + SiteMembershipRequestEntry, + SiteMembershipRequestPaging, + SiteMembershipRequestWithPersonPaging, + SitePaging, + SiteRoleEntry, + SiteRolePaging +} from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentPagingQuery } from './types'; + +/** + * Sites service. + */ +export class SitesApi extends BaseApi { + /** + * Approve a site membership request + * + * @param siteId The identifier of a site. + * @param inviteeId The invitee username. + * @param opts Optional parameters + * @param opts.siteMembershipApprovalBody Accepting a request to join, optionally, allows assignment of a role to the user. + * @returns Promise<{}> + */ + approveSiteMembershipRequest(siteId: string, inviteeId: string, opts?: { siteMembershipApprovalBody?: any }): Promise<any> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(inviteeId, 'inviteeId'); + + const postBody = opts?.siteMembershipApprovalBody; + + const pathParams = { + siteId, + inviteeId + }; + + return this.post({ + path: '/sites/{siteId}/site-membership-requests/{inviteeId}/approve', + pathParams, + bodyParam: postBody + }); + } + + /** + * Create a site + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param siteBodyCreate The site details + * @param opts Optional parameters + * @param opts.skipConfiguration Flag to indicate whether the Share-specific (surf) configuration files for the site should not be created. (default to false) + * @param opts.skipAddToFavorites Flag to indicate whether the site should not be added to the user's site favorites. (default to false) + * @param opts.fields A list of field names. You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * The list applies to a returned individual entity or entries within a collection. + * If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<SiteEntry> + */ + createSite( + siteBodyCreate: SiteBodyCreate, + opts?: { skipConfiguration?: boolean; skipAddToFavorites?: boolean; fields?: string[] } + ): Promise<SiteEntry> { + throwIfNotDefined(siteBodyCreate, 'siteBodyCreate'); + opts = opts || {}; + + const queryParams = { + skipConfiguration: opts?.skipConfiguration, + skipAddToFavorites: opts?.skipAddToFavorites, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/sites', + queryParams, + bodyParam: siteBodyCreate, + returnType: SiteEntry + }); + } + + /** + * Create a site membership + * + * @param siteId The identifier of a site. + * @param siteMembershipBodyCreate The person to add and their role + * @param opts Optional parameters + * @param opts.fields A list of field names. You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual + * entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + * @returns Promise<SiteMemberEntry> + */ + createSiteMembership(siteId: string, siteMembershipBodyCreate: SiteMembershipBodyCreate, opts?: { fields?: string[] }): Promise<SiteMemberEntry> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(siteMembershipBodyCreate, 'siteMembershipBodyCreate'); + + const pathParams = { + siteId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/sites/{siteId}/members', + pathParams, + queryParams, + bodyParam: siteMembershipBodyCreate, + returnType: SiteMemberEntry + }); + } + + /** + * Create a site membership request + * + * @param personId The identifier of a person. + * @param siteMembershipRequestBodyCreate Site membership request details + * @param opts Optional parameters + * @returns Promise<SiteMembershipRequestEntry> + */ + createSiteMembershipRequestForPerson( + personId: string, + siteMembershipRequestBodyCreate: SiteMembershipRequestBodyCreate, + opts?: ContentFieldsQuery + ): Promise<SiteMembershipRequestEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteMembershipRequestBodyCreate, 'siteMembershipRequestBodyCreate'); + + const pathParams = { + personId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/people/{personId}/site-membership-requests', + pathParams, + queryParams, + bodyParam: siteMembershipRequestBodyCreate, + returnType: SiteMembershipRequestEntry + }); + } + + /** + * Delete a site + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param siteId The identifier of a site. + * @param opts Optional parameters + * @param opts.permanent Flag to indicate whether the site should be permanently deleted i.e. bypass the trashcan. (default to false) + * @returns Promise<{}> + */ + deleteSite(siteId: string, opts?: { permanent?: boolean }): Promise<void> { + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + siteId + }; + + const queryParams = { + permanent: opts?.permanent + }; + + return this.delete({ + path: '/sites/{siteId}', + pathParams, + queryParams + }); + } + + /** + * Delete a site membership + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param siteId The identifier of a site. + * @param personId The identifier of a person. + * @returns Promise<{}> + */ + deleteSiteMembership(siteId: string, personId: string): Promise<void> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + siteId, + personId + }; + + return this.delete({ + path: '/sites/{siteId}/members/{personId}', + pathParams + }); + } + + /** + * Delete a site membership + * + * Deletes person **personId** as a member of site **siteId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param siteId The identifier of a site. + * @returns Promise<{}> + */ + deleteSiteMembershipForPerson(personId: string, siteId: string): Promise<void> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + personId, + siteId + }; + + return this.delete({ + path: '/people/{personId}/sites/{siteId}', + pathParams + }); + } + + /** + * Delete a site membership request + * + * Deletes the site membership request to site **siteId** for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param siteId The identifier of a site. + * @returns Promise<{}> + */ + deleteSiteMembershipRequestForPerson(personId: string, siteId: string): Promise<void> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + personId, + siteId + }; + + return this.delete({ + path: '/people/{personId}/site-membership-requests/{siteId}', + pathParams + }); + } + + /** + * Get a site + * + * Gets information for site **siteId**. + * + * You can use the **relations** parameter to include one or more related + * entities in a single response and so reduce network traffic. + * + * The entity types in Alfresco are organized in a tree structure. + * The **sites** entity has two children, **containers** and **members**. + * The following relations parameter returns all the container and member + * objects related to the site **siteId**: + * + * containers,members + * + * @param siteId The identifier of a site. + * @param opts Optional parameters + * @param opts.relations Use the relations parameter to include one or more related entities in a single response. + * @returns Promise<SiteEntry> + */ + getSite(siteId: string, opts?: { relations?: string[] } & ContentFieldsQuery): Promise<SiteEntry> { + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + siteId + }; + + const queryParams = { + relations: buildCollectionParam(opts?.relations, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/sites/{siteId}', + pathParams, + queryParams, + returnType: SiteEntry + }); + } + + /** + * Get a site container + * + * Gets information on the container **containerId** in site **siteId**. + * + * @param siteId The identifier of a site. + * @param containerId The unique identifier of a site container. + * @param opts Optional parameters + * @returns Promise<SiteContainerEntry> + */ + getSiteContainer(siteId: string, containerId: string, opts?: ContentFieldsQuery): Promise<SiteContainerEntry> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(containerId, 'containerId'); + + const pathParams = { + siteId, + containerId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/sites/{siteId}/containers/{containerId}', + pathParams, + queryParams + }); + } + + /** + * Get a site membership + * + * Gets site membership information for person **personId** on site **siteId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param siteId The identifier of a site. + * @param personId The identifier of a person. + * @param opts Optional parameters + * @returns Promise<SiteMemberEntry> + */ + getSiteMembership(siteId: string, personId: string, opts?: ContentFieldsQuery): Promise<SiteMemberEntry> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + siteId, + personId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/sites/{siteId}/members/{personId}', + pathParams, + queryParams, + returnType: SiteMemberEntry + }); + } + + /** + * Get a site membership + * + * Gets site membership information for person **personId** on site **siteId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param siteId The identifier of a site. + * @returns Promise<SiteRoleEntry> + */ + getSiteMembershipForPerson(personId: string, siteId: string): Promise<SiteRoleEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + personId, + siteId + }; + + return this.get({ + path: '/people/{personId}/sites/{siteId}', + pathParams, + returnType: SiteRoleEntry + }); + } + + /** + * Get a site membership request + * + * Gets the site membership request for site **siteId** for person **personId**, if one exists. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param siteId The identifier of a site. + * @param opts Optional parameters + * @returns Promise<SiteMembershipRequestEntry> + */ + getSiteMembershipRequestForPerson(personId: string, siteId: string, opts?: ContentFieldsQuery): Promise<SiteMembershipRequestEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + personId, + siteId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/site-membership-requests/{siteId}', + pathParams, + queryParams, + returnType: SiteMembershipRequestEntry + }); + } + + /** + * Get site membership requests + * + * You can use the **where** parameter to filter the returned site membership requests by **siteId**. For example: + * + * (siteId=mySite) + * + * The **where** parameter can also be used to filter by ***personId***. For example: + * + * where=(personId=person) + * + * This may be combined with the siteId filter, as shown below: + * + * where=(siteId=mySite AND personId=person)) + * + * @param opts Optional parameters + * @param opts.where A string to restrict the returned objects by using a predicate. + * @returns Promise<SiteMembershipRequestWithPersonPaging> + */ + getSiteMembershipRequests(opts?: { where?: string } & ContentPagingQuery & ContentFieldsQuery): Promise<SiteMembershipRequestWithPersonPaging> { + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + where: opts?.where, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/site-membership-requests', + queryParams, + returnType: SiteMembershipRequestWithPersonPaging + }); + } + + /** + * List site containers + * + * Gets a list of containers for the site **siteId**. + * + * @param siteId The identifier of a site. + * @param opts Optional parameters + * @returns Promise<SiteContainerPaging> + */ + listSiteContainers(siteId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<SiteContainerPaging> { + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + siteId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/sites/{siteId}/containers', + pathParams, + queryParams, + returnType: SiteContainerPaging + }); + } + + /** + * List site membership requests + * + * Gets a list of the current site membership requests for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @returns Promise<SiteMembershipRequestPaging> + */ + listSiteMembershipRequestsForPerson(personId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<SiteMembershipRequestPaging> { + throwIfNotDefined(personId, 'personId'); + + const pathParams = { + personId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/people/{personId}/site-membership-requests', + pathParams, + queryParams, + returnType: SiteMembershipRequestPaging + }); + } + + /** + * List site memberships + * + * Gets a list of site memberships for site **siteId**. + * + * @param siteId The identifier of a site. + * @param opts Optional parameters + * @returns Promise<SiteMemberPaging> + */ + listSiteMemberships(siteId: string, opts?: { where?: string } & ContentPagingQuery & ContentFieldsQuery): Promise<SiteMemberPaging> { + throwIfNotDefined(siteId, 'siteId'); + + opts = opts || {}; + + const pathParams = { + siteId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + where: opts?.where, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/sites/{siteId}/members', + pathParams, + queryParams, + returnType: SiteMemberPaging + }); + } + + /** + * List site memberships + * + * Gets a list of site membership information for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * You can use the **where** parameter to filter the returned sites by **visibility** or site **preset**. + * + * Example to filter by **visibility**, use any one of: + * - (visibility='PRIVATE') + * - (visibility='PUBLIC') + * - (visibility='MODERATED') + * + * Example to filter by site **preset**: + * + * (preset='site-dashboard') + * + * The default sort order for the returned list is for sites to be sorted by ascending title. + * You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + * - id + * - title + * - role + * + * @param personId The identifier of a person. + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.relations Use the relations parameter to include one or more related entities in a single response. + * @param opts.where A string to restrict the returned objects by using a predicate. + * @returns Promise<SiteRolePaging> + */ + listSiteMembershipsForPerson( + personId: string, + opts?: { where?: string; orderBy?: string[]; relations?: string[] } & ContentPagingQuery & ContentFieldsQuery + ): Promise<SiteRolePaging> { + throwIfNotDefined(personId, 'personId'); + opts = opts || {}; + + const pathParams = { + personId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + relations: buildCollectionParam(opts?.relations, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv'), + where: opts?.where + }; + + return this.get({ + path: '/people/{personId}/sites', + pathParams, + queryParams, + returnType: SiteRolePaging + }); + } + + /** + * List sites + * + * Gets a list of sites in this repository. + * + * You can use the **where** parameter to filter the returned sites by **visibility** or site **preset**. + * + * Example to filter by **visibility**, use any one of: + * + * (visibility='PRIVATE') + * (visibility='PUBLIC') + * (visibility='MODERATED') + * + * Example to filter by site **preset**: + * + * (preset='site-dashboard') + * + * The default sort order for the returned list is for sites to be sorted by ascending title. + * You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + * id + * title + * description + * + * You can use the **relations** parameter to include one or more related + * entities in a single response and so reduce network traffic. + * + * The entity types in Alfresco are organized in a tree structure. + * The **sites** entity has two children, **containers** and **members**. + * The following relations parameter returns all the container and member + * objects related to each site: + * + * containers,members + * + * + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.relations Use the relations parameter to include one or more related entities in a single response. + * @param opts.where A string to restrict the returned objects by using a predicate. + * @returns Promise<SitePaging> + */ + listSites( + opts?: { + orderBy?: string[]; + relations?: string[]; + where?: string; + } & ContentPagingQuery & + ContentFieldsQuery + ): Promise<SitePaging> { + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + relations: buildCollectionParam(opts?.relations, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv'), + where: opts?.where + }; + + return this.get({ + path: '/sites', + queryParams, + returnType: SitePaging + }); + } + + /** + * Reject a site membership request + * + * @param siteId The identifier of a site. + * @param inviteeId The invitee username. + * @param opts Optional parameters + * @param opts.siteMembershipRejectionBody Rejecting a request to join, optionally, allows the inclusion of comment. + * @returns Promise<{}> + */ + rejectSiteMembershipRequest(siteId: string, inviteeId: string, opts?: { siteMembershipRejectionBody?: any }): Promise<any> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(inviteeId, 'inviteeId'); + + const postBody = opts?.siteMembershipRejectionBody; + + const pathParams = { + siteId, + inviteeId + }; + + return this.post({ + path: '/sites/{siteId}/site-membership-requests/{inviteeId}/reject', + pathParams, + bodyParam: postBody + }); + } + + /** + * Update a site + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Update the details for the given site **siteId**. Site Manager or otherwise a + * (site) admin can update title, description or visibility. + * + * Note: the id of a site cannot be updated once the site has been created. + * + * @param siteId The identifier of a site. + * @param siteBodyUpdate The site information to update. + * @param opts Optional parameters + * @returns Promise<SiteEntry> + */ + updateSite(siteId: string, siteBodyUpdate: SiteBodyUpdate, opts?: ContentFieldsQuery): Promise<SiteEntry> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(siteBodyUpdate, 'siteBodyUpdate'); + + opts = opts || {}; + + const pathParams = { + siteId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/sites/{siteId}', + pathParams, + queryParams, + bodyParam: siteBodyUpdate, + returnType: SiteEntry + }); + } + + /** + * Update a site membership + * + * Update the membership of person **personId** in site **siteId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * You can set the **role** to one of four types: + * - SiteConsumer + * - SiteCollaborator + * - SiteContributor + * - SiteManager + * + * @param siteId The identifier of a site. + * @param personId The identifier of a person. + * @param siteMembershipBodyUpdate The persons new role + * @param opts Optional parameters + * @returns Promise<SiteMemberEntry> + */ + updateSiteMembership( + siteId: string, + personId: string, + siteMembershipBodyUpdate: SiteMembershipBodyUpdate, + opts?: ContentFieldsQuery + ): Promise<SiteMemberEntry> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteMembershipBodyUpdate, 'siteMembershipBodyUpdate'); + + const pathParams = { + siteId, + personId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/sites/{siteId}/members/{personId}', + pathParams, + queryParams, + bodyParam: siteMembershipBodyUpdate, + returnType: SiteMemberEntry + }); + } + + /** + * Update a site membership request + * + * Updates the message for the site membership request to site **siteId** for person **personId**. + * You can use the -me- string in place of <personId> to specify the currently authenticated user. + * + * @param personId The identifier of a person. + * @param siteId The identifier of a site. + * @param siteMembershipRequestBodyUpdate The new message to display + * @param opts Optional parameters + * @returns Promise<SiteMembershipRequestEntry> + */ + updateSiteMembershipRequestForPerson( + personId: string, + siteId: string, + siteMembershipRequestBodyUpdate: SiteMembershipRequestBodyUpdate, + opts?: ContentFieldsQuery + ): Promise<SiteMembershipRequestEntry> { + throwIfNotDefined(personId, 'personId'); + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(siteMembershipRequestBodyUpdate, 'siteMembershipRequestBodyUpdate'); + + const pathParams = { + personId, + siteId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/people/{personId}/site-membership-requests/{siteId}', + pathParams, + queryParams, + bodyParam: siteMembershipRequestBodyUpdate, + returnType: SiteMembershipRequestEntry + }); + } + + /** + * Create a site membership for group + * + * **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions. + * You can set the **role** to one of four types: + * - SiteConsumer + * - SiteCollaborator + * - SiteContributor + * - SiteManager + * + * @param siteId The identifier of a site. + * @param siteMembershipBodyCreate The group to add and it role + * @param opts Optional parameters + * @returns Promise<SiteGroupEntry> + */ + createSiteGroupMembership( + siteId: string, + siteMembershipBodyCreate: SiteMembershipBodyCreate, + opts?: ContentFieldsQuery + ): Promise<SiteGroupEntry> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(siteMembershipBodyCreate, 'siteMembershipBodyCreate'); + + const pathParams = { + siteId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/sites/{siteId}/group-members', + pathParams, + queryParams, + bodyParam: siteMembershipBodyCreate, + returnType: SiteGroupEntry + }); + } + + /** + * List group membership for site + * + * **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions. + * + * @param siteId The identifier of a site. + * @param opts Optional parameters + * @returns Promise<SiteGroupPaging> + */ + listSiteGroups(siteId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<SiteGroupPaging> { + throwIfNotDefined(siteId, 'siteId'); + + const pathParams = { + siteId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/sites/{siteId}/group-members', + pathParams, + queryParams, + returnType: SiteGroupPaging + }); + } + + /** + * Get information about site membership of group + * **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions. + * Gets site membership information for group **groupId** on site **siteId**. + * + * @param siteId The identifier of a site. + * @param groupId The authorityId of a group. + * @param opts Optional parameters + * @returns Promise<SiteGroupEntry> + */ + getSiteGroupMembership(siteId: string, groupId: string, opts?: ContentFieldsQuery): Promise<SiteGroupEntry> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + siteId, + groupId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/sites/{siteId}/group-members/{groupId}', + pathParams, + queryParams, + returnType: SiteGroupEntry + }); + } + + /** + * Update site membership of group + * + * **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions. + * + * You can set the **role** to one of four types: + * - SiteConsumer + * - SiteCollaborator + * - SiteContributor + * - SiteManager + * + * @param siteId The identifier of a site. + * @param groupId The authorityId of a group. + * @param siteMembershipBodyUpdate The group new role + * @param opts Optional parameters + * @returns Promise<SiteGroupEntry> + */ + updateSiteGroupMembership( + siteId: string, + groupId: string, + siteMembershipBodyUpdate: SiteMembershipBodyUpdate, + opts?: ContentFieldsQuery + ): Promise<SiteGroupEntry> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(groupId, 'groupId'); + throwIfNotDefined(siteMembershipBodyUpdate, 'siteMembershipBodyUpdate'); + + const pathParams = { + siteId, + groupId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/sites/{siteId}/group-members/{groupId}', + pathParams, + queryParams, + bodyParam: siteMembershipBodyUpdate, + returnType: SiteGroupEntry + }); + } + + /** + * Delete a group membership for site + * + * @param siteId The identifier of a site. + * @param groupId The authorityId of a group. + * @returns Promise<{}> + */ + deleteSiteGroupMembership(siteId: string, groupId: string): Promise<void> { + throwIfNotDefined(siteId, 'siteId'); + throwIfNotDefined(groupId, 'groupId'); + + const pathParams = { + siteId, + groupId + }; + + return this.delete({ + path: '/sites/{siteId}/group-members/{groupId}', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/tags.api.ts b/lib/js-api/src/api/content-rest-api/api/tags.api.ts new file mode 100644 index 0000000000..398a2d9b52 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/tags.api.ts @@ -0,0 +1,262 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TagBody } from '../model/tagBody'; +import { TagEntry } from '../model/tagEntry'; +import { TagPaging } from '../model/tagPaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +/** + * Tags service. + */ +export class TagsApi extends BaseApi { + /** + * Create a tag for a node + * + * @param nodeId The identifier of a node. + * @param tagBodyCreate The new tag + * @param opts Optional parameters + * @returns Promise<TagEntry> + */ + createTagForNode(nodeId: string, tagBodyCreate: TagBody[], opts?: ContentFieldsQuery): Promise<TagEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(tagBodyCreate, 'tagBodyCreate'); + + const pathParams = { + nodeId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/tags', + pathParams, + queryParams, + bodyParam: tagBodyCreate, + returnType: TagEntry + }); + } + + /** + * Delete a tag from a node + * + * @param nodeId The identifier of a node. + * @param tagId The identifier of a tag. + * @returns Promise<{}> + */ + deleteTagFromNode(nodeId: string, tagId: string): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(tagId, 'tagId'); + + const pathParams = { + nodeId, + tagId + }; + + return this.delete({ + path: '/nodes/{nodeId}/tags/{tagId}', + pathParams + }); + } + + /** + * Get a tag + * + * @param tagId The identifier of a tag. + * @param opts Optional parameters + * @returns Promise<TagEntry> + */ + getTag(tagId: string, opts?: ContentFieldsQuery): Promise<TagEntry> { + throwIfNotDefined(tagId, 'tagId'); + + const pathParams = { + tagId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/tags/{tagId}', + pathParams, + queryParams, + returnType: TagEntry + }); + } + + /** + * List tags + * + * @param opts Optional parameters + * @param opts.tag Name or pattern for which tag is returned. Example of pattern: *test* which returns tags like 'my test 1' + * @param opts.matching Switches filtering to pattern mode instead of exact mode. + * @returns Promise<TagPaging> + */ + listTags(opts?: { tag?: string; matching?: boolean } & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<TagPaging> { + opts = opts || {}; + + const pathParams = {}; + + let where: string; + if (opts?.tag) { + where = opts.matching ? `(tag matches ('${opts.tag}'))` : `(tag='${opts.tag}')`; + } + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv'), + include: buildCollectionParam(opts?.include, 'csv'), + where + }; + + return this.get({ + path: '/tags', + pathParams, + queryParams, + returnType: TagPaging + }); + } + + /** + * List tags for a node + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @returns Promise<TagPaging> + */ + listTagsForNode(nodeId: string, opts?: ContentPagingQuery & ContentFieldsQuery): Promise<TagPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/nodes/{nodeId}/tags', + pathParams, + queryParams, + returnType: TagPaging + }); + } + + /** + * Update a tag + * + * @param tagId The identifier of a tag. + * @param tagBodyUpdate The updated tag + * @param opts Optional parameters + * @returns Promise<TagEntry> + */ + updateTag(tagId: string, tagBodyUpdate: TagBody, opts?: ContentFieldsQuery): Promise<TagEntry> { + throwIfNotDefined(tagId, 'tagId'); + throwIfNotDefined(tagBodyUpdate, 'tagBodyUpdate'); + + const pathParams = { + tagId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/tags/{tagId}', + pathParams, + queryParams, + bodyParam: tagBodyUpdate, + returnType: TagEntry + }); + } + + /** + * Deletes a tag by **tagId**. This will cause the tag to be removed from all nodes. + * + * @param tagId The identifier of a tag. + * @returns Promise<{}> + */ + deleteTag(tagId: string): Promise<void> { + throwIfNotDefined(tagId, 'tagId'); + + const pathParams = { + tagId + }; + + return this.delete({ + path: '/tags/{tagId}', + pathParams + }); + } + + /** + * Create specified by **tags** list of tags. + * + * @param tags List of tags to create. + * @returns Promise<TagEntry[]> + */ + createTags(tags: TagBody[]): Promise<TagEntry[]> { + throwIfNotDefined(tags, 'tags'); + + return this.post({ + path: '/tags', + bodyParam: tags + }); + } + + /** + * Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned. + * + * @param nodeId Id of node to which tags should be assigned. + * @param tags List of tags to create and assign or just assign if they already exist. + * @returns Promise<TagPaging> + */ + assignTagsToNode(nodeId: string, tags: TagBody[]): Promise<TagPaging> { + return this.post({ + path: '/nodes/{nodeId}/tags', + pathParams: { nodeId }, + bodyParam: tags, + returnType: TagPaging + }); + } + + /** + * Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned. + * + * @param nodeId Id of node to which tags should be assigned. + * @param tag List of tags to create and assign or just assign if they already exist. + * @returns Promise<TagEntry> + */ + assignTagToNode(nodeId: string, tag: TagBody): Promise<TagEntry> { + return this.post({ + path: '/nodes/{nodeId}/tags', + pathParams: { nodeId }, + bodyParam: tag, + returnType: TagEntry + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/trashcan.api.ts b/lib/js-api/src/api/content-rest-api/api/trashcan.api.ts new file mode 100644 index 0000000000..2d6bdb6a10 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/trashcan.api.ts @@ -0,0 +1,381 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeletedNodeEntry } from '../model/deletedNodeEntry'; +import { DeletedNodesPaging } from '../model/deletedNodesPaging'; +import { DirectAccessUrlEntry } from '../model/directAccessUrlEntry'; +import { NodeEntry } from '../model/nodeEntry'; +import { RenditionEntry } from '../model/renditionEntry'; +import { RenditionPaging } from '../model/renditionPaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +/** + * Trashcan service. + * + * @module TrashcanApi + */ +export class TrashcanApi extends BaseApi { + /** + * Permanently delete a deleted node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @returns Promise<{}> + */ + deleteDeletedNode(nodeId: string): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + return this.delete({ + path: '/deleted-nodes/{nodeId}', + pathParams + }); + } + + /** + * Get rendition information for a deleted node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*. + * @returns Promise<RenditionEntry> + */ + getArchivedNodeRendition(nodeId: string, renditionId: string): Promise<RenditionEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(renditionId, 'renditionId'); + + const pathParams = { + nodeId, + renditionId + }; + + return this.get({ + path: '/deleted-nodes/{nodeId}/renditions/{renditionId}', + pathParams, + returnType: RenditionEntry + }); + } + + /** + * Get rendition content of a deleted node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; + * for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.range The Range header indicates the part of a document that the server should return. + * Single part request supported, for example: bytes=1-10. + * @param opts.placeholder If **true** and there is no rendition for this **nodeId** and **renditionId**, + * then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. (default to false) + * @returns Promise<Blob> + */ + getArchivedNodeRenditionContent( + nodeId: string, + renditionId: string, + opts?: { + attachment?: boolean; + placeholder?: boolean; + ifModifiedSince?: string; + range?: string; + } + ): Promise<Blob> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(renditionId, 'renditionId'); + opts = opts || {}; + + const pathParams = { + nodeId, + renditionId + }; + + const queryParams = { + attachment: opts?.attachment, + placeholder: opts?.placeholder + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince, + Range: opts?.range + }; + + return this.get({ + path: '/deleted-nodes/{nodeId}/renditions/{renditionId}/content', + pathParams, + queryParams, + headerParams, + accepts: ['application/octet-stream'] + }); + } + + /** + * Get a deleted node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @returns Promise<DeletedNodeEntry> + */ + getDeletedNode(nodeId: string, opts?: ContentIncludeQuery): Promise<DeletedNodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.get({ + path: '/deleted-nodes/{nodeId}', + pathParams, + queryParams, + returnType: DeletedNodeEntry + }); + } + + /** + * Get deleted node content + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; + * for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.range The Range header indicates the part of a document that the server should return. + * Single part request supported, for example: bytes=1-10. + * @returns Promise<Blob> + */ + getDeletedNodeContent( + nodeId: string, + opts?: { + attachment?: boolean; + ifModifiedSince?: string; + range?: string; + } + ): Promise<Blob> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + attachment: opts?.attachment + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince, + Range: opts?.range + }; + + const accepts = ['application/octet-stream']; + + return this.get({ + path: '/deleted-nodes/{nodeId}/content', + pathParams, + queryParams, + headerParams, + accepts, + returnType: 'blob' + }); + } + + /** + * List renditions for a deleted node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Each rendition returned has a **status**: `CREATED` means it is available to view or download, + * `NOT_CREATED` means the rendition can be requested. + * + * You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where** + * clause will return just the CREATED renditions: + * + * - (status='CREATED') + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @param opts.where A string to restrict the returned objects by using a predicate. + * @returns Promise<RenditionPaging> + */ + listDeletedNodeRenditions(nodeId: string, opts?: { where?: string }): Promise<RenditionPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + where: opts?.where + }; + + return this.get({ + path: '/deleted-nodes/{nodeId}/renditions', + pathParams, + queryParams, + returnType: RenditionPaging + }); + } + + /** + * List deleted nodes + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets a list of deleted nodes for the current user. + * If the current user is an administrator deleted nodes for all users will be returned. + * The list of deleted nodes will be ordered with the most recently deleted node at the top of the list. + * + * @param opts Optional parameters + * @returns Promise<DeletedNodesPaging> + */ + listDeletedNodes(opts?: ContentPagingQuery & ContentIncludeQuery): Promise<DeletedNodesPaging> { + const queryParams = { + ...(opts || {}), + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.get({ + path: '/deleted-nodes', + queryParams, + returnType: DeletedNodesPaging + }); + } + + /** + * Restore a deleted node + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Attempts to restore the deleted node **nodeId** to its original location or to a new location. + * + * If the node is successfully restored to its former primary parent, then only the + * primary child association will be restored, including recursively for any primary + * children. It should be noted that no other secondary child associations or peer + * associations will be restored, for any of the nodes within the primary parent-child + * hierarchy of restored nodes, irrespective of whether these associations were to + * nodes within or outside the restored hierarchy. + * + * Also, any previously shared link will not be restored since it is deleted at the time + * of delete of each node. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @param opts.deletedNodeBodyRestore The targetParentId if the node is restored to a new location. + * @returns Promise<NodeEntry> + */ + restoreDeletedNode( + nodeId: string, + opts?: { + deletedNodeBodyRestore?: { + targetParentId?: string; + assocType?: string; + }; + } & ContentFieldsQuery + ): Promise<NodeEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/deleted-nodes/{nodeId}/restore', + pathParams, + queryParams, + bodyParam: opts?.deletedNodeBodyRestore, + returnType: NodeEntry + }); + } + + /** + * Generate a direct access content url for a given deleted node + * + * **Note:** this endpoint is available in Alfresco 7.1 and newer versions. + * + * @param nodeId The identifier of a node. + * @returns Promise<DirectAccessUrlEntry> + */ + requestDirectAccessUrl(nodeId: string): Promise<DirectAccessUrlEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + return this.post({ + path: '/deleted-nodes/{nodeId}/request-direct-access-url', + pathParams, + returnType: DirectAccessUrlEntry + }); + } + + /** + * Generate a direct access content url for a given rendition of a deleted node + * + * **Note:** this endpoint is available in Alfresco 7.1 and newer versions. + * + * @param nodeId The identifier of a node. + * @param renditionId The identifier of a version + * @returns Promise<DirectAccessUrlEntry> + */ + requestRenditionDirectAccessUrl(nodeId: string, renditionId: string): Promise<DirectAccessUrlEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(renditionId, 'renditionId'); + + const pathParams = { + nodeId, + renditionId + }; + + return this.post({ + path: '/deleted-nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url', + pathParams, + returnType: DirectAccessUrlEntry + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/api/types.ts b/lib/js-api/src/api/content-rest-api/api/types.ts new file mode 100644 index 0000000000..63f165a2d0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/types.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type ContentPagingQuery = { + /** + * The number of entities that exist in the collection before those included in this list. + */ + skipCount?: number; + + /** + * The maximum number of items to return in the list. + */ + maxItems?: number; +}; + +export type ContentIncludeQuery = { + /** + * Returns additional information about the record. Any optional field from the response model can be requested. + */ + include?: string[]; +}; + +export type ContentFieldsQuery = { + /** + * A list of field names. + * + * You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * + * The list applies to a returned individual + * entity or entries within a collection. + * + * If the API method also supports the **include** + * parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + */ + fields?: string[]; +}; diff --git a/lib/js-api/src/api/content-rest-api/api/versions.api.ts b/lib/js-api/src/api/content-rest-api/api/versions.api.ts new file mode 100644 index 0000000000..966de805b8 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/api/versions.api.ts @@ -0,0 +1,406 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DirectAccessUrlEntry, RenditionBodyCreate, RenditionEntry, RenditionPaging, RevertBody, VersionEntry, VersionPaging } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types'; + +/** + * Versions service. + * + * @module VersionsApi + */ +export class VersionsApi extends BaseApi { + /** + * Create rendition for a file version + * + * **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions. + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version, ie. version label, within the version history of a node. + * @param renditionBodyCreate The rendition \"id\". + * @returns Promise<{}> + */ + createVersionRendition(nodeId: string, versionId: string, renditionBodyCreate: RenditionBodyCreate): Promise<any> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + throwIfNotDefined(renditionBodyCreate, 'renditionBodyCreate'); + + const pathParams = { + nodeId, + versionId + }; + + return this.post({ + path: '/nodes/{nodeId}/versions/{versionId}/renditions', + pathParams, + bodyParam: renditionBodyCreate + }); + } + + /** + * Delete a version + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Delete the version identified by **versionId** and **nodeId*. + * + * If the version is successfully deleted then the content and metadata for that versioned node + * will be deleted and will no longer appear in the version history. This operation cannot be undone. + * + * If the most recent version is deleted the live node will revert to the next most recent version. + * + * We currently do not allow the last version to be deleted. If you wish to clear the history then you + * can remove the \"cm:versionable\" aspect (via update node) which will also disable versioning. In this + * case, you can re-enable versioning by adding back the \"cm:versionable\" aspect or using the version + * params (majorVersion and comment) on a subsequent file content update. + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version, ie. version label, within the version history of a node. + * @returns Promise<{}> + */ + deleteVersion(nodeId: string, versionId: string): Promise<void> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + + const pathParams = { + nodeId, + versionId + }; + + return this.delete({ + path: '/nodes/{nodeId}/versions/{versionId}', + pathParams + }); + } + + /** + * Get version information + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version, ie. version label, within the version history of a node. + * @returns Promise<VersionEntry> + */ + getVersion(nodeId: string, versionId: string): Promise<VersionEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + + const pathParams = { + nodeId, + versionId + }; + + return this.get({ + path: '/nodes/{nodeId}/versions/{versionId}', + pathParams, + returnType: VersionEntry + }); + } + + /** + * Get version content + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version, ie. version label, within the version history of a node. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; + * for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. + * (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.range The Range header indicates the part of a document that the server should return. + * Single part request supported, for example: bytes=1-10. + * @returns Promise<Blob> + */ + getVersionContent( + nodeId: string, + versionId: string, + opts?: { + attachment?: boolean; + ifModifiedSince?: string; + range?: string; + } + ): Promise<Blob> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + + const pathParams = { + nodeId, + versionId + }; + + const queryParams = { + attachment: opts?.attachment + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince, + Range: opts?.range + }; + + const accepts = ['application/octet-stream']; + + return this.get({ + path: '/nodes/{nodeId}/versions/{versionId}/content', + pathParams, + queryParams, + headerParams, + accepts, + returnType: 'blob' + }); + } + /** + * Get rendition information for a file version + * + * **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions. + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version, ie. version label, within the version history of a node. + * @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*. + * @returns Promise<RenditionEntry> + */ + getVersionRendition(nodeId: string, versionId: string, renditionId: string): Promise<RenditionEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + throwIfNotDefined(renditionId, 'renditionId'); + + const pathParams = { + nodeId, + versionId, + renditionId + }; + + return this.get({ + path: '/nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}', + pathParams, + returnType: RenditionEntry + }); + } + + /** + * Get rendition content for a file version + * + * **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions. + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version, ie. version label, within the version history of a node. + * @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not + * download the file. + * You can only set this parameter to **false** if the content type of the file is in the supported list; + * for example, certain image files and PDF files. + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. + * (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @param opts.range The Range header indicates the part of a document that the server should return. + * Single part request supported, for example: bytes=1-10. + * @param opts.placeholder If **true** and there is no rendition for this **nodeId** and **renditionId**, + * then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. + * (default to false) + * @returns Promise<Blob> + */ + getVersionRenditionContent( + nodeId: string, + versionId: string, + renditionId: string, + opts?: { + attachment?: boolean; + placeholder?: boolean; + ifModifiedSince?: string; + range?: string; + } + ): Promise<Blob> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + throwIfNotDefined(renditionId, 'renditionId'); + + opts = opts || {}; + + const pathParams = { + nodeId, + versionId, + renditionId + }; + + const queryParams = { + attachment: opts?.attachment, + placeholder: opts?.placeholder + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince, + Range: opts?.range + }; + + const accepts = ['application/octet-stream']; + + return this.get({ + path: '/nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content', + pathParams, + queryParams, + headerParams, + accepts, + returnType: 'blob' + }); + } + + /** + * List version history + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Gets the version history as an ordered list of versions for the specified **nodeId**. + * + * The list is ordered in descending modified order. So the most recent version is first and + * the original version is last in the list. + * + * @param nodeId The identifier of a node. + * @param opts Optional parameters + * @returns Promise<VersionPaging> + */ + listVersionHistory(nodeId: string, opts?: ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<VersionPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv'), + skipCount: opts?.skipCount, + maxItems: opts?.maxItems + }; + + return this.get({ + path: '/nodes/{nodeId}/versions', + pathParams, + queryParams, + returnType: VersionPaging + }); + } + + /** + * List renditions for a file version + * + * **Note:** this endpoint is available in Alfresco 7.0.0 and newer versions. + * + * Gets a list of the rendition information for each rendition of the version of file **nodeId** and **versionId**, including the rendition id. + * Each rendition returned has a **status**: CREATED means it is available to view or download, NOT_CREATED means the rendition can be requested. + * You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where** + * clause will return just the CREATED renditions: (status='CREATED') + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version, ie. version label, within the version history of a node. + * @param opts Optional parameters + * @param opts.where A string to restrict the returned objects by using a predicate. + * @returns Promise<RenditionPaging> + */ + listVersionRenditions(nodeId: string, versionId: string, opts?: { where?: string }): Promise<RenditionPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + + const pathParams = { + nodeId, + versionId + }; + + return this.get({ + path: '/nodes/{nodeId}/versions/{versionId}/renditions', + pathParams, + queryParams: opts, + returnType: RenditionPaging + }); + } + + /** + * Revert a version + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * Attempts to revert the version identified by **versionId** and **nodeId** to the live node. + * If the node is successfully reverted then the content and metadata for that versioned node + * will be promoted to the live node and a new version will appear in the version history. + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version, ie. version label, within the version history of a node. + * @param revertBody Optionally, specify a version comment and whether this should be a major version, or not. + * @param opts Optional parameters + * @returns Promise<VersionEntry> + */ + revertVersion(nodeId: string, versionId: string, revertBody: RevertBody, opts?: ContentFieldsQuery): Promise<VersionEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + throwIfNotDefined(revertBody, 'revertBody'); + + const pathParams = { + nodeId, + versionId + }; + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/nodes/{nodeId}/versions/{versionId}/revert', + pathParams, + queryParams, + bodyParam: revertBody, + returnType: VersionEntry + }); + } + + /** + * Generate a direct access content url for a given version of a node + * + * **Note:** this endpoint is available in Alfresco 7.1 and newer versions. + * + * @param nodeId The identifier of a node. + * @param versionId The identifier of a version + * @returns Promise<DirectAccessUrlEntry> + */ + requestDirectAccessUrl(nodeId: string, versionId: string): Promise<DirectAccessUrlEntry> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(versionId, 'versionId'); + + const pathParams = { + nodeId, + versionId + }; + + return this.post({ + path: '/nodes/{nodeId}/versions/{versionId}/request-direct-access-url', + pathParams, + returnType: DirectAccessUrlEntry + }); + } +} diff --git a/lib/js-api/src/api/content-rest-api/docs/ActionsApi.md b/lib/js-api/src/api/content-rest-api/docs/ActionsApi.md new file mode 100644 index 0000000000..94ecb0a2c1 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/ActionsApi.md @@ -0,0 +1,272 @@ +# ActionsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|---------------------------------|--------------------------------------------------|----------------------------------------------| +| [actionDetails](#actionDetails) | **GET** /action-definitions/{actionDefinitionId} | Retrieve the details of an action definition | +| [actionExec](#actionExec) | **POST** /action-executions | Execute an action | +| [listActions](#listActions) | **GET** /action-definitions | Retrieve list of available actions | +| [nodeActions](#nodeActions) | **GET** /nodes/{nodeId}/action-definitions | Retrieve actions for a node | + + +## actionDetails + +Retrieve the details of an action definition + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|------------------------|--------|-----------------------------------------| +| **actionDefinitionId** | string | The identifier of an action definition. | + +**Return type**: [ActionDefinitionEntry](#ActionDefinitionEntry) + +**Example** + +```javascript +import { AlfrescoApi, ActionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const actionsApi = new ActionsApi(alfrescoApi); + +actionsApi.actionDetails(`<actionDefinitionId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## actionExec + +Execute an action + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Executes an action + +An action may be executed against a node specified by **targetId**. For example: + +```json +{ + "actionDefinitionId": "copy", + "targetId": "4c4b3c43-f18b-43ff-af84-751f16f1ddfd", + "params": { + "destination-folder": "34219f79-66fa-4ebf-b371-118598af898c" + } +} +``` + +Performing a POST with the request body shown above will result in the node identified by targetId +being copied to the destination folder specified in the params object by the key destination-folder. + +**targetId** is optional, however, currently **targetId** must be a valid node ID. +In the future, actions may be executed against different entity types or +executed without the need for the context of an entity. + +Parameters supplied to the action within the params object will be converted to the expected type, +where possible using the DefaultTypeConverter class. In addition: + +* Node IDs may be supplied in their short form (implicit `workspace://SpacesStore` prefix) +* Aspect names may be supplied using their short form, e.g. `cm:versionable` or `cm:auditable` + +In this example, we add the aspect `cm:versionable` to a node using the QName resolution mentioned above: + +```json +{ + "actionDefinitionId": "add-features", + "targetId": "16349e3f-2977-44d1-93f2-73c12b8083b5", + "params": { + "aspect-name": "cm:versionable" + } +} +``` + +The actionDefinitionId is the id of an action definition as returned by +the _list actions_ operations (e.g. `GET /action-definitions`). + +The action will be executed **asynchronously** with a 202 HTTP response signifying that +the request has been accepted successfully. The response body contains the unique ID of the action +pending execution. The ID may be used, for example to correlate an execution with output in the server logs. + +**Parameters** + +| Name | Type | Description | +|----------------|-----------------------------------|--------------------------| +| actionBodyExec | [ActionBodyExec](#ActionBodyExec) | Action execution details | + +**Return type**: [ActionExecResultEntry](#ActionExecResultEntry) + +**Example** + +```javascript +import { AlfrescoApi, ActionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const actionsApi = new ActionsApi(alfrescoApi); +const actionBodyExec = {}; + +actionsApi.actionExec(actionBodyExec).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listActions + +Retrieve list of available actions + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. + +The default sort order for the returned list is for actions to be sorted by ascending name. +You can override the default by using the **orderBy** parameter. + +You can use any of the following fields to order the results: + +* name +* title + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [ActionDefinitionList](#ActionDefinitionList) + +**Example** + +```javascript +import { AlfrescoApi, ActionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const actionsApi = new ActionsApi(alfrescoApi); +const opts = {}; + +actionsApi.listActions(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## nodeActions + +Retrieve actions for a node + +> this endpoint is available in Alfresco 5.2 and newer versions. + +The default sort order for the returned list is for actions to be sorted by ascending name. +You can override the default by using the **orderBy** parameter. + +You can use any of the following fields to order the results: + +* name +* title + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **nodeId** | string | The identifier of a node. | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.fields | string [] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [ActionDefinitionList](#ActionDefinitionList) + +**Example** + +```javascript +import { AlfrescoApi, ActionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const actionsApi = new ActionsApi(alfrescoApi); +const opts = {}; + +actionsApi.nodeActions(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## ActionBodyExec + +**Properties** + +| Name | Type | Description | +|------------------------|--------|------------------------------------------------------------------------------| +| **actionDefinitionId** | string | | +| targetId | string | The entity upon which to execute the action, typically a node ID or similar. | +| params | any | | + +## ActionDefinitionEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------------------| +| **entry** | [ActionDefinition](#ActionDefinition) | + +## ActionDefinition + +**Properties** + +| Name | Type | Description | +|----------------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------| +| **id** | string | Identifier of the action definition — used for example when executing an action | +| name | string | name of the action definition, e.g. "move" | +| title | string | title of the action definition, e.g. "Move" | +| description | string | describes the action definition, e.g. "This will move the matched item to another space." | +| **applicableTypes** | string[] | QNames of the types this action applies to | +| **trackStatus** | boolean | whether the basic action definition supports action tracking or not | +| parameterDefinitions | [ActionParameterDefinition[]](#ActionParameterDefinition) | | + +## ActionParameterDefinition + +**Properties** + +| Name | Type | +|--------------|---------| +| name | string | +| type | string | +| multiValued | boolean | +| mandatory | boolean | +| displayLabel | string | + +## ActionExecResultEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------------------| +| **entry** | [ActionExecResult](#ActionExecResult) | + +## ActionExecResult + +**Properties** + +| Name | Type | Description | +|--------|--------|-------------------------------------------------------| +| **id** | string | The unique identifier of the action pending execution | + +## ActionDefinitionList + +**Properties** + +| Name | Type | +|------|-------------------------------------------------------| +| list | [ActionDefinitionListList](#ActionDefinitionListList) | + +## ActionDefinitionListList + +**Properties** + +| Name | Type | +|------------|-----------------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [ActionDefinition[]](#ActionDefinition) | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/ActivitiesApi.md b/lib/js-api/src/api/content-rest-api/docs/ActivitiesApi.md new file mode 100644 index 0000000000..7bab6afce3 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/ActivitiesApi.md @@ -0,0 +1,86 @@ +# Activities Api + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------------------|---------------------------------------|-----------------| +| [listActivitiesForPerson](#listActivitiesForPerson) | **GET** /people/{personId}/activities | List activities | + +## listActivitiesForPerson + +List activities + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------| +| **personId** | string | The identifier of a person. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | [default to 0] | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | [default to 100] | +| opts.who | string | A filter to include the user's activities only me, other user's activities only others' | | +| opts.siteId | string | Include only activity feed entries relating to this site. | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [ActivityPaging](#ActivityPaging) + +**Example**x + +```javascript +import { AlfrescoApi, ActivitiesApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const activitiesApi = new ActivitiesApi(alfrescoApi); + +const personId = '<personId>'; +const opts = {}; + +activitiesApi.listActivitiesForPerson(personId, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## ActivityPaging + +**Properties** + +| Name | Type | +|------|-------------------------------------------| +| list | [ActivityPagingList](#ActivityPagingList) | + +## ActivityPagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [ActivityEntry[]](#ActivityEntry) | + + +## ActivityEntry + +**Properties** + +| Name | Type | +|-------|-----------------------| +| entry | [Activity](#Activity) | + +## Activity + +**Properties** + +| Name | Type | Description | +|------------------|---------------------|---------------------------------------------------------------| +| **postPersonId** | string | The id of the person who performed the activity | +| **id** | number | The unique id of the activity | +| siteId | string | The unique id of the site on which the activity was performed | +| postedAt | Date | The date time at which the activity was performed | +| **feedPersonId** | string | The feed on which this activity was posted | +| activitySummary | Map<string, string> | An object summarizing the activity | +| **activityType** | string | The type of the activity posted | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/Association.md b/lib/js-api/src/api/content-rest-api/docs/Association.md new file mode 100644 index 0000000000..a5e5c74bb8 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Association.md @@ -0,0 +1,9 @@ +# Association + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**targetId** | **string** | | [default to null] +**assocType** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/AssociationEntry.md b/lib/js-api/src/api/content-rest-api/docs/AssociationEntry.md new file mode 100644 index 0000000000..a0e6226409 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/AssociationEntry.md @@ -0,0 +1,8 @@ +# AssociationEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Association**](Association.md) | | [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/AssociationInfo.md b/lib/js-api/src/api/content-rest-api/docs/AssociationInfo.md new file mode 100644 index 0000000000..9b30903080 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/AssociationInfo.md @@ -0,0 +1,8 @@ +# AssociationInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assocType** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/AuditApi.md b/lib/js-api/src/api/content-rest-api/docs/AuditApi.md new file mode 100644 index 0000000000..2a84c514e6 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/AuditApi.md @@ -0,0 +1,427 @@ +**# AuditApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------------------------------|----------------------------------------------------------------------------------|-----------------------------------------------------------| +| [deleteAuditEntriesForAuditApp](#deleteAuditEntriesForAuditApp) | **DELETE** /audit-applications/{auditApplicationId}/audit-entries | Permanently delete audit entries for an audit application | +| [deleteAuditEntry](#deleteAuditEntry) | **DELETE** /audit-applications/{auditApplicationId}/audit-entries/{auditEntryId} | Permanently delete an audit entry | +| [getAuditApp](#getAuditApp) | **GET** /audit-applications/{auditApplicationId} | Get audit application info | +| [getAuditEntry](#getAuditEntry) | **GET** /audit-applications/{auditApplicationId}/audit-entries/{auditEntryId} | Get audit entry | +| [listAuditApps](#listAuditApps) | **GET** /audit-applications | List audit applications | +| [listAuditEntriesForAuditApp](#listAuditEntriesForAuditApp) | **GET** /audit-applications/{auditApplicationId}/audit-entries | List audit entries for an audit application | +| [listAuditEntriesForNode](#listAuditEntriesForNode) | **GET** /nodes/{nodeId}/audit-entries | List audit entries for a node | +| [updateAuditApp](#updateAuditApp) | **PUT** /audit-applications/{auditApplicationId} | Update audit application info | + +## deleteAuditEntriesForAuditApp + +Permanently delete audit entries for an audit application + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. + +The **where** clause must be specified, either with an inclusive time period or for +an inclusive range of ids. The deletion is within the context of the given audit application. + +For example: + +- `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')` +- `where=(id BETWEEN ('1234', '4321')` + +You must have admin rights to delete audit information. + +**Parameters** + +| Name | Type | Description | +|------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **auditApplicationId** | string | The identifier of an audit application. | +| **where** | string | Audit entries to permanently delete for an audit application, given an inclusive time period or range of ids. For example: `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')`, `where=(id BETWEEN ('1234', '4321')` | + +**Example** + +```javascript +import { AlfrescoApi, AuditApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const auditApi = new AuditApi(alfrescoApi); + +auditApi.deleteAuditEntriesForAuditApp('<auditApplicationId>', '<where>').then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteAuditEntry + +Permanently delete an audit entry + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. +> You must have admin rights to delete audit information. + +**Parameters** + +| Name | Type | Description | +|------------------------|--------|-----------------------------------------| +| **auditApplicationId** | string | The identifier of an audit application. | +| **auditEntryId** | string | The identifier of an audit entry. | + +**Example** + +```javascript +import { AlfrescoApi, AuditApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const auditApi = new AuditApi(alfrescoApi); + +auditApi.deleteAuditEntry('<auditApplicationId>', '<auditEntryId>').then(() => { + console.log('API called successfully.'); +}); +``` + +## getAuditApp + +Get audit application info + +> **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions. +> You must have admin rights to retrieve audit information. + +You can use the **include** parameter to return the minimum and/or maximum audit record id for the application. + +**Parameters** + +| Name | Type | Description | +|------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **auditApplicationId** | string | The identifier of an audit application. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | +| opts.include | string[] | Also include the current minimum and/or maximum audit entry ids for the application. The following optional fields can be requested: `max`, `min` | + +**Return type**: [AuditApp](#AuditApp) + +**Example** + +```javascript +import { AlfrescoApi, AuditApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const auditApi = new AuditApi(alfrescoApi); +const opts = {}; + +auditApi.getAuditApp(`<auditApplicationId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getAuditEntry + +Get audit entry + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. +> You must have admin rights to access audit information. + +**Parameters** + +| Name | Type | Description | +|------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **auditApplicationId** | string | The identifier of an audit application. | +| **auditEntryId** | string | The identifier of an audit entry. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [AuditEntryEntry](#AuditEntryEntry) + +**Example** + +```javascript +import { AlfrescoApi, AuditApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const auditApi = new AuditApi(alfrescoApi); +const opts = {}; + +auditApi.getAuditEntry('<auditApplicationId>', '<auditEntryId>', opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listAuditApps + +List audit applications + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. +> You must have admin rights to retrieve audit information. + +Gets a list of audit applications in this repository. +This list may include pre-configured audit applications, if enabled, such as: + +* alfresco-access +* CMISChangeLog +* Alfresco Tagging Service +* Alfresco Sync Service (used by Enterprise Cloud Sync) + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. | If not supplied then the default value is 0. default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [AuditAppPaging](#AuditAppPaging) + +**Example** + +```javascript +import { AlfrescoApi, AuditApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const auditApi = new AuditApi(alfrescoApi); +const opts = {}; + +auditApi.listAuditApps(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listAuditEntriesForAuditApp + +List audit entries for an audit application + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. +> You must have admin rights to retrieve audit information. + +You can use the **include** parameter to return additional **values** information. + +The list can be filtered by one or more of: + +* **createdByUser** person id +* **createdAt** inclusive time period +* **id** inclusive range of ids +* **valuesKey** audit entry values contains the exact matching key +* **valuesValue** audit entry values contains the exact matching value + +The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC** +modifier to specify an ascending or descending sort order. + +For example, specifying `orderBy=createdAt DESC` returns audit entries in descending **createdAt** order. + +**Example** + +```javascript +import { AlfrescoApi, AuditApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const auditApi = new AuditApi(alfrescoApi); +const opts = {}; + +auditApi.listAuditEntriesForAuditApp(`<auditApplicationId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +**Parameters** + +| Name | Type | Description | Notes | +|------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **auditApplicationId** | string | The identifier of an audit application. | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.orderBy | string | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.where | string | Optionally filter the list. | | +| opts.include | string | Returns additional information about the audit entry. The following optional fields can be requested: `values` | | +| opts.fields | string | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**where** examples: + +* `where=(createdByUser='jbloggs')` +* `where=(id BETWEEN ('1234', '4321')` +* `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')` +* `where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')` +* `where=(valuesKey='/alfresco-access/login/user')` +* `where=(valuesKey='/alfresco-access/transaction/action' and valuesValue='DELETE')` + +**Return type**: [AuditEntryPaging](#AuditEntryPaging) + +## listAuditEntriesForNode + +List audit entries for a node + +> this endpoint is available in Alfresco 5.2.2 and newer versions. + +Gets a list of audit entries for node **nodeId**. + +The list can be filtered by **createdByUser** and for a given inclusive time period. + +The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC** +modifier to specify an ascending or descending sort order. + +For example, specifying `orderBy=createdAt DESC` returns audit entries in descending **createdAt** order. + +This relies on the pre-configured 'alfresco-access' audit application. + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **nodeId** | string | The identifier of a node. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.where | string | Optionally filter the list. | | +| opts.include | string[] | Returns additional information about the audit entry. The following optional fields can be requested: `values` | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**where* examples: + +- `where=(createdByUser='-me-')` +- `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')` +- `where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')` + +**Return type**: [AuditEntryPaging](#AuditEntryPaging) + +**Example** + +```javascript +import { AlfrescoApi, AuditApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const auditApi = new AuditApi(alfrescoApi); +const opts = {}; + +auditApi.listAuditEntriesForNode(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## updateAuditApp + +Update audit application info + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. +> You must have admin rights to update audit application. + +Disable or re-enable the audit application **auditApplicationId**. + +New audit entries will not be created for a disabled audit application until +it is re-enabled (and system-wide auditing is also enabled). + +> it is still possible to query &/or delete any existing audit entries even +if auditing is disabled for the audit application. + +**Parameters** + +| Name | Type | Description | +|------------------------|-------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **auditApplicationId** | string | The identifier of an audit application. | +| **auditAppBodyUpdate** | [AuditBodyUpdate](#AuditBodyUpdate) | The audit application to update. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [AuditApp](#AuditApp) + +**Example** + +```javascript +import { AlfrescoApi, AuditApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*...*/); +const auditApi = new AuditApi(alfrescoApi); +const auditAppBodyUpdate = {}; +const opts = {}; + +auditApi.updateAuditApp(`<auditApplicationId>`, auditAppBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## AuditApp + +**Properties** + +| Name | Type | +|------------|---------| +| **id** | string | +| name | string | +| isEnabled | boolean | +| maxEntryId | number | +| minEntryId | number | + +## AuditAppPaging + +**Properties** + +| Name | Type | +|------|-------------------------------------------| +| list | [AuditAppPagingList](#AuditAppPagingList) | + + +## AuditAppPagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [AuditAppEntry[]](#AuditAppEntry) | + +## AuditAppEntry + +**Properties** + +| Name | Type | +|-------|-----------------------| +| entry | [AuditApp](#AuditApp) | + +## AuditApp + +**Properties** + +| Name | Type | +|------------|---------| +| **id** | string | +| name | string | +| isEnabled | boolean | +| maxEntryId | number | +| minEntryId | number | + +## AuditBodyUpdate + +| Name | Type | +|-----------|---------| +| isEnabled | boolean | + +## AuditEntryPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------------| +| list | [AuditEntryPagingList](#AuditEntryPagingList) | + +## AuditEntryPagingList + +**Properties** + +| Name | Type | +|------------|---------------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [AuditEntryEntry[]](#AuditEntryEntry) | + +## AuditEntryEntry + +**Properties** + +| Name | Type | +|-------|---------------------------| +| entry | [AuditEntry](#AuditEntry) | + +## AuditEntry + +**Properties** + +| Name | Type | +|------------------------|-------------------------| +| **id** | string | +| **auditApplicationId** | string | +| **createdByUser** | [UserInfo](UserInfo.md) | +| **createdAt** | Date | +| values | any | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/CategoriesApi.md b/lib/js-api/src/api/content-rest-api/docs/CategoriesApi.md new file mode 100644 index 0000000000..b425e377fe --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/CategoriesApi.md @@ -0,0 +1,73 @@ +# CategoriesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------------------|--------------------------------------------------------|---------------------------------------------| +| [getSubcategories](#getSubcategories) | **GET** /categories/{categoryId}/subcategories | List of subcategories within category | +| [getCategory](#getCategory) | **GET** /categories/{categoryId} | Get a category | +| [getCategoryLinksForNode](#getCategoryLinksForNode) | **GET** /nodes/{nodeId}/category-links | List of categories that node is assigned to | +| [deleteCategory](#deleteCategory) | **DELETE** /categories/{categoryId} | Deletes the category | +| [unlinkNodeFromCategory](#unlinkNodeFromCategory) | **DELETE** /nodes/{nodeId}/category-links/{categoryId} | Unassign a node from category | +| [updateCategory](#updateCategory) | **PUT** /categories/{categoryId} | Update a category | +| [createSubcategories](#createSubcategories) | **POST** /categories/{categoryId}/subcategories | Create new categories | +| [linkNodeToCategory](#linkNodeToCategory) | **POST** /nodes/{nodeId}/category-links | Assign a node to a category | + +# Models + +## CategoryPaging + +**Properties** + +| Name | Type | +|------|-------------------------------------------| +| list | [CategoryPagingList](#CategoryPagingList) | + +## CategoryPagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [CategoryEntry[]](#CategoryEntry) | + +## CategoryEntry + +**Properties** + +| Name | Type | +|-----------|-----------------------| +| **entry** | [Category](#Category) | + +## Category + +**Properties** + +| Name | Type | +|-------------|---------| +| **id** | string | +| **name** | string | +| parentId | string | +| hasChildren | boolean | +| count | number | +| path | string | + +## CategoryBody + +**Properties** + +| Name | Type | +|----------|--------| +| **name** | string | + +## CategoryLinkBody + +**Properties** + +| Name | Type | +|----------------|--------| +| **categoryId** | string | + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/ChildAssociation.md b/lib/js-api/src/api/content-rest-api/docs/ChildAssociation.md new file mode 100644 index 0000000000..0d5a9317fe --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/ChildAssociation.md @@ -0,0 +1,10 @@ +# ChildAssociation + +**Properties** + +| Name | Type | +|---------------|--------| +| **childId** | string | +| **assocType** | string | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/ChildAssociationEntry.md b/lib/js-api/src/api/content-rest-api/docs/ChildAssociationEntry.md new file mode 100644 index 0000000000..c011e1120b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/ChildAssociationEntry.md @@ -0,0 +1,9 @@ +# ChildAssociationEntry + +**Properties** + +| Name | Type | +|-----------|-----------------------------------------| +| **entry** | [ChildAssociation](ChildAssociation.md) | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/ChildAssociationInfo.md b/lib/js-api/src/api/content-rest-api/docs/ChildAssociationInfo.md new file mode 100644 index 0000000000..aafb60b94a --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/ChildAssociationInfo.md @@ -0,0 +1,10 @@ +# ChildAssociationInfo + +**Properties** + +| Name | Type | +|---------------|---------| +| **assocType** | string | +| **isPrimary** | boolean | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/CommentsApi.md b/lib/js-api/src/api/content-rest-api/docs/CommentsApi.md new file mode 100644 index 0000000000..8db72c46d5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/CommentsApi.md @@ -0,0 +1,220 @@ +# CommentsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|---------------------------------|-------------------------------------------------|------------------| +| [createComment](#createComment) | **POST** /nodes/{nodeId}/comments | Create a comment | +| [deleteComment](#deleteComment) | **DELETE** /nodes/{nodeId}/comments/{commentId} | Delete a comment | +| [listComments](#listComments) | **GET** /nodes/{nodeId}/comments | List comments | +| [updateComment](#updateComment) | **PUT** /nodes/{nodeId}/comments/{commentId} | Update a comment | + +## createComment + +Create a comment + +You specify the comment in a JSON body like this: + +```json +{ + "content": "This is a comment" +} +``` + +**Note:** You can create more than one comment by specifying a list of comments in the JSON body like this: + +```json +[ + { + "content": "This is a comment" + }, + { + "content": "This is another comment" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. +For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": {} + }, + { + "entry": {} + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **commentBodyCreate** | [CommentBody](#CommentBody) | The comment text. Note that you can also provide a list of comments. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [CommentEntry](#CommentEntry) + +**Example** + +```javascript +import { AlfrescoApi, CommentsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const commentsApi = new CommentsApi(alfrescoApi); +const opts = {}; +const commentBodyCreate = {}; + +commentsApi.createComment(`<nodeId>`, commentBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteComment + +Delete a comment + +**Parameters** + +| Name | Type | Description | +|---------------|--------|------------------------------| +| **nodeId** | string | The identifier of a node. | +| **commentId** | string | The identifier of a comment. | + +**Example** + +```javascript +import { AlfrescoApi, CommentsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const commentsApi = new CommentsApi(alfrescoApi); + +commentsApi.deleteComment(`<nodeId>`, `<commentId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## listComments + +Gets a list of comments for the node **nodeId**, sorted chronologically with the newest comment first. + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **nodeId** | string | The identifier of a node. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [CommentPaging](#CommentPaging) + +**Example** + +```javascript +import { AlfrescoApi, CommentsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const commentsApi = new CommentsApi(alfrescoApi); +const opts = {}; + +commentsApi.listComments(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## updateComment + +Update a comment + +**Parameters** + +| Name | Type | Description | +|-----------------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **commentId** | string | The identifier of a comment. | +| **commentBodyUpdate** | [CommentBody](#CommentBody) | The JSON representing the comment to be updated. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [CommentEntry](#CommentEntry) + +**Example** + +```javascript +import { AlfrescoApi, CommentsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const commentsApi = new CommentsApi(alfrescoApi); +const commentBodyUpdate = {}; +const opts = {}; + +commentsApi.updateComment(`<nodeId>`, `<commentId>`, commentBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## CommentBody + +**Properties** + +| Name | Type | +|-------------|--------| +| **content** | string | + +## CommentPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------| +| list | [CommentPagingList](#CommentPagingList) | + +## CommentPagingList + +**Properties** + +| Name | Type | +|------------|---------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [CommentEntry[]](#CommentEntry) | + +## CommentEntry + +**Properties** + +| Name | Type | +|-----------|---------------------| +| **entry** | [Comment](#Comment) | + +## Comment + +**Properties** + +| Name | Type | +|----------------|---------------------| +| **id** | string | +| **title** | string | +| **content** | string | +| **createdBy** | [Person](Person.md) | +| **createdAt** | Date | +| **edited** | boolean | +| **modifiedBy** | [Person](Person.md) | +| **modifiedAt** | Date | +| **canEdit** | boolean | +| **canDelete** | boolean | \ No newline at end of file diff --git a/lib/js-api/src/api/content-rest-api/docs/Company.md b/lib/js-api/src/api/content-rest-api/docs/Company.md new file mode 100644 index 0000000000..e717a8f199 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Company.md @@ -0,0 +1,16 @@ +# Company + +**Properties** + +| Name | Type | +|--------------|--------| +| organization | string | +| address1 | string | +| address2 | string | +| address3 | string | +| postcode | string | +| telephone | string | +| fax | string | +| email | string | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/ContentInfo.md b/lib/js-api/src/api/content-rest-api/docs/ContentInfo.md new file mode 100644 index 0000000000..9caf1bd8ad --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/ContentInfo.md @@ -0,0 +1,12 @@ +# ContentInfo + +**Properties** + +| Name | Type | +|------------------|--------| +| **mimeType** | string | +| **mimeTypeName** | string | +| **sizeInBytes** | number | +| encoding | string | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/Definition.md b/lib/js-api/src/api/content-rest-api/docs/Definition.md new file mode 100644 index 0000000000..fe23731ac5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Definition.md @@ -0,0 +1,8 @@ +# Definition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | [**Property[]**](Property.md) | List of property definitions effective for this node as the result of combining the type with all aspects. | [optional] [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/DirectAccessUrl.md b/lib/js-api/src/api/content-rest-api/docs/DirectAccessUrl.md new file mode 100644 index 0000000000..2cc8d8c5b7 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/DirectAccessUrl.md @@ -0,0 +1,9 @@ +# DirectAccessUrl + +**Properties** + +| Name | Type | Description | +|----------------|---------|----------------------------------------------------------------------------| +| **contentUrl** | string | The direct access URL of a binary content | +| attachment | boolean | Whether or not the content downloads as an attachment | +| expiryTime | Date | The direct access URL would become invalid when the expiry date is reached | diff --git a/lib/js-api/src/api/content-rest-api/docs/DirectAccessUrlEntry.md b/lib/js-api/src/api/content-rest-api/docs/DirectAccessUrlEntry.md new file mode 100644 index 0000000000..a5d34b2e9e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/DirectAccessUrlEntry.md @@ -0,0 +1,9 @@ +# DirectAccessUrlEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------------------| +| **entry** | [DirectAccessUrl](DirectAccessUrl.md) | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/DownloadsApi.md b/lib/js-api/src/api/content-rest-api/docs/DownloadsApi.md new file mode 100644 index 0000000000..c31967335d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/DownloadsApi.md @@ -0,0 +1,156 @@ +# DownloadsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------|------------------------------------|-----------------------| +| [cancelDownload](#cancelDownload) | **DELETE** /downloads/{downloadId} | Cancel a download | +| [createDownload](#createDownload) | **POST** /downloads | Create a new download | +| [getDownload](#getDownload) | **GET** /downloads/{downloadId} | Get a download | + +## cancelDownload + +Cancel a download + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. + +Cancels the creation of a download request. + +> The download node can be deleted using the **DELETE /nodes/{downloadId}** endpoint + +By default, if the download node is not deleted it will be picked up by a cleaner job which removes download nodes older than a configurable amount of time (default is 1 hour) + +Information about the existing progress at the time of cancelling can be retrieved by calling the **GET /downloads/{downloadId}** endpoint + +The cancel operation is done asynchronously. + +**Parameters** + +| Name | Type | Description | +|----------------|--------|------------------------------------| +| **downloadId** | string | The identifier of a download node. | + +**Example** + +```javascript +import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const downloadsApi = new DownloadsApi(alfrescoApi); + +downloadsApi.cancelDownload(`<downloadId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## createDownload + +Create a new download + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. + +Creates a new download node asynchronously, the content of which will be the zipped content of the **nodeIds** specified in the JSON body like this: + +```json +{ + "nodeIds": + [ + "c8bb482a-ff3c-4704-a3a3-de1c83ccd84c", + "cffa62db-aa01-493d-9594-058bc058eeb1" + ] +} +``` + +> The content of the download node can be obtained using the **GET /nodes/{downloadId}/content** endpoint + +**Parameters** + +| Name | Type | Description | +|------------------------|-------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **downloadBodyCreate** | [DownloadBodyCreate](#DownloadBodyCreate) | The nodeIds the content of which will be zipped, which zip will be set as the content of our download node. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [DownloadEntry](#DownloadEntry) + +**Example** + +```javascript +import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const downloadsApi = new DownloadsApi(alfrescoApi); +const downloadBodyCreate = {}; +const opts = {}; + +downloadsApi.createDownload(downloadBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getDownload + +Retrieve status information for download node + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. + +**Parameters** + +| Name | Type | Description | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **downloadId** | string | The identifier of a download node. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [DownloadEntry](#DownloadEntry) + +**Example** + +```javascript +import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const downloadsApi = new DownloadsApi(alfrescoApi); +const opts = {}; + +downloadsApi.getDownload(`<downloadId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## DownloadBodyCreate + +**Properties** + +| Name | Type | +|-------------|----------| +| **nodeIds** | string[] | + +## DownloadEntry + +**Properties** + +| Name | Type | +|-----------|-----------------------| +| **entry** | [Download](#Download) | + +## Download + +**Properties** + +| Name | Type | Description | +|------------|--------|--------------------------------------------------| +| filesAdded | number | number of files added so far in the zip | +| bytesAdded | number | number of bytes added so far in the zip | +| id | string | the id of the download node | +| totalFiles | number | the total number of files to be added in the zip | +| totalBytes | number | the total number of bytes to be added in the zip | +| status | string | the current status of the download node creation | + +### Download.StatusEnum + +* `PENDING` (value: `'PENDING'`) +* `CANCELLED` (value: `'CANCELLED'`) +* `INPROGRESS` (value: `'IN_PROGRESS'`) +* `DONE` (value: `'DONE'`) +* `MAXCONTENTSIZEEXCEEDED` (value: `'MAX_CONTENT_SIZE_EXCEEDED'`) \ No newline at end of file diff --git a/lib/js-api/src/api/content-rest-api/docs/Error.md b/lib/js-api/src/api/content-rest-api/docs/Error.md new file mode 100644 index 0000000000..9beb7f2852 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Error.md @@ -0,0 +1,8 @@ +# ModelError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorError**](ErrorError.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/ErrorError.md b/lib/js-api/src/api/content-rest-api/docs/ErrorError.md new file mode 100644 index 0000000000..f8b473d9af --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/ErrorError.md @@ -0,0 +1,13 @@ +# ErrorError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errorKey** | **string** | | [optional] [default to null] +**statusCode** | **number** | | [default to null] +**briefSummary** | **string** | | [default to null] +**stackTrace** | **string** | | [default to null] +**descriptionURL** | **string** | | [default to null] +**logId** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/FavoritesApi.md b/lib/js-api/src/api/content-rest-api/docs/FavoritesApi.md new file mode 100644 index 0000000000..8a7a635c4a --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/FavoritesApi.md @@ -0,0 +1,465 @@ +# FavoritesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------------------------|-------------------------------------------------------|------------------------| +| [createFavorite](#createFavorite) | **POST** /people/{personId}/favorites | Create a favorite | +| [createSiteFavorite](#createSiteFavorite) | **POST** /people/{personId}/favorite-sites | Create a site favorite | +| [deleteFavorite](#deleteFavorite) | **DELETE** /people/{personId}/favorites/{favoriteId} | Delete a favorite | +| [deleteSiteFavorite](#deleteSiteFavorite) | **DELETE** /people/{personId}/favorite-sites/{siteId} | Delete a site favorite | +| [getFavorite](#getFavorite) | **GET** /people/{personId}/favorites/{favoriteId} | Get a favorite | +| [getFavoriteSite](#getFavoriteSite) | **GET** /people/{personId}/favorite-sites/{siteId} | Get a favorite site | +| [listFavoriteSitesForPerson](#listFavoriteSitesForPerson) | **GET** /people/{personId}/favorite-sites | List favorite sites | +| [listFavorites](#listFavorites) | **GET** /people/{personId}/favorites | List favorites | + +## createFavorite + +Favorite a **site**, **file**, or **folder** in the repository. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Note:** You can favorite more than one entity by specifying a list of objects in the JSON body like this: + +```json +[ + { + "target": { + "file": { + "guid": "abcde-01234-...." + } + } + }, + { + "target": { + "file": { + "guid": "abcde-09863-...." + } + } + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": {} + }, + { + "entry": {} + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|------------------------|-------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **favoriteBodyCreate** | [FavoriteBodyCreate](#FavoriteBodyCreate) | An object identifying the entity to be favorited. The object consists of a single property which is an object with the name site, file, or folder. The content of that object is the guid of the target entity. For example, to favorite a file the following body would be used. | +| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [FavoriteEntry](#FavoriteEntry) + +**Example** + +```javascript +import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const favoritesApi = new FavoritesApi(alfrescoApi); +const favoriteBodyCreate = {}; +const opts = {}; + +favoritesApi.createFavorite(`<personId>`, favoriteBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## createSiteFavorite + +Create a site favorite + +> this endpoint is deprecated as of **Alfresco 4.2**, and will be removed in the future. +> Use **/people/{personId}/favorites** instead. + +Create a site favorite for person **personId**. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + + **Note:** You can favorite more than one site by specifying a list of sites in the JSON body like this: + +```json +[ + { + "id": "test-site-1" + }, + { + "id": "test-site-2" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": {} + }, + { + "entry": {} + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|----------------------------|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **favoriteSiteBodyCreate** | [FavoriteSiteBodyCreate](#FavoriteSiteBodyCreate) | The id of the site to favorite. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [FavoriteSiteEntry](#FavoriteSiteEntry) + +**Example** + +```javascript +import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const favoritesApi = new FavoritesApi(alfrescoApi); +const favoriteSiteBodyCreate = {}; +const opts = {}; + +favoritesApi.createSiteFavorite(`<personId>`, favoriteSiteBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteFavorite + +Delete a favorite + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|----------------|--------|-------------------------------| +| **personId** | string | The identifier of a person. | +| **favoriteId** | string | The identifier of a favorite. | + +**Example** + +```javascript +import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const favoritesApi = new FavoritesApi(alfrescoApi); + +favoritesApi.deleteFavorite(`<personId>`, `<favoriteId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteSiteFavorite + +Delete a site favorite + +> this endpoint is deprecated as of **Alfresco 4.2**, and will be removed in the future. +> Use **/people/{personId}/favorites/{favoriteId}** instead. + +Deletes site **siteId** from the favorite site list of person **personId**. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Example** + +```javascript +import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const favoritesApi = new FavoritesApi(alfrescoApi); + +favoritesApi.deleteSiteFavorite(`<personId>`, `<siteId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +**Parameters** + +| Name | Type | Description | +|--------------|--------|-----------------------------| +| **personId** | string | The identifier of a person. | +| **siteId** | string | The identifier of a site. | + +## getFavorite + +Get a favorite + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **favoriteId** | string | The identifier of a favorite. | +| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [FavoriteEntry](#FavoriteEntry) + +**Example** + +```javascript +import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const favoritesApi = new FavoritesApi(alfrescoApi); +const opts = {}; + +favoritesApi.getFavorite(`<personId>`, `<favoriteId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getFavoriteSite + +Get a favorite site + +> This endpoint is **deprecated** as of **Alfresco 4.2**, and will be removed in the future. +> Use `/people/{personId}/favorites/{favoriteId}` instead. + +Gets information on favorite site **siteId** of person **personId**. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **siteId** | string | The identifier of a site. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteEntry](SiteEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const favoritesApi = new FavoritesApi(alfrescoApi); +const opts = {}; + +favoritesApi.getFavoriteSite(`<personId>`, `<siteId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listFavoriteSitesForPerson + +List favorite sites + +> This endpoint is **deprecated** as of Alfresco 4.2, and will be removed in the future. +> Use **/people/{personId}/favorites** instead. + +Gets a list of a person's favorite sites. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Example** + +```javascript +import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const favoritesApi = new FavoritesApi(alfrescoApi); +const opts = {}; + +favoritesApi.listFavoriteSitesForPerson(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +**Parameters** + +| Name | Type | Description | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SitePaging](SitePaging.md) + +## listFavorites + +List favorites + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +The default sort order for the returned list of favorites is type ascending, createdAt descending. +You can override the default by using the **orderBy** parameter. + +You can use any of the following fields to order the results: + +* type +* createdAt +* title + +You can use the **where** parameter to restrict the list in the response +to entries of a specific kind. The **where** parameter takes a value. + +The value is a single predicate that can include one or more **EXISTS** +conditions. The **EXISTS** condition uses a single operand to limit the +list to include entries that include that one property. The property values are: + +* target/file +* target/folder +* target/site + +For example, the following **where** parameter restricts the returned list to the file favorites for a person: + +```sql +(EXISTS(target/file)) +``` + +You can specify more than one condition using **OR**. +The predicate must be enclosed in parentheses. + +For example, the following **where** parameter restricts the returned list to the file and folder favorites for a person: + +```sql +(EXISTS(target/file) OR EXISTS(target/folder)) +``` + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **personId** | string | The identifier of a person. | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.where | string | A string to restrict the returned objects by using a predicate. | | +| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [FavoritePaging](#FavoritePaging) + +**Example** + +```javascript +import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const favoritesApi = new FavoritesApi(alfrescoApi); +const opts = {}; + +favoritesApi.listFavorites(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## FavoritePaging + +**Properties** + +| Name | Type | +|------|-------------------------------------------| +| list | [FavoritePagingList](#FavoritePagingList) | + +## FavoritePagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [FavoriteEntry[]](#FavoriteEntry) | + +## FavoriteEntry + +**Properties** + +| Name | Type | +|-----------|-----------------------| +| **entry** | [Favorite](#Favorite) | + +## Favorite + +**Properties** + +| Name | Type | Description | +|----------------|--------|----------------------------------------------------------------------------------------------------------------------------| +| **targetGuid** | string | The guid of the object that is a favorite. | +| **target** | any | | +| createdAt | Date | The time the object was made a favorite. | +| properties | any | A subset of the target favorite properties, system properties and properties already available in the target are excluded. | + + +## FavoriteBodyCreate + +**Properties** + +| Name | Type | +|------------|---------| +| **target** | **any** | + +## FavoriteSiteBodyCreate + +**Properties** + +| Name | Type | +|------|--------| +| id | string | + +## FavoriteSiteEntry + +**Properties** + +| Name | Type | +|-------|-------------------------------| +| entry | [FavoriteSite](#FavoriteSite) | + +## FavoriteSite + +**Properties** + +| Name | Type | +|------|--------| +| id | string | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/Group.md b/lib/js-api/src/api/content-rest-api/docs/Group.md new file mode 100644 index 0000000000..3b9f1a6872 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Group.md @@ -0,0 +1,12 @@ +# Group + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**displayName** | **string** | | [default to null] +**isRoot** | **boolean** | | [default to null] +**parentIds** | **string[]** | | [optional] [default to null] +**zones** | **string[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/GroupMember.md b/lib/js-api/src/api/content-rest-api/docs/GroupMember.md new file mode 100644 index 0000000000..7d1cd00941 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/GroupMember.md @@ -0,0 +1,18 @@ +# GroupMember + +**Properties** + +| Name | Type | +|-----------------|--------| +| **id** | string | +| **displayName** | string | +| **memberType** | string | + +## GroupMember.MemberTypeEnum + +* `GROUP` (value: `'GROUP'`) +* `PERSON` (value: `'PERSON'`) + + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/GroupsApi.md b/lib/js-api/src/api/content-rest-api/docs/GroupsApi.md new file mode 100644 index 0000000000..e5a1cc3f06 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/GroupsApi.md @@ -0,0 +1,512 @@ +# GroupsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------------------------------|------------------------------------------------------|-----------------------------| +| [createGroup](#createGroup) | **POST** /groups | Create a group | +| [createGroupMembership](#createGroupMembership) | **POST** /groups/{groupId}/members | Create a group membership | +| [deleteGroup](#deleteGroup) | **DELETE** /groups/{groupId} | Delete a group | +| [deleteGroupMembership](#deleteGroupMembership) | **DELETE** /groups/{groupId}/members/{groupMemberId} | Delete a group membership | +| [getGroup](#getGroup) | **GET** /groups/{groupId} | Get group details | +| [listGroupMemberships](#listGroupMemberships) | **GET** /groups/{groupId}/members | List memberships of a group | +| [listGroupMembershipsForPerson](#listGroupMembershipsForPerson) | **GET** /people/{personId}/groups | List group memberships | +| [listGroups](#listGroups) | **GET** /groups | List groups | +| [updateGroup](#updateGroup) | **PUT** /groups/{groupId} | Update group details | + +## createGroup + +Create a group + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. +> You must have admin rights to create a group. + +Create a group. + +The group id must start with \"GROUP\\_\". If this is omitted it will be added automatically. +This format is also returned when listing groups or group memberships. It should be noted +that the other group-related operations also expect the id to start with \"GROUP\\_\". + +If one or more parentIds are specified then the group will be created and become a member +of each of the specified parent groups. + +If no parentIds are specified then the group will be created as a root group. + +The group will be created in the **APP.DEFAULT** and **AUTH.ALF** zones. + +**Parameters** + +| Name | Type | Description | +|---------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **groupBodyCreate** | [GroupBodyCreate](#GroupBodyCreate) | The group to create. | +| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [GroupEntry](#GroupEntry) + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); + +const payload = {}; +const opts = {}; + +groupsApi.createGroup(payload, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## createGroupMembership + +Create a group membership + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. +> You must have admin rights to create a group membership. + +Create a group membership (for an existing person or group) within a group **groupId**. +If the added group was previously a root group then it becomes a non-root group since it now has a parent. + +It is an error to specify an **id** that does not exist. + +**Parameters** + +| Name | Type | Description | +|-------------------------------|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **groupId** | string | The identifier of a group. | +| **groupMembershipBodyCreate** | [GroupMembershipBodyCreate](#GroupMembershipBodyCreate) | The group membership to add (person or sub-group). | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [GroupMemberEntry](#GroupMemberEntry) + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); + +const groupMembershipBodyCreate = {}; +const opts = {}; + +groupsApi.createGroupMembership(`<groupId>`, groupMembershipBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteGroup + +Delete a group + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. +> You must have admin rights to delete a group. + +The option to cascade delete applies this recursively to any hierarchy of group members. +In this case, removing a group member does not delete the person or subgroup itself. +If a removed subgroup no longer has any parent groups then it becomes a root group. + +**Parameters** + +| Name | Type | Description | Notes | +|--------------|---------|-----------------------------------------------------------------------|------------------| +| **groupId** | string | The identifier of a group. | | +| opts.cascade | boolean | If **true** then the delete will be applied in cascade to sub-groups. | default to false | + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); + +const opts = { + cascade: true +}; + +groupsApi.deleteGroup(`<groupId>`, opts).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteGroupMembership + +Delete a group membership + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. +> You must have admin rights to delete a group membership. + +Delete group member **groupMemberId** (person or subgroup) from group **groupId**. + +Removing a group member does not delete the person or subgroup itself. +If a removed subgroup no longer has any parent groups then it becomes a root group. + +**Parameters** + +| Name | Type | Description | +|---------------|--------|--------------------------------------| +| groupId | string | The identifier of a group. | +| groupMemberId | string | The identifier of a person or group. | + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); + +groupsApi.deleteGroupMembership(`<groupId>`, `<groupMemberId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## getGroup + +Get group details + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. + +You can use the **include** parameter to return additional information. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **groupId** | string | The identifier of a group. | +| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [GroupEntry](#GroupEntry) + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); + +const opts = {}; + +groupsApi.getGroup(`<groupId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listGroupMemberships + +List memberships of a group + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. + +Gets a list of the group memberships for the group **groupId**. +You can use the **where** parameter to filter the returned groups by **memberType**. + +Example to filter by **memberType**, use any one of: + +```text +(memberType='GROUP') +(memberType='PERSON') +``` + +The default sort order for the returned list is for group members to be sorted by ascending displayName. +You can override the default by using the **orderBy** parameter. You can specify one of the following fields in the **orderBy** parameter: + +* id +* displayName + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **groupId** | string | The identifier of a group. | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.where | string | A string to restrict the returned objects by using a predicate. | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [GroupMemberPaging](#GroupMemberPaging) + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); +const opts = { }; + +groupsApi.listGroupMemberships(`<groupId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listGroupMembershipsForPerson + +List group memberships + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. + +Gets a list of group membership information for person **personId**. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +You can use the **include** parameter to return additional information. + +You can use the **where** parameter to filter the returned groups by **isRoot**. For example, the following **where** +clause will return just the root groups: + +```text +(isRoot=true) +``` + +The **where** parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow +a result set even further. For example, the following where clause will only return groups belonging to the +`MY.ZONE` zone. + +```text +where=(zones in ('MY.ZONE')) +``` + +This may be combined with the isRoot filter, as shown below: + +```text +where=(isRoot=false AND zones in ('MY.ZONE')) +``` + + ***Note:*** restrictions include + + * AND is the only supported operator when combining isRoot and zones filters + * Only one zone is supported by the filter + * The quoted zone name must be placed in parentheses — a 400 error will result if these are omitted. + + The default sort order for the returned list is for groups to be sorted by ascending displayName. + You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + +* id +* displayName + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **personId** | string | The identifier of a person. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | | +| opts.where | string | A string to restrict the returned objects by using a predicate. | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [GroupPaging](#GroupPaging) + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); +const opts = {}; + +groupsApi.listGroupMembershipsForPerson(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listGroups + +List groups + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. + +Gets a list of groups. + +You can use the **include** parameter to return additional information. + +You can use the **where** parameter to filter the returned groups by **isRoot**. For example, the following **where** +clause will return just the root groups: + +```text +(isRoot=true) +``` + +The **where** parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow +a result set even further. For example, the following where clause will only return groups belonging to the +`MY.ZONE` zone. + +```text +where=(zones in ('MY.ZONE')) +``` + +This may be combined with the isRoot filter, as shown below: + +```text +where=(isRoot=false AND zones in ('MY.ZONE')) +``` + +***Note:*** restrictions include + +* AND is the only supported operator when combining isRoot and zones filters +* Only one zone is supported by the filter +* The quoted zone name must be placed in parentheses — a 400 error will result if these are omitted. + +The default sort order for the returned list is for groups to be sorted by ascending displayName. +You can override the default by using the **orderBy** parameter. You can specify one of the following fields in the **orderBy** parameter: + +* id +* displayName + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | | +| opts.where | string | A string to restrict the returned objects by using a predicate. | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [GroupPaging](#GroupPaging) + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); + +const opts = {}; + +groupsApi.listGroups(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## updateGroup + +Update group details + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. +> You must have admin rights to update a group. + +**Parameters** + +| Name | Type | Description | +|---------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **groupId** | string | The identifier of a group. | +| **groupBodyUpdate** | [GroupBodyUpdate](#GroupBodyUpdate) | The group information to update. | +| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [GroupEntry](#GroupEntry) + +**Example** + +```javascript +import { AlfrescoApi, GroupsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const groupsApi = new GroupsApi(alfrescoApi); +const groupBodyUpdate = {}; +const opts = {}; + +groupsApi.updateGroup(`<groupId>`, groupBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## GroupMemberPaging + +**Properties** + +| Name | Type | +|------|-------------------------------------------------| +| list | [GroupMemberPagingList](#GroupMemberPagingList) | + +## GroupMemberPagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [GroupMemberEntry[]](#GroupMemberEntry) | + +## GroupMemberEntry + +**Properties** + +| Name | Type | +|-------|-------------------------------| +| entry | [GroupMember](GroupMember.md) | + +## GroupBodyCreate + +**Properties** + +| Name | Type | +|-------------|----------| +| id | string | +| displayName | string | +| parentIds | string[] | + +## GroupMembershipBodyCreate + +**Properties** + +| Name | Type | +|------------|--------| +| id | string | +| memberType | string | + + +### GroupMembershipBodyCreate.MemberTypeEnum + +* `GROUP` (value: `'GROUP'`) +* `PERSON` (value: `'PERSON'`) + +## GroupBodyUpdate + +**Properties** + +| Name | Type | +|-------------|--------| +| displayName | string | + +## GroupPaging + +**Properties** + +| Name | Type | +|------|-------------------------------------| +| list | [GroupPagingList](#GroupPagingList) | + + +## GroupPagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [GroupEntry[]](#GroupEntry) | + +## GroupEntry + +**Properties** + +| Name | Type | +|-----------|-------------------| +| **entry** | [Group](Group.md) | + diff --git a/lib/js-api/src/api/content-rest-api/docs/NetworksApi.md b/lib/js-api/src/api/content-rest-api/docs/NetworksApi.md new file mode 100644 index 0000000000..4c88e4f7c6 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/NetworksApi.md @@ -0,0 +1,158 @@ +# NetworksApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-------------------------------------------------|-------------------------------------------------|-------------------------| +| [getNetwork](#getNetwork) | **GET** /networks/{networkId} | Get a network | +| [getNetworkForPerson](#getNetworkForPerson) | **GET** /people/{personId}/networks/{networkId} | Get network information | +| [listNetworksForPerson](#listNetworksForPerson) | **GET** /people/{personId}/networks | List network membership | + +## getNetwork + +Get a network + +**Parameters** + +| Name | Type | Description | +|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **networkId** | string | The identifier of a network. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [PersonNetworkEntry](#PersonNetworkEntry) + +**Example** + +```javascript +import { AlfrescoApi, NetworksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const networksApi = new NetworksApi(alfrescoApi); +const opts = {}; + +networksApi.getNetwork(`<networkId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getNetworkForPerson + +Get network information + +You can use the `-me-` string in place of <personId> to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **networkId** | string | The identifier of a network. | +| fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [PersonNetworkEntry](#PersonNetworkEntry) + +**Example** + +```javascript +import { AlfrescoApi, NetworksApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const networksApi = new NetworksApi(alfrescoApi); + +const opts = {}; + +networksApi.getNetworkForPerson(`<personId>`, `<networkId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listNetworksForPerson + +List network membership + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **personId** | string | The identifier of a person. | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [PersonNetworkPaging](#PersonNetworkPaging) + +**Example** + +```javascript +import { AlfrescoApi, NetworksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const networksApi = new NetworksApi(alfrescoApi); + +const opts = {}; + +networksApi.listNetworksForPerson(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## PersonNetworkEntry + +**Properties** + +| Name | Type | +|-------|---------------------------------| +| entry | [PersonNetwork](#PersonNetwork) | + +## PersonNetworkPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------------------| +| list | [PersonNetworkPagingList](#PersonNetworkPagingList) | + + +## PersonNetworkPagingList + +**Properties** + +| Name | Type | +|------------|---------------------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [PersonNetworkEntry[]](#PersonNetworkEntry) | + + +## PersonNetwork + +**Properties** + +| Name | Type | Description | +|-------------------|---------------------------------|---------------------------| +| **id** | string | This network's unique id | +| homeNetwork | boolean | Is this the home network? | +| **isEnabled** | boolean | | +| createdAt | Date | | +| paidNetwork | boolean | | +| subscriptionLevel | string | | +| quotas | [NetworkQuota[]](#NetworkQuota) | | + +### PersonNetwork.SubscriptionLevelEnum + +* `Free` (value: `'Free'`) +* `Standard` (value: `'Standard'`) +* `Enterprise` (value: `'Enterprise'`) + +## NetworkQuota + +**Properties** + +| Name | Type | +|-----------|--------| +| **id** | string | +| **limit** | number | +| **usage** | number | diff --git a/lib/js-api/src/api/content-rest-api/docs/Node.md b/lib/js-api/src/api/content-rest-api/docs/Node.md new file mode 100644 index 0000000000..96f51cec5d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Node.md @@ -0,0 +1,29 @@ +# Node + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isFolder** | **boolean** | | [default to null] +**isFile** | **boolean** | | [default to null] +**isLocked** | **boolean** | | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**parentId** | **string** | | [optional] [default to null] +**isLink** | **boolean** | | [optional] [default to null] +**isFavorite** | **boolean** | | [optional] [default to null] +**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] +**permissions** | [**PermissionsInfo**](PermissionsInfo.md) | | [optional] [default to null] +**definition** | [**Definition**](Definition.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/NodeEntry.md b/lib/js-api/src/api/content-rest-api/docs/NodeEntry.md new file mode 100644 index 0000000000..a914a74202 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/NodeEntry.md @@ -0,0 +1,8 @@ +# NodeEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Node**](Node.md) | | [default to null] + + diff --git a/lib/js-api/src/api/content-rest-api/docs/NodesApi.md b/lib/js-api/src/api/content-rest-api/docs/NodesApi.md new file mode 100644 index 0000000000..e760708db4 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/NodesApi.md @@ -0,0 +1,1414 @@ +# NodesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|---------------------------------------------------------------------|---------------------------------------------------------|-------------------------------------------------------| +| [copyNode](#copyNode) | **POST** /nodes/{nodeId}/copy | Copy a node | +| [createAssociation](#createAssociation) | **POST** /nodes/{nodeId}/targets | Create node association | +| [createNode](#createNode) | **POST** /nodes/{nodeId}/children | Create a node | +| [createSecondaryChildAssociation](#createSecondaryChildAssociation) | **POST** /nodes/{nodeId}/secondary-children | Create secondary child | +| [deleteAssociation](#deleteAssociation) | **DELETE** /nodes/{nodeId}/targets/{targetId} | Delete node association(s) | +| [deleteNode](#deleteNode) | **DELETE** /nodes/{nodeId} | Delete a node | +| [deleteNodes](#deleteNodes) | | Deletes multiple nodes | +| [deleteSecondaryChildAssociation](#deleteSecondaryChildAssociation) | **DELETE** /nodes/{nodeId}/secondary-children/{childId} | Delete secondary child or children | +| [getNode](#getNode) | **GET** /nodes/{nodeId} | Get a node | +| [getNodeContent](#getNodeContent) | **GET** /nodes/{nodeId}/content | Get node content | +| [listNodeChildren](#listNodeChildren) | **GET** /nodes/{nodeId}/children | List node children | +| [listParents](#listParents) | **GET** /nodes/{nodeId}/parents | List parents | +| [listSecondaryChildren](#listSecondaryChildren) | **GET** /nodes/{nodeId}/secondary-children | List secondary children | +| [listSourceAssociations](#listSourceAssociations) | **GET** /nodes/{nodeId}/sources | List source associations | +| [listTargetAssociations](#listTargetAssociations) | **GET** /nodes/{nodeId}/targets | List target associations | +| [lockNode](#lockNode) | **POST** /nodes/{nodeId}/lock | Lock a node | +| [moveNode](#moveNode) | **POST** /nodes/{nodeId}/move | Move a node | +| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /nodes/{nodeId}/request-direct-access-url | Generate a direct access content url for a given node | +| [unlockNode](#unlockNode) | **POST** /nodes/{nodeId}/unlock | Unlock a node | +| [updateNode](#updateNode) | **PUT** /nodes/{nodeId} | Update a node | +| [updateNodeContent](#updateNodeContent) | **PUT** /nodes/{nodeId}/content | Update node content | + +## copyNode + +Copy a node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Copies the node **nodeId** to the parent folder node **targetParentId**. You specify the **targetParentId** in the request body. + +The new node has the same name as the source node unless you specify a new **name** in the request body. + +If the source **nodeId** is a folder, then all of its children are also copied. + +If the source **nodeId** is a file, it's properties, aspects and tags are copied, it's ratings, comments and locks are not. + +**Parameters** + +| Name | Type | Description | +|------------------|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **nodeBodyCopy** | [NodeBodyCopy](#NodeBodyCopy) | The targetParentId and, optionally, a new name which should include the file extension. | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `permissions`, `definition` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const nodeBodyCopy = {}; +const opts = {}; + +nodesApi.copyNode(`<nodeId>`, nodeBodyCopy, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## createAssociation + +Create node association + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Create an association, with the given association type, between the source **nodeId** and a target node. + +**Note:** You can create more than one association by +specifying a list of associations in the JSON body like this: + +```json +[ + { + "targetId": "string", + "assocType": "string" + }, + { + "targetId": "string", + "assocType": "string" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": { + } + }, + { + "entry": { + } + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|---------------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a source node. | +| **associationBodyCreate** | [AssociationBody](#AssociationBody) | The target node id and assoc type. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [AssociationEntry](AssociationEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const associationBodyCreate = {}; +const opts = {}; + +nodesApi.createAssociation(`<nodeId>`, associationBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## createNode + +Create a node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Create a node and add it as a primary child of node **nodeId**. + +This endpoint supports both `JSON` and `multipart/form-data` (file upload). + +**Using multipart/form-data** + +Use the **filedata** field to represent the content to upload, for example, the following curl command will +create a node with the contents of test.txt in the test user's home folder. + +```shell +curl -utest:test -X POST host:port/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children -F filedata=@test.txt +``` + +You can use the **name** field to give an alternative name for the new file. + +You can use the **nodeType** field to create a specific type. The default is cm:content. + +You can use the **renditions** field to create renditions (e.g. doclib) asynchronously upon upload. +Also, as requesting rendition is a background process, +any rendition failure (e.g. No transformer is currently available) will not fail the whole upload and has the potential to silently fail. + +Use **overwrite** to overwrite an existing file, matched by name. If the file is versionable, +the existing content is replaced. + +When you overwrite existing content, you can set the **majorVersion** boolean field to **true** to indicate a major version +should be created. The default for **majorVersion** is **false**. +Setting **majorVersion** enables versioning of the node, if it is not already versioned. + +When you overwrite existing content, you can use the **comment** field to add a version comment that appears in the +version history. This also enables versioning of this node, if it is not already versioned. + +You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then +the API method tries to create a unique name using an integer suffix. + +You can use the **relativePath** field to specify the folder structure to create relative to the node **nodeId**. +Folders in the **relativePath** that do not exist are created before the node is created. + +Any other field provided will be treated as a property to set on the newly created node. + +> setting properties of type d:content and d:category are not supported. + +**Using JSON** + +You must specify at least a **name** and **nodeType**. For example, to create a folder: + +```json +{ + "name": "My Folder", + "nodeType": "cm:folder" +} +``` + +You can create an empty file like this: + +```json +{ + "name": "My text file.txt", + "nodeType": "cm:content" +} +``` + +You can update binary content using the `PUT /nodes/{nodeId}` API method. + +You can create a folder, or other node, inside a folder hierarchy: + +```json +{ + "name": "My Special Folder", + "nodeType": "cm:folder", + "relativePath": "X/Y/Z" +} +``` + +The **relativePath** specifies the folder structure to create relative to the node **nodeId**. Folders in the +**relativePath** that do not exist are created before the node is created. + +You can set properties when you create a new node: + +```json +{ + "name": "My Other Folder", + "nodeType": "cm:folder", + "properties": + { + "cm:title": "Folder title", + "cm:description": "This is an important folder" + } +} +``` + +You can set multi-value properties when you create a new node which supports properties of type multiple. + +```json +{ + "name": "My Other Folder", + "nodeType": "custom:destination", + "properties": + { + "cm:title": "Folder title", + "cm:description": "This is an important folder", + "custom:locations": [ + "location X", + "location Y" + ] + } +} +``` + +Any missing aspects are applied automatically. For example, **cm:titled** in the JSON shown above. You can set aspects +explicitly, if needed, using an **aspectNames** field. + +> setting properties of type `d:content` and `d:category` are not supported. + +You can also optionally disable (or enable) inherited permissions via *isInheritanceEnabled* flag: + +```json +{ + "permissions": + { + "isInheritanceEnabled": false, + "locallySet": + [ + {"authorityId": "GROUP_special", "name": "Read", "accessStatus":"DENIED"}, + {"authorityId": "testuser", "name": "Contributor", "accessStatus":"ALLOWED"} + ] + } +} +``` + +Typically, for files and folders, the primary children are created within the parent folder using the default "cm:contains" assocType. +If the content model allows then it is also possible to create primary children with a different assoc type. For example: + +```json +{ + "name": "My Node", + "nodeType": "my:specialNodeType", + "association": { + "assocType": "my:specialAssocType" + } +} +``` + +Additional associations can be added after creating a node. You can also add associations at the time the node is created. This is +required, for example, if the content model specifies that a node has mandatory associations to one or more existing nodes. + +You can optionally +specify an array of **secondaryChildren** to create one or more secondary child associations, such that the newly created node acts as a parent node. + +You can optionally specify an array of **targets** to create one or more peer associations such that the newly created node acts as a source node. +For example, to associate one or more secondary children at time of creation: + +```json +{ + "name": "My Folder", + "nodeType": "cm:folder", + "secondaryChildren": + [ + { + "childId": "abcde-01234-...", + "assocType": "my:specialChildAssocType" + } + ] +} +``` + +For example, to associate one or more targets at time of creation: + +```json +{ + "name": "My Folder", + "nodeType": "cm:folder", + "targets": + [ + { + "targetId": "abcde-01234-...", + "assocType": "my:specialPeerAssocType" + } + ] +} +``` + +**Note:** You can create more than one child by +specifying a list of nodes in the JSON body. For example, the following JSON +body creates two folders inside the specified **nodeId**, if the **nodeId** identifies +a folder: + +```json +[ + { + "name":"My Folder 1", + "nodeType":"cm:folder" + }, + { + "name":"My Folder 2", + "nodeType":"cm:folder" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": { + } + }, + { + "entry": { + } + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|--------------------|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. You can also use one of these well-known aliases: `-my-`, `-shared-`, `-root-` | +| **nodeBodyCreate** | [NodeBodyCreate](#NodeBodyCreate) | The node information to create. | +| opts.autoRename | boolean | If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `permissions`, `definition` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const nodeBodyCreate = {}; +const opts = {}; + +nodesApi.createNode(`<nodeId>`, nodeBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## createSecondaryChildAssociation + +Create secondary child + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Create a secondary child association, with the given association type, between the parent **nodeId** and a child node. + +**Note:** You can create more than one secondary child association by +specifying a list of associations in the JSON body like this: + +```json +[ + { + "childId": "string", + "assocType": "string" + }, + { + "childId": "string", + "assocType": "string" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": { + } + }, + { + "entry": { + } + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------------------------|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a parent node. | +| **secondaryChildAssociationBodyCreate** | [ChildAssociationBody](#ChildAssociationBody) | The child node id and assoc type. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [ChildAssociationEntry](ChildAssociationEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const secondaryChildAssociationBodyCreate = {}; +const opts = {}; + +nodesApi.createSecondaryChildAssociation(nodeId, secondaryChildAssociationBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteAssociation + +Delete node association(s) + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Delete an association, or associations, from the source **nodeId* to a target node for the given association type. + +If the association type is **not** specified, then all peer associations, of any type, in the direction +from source to target, are deleted. + +> After removal of the peer association, or associations, from source to target, the two nodes may still have peer associations +in the other direction. + + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|--------|----------------------------------------|------------| +| **nodeId** | string | The identifier of a source node. | | +| **targetId** | string | The identifier of a target node. | | +| opts.assocType | string | Only delete associations of this type. | [optional] | + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = { }; + +nodesApi.deleteAssociation(`<nodeId>`, `<targetId>`, opts).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteNode + +Delete a node + +> this endpoint is available in **Alfresco 5.**2 and newer versions. + +Deletes the node **nodeId**. + +If **nodeId** is a folder, then its children are also deleted. + +Deleted nodes move to the trashcan unless the **permanent** query parameter is **true** and the current user is the owner of the node or an admin. + +Deleting a node deletes it from its primary parent and also from any secondary parents. Peer associations are also deleted, where the deleted +node is either a source or target of an association. This applies recursively to any hierarchy of primary children of the deleted node. + +**Note:** If the node is not permanently deleted, and is later successfully restored to its former primary parent, then the primary +child association is restored. This applies recursively for any primary children. No other secondary child associations or +peer associations are restored for any of the nodes in the primary parent-child hierarchy of restored nodes, regardless of whether the original +associations were to nodes inside or outside the restored hierarchy. + +**Parameters** + +| Name | Type | Description | +|----------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| opts.permanent | boolean | If **true** then the node is deleted permanently, without moving to the trashcan. Only the owner of the node or an admin can permanently delete the node. | + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = { }; + +nodesApi.deleteNode(`<nodeId>`, opts).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteNodes + +Delete multiple nodes + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Deletes the nodes specified in the **nodeIds** array. + +**Parameters** + +| Name | Type | Description | +|----------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeIds** | string[] | The list of node IDs to delete. | +| opts.permanent | boolean | If **true** then nodes are deleted permanently, without moving to the trashcan. Only the owner of the node or an admin can permanently delete the node. | + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = { }; + +nodesApi.deleteNodes(`[<nodeId1>, <nodeId2>]`, opts).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteSecondaryChildAssociation + +Delete secondary child or children + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Delete secondary child associations between the parent **nodeId** and child nodes for the given association type. + +If the association type is **not** specified, then all secondary child associations, of any type in the direction +from parent to secondary child, will be deleted. The child will still have a primary parent and may still be +associated as a secondary child with other secondary parents. + +**Parameters** + +| Name | Type | Description | +|----------------|--------|----------------------------------------| +| **nodeId** | string | The identifier of a parent node. | +| **childId** | string | The identifier of a child node. | +| opts.assocType | string | Only delete associations of this type. | + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.deleteSecondaryChildAssociation(`<nodeId>`, `<childId>`, opts).then(() => { + console.log('API called successfully.'); +}); +``` + +## getNode + +Get a node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Get information for node **nodeId**. + +You can use the **include** parameter to return additional information. + +**Parameters** + +| Name | Type | Description | +|-------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. You can also use one of these well-known aliases: `-my-`, `-shared-`, `-root-` | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `permissions`, `definition` | +| opts.relativePath | string | A path relative to the **nodeId**. If you set this, information is returned on the node resolved by this path. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.getNode(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getNodeContent + +Get node content + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets the content of the node with identifier **nodeId**. + +**Parameters** + +| Name | Type | Description | +|-----------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | **string** | The identifier of a node. | +| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. | +| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. | + +**Return type**: Blob + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.getNodeContent(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listNodeChildren + +List node children + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of children of the parent node **nodeId**. + +Minimal information for each child is returned by default. + +You can use the **include** parameter to return additional information. + +The list of child nodes includes primary children and secondary children, if there are any. + +You can use the **include** parameter (include=association) to return child association details +for each child, including the **assocTyp**e and the **isPrimary** flag. + +The default sort order for the returned list is for folders to be sorted before files, and by ascending name. + +You can override the default using **orderBy** to specify one or more fields to sort by. The default order is always ascending, but +you can use an optional **ASC** or **DESC** modifier to specify an ascending or descending sort order. + +For example, specifying `orderBy=name DESC` returns a mixed folder/file list in descending **name** order. + +You can use any of the following fields to order the results: + +* isFolder +* name +* mimeType +* nodeType +* sizeInBytes +* modifiedAt +* createdAt +* modifiedByUser +* createdByUser + +**Parameters** + +| Name | Type | Description | +|---------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. You can also use one of these well-known aliases: `-my-`, `-shared-`, `-root-` | +| skipCount | number | Default: 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | +| maxItems | number | Default: 100. The maximum number of items to return in the list. If not supplied then the default value is 100. | +| orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | +| where | string | Optionally filter the list. Here are some examples: `where=(isFolder=true)`, `where=(isFile=true)`, `where=(nodeType='my:specialNodeType')`, `where=(nodeType='my:specialNodeType INCLUDESUBTYPES')`, `where=(isPrimary=true)`, `where=(assocType='my:specialAssocType')`, `where=(isPrimary=false and assocType='my:specialAssocType')` | +| include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties`, `permissions` | +| relativePath | string | Return information on children in the folder resolved by this path. The path is relative to **nodeId**. | +| includeSource | boolean | Also include **source** in addition to **entries** with folder information on the parent node – either the specified parent **nodeId**, or as resolved by **relativePath**. | +| fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeChildAssociationPaging](#NodeChildAssociationPaging) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.listNodeChildren(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listParents + +List parents + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of parent nodes that are associated with the current child **nodeId**. + +The list includes both the primary parent and any secondary parents. + +**Parameters** + +| Name | Type | Description | Notes | +|---------------|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **nodeId** | **string** | The identifier of a child node. You can also use one of these well-known aliases: `-my-`, `-shared-`, `-root-` | | +| where | string | Optionally filter the list by **assocType** and/or **isPrimary**. Here are some example filters: `where=(assocType='my:specialAssocType')`, `where=(isPrimary=true)`, `where=(isPrimary=false and assocType='my:specialAssocType')` | | +| include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties` | | +| skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| includeSource | boolean | Also include **source** (in addition to **entries**) with folder information on **nodeId** | | +| fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [NodeAssociationPaging](#NodeAssociationPaging) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.listParents(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSecondaryChildren + +List secondary children + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of secondary child nodes that are associated with the current parent **nodeId**, via a secondary child association. + +**Parameters** + +| Name | Type | Description | +|--------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a parent node. You can also use one of these well-known aliases: `-my-`, `-shared-`, `-root-` | +| opts.where | string | Optionally filter the list by assocType. Here's an example: `where=(assocType='my:specialAssocType')` | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties` | +| opts.skipCount | number | Default: 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | +| opts.maxItems | number | Default: 100. The maximum number of items to return in the list. If not supplied then the default value is 100. | +| opts.includeSource | boolean | Also include **source** (in addition to **entries**) with folder information on **nodeId** | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeChildAssociationPaging](#NodeChildAssociationPaging) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.listSecondaryChildren(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSourceAssociations + +List source associations + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of source nodes that are associated with the current target **nodeId**. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a target node. | +| opts.where | string | Optionally filter the list by **assocType**. Here's an example: ` where=(assocType='my:specialAssocType')` | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeAssociationPaging](#NodeAssociationPaging) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.listSourceAssociations(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listTargetAssociations + +List target associations + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of target nodes that are associated with the current source **nodeId**. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a source node. | +| opts.where | string | Optionally filter the list by **assocType**. Here's an example: `where=(assocType='my:specialAssocType')` | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeAssociationPaging](#NodeAssociationPaging) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.listTargetAssociations(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## lockNode + +Lock a node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Places a lock on node **nodeId**. + +**Note:** you can only lock files. More specifically, a node can only be locked if it is +of type cm:content or a subtype of cm:content. + +The lock is owned by the current user, and prevents other users or processes from making updates to the node until the lock is released. + +If the **timeToExpire** is not set or is zero, then the lock never expires. Otherwise, the **timeToExpire** is the number of seconds before the lock expires. + +When a lock expires, the lock is released. + +If the node is already locked, and the user is the lock owner, then the lock is renewed with the new **timeToExpire**. + +By default, a lock is applied that allows the owner to update or delete the node. +You can use **type** to change the lock type to one of the following: + +* **ALLOW_OWNER_CHANGES** (default) changes to the node can be made only by the lock owner. This enum is the same value as the deprecated `WRITE_LOCK` described in `org.alfresco.service.cmr.lock.LockType` in the Alfresco Public Java API. This is the default value. +* **FULL** no changes by any user are allowed. This enum is the same value as the deprecated `READ_ONLY_LOCK` described in `org.alfresco.service.cmr.lock.LockType` in the Alfresco Public Java API. + +By default, a lock is persisted in the database. You can create a volatile in-memory lock by setting the **lifetime** property to EPHEMERAL. +You might choose use `EPHEMERAL` locks, for example, if you are taking frequent short-term locks that you don't need +to be kept over a restart of the repository. In this case you don't need the +overhead of writing the locks to the database. + +If a lock on the node cannot be taken, then an error is returned. + +**Parameters** + +| Name | Type | Description | +|------------------|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **nodeBodyLock** | [NodeBodyLock](#NodeBodyLock) | Lock details. | +| include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `permissions`, `definition` | +| fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const nodeBodyLock = {}; +const opts = {}; + +nodesApi.lockNode(`<nodeId>`, nodeBodyLock, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## moveNode + +Move a node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Move the node **nodeId** to the parent folder node **targetParentId**. + +The **targetParentId** is specified in the in request body. + +The moved node retains its name unless you specify a new **name** in the request body. + +If the source **nodeId** is a folder, then its children are also moved. + +The move will effectively change the primary parent. + +**Parameters** + +| Name | Type | Description | +|------------------|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **nodeBodyMove** | [NodeBodyMove](#NodeBodyMove) | The targetParentId and, optionally, a new name which should include the file extension. | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `permissions`, `definition` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const nodeBodyMove = {}; +const opts = {}; + +nodesApi.moveNode(`<nodeId>`, nodeBodyMove, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## requestDirectAccessUrl + +Generate a direct access content url for a given node + +> this endpoint is available in **Alfresco 7.1** and newer versions. + +**Parameters** + +| Name | Type | Description | +|------------|--------|---------------------------| +| **nodeId** | string | The identifier of a node. | + +**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); + +const nodeId = 'da2e6953-3850-408b-8284-3534dd777417'; + +nodesApi.requestDirectAccessUrl(nodeId).then((data) => { + console.log('URL generated successfully: ', data.contentUrl); +}); +``` + +## unlockNode + +Unlock a node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Deletes a lock on node **nodeId**. + +The current user must be the owner of the locks or have admin rights, otherwise an error is returned. + +If a lock on the node cannot be released, then an error is returned. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `permissions`, `definition` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const opts = {}; + +nodesApi.unlockNode(`nodeId`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## updateNode + +Update a node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Updates the node **nodeId**. For example, you can rename a file or folder: + +```json +{ + "name":"My new name" +} +``` + +You can also set or update one or more properties: + +```json +{ + "properties": + { + "cm:title":"Folder title" + } +} +``` + +You can update multi-value properties of a node which supports properties of type multiple. + +```json +{ + "name":"My Other Folder", + "nodeType":"custom:destination", + "properties": + { + "cm:title":"Folder title", + "cm:description":"This is an important folder", + "custom:locations": [ + "location NewX", + "location NewY" + ] + } +} +``` + +**Note:** setting properties of type d:content and d:category are not supported. + +**Note:** if you want to add or remove aspects, then you must use **GET /nodes/{nodeId}** first to get the complete set of *aspectNames*. + +You can add (or remove) *locallySet* permissions, if any, in addition to any inherited permissions. +You can also optionally disable (or re-enable) inherited permissions via *isInheritanceEnabled* flag: + +```json +{ + "permissions": + { + "isInheritanceEnabled": false, + "locallySet": + [ + {"authorityId": "GROUP_special", "name": "Read", "accessStatus":"DENIED"}, + {"authorityId": "testuser", "name": "Contributor", "accessStatus":"ALLOWED"} + ] + } +} +``` + +**Note:** if you want to add or remove locally set permissions then you must use **GET /nodes/{nodeId}** first to get the complete set of *locallySet* permissions. + +**Note:** Currently there is no optimistic locking for updates, so they are applied in "last one wins" order. + +**Parameters** + +| Name | Type | Description | +|--------------------|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **nodeBodyUpdate** | [NodeBodyUpdate](#NodeBodyUpdate) | The node information to update. | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `permissions`, `definition` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const nodeBodyUpdate = {}; +const opts = {}; + +nodesApi.updateNode(`<nodeId>`, nodeBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## updateNodeContent + +Update node content + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Updates the content of the node with identifier **nodeId**. + +The request body for this endpoint can be any text or binary stream. + +The **majorVersion** and **comment** parameters can be used to control versioning behaviour. If the content is versionable, +a new minor version is created by default. + +Optionally a new **name** parameter can also be specified that must be unique within the parent folder. If specified and valid then this +will rename the node. If invalid then an error is returned and the content is not updated. + +**Note:** This API method accepts any content type, but for testing with this tool text based content can be provided. +This is because the OpenAPI Specification does not allow a wildcard to be provided or the ability for +tooling to accept an arbitrary file. + +**Parameters** + +| Name | Type | Description | +|-----------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **contentBodyUpdate** | string | The binary content | +| opts.majorVersion | boolean | If **true**, create a major version. Setting this parameter also enables versioning of this node, if it is not already versioned. | +| opts.comment | string | Add a version comment which will appear in version history. Setting this parameter also enables versioning of this node, if it is not already versioned. | +| opts.name | string | Optional new name. This should include the file extension. The name must not contain spaces or the following special characters: `* " < > \\ / ? :` and `\|`. The character . must not be used at the end of the name. | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `permissions`, `definition` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, NodesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const nodesApi = new NodesApi(alfrescoApi); +const contentBodyUpdate = {}; +const opts = {}; + +nodesApi.updateNodeContent(`<nodeId>`, contentBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## NodeBodyUpdate + +**Properties** + +| Name | Type | Description | +|-------------|-------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| +| name | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|` . The character . must not be used at the end of the name. | +| nodeType | string | | +| aspectNames | string[] | | +| properties | Map<string, string> | | +| permissions | [PermissionsBody](#PermissionsBody) | | + +## NodeAssociationPaging + +**Properties** + +| Name | Type | +|------|---------------------------------------------------------| +| list | [NodeAssociationPagingList](#NodeAssociationPagingList) | + +## NodeAssociationPagingList + +**Properties** + +| Name | Type | +|------------|-------------------------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [NodeAssociationEntry[]](#NodeAssociationEntry) | +| source | [Node](Node.md) | + +## NodeAssociationEntry + +**Properties** + +| Name | Type | +|-----------|-------------------------------------| +| **entry** | [NodeAssociation](#NodeAssociation) | + +## NodeAssociation + +**Properties** + +| Name | Type | Description | +|---------------------|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **id** | string | | +| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|` . The character . must not be used at the end of the name. | +| **nodeType** | string | | +| **isFolder** | boolean | | +| **isFile** | boolean | | +| isLocked | boolean | | +| **modifiedAt** | Date | | +| **modifiedByUser** | [UserInfo](UserInfo.md) | | +| **createdAt** | Date | | +| **createdByUser** | [UserInfo](UserInfo.md) | | +| parentId | string | | +| isLink | boolean | | +| isFavorite | boolean | | +| content | [ContentInfo](ContentInfo.md) | | +| aspectNames | string[] | | +| properties | any | | +| allowableOperations | string[] | | +| path | [PathInfo](PathInfo.md) | | +| permissions | [PermissionsInfo](PermissionsInfo.md) | | +| definition | [Definition](Definition.md) | | +| association | [AssociationInfo](AssociationInfo.md) | | + +## NodeBodyMove + +**Properties** + +| Name | Type | Description | +|--------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **targetParentId** | string | | +| name | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|` . The character . must not be used at the end of the name. | + +## NodeBodyLock + +**Properties** + +| Name | Type | +|--------------|--------| +| timeToExpire | number | +| type | string | +| lifetime | string | + +### NodeBodyLock.TypeEnum + +* `ALLOWOWNERCHANGES` (value: `'ALLOW_OWNER_CHANGES'`) +* `FULL` (value: `'FULL'`) + +### NodeBodyLock.LifetimeEnum + +* `PERSISTENT` (value: `'PERSISTENT'`) +* `EPHEMERAL` (value: `'EPHEMERAL'`) + +## NodeBodyCopy + +**Properties** + +| Name | Type | Description | +|--------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **targetParentId** | string | | +| name | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|` . The character . must not be used at the end of the name. | + +## NodeChildAssociationPaging + +**Properties** + +| Name | Type | +|------|-------------------------------------------------------------------| +| list | [NodeChildAssociationPagingList](#NodeChildAssociationPagingList) | + +## NodeChildAssociationPagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [NodeChildAssociationEntry[]](#NodeChildAssociationEntry) | +| source | [Node](Node.md) | + +## NodeChildAssociationEntry + +**Properties** + +| Name | Type | +|-----------|-----------------------------------------------| +| **entry** | [NodeChildAssociation](#NodeChildAssociation) | + +## NodeChildAssociation + +**Properties** + +| Name | Type | Description | +|---------------------|-------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **id** | string | | +| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|` . The character . must not be used at the end of the name. | +| **nodeType** | string | | +| **isFolder** | boolean | | +| **isFile** | boolean | | +| isLocked | boolean | | +| **modifiedAt** | Date | | +| **modifiedByUser** | [UserInfo](UserInfo.md) | | +| **createdAt** | Date | | +| **createdByUser** | [UserInfo](UserInfo.md) | | +| parentId | string | | +| isLink | boolean | | +| isFavorite | boolean | | +| content | [ContentInfo](ContentInfo.md) | | +| aspectNames | string[] | | +| properties | any | | +| allowableOperations | string[] | | +| path | [PathInfo](PathInfo.md) | | +| permissions | [PermissionsInfo](PermissionsInfo.md) | | +| definition | [Definition](Definition.md) | | +| association | [ChildAssociationInfo](ChildAssociationInfo.md) | | + +## NodeBodyCreate + +**Properties** + +| Name | Type | Description | +|-------------------|---------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|`. The character . must not be used at the end of the name. | +| **nodeType** | string | | +| aspectNames | string[] | | +| properties | any | | +| permissions | [PermissionsBody](#PermissionsBody) | | +| definition | [Definition](Definition.md) | | +| relativePath | string | | +| association | [NodeBodyCreateAssociation](#NodeBodyCreateAssociation) | | +| secondaryChildren | [ChildAssociationBody[]](#ChildAssociationBody) | | +| targets | [AssociationBody[]](#AssociationBody) | | + +## NodeBodyCreateAssociation + +**Properties** + +| Name | Type | +|-----------|--------| +| assocType | string | + +## AssociationBody + +**Properties** + +| Name | Type | +|---------------|--------| +| **targetId** | string | +| **assocType** | string | + +## ChildAssociationBody + +**Properties** + +| Name | Type | +|---------------|--------| +| **childId** | string | +| **assocType** | string | + +## PermissionsBody + +**Properties** + +| Name | Type | +|----------------------|---------------------------------------------| +| isInheritanceEnabled | boolean | +| locallySet | [PermissionElement[]](PermissionElement.md) | + + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/Pagination.md b/lib/js-api/src/api/content-rest-api/docs/Pagination.md new file mode 100644 index 0000000000..3757f88088 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Pagination.md @@ -0,0 +1,13 @@ +# Pagination + +**Properties** + +| Name | Type | Description | +|--------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| count | number | The number of objects in the entries array. | +| hasMoreItems | boolean | A boolean value which is **true** if there are more entities in the collection beyond those in this response. A true value means a request with a larger value for the **skipCount** or the **maxItems** parameter will return more entities. | +| totalItems | number | An integer describing the total number of entities in the collection. The API might not be able to determine this value, in which case this property will not be present. | +| skipCount | number | An integer describing how many entities exist in the collection before those included in this list. If there was no **skipCount** parameter then the default value is 0. | +| maxItems | number | The value of the **maxItems** parameter used to generate this list. If there was no **maxItems** parameter then the default value is 100. | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/PathElement.md b/lib/js-api/src/api/content-rest-api/docs/PathElement.md new file mode 100644 index 0000000000..ec35c164e4 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/PathElement.md @@ -0,0 +1,12 @@ +# PathElement + +**Properties** + +| Name | Type | +|-------------|----------| +| id | string | +| name | string | +| nodeType | string | +| aspectNames | string[] | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/PathInfo.md b/lib/js-api/src/api/content-rest-api/docs/PathInfo.md new file mode 100644 index 0000000000..cf0e24fbc5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/PathInfo.md @@ -0,0 +1,11 @@ +# PathInfo + +**Properties** + +| Name | Type | +|------------|---------------------------------| +| elements | [PathElement[]](PathElement.md) | +| name | string | +| isComplete | boolean | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/PeopleApi.md b/lib/js-api/src/api/content-rest-api/docs/PeopleApi.md new file mode 100644 index 0000000000..3532544900 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/PeopleApi.md @@ -0,0 +1,457 @@ +# PeopleApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------------|----------------------------------------------------|------------------------| +| [createPerson](#createPerson) | **POST** /people | Create person | +| [deleteAvatarImage](#deleteAvatarImage) | **DELETE** /people/{personId}/avatar | Delete avatar image | +| [getAvatarImage](#getAvatarImage) | **GET** /people/{personId}/avatar | Get avatar image | +| [getPerson](#getPerson) | **GET** /people/{personId} | Get a person | +| [listPeople](#listPeople) | **GET** /people | List people | +| [requestPasswordReset](#requestPasswordReset) | **POST** /people/{personId}/request-password-reset | Request password reset | +| [resetPassword](#resetPassword) | **POST** /people/{personId}/reset-password | Reset password | +| [updateAvatarImage](#updateAvatarImage) | **PUT** /people/{personId}/avatar | Update avatar image | +| [updatePerson](#updatePerson) | **PUT** /people/{personId} | Update person | + +## createPerson + +Create person + +> this endpoint is available in **Alfresco 5.2** and newer versions. +> You must have admin rights to create a person. + +Create a person. + +If applicable, the given person's login access can also be optionally disabled. + +You can set custom properties when you create a person: + +```json +{ + "id": "abeecher", + "firstName": "Alice", + "lastName": "Beecher", + "displayName": "Alice Beecher", + "email": "abeecher@example.com", + "password": "secret", + "properties": + { + "my:property": "The value" + } +} +``` + +> setting properties of type d:content and d:category are not supported. + + +**Parameters** + +| Name | Type | Description | +|----------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personBodyCreate** | [PersonBodyCreate](#PersonBodyCreate) | The person details. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [PersonEntry](PersonEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); +const personBodyCreate = {}; +const opts = {}; + +peopleApi.createPerson(personBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteAvatarImage + +Deletes the avatar image related to person. + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. +> You must be the person or have admin rights to update a person's avatar. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|--------|-----------------------------| +| **personId** | string | The identifier of a person. | + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); + +peopleApi.deleteAvatarImage(`<personId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## getAvatarImage + +Get avatar image + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. + +Gets the avatar image related to the person **personId**. If the person has no related avatar then +the **placeholder** query parameter can be optionally used to request a placeholder image to be returned. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. | +| opts.placeholder | boolean | If **true** (default) and there is no avatar for this **personId** then the placeholder image is returned, rather than a 404 response. | + +**Return type**: Blob + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); +const opts = {}; + +peopleApi.getAvatarImage(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getPerson + +Gets information for the person + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [PersonEntry](PersonEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); +const opts = {}; + +peopleApi.getPerson(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listPeople + +List people + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +You can use the **include** parameter to return any additional information. + +The default sort order for the returned list is for people to be sorted by ascending id. +You can override the default by using the **orderBy** parameter. + +You can use any of the following fields to order the results: + +* id +* firstName +* lastName + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.include | string[] | Returns additional information about the person. The following optional fields can be requested: `properties`, `aspectNames`, `capabilities` | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [PersonPaging](PersonPaging.md) + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); +const opts = {}; + +peopleApi.listPeople(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## requestPasswordReset + +Request password reset + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. +> No authentication is required to call this endpoint. + +Initiates the reset password workflow to send an email with reset password instruction to the user's registered email. + +The client is mandatory in the request body. For example: + +```json +{ + "client": "myClient" +} +``` + +**Note:** The client must be registered before this API can send an email. See [server documentation]. However, out-of-the-box +share is registered as a default client, so you could pass **share** as the client name: + +```json +{ + "client": "share" +} +``` + +**Parameters** + +| Name | Type | Description | +|----------------|---------------------------|------------------------------------------------------| +| **personId** | **string** | The identifier of a person. | +| **clientBody** | [ClientBody](#ClientBody) | The client name to send email with app-specific url. | + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); +const clientBody = {}; + +peopleApi.requestPasswordReset(`<personId>`, clientBody).then(() => { + console.log('API called successfully.'); +}); +``` + +## resetPassword + +Resets user's password + +> this endpoint is available in **Alfresco 5.2.1** and newer versions. +> No authentication is required to call this endpoint. + +The password, id and key properties are mandatory in the request body. For example: + +```json +{ + "password":"newPassword", + "id":"activiti$10", + "key":"4dad6d00-0daf-413a-b200-f64af4e12345" +} +``` + +**Parameters** + +| Name | Type | Description | +|-----------------------|-----------------------------------------|-----------------------------| +| **personId** | string | The identifier of a person. | +| **passwordResetBody** | [PasswordResetBody](#PasswordResetBody) | The reset password details | + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); +const passwordResetBody = {}; + +peopleApi.resetPassword(`<personId>`, passwordResetBody).then(() => { + console.log('API called successfully.'); +}); +``` + +## updateAvatarImage + +Updates the avatar image related to the person + +> this endpoint is available in **Alfresco 5.2.2** and newer versions. +> You must be the person or have admin rights to update a person's avatar. + +The request body should be the binary stream for the avatar image. The content type of the file +should be an image file. This will be used to generate an "avatar" thumbnail rendition. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|-----------------------|--------|-----------------------------| +| **personId** | string | The identifier of a person. | +| **contentBodyUpdate** | string | The binary content | + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); +const contentBodyUpdate = {}; + +peopleApi.updateAvatarImage(`<personId>`, contentBodyUpdate).then(() => { + console.log('API called successfully.'); +}); +``` + +## updatePerson + +Update the given person's details. + +> this endpoint is available in **Alfresco 5.2** and newer versions. +> You must have admin rights to update a person — unless updating your own details. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +If applicable, the given person's login access can also be optionally disabled or re-enabled. + +If you are changing your password, as a non-admin user, then the existing password must also +be supplied (using the oldPassword field in addition to the new password value). + +Admin users cannot be disabled by setting enabled to false. + +Non-admin users may not disable themselves. + +You can set custom properties when you update a person: + +```json +{ + "firstName": "Alice", + "properties": + { + "my:property": "The value" + } +} +``` + +> setting properties of type d:content and d:category are not supported. + +**Parameters** + +| Name | Type | Description | +|----------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **personBodyUpdate** | [PersonBodyUpdate](#PersonBodyUpdate) | The person details. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [PersonEntry](PersonEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, PeopleApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const peopleApi = new PeopleApi(alfrescoApi); +const personBodyUpdate = {}; +const opts = {}; + +peopleApi.updatePerson(`<personId>`, personBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## PersonBodyCreate + +**Properties** + +| Name | Type | Description | +|---------------------------|-----------------------|-------------| +| **id** | string | | +| **firstName** | string | | +| lastName | string | | +| description | string | | +| **email** | string | | +| skypeId | string | | +| googleId | string | | +| instantMessageId | string | | +| jobTitle | string | | +| location | string | | +| company | [Company](Company.md) | | +| mobile | string | | +| telephone | string | | +| userStatus | string | | +| enabled | boolean | | +| emailNotificationsEnabled | boolean | | +| **password** | string | | +| aspectNames | string[] | | +| properties | any | | + +## PersonBodyUpdate + +**Properties** + +| Name | Type | +|---------------------------|-----------------------| +| firstName | string | +| lastName | string | +| description | string | +| email | string | +| skypeId | string | +| googleId | string | +| instantMessageId | string | +| jobTitle | string | +| location | string | +| company | [Company](Company.md) | +| mobile | string | +| telephone | string | +| userStatus | string | +| enabled | boolean | +| emailNotificationsEnabled | boolean | +| password | string | +| oldPassword | string | +| aspectNames | string[] | +| properties | any | + +## ClientBody + +**Properties** + +| Name | Type | Description | +|--------|--------|-----------------| +| client | string | the client name | + +## PasswordResetBody + +**Properties** + +| Name | Type | Description | +|--------------|--------|-------------------------------------------------------| +| **password** | string | the new password | +| **id** | string | the workflow id provided in the reset password email | +| **key** | string | the workflow key provided in the reset password email | + + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/PermissionElement.md b/lib/js-api/src/api/content-rest-api/docs/PermissionElement.md new file mode 100644 index 0000000000..8896223d70 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/PermissionElement.md @@ -0,0 +1,14 @@ +# PermissionElement + +**Properties** + +| Name | Type | +|--------------|--------| +| authorityId | string | +| name | string | +| accessStatus | string | + +## PermissionElement.AccessStatusEnum + +* `ALLOWED` (value: `'ALLOWED'`) +* `DENIED` (value: `'DENIED'`) \ No newline at end of file diff --git a/lib/js-api/src/api/content-rest-api/docs/PermissionsInfo.md b/lib/js-api/src/api/content-rest-api/docs/PermissionsInfo.md new file mode 100644 index 0000000000..60a3ae5518 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/PermissionsInfo.md @@ -0,0 +1,12 @@ +# PermissionsInfo + +**Properties** + +| Name | Type | +|----------------------|---------------------------------------------| +| isInheritanceEnabled | boolean | +| inherited | [PermissionElement[]](PermissionElement.md) | +| locallySet | [PermissionElement[]](PermissionElement.md) | +| settable | string[] | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/Person.md b/lib/js-api/src/api/content-rest-api/docs/Person.md new file mode 100644 index 0000000000..e0b8251923 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Person.md @@ -0,0 +1,39 @@ +# Person + +**Properties** + +| Name | Type | +|---------------------------|-------------------------------| +| **id** | string | +| **firstName** | string | +| lastName | string | +| displayName | string | +| description | string | +| avatarId | string | +| **email** | string | +| skypeId | string | +| googleId | string | +| instantMessageId | string | +| jobTitle | string | +| location | string | +| company | [Company](Company.md) | +| mobile | string | +| telephone | string | +| statusUpdatedAt | Date | +| userStatus | string | +| **enabled** | boolean | +| emailNotificationsEnabled | boolean | +| aspectNames | string[] | +| properties | Map<string, string> | +| capabilities | [Capabilities](#Capabilities) | + +## Capabilities + +**Properties** + +| Name | Type | +|-----------|---------| +| isAdmin | boolean | +| isGuest | boolean | +| isMutable | boolean | + diff --git a/lib/js-api/src/api/content-rest-api/docs/PersonEntry.md b/lib/js-api/src/api/content-rest-api/docs/PersonEntry.md new file mode 100644 index 0000000000..6346877b96 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/PersonEntry.md @@ -0,0 +1,9 @@ +# PersonEntry + +**Properties** + +| Name | Type | +|-----------|---------------------| +| **entry** | [Person](Person.md) | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/PersonPaging.md b/lib/js-api/src/api/content-rest-api/docs/PersonPaging.md new file mode 100644 index 0000000000..236353b7e2 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/PersonPaging.md @@ -0,0 +1,18 @@ +# PersonPaging + +**Properties** + +| Name | Type | +|------|---------------------------------------| +| list | [PersonPagingList](#PersonPagingList) | + +# PersonPagingList + +**Properties** + +| Name | Type | +|------------|---------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [PersonEntry[]](PersonEntry.md) | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/PreferencesApi.md b/lib/js-api/src/api/content-rest-api/docs/PreferencesApi.md new file mode 100644 index 0000000000..aca7ff654d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/PreferencesApi.md @@ -0,0 +1,108 @@ +# PreferencesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-------------------------------------|---------------------------------------------------------|------------------| +| [getPreference](#getPreference) | **GET** /people/{personId}/preferences/{preferenceName} | Get a preference | +| [listPreferences](#listPreferences) | **GET** /people/{personId}/preferences | List preferences | + +## getPreference + +Get a preference + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +### Parameters + +| Name | Type | Description | +|--------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **preferenceName** | string | The name of the preference. | +| opts.fields | string | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [PreferenceEntry](#PreferenceEntry) + +**Example** + +```javascript +import { AlfrescoApi, PreferencesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const preferencesApi = new PreferencesApi(alfrescoApi); +const opts = {}; + +preferencesApi.getPreference(`<personId>`, `<preferenceName>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listPreferences + +Gets a list of preferences for person. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. +Note that each preference consists of an **id** and a **value**. + +The **value** can be of any JSON type. + +### Parameters + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **personId** | string | The identifier of a person. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [PreferencePaging](#PreferencePaging) + +**Example** + +```javascript +import { AlfrescoApi, PreferencesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const preferencesApi = new PreferencesApi(alfrescoApi); +const opts = {}; + +preferencesApi.listPreferences(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## PreferencePaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------------| +| list | [PreferencePagingList](#PreferencePagingList) | + +## PreferencePagingList + +**Properties** + +| Name | Type | +|----------------|---------------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [PreferenceEntry[]](#PreferenceEntry) | + +## PreferenceEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------| +| **entry** | [Preference](#Preference) | + +# Preference + +**Properties** + +| Name | Type | Description | +|--------|--------|----------------------------------------------------------------------| +| **id** | string | The unique id of the preference | +| value | string | The value of the preference. Note that this can be of any JSON type. | \ No newline at end of file diff --git a/lib/js-api/src/api/content-rest-api/docs/ProbesApi.md b/lib/js-api/src/api/content-rest-api/docs/ProbesApi.md new file mode 100644 index 0000000000..5414a0c252 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/ProbesApi.md @@ -0,0 +1,61 @@ +# ProbesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------|---------------------------|------------------------------------------------| +| [getProbe](#getProbe) | **GET** /probes/{probeId} | Check readiness and liveness of the repository | + +## getProbe + +Check readiness and liveness of the repository + +> No authentication is required to call this endpoint. +> This endpoint is available in **Alfresco 6.0** and newer versions. + +Returns a status of `200` to indicate success and `503` for failure. + +The readiness probe is normally only used to check repository startup. +The liveness probe should then be used to check the repository is still responding to requests. + +**Parameters** + +| Name | Type | Description | +|-------------|--------|--------------------------------------------| +| **probeId** | string | The name of the probe: `-ready-`, `-live-` | + +**Return type**: [ProbeEntry](#ProbeEntry) + +**Example** + +```javascript +import { AlfrescoApi, ProbesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const probesApi = new ProbesApi(alfrescoApi); + +probesApi.getProbe(`<probeId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## ProbeEntry + +**Properties** + +| Name | Type | +|-------|-------------------------------------| +| entry | [ProbeEntryEntry](#ProbeEntryEntry) | + +## ProbeEntryEntry + +**Properties** + +| Name | Type | +|-------------|--------| +| **message** | string | + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/Property.md b/lib/js-api/src/api/content-rest-api/docs/Property.md new file mode 100644 index 0000000000..5eb95f02cf --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Property.md @@ -0,0 +1,31 @@ +# Property + +**Properties** + +| Name | Type | Description | +|---------------------|-----------------------------|------------------------------------------------------------| +| **id** | string | | +| title | string | the human-readable title | +| description | string | the human-readable description | +| defaultValue | string | the default value | +| dataType | string | the name of the property type (i.g. d:text) | +| isMultiValued | boolean | define if the property is multi-valued | +| isMandatory | boolean | define if the property is mandatory | +| isMandatoryEnforced | boolean | define if the presence of mandatory properties is enforced | +| isProtected | boolean | define if the property is system maintained | +| constraints | [Constraint[]](#Constraint) | list of constraints defined for the property | + +## Constraint + +**Properties** + +| Name | Type | Description | +|-------------|------------------|-------------------------------------------| +| **id** | string | | +| type | string | the type of the constraint | +| title | string | the human-readable constraint title | +| description | string | the human-readable constraint description | +| parameters | Map<string, any> | | + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/QueriesApi.md b/lib/js-api/src/api/content-rest-api/docs/QueriesApi.md new file mode 100644 index 0000000000..7b06b31b0c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/QueriesApi.md @@ -0,0 +1,182 @@ +# QueriesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|---------------------------|-------------------------|-------------| +| [findNodes](#findNodes) | **GET** /queries/nodes | Find nodes | +| [findPeople](#findPeople) | **GET** /queries/people | Find people | +| [findSites](#findSites) | **GET** /queries/sites | Find sites | + +## findNodes + +Find nodes + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of nodes that match the given search criteria. + +The search term is used to look for nodes that match against name, title, description, full text content or tags. + +The search term: + +- must contain a minimum of 3 alphanumeric characters +- allows "quoted term" +- can optionally use `*` for wildcard matching + +By default, file and folder types will be searched unless a specific type is provided as a query parameter. + +By default, the search will be across the repository unless a specific root node id is provided to start the search from. + +You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + +* name +* modifiedAt +* createdAt + +**Parameters** + +| Name | Type | Description | +|-----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **term** | string | The term to search for. | +| opts.rootNodeId | string | The id of the node to start the search from. Supports the aliases `-my-`, `-root-` and `-shared-`. | +| opts.skipCount | number | Default: 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | +| opts.maxItems | number | Default: 100. The maximum number of items to return in the list. If not supplied then the default value is 100. | +| opts.nodeType | string | Restrict the returned results to only those of the given node type and its sub-types | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties` | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [NodePaging](#NodePaging) + +**Example** + +```javascript +import { AlfrescoApi, QueriesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const queriesApi = new QueriesApi(alfrescoApi); +const opts = {}; + +queriesApi.findNodes(`<term>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## findPeople + +Find people + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of people that match the given search criteria. + +The search term is used to look for matches against person id, firstname and lastname. + +The search term: + +- must contain a minimum of 2 alphanumeric characters +- can optionally use '*' for wildcard matching within the term + +You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + +* id +* firstName +* lastName + +**Parameters** + +| Name | Type | Description | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **term** | string | The term to search for. | +| opts.skipCount | number | Default 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | +| opts.maxItems | number | Default 100. The maximum number of items to return in the list. If not supplied then the default value is 100. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | + +**Return type**: [PersonPaging](PersonPaging.md) + +**Example** + +```javascript +import { AlfrescoApi, QueriesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const queriesApi = new QueriesApi(alfrescoApi); +const opts = {}; + +queriesApi.findPeople(`<term>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## findSites + +Find sites + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of sites that match the given search criteria. + +The search term is used to look for sites that match against site id, title or description. + +The search term: + +- must contain a minimum of 2 alphanumeric characters +- can optionally use '*' for wildcard matching within the term + +The default sort order for the returned list is for sites to be sorted by ascending id. +You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + +* id +* title +* description + +**Parameters** + +| Name | Type | Description | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **term** | string | The term to search for. | +| opts.skipCount | number | Default 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | +| opts.maxItems | number | Default 100. The maximum number of items to return in the list. If not supplied then the default value is 100. | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SitePaging](SitePaging.md) + +**Example** + +```javascript +import { AlfrescoApi, QueriesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const queriesApi = new QueriesApi(alfrescoApi); +const opts = {}; + +queriesApi.findSites(`<term>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## NodePaging + +**Properties** + +| Name | Type | +|------|-----------------------------------| +| list | [NodePagingList](#NodePagingList) | + +## NodePagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [NodeEntry[]](NodeEntry.md) | +| source | [Node](Node.md) | + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/RatingsApi.md b/lib/js-api/src/api/content-rest-api/docs/RatingsApi.md new file mode 100644 index 0000000000..70a79843d0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/RatingsApi.md @@ -0,0 +1,181 @@ +# RatingsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-------------------------------|-----------------------------------------------|-----------------| +| [createRating](#createRating) | **POST** /nodes/{nodeId}/ratings | Create a rating | +| [deleteRating](#deleteRating) | **DELETE** /nodes/{nodeId}/ratings/{ratingId} | Delete a rating | +| [getRating](#getRating) | **GET** /nodes/{nodeId}/ratings/{ratingId} | Get a rating | +| [listRatings](#listRatings) | **GET** /nodes/{nodeId}/ratings | List ratings | + +## createRating + +Create a rating + +**Parameters** + +| Name | Type | Description | +|----------------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **ratingBodyCreate** | [RatingBody](#RatingBody) | For "myRating" the type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. For example, to "like" a file the following body would be used: `{ "id": "likes", "myRating": true }` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [RatingEntry](#RatingEntry) + +**Example** + +```javascript +import { AlfrescoApi, RatingsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const ratingsApi = new RatingsApi(alfrescoApi); +const ratingBodyCreate = {}; +const opts = {}; + +ratingsApi.createRating(`<nodeId>`, ratingBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteRating + +Delete a rating + +**Parameters** + +| Name | Type | Description | Notes | +|--------------|--------|-----------------------------|-------| +| **nodeId** | string | The identifier of a node. | | +| **ratingId** | string | The identifier of a rating. | | + +**Example** + +```javascript +import { AlfrescoApi, RatingsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const ratingsApi = new RatingsApi(alfrescoApi); + +ratingsApi.deleteRating(`<nodeId>`, `<ratingId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## getRating + +Get a rating + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **ratingId** | string | The identifier of a rating. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [RatingEntry](#RatingEntry) + +**Example** + +```javascript +import { AlfrescoApi, RatingsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const ratingsApi = new RatingsApi(alfrescoApi); +const opts = {}; + +ratingsApi.getRating(`<nodeId>`, `<ratingId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listRatings + +List ratings + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **nodeId** | string | The identifier of a node. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [RatingPaging](#RatingPaging) + +**Example** + +```javascript +import { AlfrescoApi, RatingsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const ratingsApi = new RatingsApi(alfrescoApi); +const opts = {}; + +ratingsApi.listRatings(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## RatingPaging + +**Properties** + +| Name | Type | +|------|---------------------------------------| +| list | [RatingPagingList](#RatingPagingList) | + +## RatingPagingList + +**Properties** + +| Name | Type | +|----------------|-------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [RatingEntry[]](#RatingEntry) | + +## RatingEntry + +**Properties** + +| Name | Type | +|-----------|-------------------| +| **entry** | [Rating](#Rating) | + +## Rating + +**Properties** + +| Name | Type | Description | +|-----------|-------------------------------------|---------------------------------------------------------------------------------------------------------------| +| **id** | string | | +| aggregate | [RatingAggregate](#RatingAggregate) | | +| ratedAt | Date | | +| myRating | string | The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. | + +## RatingAggregate + +**Properties** + +| Name | Type | +|---------------------|--------| +| **numberOfRatings** | number | +| average | number | + +## RatingBody + +**Properties** + +| Name | Type | Description | +|--------------|--------|--------------------------------------------------------------------------------------------------------------| +| **id** | string | The rating scheme type. Possible values are likes and fiveStar. | +| **myRating** | string | The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar | + +### RatingBody.IdEnum + +* `Likes` (value: `'likes'`) +* `FiveStar` (value: `'fiveStar'`) \ No newline at end of file diff --git a/lib/js-api/src/api/content-rest-api/docs/Rendition.md b/lib/js-api/src/api/content-rest-api/docs/Rendition.md new file mode 100644 index 0000000000..212cf7d4ce --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Rendition.md @@ -0,0 +1,21 @@ +# Rendition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] + + +<a name="Rendition.StatusEnum"></a> +## Enum: Rendition.StatusEnum + + +* `CREATED` (value: `'CREATED'`) + +* `NOTCREATED` (value: `'NOT_CREATED'`) + + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/RenditionBodyCreate.md b/lib/js-api/src/api/content-rest-api/docs/RenditionBodyCreate.md new file mode 100644 index 0000000000..6f4aec378b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/RenditionBodyCreate.md @@ -0,0 +1,9 @@ +# RenditionBodyCreate + +**Properties** + +| Name | Type | +|--------|--------| +| **id** | string | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/RenditionEntry.md b/lib/js-api/src/api/content-rest-api/docs/RenditionEntry.md new file mode 100644 index 0000000000..0f8bab08ff --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/RenditionEntry.md @@ -0,0 +1,9 @@ +# RenditionEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------| +| **entry** | [Rendition](Rendition.md) | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/RenditionPaging.md b/lib/js-api/src/api/content-rest-api/docs/RenditionPaging.md new file mode 100644 index 0000000000..ec5e2266bd --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/RenditionPaging.md @@ -0,0 +1,18 @@ +# RenditionPaging + +**Properties** + +| Name | Type | +|------|---------------------------------------------| +| list | [RenditionPagingList](#RenditionPagingList) | + +# RenditionPagingList + +**Properties** + +| Name | Type | +|------------|---------------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [RenditionEntry[]](RenditionEntry.md) | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/RenditionsApi.md b/lib/js-api/src/api/content-rest-api/docs/RenditionsApi.md new file mode 100644 index 0000000000..0103fa8c8f --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/RenditionsApi.md @@ -0,0 +1,192 @@ +# RenditionsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|---------------------------------------------------|-----------------------------------------------------------------------------|----------------------------------------------------------------------| +| [createRendition](#createRendition) | **POST** /nodes/{nodeId}/renditions | Create rendition | +| [getRendition](#getRendition) | **GET** /nodes/{nodeId}/renditions/{renditionId} | Get rendition information | +| [getRenditionContent](#getRenditionContent) | **GET** /nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content | +| [listRenditions](#listRenditions) | **GET** /nodes/{nodeId}/renditions | List renditions | +| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url | Generate a direct access content url for a given rendition of a node | + +## createRendition + +Create rendition + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +An asynchronous request to create a rendition for file **nodeId**. + +The rendition is specified by name **id** in the request body: + +```json +{ + "id": "doclib" +} +``` + +Multiple names may be specified as a comma separated list or using a list format: + +```json +[ + { + "id": "doclib" + }, + { + "id": "avatar" + } +] +``` + +**Parameters** + +| Name | Type | Description | +|-------------------------|-----------------------------------------------|---------------------------| +| **nodeId** | string | The identifier of a node. | +| **renditionBodyCreate** | [RenditionBodyCreate](RenditionBodyCreate.md) | The rendition "id". | + +**Example** + +```javascript +import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const renditionsApi = new RenditionsApi(alfrescoApi); +const renditionBodyCreate = {}; + +renditionsApi.createRendition(`<nodeId>`, renditionBodyCreate).then(() => { + console.log('API called successfully.'); +}); +``` + +## getRendition + +Get rendition information + +> **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + +**Parameters** + +| Name | Type | Description | +|-----------------|--------|--------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. | + +**Return type**: [RenditionEntry](RenditionEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const renditionsApi = new RenditionsApi(alfrescoApi); + +renditionsApi.getRendition(`<nodeId>`, `<renditionId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getRenditionContent + +Get rendition content + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. | +| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. | +| opts.range | string | Default: true. The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. | +| opts.placeholder | boolean | Default: false. If **true** and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. | + +**Return type**: Blob + +**Example** + +```javascript +import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const renditionsApi = new RenditionsApi(alfrescoApi); +const opts = {}; + +renditionsApi.getRenditionContent(`<nodeId>`, `<renditionId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listRenditions + +List renditions + +**Note:** this endpoint is available in Alfresco 5.2 and newer versions. + +Gets a list of the rendition information for each rendition of the file **nodeId**, including the rendition id. + +Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested. + +You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where** +clause will return just the `CREATED` renditions: + +```text +(status='CREATED') +``` + +**Parameters** + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| where | string | A string to restrict the returned objects by using a predicate. | + +**Return type**: [RenditionPaging](RenditionPaging.md) + +**Example** + +```javascript +import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const renditionsApi = new RenditionsApi(alfrescoApi); + +renditionsApi.listRenditions(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## requestDirectAccessUrl + +Generate a direct access content url for a given rendition of a node + +> this endpoint is available in **Alfresco 7.1** and newer versions. + +**Parameters** + +| Name | Type | Description | +|-----------------|--------|--------------------------------| +| **nodeId** | string | The identifier of a node. | +| **renditionId** | string | The identifier of a rendition. | + +**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const renditionsApi = new RenditionsApi(alfrescoApi); + +const nodeId = 'da2e6953-3850-408b-8284-3534dd777417'; +const renditionId = 'avatar'; + +renditionsApi.requestDirectAccessUrl(nodeId, renditionId).then((data) => { + console.log('URL generated successfully: ', data.contentUrl); +}); +``` \ No newline at end of file diff --git a/lib/js-api/src/api/content-rest-api/docs/SharedlinksApi.md b/lib/js-api/src/api/content-rest-api/docs/SharedlinksApi.md new file mode 100644 index 0000000000..e89de62c75 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/SharedlinksApi.md @@ -0,0 +1,457 @@ +# SharedlinksApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------| +| [createSharedLink](#createSharedLink) | **POST** /shared-links | Create a shared link to a file | +| [deleteSharedLink](#deleteSharedLink) | **DELETE** /shared-links/{sharedId} | Deletes a shared link | +| [emailSharedLink](#emailSharedLink) | **POST** /shared-links/{sharedId}/email | Email shared link | +| [getSharedLink](#getSharedLink) | **GET** /shared-links/{sharedId} | Get a shared link | +| [getSharedLinkContent](#getSharedLinkContent) | **GET** /shared-links/{sharedId}/content | Get shared link content | +| [getSharedLinkRendition](#getSharedLinkRendition) | **GET** /shared-links/{sharedId}/renditions/{renditionId} | Get shared link rendition information | +| [getSharedLinkRenditionContent](#getSharedLinkRenditionContent) | **GET** /shared-links/{sharedId}/renditions/{renditionId}/content | Get shared link rendition content | +| [listSharedLinkRenditions](#listSharedLinkRenditions) | **GET** /shared-links/{sharedId}/renditions | List renditions for a shared link | +| [listSharedLinks](#listSharedLinks) | **GET** /shared-links | List shared links | + +## createSharedLink + +Create a shared link to a file + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Create a shared link to the file **nodeId** in the request body. Also, an optional expiry date could be set, +so the shared link would become invalid when the expiry date is reached. For example: + +```json +{ + "nodeId": "1ff9da1a-ee2f-4b9c-8c34-3333333333", + "expiresAt": "2017-03-23T23:00:00.000+0000" +} +``` + +**Note:** You can create shared links to more than one file +specifying a list of **nodeId**s in the JSON body like this: + +```json +[ + { + "nodeId": "1ff9da1a-ee2f-4b9c-8c34-4444444444" + }, + { + "nodeId": "1ff9da1a-ee2f-4b9c-8c34-5555555555" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": { + } + }, + { + "entry": { + } + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|--------------------------|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **sharedLinkBodyCreate** | [SharedLinkBodyCreate](#SharedLinkBodyCreate) | The nodeId to create a shared link for. | +| opts.include | string[] | Returns additional information about the shared link, the following optional fields can be requested: `allowableOperations`, `path`, `properties`, `isFavorite`, `aspectNames` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SharedLinkEntry](#SharedLinkEntry) + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); +const sharedLinkBodyCreate = {}; +const opts = {}; + +sharedlinksApi.createSharedLink(sharedLinkBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteSharedLink + +Deletes a shared link + +> this endpoint is available in Alfresco 5.2 and newer versions. + +**Parameters** + +| Name | Type | Description | +|--------------|--------|--------------------------------------------| +| **sharedId** | string | The identifier of a shared link to a file. | + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); + +sharedlinksApi.deleteSharedLink(`<sharedId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## emailSharedLink + +Email shared link + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Sends email with app-specific url including identifier **sharedId**. + +The client and recipientEmails properties are mandatory in the request body. For example, to email a shared link with minimum info: + +```json +{ + "client": "myClient", + "recipientEmails": ["john.doe@acme.com", "joe.bloggs@acme.com"] +} +``` + +A plain text message property can be optionally provided in the request body to customise the email being sent. +Also, a locale property can be optionally provided in the request body to send the emails in a particular language (if the locale is supported by Alfresco). +For example, to email a shared link with a messages and a locale: + +```json +{ + "client": "myClient", + "recipientEmails": ["john.doe@acme.com", "joe.bloggs@acme.com"], + "message": "myMessage", + "locale":"en-GB" +} +``` + +>The client must be registered before you can send a shared link email. See [server documentation]. However, out-of-the-box + share is registered as a default client, so you could pass **share** as the client name: + +```json +{ + "client": "share", + "recipientEmails": ["john.doe@acme.com"] +} +``` + +**Parameters** + +| Name | Type | Description | +|-------------------------|---------------------------------------------|--------------------------------------------| +| **sharedId** | string | The identifier of a shared link to a file. | +| **sharedLinkBodyEmail** | [SharedLinkBodyEmail](#SharedLinkBodyEmail) | The shared link email to send. | + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); +const sharedLinkBodyEmail = {}; + +sharedlinksApi.emailSharedLink(`<sharedId>`, sharedLinkBodyEmail).then(() => { + console.log('API called successfully.'); +}); +``` + +## getSharedLink + +Get a shared link + +> this endpoint is available in **Alfresco 5.2** and newer versions. +> No authentication is required to call this endpoint. + +Gets minimal information for the file with shared link identifier **sharedId**. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **sharedId** | string | The identifier of a shared link to a file. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [SharedLinkEntry](#SharedLinkEntry) + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); +const opts = {}; + +sharedlinksApi.getSharedLink(`<sharedId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getSharedLinkContent + +Get shared link content + +> this endpoint is available in **Alfresco 5.2** and newer versions. +> No authentication is required to call this endpoint. + +Gets the content of the file with shared link identifier **sharedId**. + +**Parameters** + +| Name | Type | Description | +|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **sharedId** | string | The identifier of a shared link to a file. | +| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. | +| opts.range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. | + +**Return type**: Blob + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); +const opts = {}; + +sharedlinksApi.getSharedLinkContent(`<sharedId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getSharedLinkRendition + +Get shared link rendition information + +> this endpoint is available in **Alfresco 5.2** and newer versions. +> No authentication is required to call this endpoint. + +Gets rendition information for the file with shared link identifier **sharedId**. + +This API method returns rendition information where the rendition status is CREATED, +which means the rendition is available to view/download. + +**Parameters** + +| Name | Type | Description | +|-----------------|--------|--------------------------------------------------------------------| +| **sharedId** | string | The identifier of a shared link to a file. | +| **renditionId** | string | The name of a thumbnail rendition, for example `doclib`, or `pdf`. | + +**Return type**: [RenditionEntry](RenditionEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); + +sharedlinksApi.getSharedLinkRendition(`<sharedId>`, `<renditionId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getSharedLinkRenditionContent + +Get shared link rendition content + +> this endpoint is available in **Alfresco 5.2** and newer versions. +> No authentication is required to call this endpoint. + +Gets the rendition content for file with shared link identifier **sharedId**. + +**Parameters** + +| Name | Type | Description | +|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **sharedId** | string | The identifier of a shared link to a file. | +| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. | +| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. | +| opts.range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. | + +**Return type**: Blob + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); +const opts = {}; + +sharedlinksApi.getSharedLinkRenditionContent(`<sharedId>`, `<renditionId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSharedLinkRenditions + +List renditions for a shared link + +> this endpoint is available in **Alfresco 5.2** and newer versions. +> No authentication is required to call this endpoint. + +Gets a list of the rendition information for the file with shared link identifier **sharedId**. + +This API method returns rendition information, including the rendition id, for each rendition +where the rendition status is `CREATED`, which means the rendition is available to view/download. + +**Parameters** + +| Name | Type | Description | +|--------------|--------|--------------------------------------------| +| **sharedId** | string | The identifier of a shared link to a file. | + +**Return type**: [RenditionPaging](RenditionPaging.md) + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); + +sharedlinksApi.listSharedLinkRenditions(`<sharedId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSharedLinks + +List shared links + +> this endpoint is available in Alfresco 5.2 and newer versions. + +Get a list of links that the current user has read permission on source node. + +The list is ordered in descending modified order. + +> The list of links is eventually consistent so newly created shared links may not appear immediately. + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.where | string | Optionally filter the list by "sharedByUser" userid of person who shared the link (can also use -me-)`where=(sharedByUser='jbloggs')`, `where=(sharedByUser='-me-')` | | +| opts.include | string[] | Returns additional information about the shared link, the following optional fields can be requested: `allowableOperations`, `path`, `properties`, `isFavorite`, `aspectNames` | | +| opts.fields | string[] | A list of field names.You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [SharedLinkPaging](#SharedLinkPaging) + +**Example** + +```javascript +import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sharedlinksApi = new SharedlinksApi(alfrescoApi); +const opts = {}; + +sharedlinksApi.listSharedLinks(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## SharedLinkPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------------| +| list | [SharedLinkPagingList](#SharedLinkPagingList) | + +## SharedLinkPagingList + +**Properties** + +| Name | Type | +|----------------|---------------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [SharedLinkEntry[]](#SharedLinkEntry) | + +## SharedLinkEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------| +| **entry** | [SharedLink](#SharedLink) | + +## SharedLinkBodyEmail + +**Properties** + +| Name | Type | +|-----------------|----------| +| client | string | +| message | string | +| locale | string | +| recipientEmails | string[] | + +## SharedLinkBodyCreate + +**Properties** + +| Name | Type | +|------------|--------| +| **nodeId** | string | +| expiresAt | Date | + +## SharedLink + +**Properties** + +| Name | Type | Description | +|-----------------------------|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| +| id | string | | +| expiresAt | Date | | +| nodeId | string | | +| name | string | The name must not contain spaces or the following special characters: `* " < > \\ / ? :` and `\|`. The character . must not be used at the end of the name. | +| title | string | | +| description | string | | +| modifiedAt | Date | | +| modifiedByUser | [UserInfo](UserInfo.md) | | +| sharedByUser | [UserInfo](UserInfo.md) | | +| content | [ContentInfo](ContentInfo.md) | | +| allowableOperations | string[] | The allowable operations for the Quickshare link itself. See allowableOperationsOnTarget for the allowable operations pertaining to the linked content node. | +| allowableOperationsOnTarget | string[] | The allowable operations for the content node being shared. | +| isFavorite | boolean | | +| properties | any | A subset of the target node's properties, system properties and properties already available in the SharedLink are excluded. | +| aspectNames | string[] | | diff --git a/lib/js-api/src/api/content-rest-api/docs/Site.md b/lib/js-api/src/api/content-rest-api/docs/Site.md new file mode 100644 index 0000000000..825a1f0158 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/Site.md @@ -0,0 +1,42 @@ +# Site + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**guid** | **string** | | [default to null] +**title** | **string** | | [default to null] +**description** | **string** | | [optional] [default to null] +**visibility** | **string** | | [default to null] +**preset** | **string** | | [optional] [default to null] +**role** | **string** | | [optional] [default to null] + + +<a name="Site.VisibilityEnum"></a> +## Enum: Site.VisibilityEnum + + +* `PRIVATE` (value: `'PRIVATE'`) + +* `MODERATED` (value: `'MODERATED'`) + +* `PUBLIC` (value: `'PUBLIC'`) + + + + +<a name="Site.RoleEnum"></a> +## Enum: Site.RoleEnum + + +* `SiteConsumer` (value: `'SiteConsumer'`) + +* `SiteCollaborator` (value: `'SiteCollaborator'`) + +* `SiteContributor` (value: `'SiteContributor'`) + +* `SiteManager` (value: `'SiteManager'`) + + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/SiteEntry.md b/lib/js-api/src/api/content-rest-api/docs/SiteEntry.md new file mode 100644 index 0000000000..4268acfe80 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/SiteEntry.md @@ -0,0 +1,7 @@ +# SiteEntry + +## Properties +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **entry** | [**Site**](Site.md) | | [default to null] | +| **relations** | [**SiteEntryRelations**]() | | [default to undefined] | diff --git a/lib/js-api/src/api/content-rest-api/docs/SiteEntryRelations.md b/lib/js-api/src/api/content-rest-api/docs/SiteEntryRelations.md new file mode 100644 index 0000000000..d91484c625 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/SiteEntryRelations.md @@ -0,0 +1,7 @@ +# SiteEntryRelations + +**Properties** + +| Name | Type | +|----------------|-----------------------------| +| **members** | [SiteMemberPaging](SiteMemberPaging.md) | diff --git a/lib/js-api/src/api/content-rest-api/docs/SitePaging.md b/lib/js-api/src/api/content-rest-api/docs/SitePaging.md new file mode 100644 index 0000000000..7978e85b0b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/SitePaging.md @@ -0,0 +1,18 @@ +# SitePaging + +**Properties** + +| Name | Type | +|------|-----------------------------------| +| list | [SitePagingList](#SitePagingList) | + +# SitePagingList + +**Properties** + +| Name | Type | +|----------------|-----------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [SiteEntry[]](SiteEntry.md) | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/SitesApi.md b/lib/js-api/src/api/content-rest-api/docs/SitesApi.md new file mode 100644 index 0000000000..4b1f967f6e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/SitesApi.md @@ -0,0 +1,1290 @@ +# SitesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-------------------------------------------------------------------------------|-----------------------------------------------------------------------|-----------------------------------| +| [listSiteGroups](#listSiteGroups) | **GET** /sites/{siteId}/group-members | List group membership for site | +| [approveSiteMembershipRequest](#approveSiteMembershipRequest) | **POST** /sites/{siteId}/site-membership-requests/{inviteeId}/approve | Approve a site membership request | +| [createSite](#createSite) | **POST** /sites | Create a site | +| [createSiteMembership](#createSiteMembership) | **POST** /sites/{siteId}/members | Create a site membership | +| [createSiteMembershipRequestForPerson](#createSiteMembershipRequestForPerson) | **POST** /people/{personId}/site-membership-requests | Create a site membership request | +| [deleteSite](#deleteSite) | **DELETE** /sites/{siteId} | Delete a site | +| [deleteSiteMembership](#deleteSiteMembership) | **DELETE** /sites/{siteId}/members/{personId} | Delete a site membership | +| [deleteSiteMembershipForPerson](#deleteSiteMembershipForPerson) | **DELETE** /people/{personId}/sites/{siteId} | Delete a site membership | +| [deleteSiteMembershipRequestForPerson](#deleteSiteMembershipRequestForPerson) | **DELETE** /people/{personId}/site-membership-requests/{siteId} | Delete a site membership request | +| [getSite](#getSite) | **GET** /sites/{siteId} | Get a site | +| [getSiteContainer](#getSiteContainer) | **GET** /sites/{siteId}/containers/{containerId} | Get a site container | +| [getSiteMembership](#getSiteMembership) | **GET** /sites/{siteId}/members/{personId} | Get a site membership | +| [getSiteMembershipForPerson](#getSiteMembershipForPerson) | **GET** /people/{personId}/sites/{siteId} | Get a site membership | +| [getSiteMembershipRequestForPerson](#getSiteMembershipRequestForPerson) | **GET** /people/{personId}/site-membership-requests/{siteId} | Get a site membership request | +| [getSiteMembershipRequests](#getSiteMembershipRequests) | **GET** /site-membership-requests | Get site membership requests | +| [listSiteContainers](#listSiteContainers) | **GET** /sites/{siteId}/containers | List site containers | +| [listSiteMembershipRequestsForPerson](#listSiteMembershipRequestsForPerson) | **GET** /people/{personId}/site-membership-requests | List site membership requests | +| [listSiteMemberships](#listSiteMemberships) | **GET** /sites/{siteId}/members | List site memberships | +| [listSiteMembershipsForPerson](#listSiteMembershipsForPerson) | **GET** /people/{personId}/sites | List site memberships | +| [listSites](#listSites) | **GET** /sites | List sites | +| [rejectSiteMembershipRequest](#rejectSiteMembershipRequest) | **POST** /sites/{siteId}/site-membership-requests/{inviteeId}/reject | Reject a site membership request | +| [updateSite](#updateSite) | **PUT** /sites/{siteId} | Update a site | +| [updateSiteMembership](#updateSiteMembership) | **PUT** /sites/{siteId}/members/{personId} | Update a site membership | +| [updateSiteMembershipRequestForPerson](#updateSiteMembershipRequestForPerson) | **PUT** /people/{personId}/site-membership-requests/{siteId} | Update a site membership request | + +## listSiteGroups + +List group membership for site + +> this endpoint is available in **Alfresco 7.0.0** and newer versions. + +**Parameters** + +| Name | Type | Description | Notes | +|------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **siteId** | string | The identifier of a site. | | +| skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + + +**Return type**: [SiteGroupPaging](#SiteGroupPaging) + +## approveSiteMembershipRequest + +Approve a site membership request + +**Parameters** + +| Name | Type | Description | +|---------------------------------|-----------------------------------------------------------|-----------------------------------------------------------------------------------| +| **siteId** | string | The identifier of a site. | +| **inviteeId** | string | The invitee user name. | +| opts.siteMembershipApprovalBody | [SiteMembershipApprovalBody](#SiteMembershipApprovalBody) | Accepting a request to join, optionally, allows assignment of a role to the user. | + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); + +const opts = { + siteMembershipApprovalBody: {} +}; + +sitesApi.approveSiteMembershipRequest(`<siteId>`, `<inviteeId>`, opts).then(() => { + console.log('API called successfully.'); +}); +``` + +## createSite + +Create a site + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Creates a default site with the given details. Unless explicitly specified, the site id will be generated +from the site title. The site id must be unique and only contain alphanumeric and/or dash characters. + +> the id of a site cannot be updated once the site has been created. + +For example, to create a public site called "Marketing" the following body could be used: + +```json +{ + "title": "Marketing", + "visibility": "PUBLIC" +} +``` + +The creation of the (surf) configuration files required by Share can be skipped via the **skipConfiguration** query parameter. + +> if skipped then such a site will **not** work within Share. + +The addition of the site to the user's site favorites can be skipped via the **skipAddToFavorites** query parameter. + +The creator will be added as a member with Site Manager role. + +When you create a site, a container called **documentLibrary** is created for you in the new site. +This container is the root folder for content stored in the site. + +**Parameters** + +| Name | Type | Description | +|-------------------------|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **siteBodyCreate** | [SiteBodyCreate](#SiteBodyCreate) | The site details | +| opts.skipConfiguration | boolean | Flag to indicate whether the Share-specific (surf) configuration files for the site should not be created. | +| opts.skipAddToFavorites | boolean | Flag to indicate whether the site should not be added to the user's site favorites. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteEntry](SiteEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const siteBodyCreate = {}; +const opts = {}; + +sitesApi.createSite(siteBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## createSiteMembership + +Create a site membership + +You can set the **role** to one of four types: + +* SiteConsumer +* SiteCollaborator +* SiteContributor +* SiteManager + +**Note:** You can create more than one site membership by +specifying a list of people in the JSON body like this: + +```json +[ + { + "role": "SiteConsumer", + "id": "joe" + }, + { + "role": "SiteConsumer", + "id": "fred" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": { + } + }, + { + "entry": { + } + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|------------------------------|-------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **siteId** | **string** | The identifier of a site. | +| **siteMembershipBodyCreate** | [SiteMembershipBodyCreate](#SiteMembershipBodyCreate) | The person to add and their role | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteMemberEntry](#SiteMemberEntry) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const siteMembershipBodyCreate = {}; +const opts = {}; + +sitesApi.createSiteMembership(`<siteId>`, siteMembershipBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## createSiteMembershipRequestForPerson + +Create a site membership request + +Create a site membership request for yourself on the site with the identifier of **id**, specified in the JSON body. +The result of the request differs depending on the type of site. + +* For a **public** site, you join the site immediately as a SiteConsumer. +* For a **moderated** site, your request is added to the site membership request list. The request waits for approval from the Site Manager. +* You cannot request membership of a **private** site. Members are invited by the site administrator. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +> You can create site membership requests for more than one site by specifying a list of sites in the JSON body like this: + +```json +[ + { + "message": "Please can you add me", + "id": "test-site-1", + "title": "Request for test site 1" + }, + { + "message": "Please can you add me", + "id": "test-site-2", + "title": "Request for test site 2" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": { + } + }, + { + "entry": { + } + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | +|-------------------------------------|---------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **siteMembershipRequestBodyCreate** | [SiteMembershipRequestBodyCreate](#SiteMembershipRequestBodyCreate) | Site membership request details | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteMembershipRequestEntry](#SiteMembershipRequestEntry) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const siteMembershipRequestBodyCreate = {}; +const opts = {}; + +sitesApi.createSiteMembershipRequestForPerson(`<personId>`, siteMembershipRequestBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteSite + +Delete a site + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|----------------|---------|-------------------------------------------------------------------------------------------| +| **siteId** | string | The identifier of a site. | +| opts.permanent | boolean | Flag to indicate whether the site should be permanently deleted i.e. bypass the trashcan. | + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); + +const opts = { + permanent: true +}; + +sitesApi.deleteSite(`<siteId>`, opts).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteSiteMembership + +Delete a site membership + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|--------|-----------------------------| +| **siteId** | string | The identifier of a site. | +| **personId** | string | The identifier of a person. | + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); + +sitesApi.deleteSiteMembership(`<siteId>`, `<personId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteSiteMembershipForPerson + +Delete a site membership + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|--------|-----------------------------| +| **personId** | string | The identifier of a person. | +| **siteId** | string | The identifier of a site. | + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); + +sitesApi.deleteSiteMembershipForPerson(`<personId>`, `<siteId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteSiteMembershipRequestForPerson + +Delete a site membership request + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|--------|-----------------------------| +| **personId** | string | The identifier of a person. | +| **siteId** | string | The identifier of a site. | + + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); + +sitesApi.deleteSiteMembershipRequestForPerson(`<personId>`, `<siteId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## getSite + +Get a site + +You can use the **relations** parameter to include one or more related +entities in a single response and so reduce network traffic. + +The entity types in Alfresco are organized in a tree structure. +The **sites** entity has two children, **containers** and **members**. +The following relations parameter returns all the container and member +objects related to the site **siteId**: + +- containers +- members + +**Parameters** + +| Name | Type | Description | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **siteId** | string | The identifier of a site. | +| opts.relations | string[] | Use the relations parameter to include one or more related entities in a single response. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteEntry](SiteEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.getSite(`<siteId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getSiteContainer + +Get a site container + +**Parameters** + +| Name | Type | Description | +|-----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **siteId** | string | The identifier of a site. | +| **containerId** | string | The unique identifier of a site container. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteContainerEntry](#SiteContainerEntry) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.getSiteContainer(`<siteId>`, `<containerId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getSiteMembership + +Get a site membership + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **siteId** | string | The identifier of a site. | +| **personId** | string | The identifier of a person. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteMemberEntry](#SiteMemberEntry) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.getSiteMembership(`<siteId>`, `<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getSiteMembershipForPerson + +Get a site membership + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|--------|-----------------------------| +| **personId** | string | The identifier of a person. | +| **siteId** | string | The identifier of a site. | + +**Return type**: [SiteRoleEntry](#SiteRoleEntry) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); + +sitesApi.getSiteMembershipForPerson(`<personId>`, `<siteId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getSiteMembershipRequestForPerson + +Gets the site membership request for site **siteId** for person **personId**, if one exists. + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **siteId** | string | The identifier of a site. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteMembershipRequestEntry](#SiteMembershipRequestEntry) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.getSiteMembershipRequestForPerson(`<personId>`, `<siteId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getSiteMembershipRequests + +Get the list of site membership requests the user can action. + +You can use the **where** parameter to filter the returned site membership requests by **siteId**. For example: + +```text +(siteId=mySite) +``` + +The **where** parameter can also be used to filter by ***personId***. For example: + +```text +where=(personId=person) +``` + +This may be combined with the siteId filter, as shown below: + +```text +where=(siteId=mySite AND personId=person)) +``` + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.where | string | A string to restrict the returned objects by using a predicate. | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [SiteMembershipRequestWithPersonPaging](#SiteMembershipRequestWithPersonPaging) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.getSiteMembershipRequests(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSiteContainers + +List site containers + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **siteId** | string | The identifier of a site. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [SiteContainerPaging](#SiteContainerPaging) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.listSiteContainers(`<siteId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSiteMembershipRequestsForPerson + +List site membership requests + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | Notes | +|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **personId** | string | The identifier of a person. | | +| skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [SiteMembershipRequestPaging](#SiteMembershipRequestPaging) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.listSiteMembershipRequestsForPerson(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSiteMemberships + +List site memberships + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **siteId** | string | The identifier of a site. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [SiteMemberPaging](#SiteMemberPaging) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.listSiteMemberships(`<siteId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSiteMembershipsForPerson + +List site memberships + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +You can use the **where** parameter to filter the returned sites by **visibility** or site **preset**. + +Example to filter by **visibility**, use any one of: + +```text +(visibility='PRIVATE') +(visibility='PUBLIC') +(visibility='MODERATED') +``` + +Example to filter by site **preset**: + +```text +(preset='site-dashboard') +``` + +The default sort order for the returned list is for sites to be sorted by ascending title. +You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + +* id +* title +* role + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **personId** | string | The identifier of a person. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.relations | string[] | Use the relations parameter to include one or more related entities in a single response. | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | +| opts.where | string | A string to restrict the returned objects by using a predicate. | | + +**Return type**: [SiteRolePaging](#SiteRolePaging) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.listSiteMembershipsForPerson(`<personId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listSites + +Gets a list of sites in this repository. + +You can use the **where** parameter to filter the returned sites by **visibility** or site **preset**. + +Example to filter by **visibility**, use any one of: + +```text +(visibility='PRIVATE') +(visibility='PUBLIC') +(visibility='MODERATED') +``` + +Example to filter by site **preset**: + +```text +(preset='site-dashboard') +``` + +The default sort order for the returned list is for sites to be sorted by ascending title. +You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter: + +* id +* title +* description + +You can use the **relations** parameter to include one or more related +entities in a single response and so reduce network traffic. + +The entity types in Alfresco are organized in a tree structure. +The **sites** entity has two children, **containers** and **members**. +The following relations parameter returns all the container and member +objects related to each site: + +- containers +- members + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | | +| opts.relations | string[] | Use the relations parameter to include one or more related entities in a single response. | | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | +| opts.where | string | A string to restrict the returned objects by using a predicate. | | + +**Return type**: [SitePaging](SitePaging.md) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const opts = {}; + +sitesApi.listSites(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## rejectSiteMembershipRequest + +Reject a site membership request. + +**Parameters** + +| Name | Type | Description | +|----------------------------------|-------------------------------------------------------------|---------------------------------------------------------------------------| +| **siteId** | string | The identifier of a site. | +| **inviteeId** | string | The invitee user name. | +| opts.siteMembershipRejectionBody | [SiteMembershipRejectionBody](#SiteMembershipRejectionBody) | Rejecting a request to join, optionally, allows the inclusion of comment. | + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); + +const opts = { + siteMembershipRejectionBody: {} +}; + +sitesApi.rejectSiteMembershipRequest(`<siteId>`, `<inviteeId>`, opts).then(() => { + console.log('API called successfully.'); +}); +``` + +## updateSite + +Update a site + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Update the details for the given site **siteId**. +Site Manager or otherwise a (site) admin can update title, description or visibility. + +> the id of a site cannot be updated once the site has been created. + +**Parameters** + +| Name | Type | Description | +|--------------------|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **siteId** | string | The identifier of a site. | +| **siteBodyUpdate** | [SiteBodyUpdate](#SiteBodyUpdate) | The site information to update. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteEntry](SiteEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const siteBodyUpdate = {}; +const opts = {}; + +sitesApi.updateSite(siteId, siteBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## updateSiteMembership + +Update a site membership + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +You can set the **role** to one of four types: + +* SiteConsumer +* SiteCollaborator +* SiteContributor +* SiteManager + +**Parameters** + +| Name | Type | Description | +|------------------------------|-------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **siteId** | string | The identifier of a site. | +| **personId** | string | The identifier of a person. | +| **siteMembershipBodyUpdate** | [SiteMembershipBodyUpdate](#SiteMembershipBodyUpdate) | The persons new role | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteMemberEntry](#SiteMemberEntry) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const siteMembershipBodyUpdate = {}; +const opts = {}; + +sitesApi.updateSiteMembership(`<siteId>`, `<personId>`, siteMembershipBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## updateSiteMembershipRequestForPerson + +Update a site membership request + +You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user. + +**Parameters** + +| Name | Type | Description | +|-------------------------------------|---------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **personId** | string | The identifier of a person. | +| **siteId** | string | The identifier of a site. | +| **siteMembershipRequestBodyUpdate** | [SiteMembershipRequestBodyUpdate](#SiteMembershipRequestBodyUpdate) | The new message to display | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [SiteMembershipRequestEntry](#SiteMembershipRequestEntry) + +**Example** + +```javascript +import { AlfrescoApi, SitesApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const sitesApi = new SitesApi(alfrescoApi); +const siteMembershipRequestBodyUpdate = {}; +const opts = {}; + +sitesApi.updateSiteMembershipRequestForPerson(`<personId>`, `<siteId>`, siteMembershipRequestBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## SiteMembershipApprovalBody + +**Properties** + +| Name | Type | +|----------|--------| +| **role** | string | + +## SiteRolePaging + +| Name | Type | +|----------|-------------------------------------------| +| **list** | [SiteRolePagingList](#SiteRolePagingList) | + +## SiteRolePagingList + +**Properties** + +| Name | Type | +|----------------|-----------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [SiteRoleEntry[]](#SiteRoleEntry) | + + +## SiteRoleEntry + +**Properties** + +| Name | Type | +|-----------|-----------------------| +| **entry** | [SiteRole](#SiteRole) | + +## SiteRole + +**Properties** + +| Name | Type | +|----------|-----------------| +| **site** | [Site](Site.md) | +| **id** | string | +| **guid** | string | +| **role** | string | + +### SiteRole.RoleEnum + +* `SiteConsumer` (value: `'SiteConsumer'`) +* `SiteCollaborator` (value: `'SiteCollaborator'`) +* `SiteContributor` (value: `'SiteContributor'`) +* `SiteManager` (value: `'SiteManager'`) + +## SiteMembershipRequestPaging + +**Properties** + +| Name | Type | +|------|---------------------------------------------------------------------| +| list | [SiteMembershipRequestPagingList](#SiteMembershipRequestPagingList) | + +## SiteMembershipRequestPagingList + +**Properties** + +| Name | Type | +|----------------|-------------------------------------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [SiteMembershipRequestEntry[]](#SiteMembershipRequestEntry) | + +## SiteMembershipRequestEntry + +**Properties** + +| Name | Type | +|-----------|-------------------------------------------------| +| **entry** | [SiteMembershipRequest](#SiteMembershipRequest) | + +## SiteMembershipRequest + +**Properties** + +| Name | Type | +|---------------|-----------------| +| **id** | string | +| **createdAt** | Date | +| **site** | [Site](Site.md) | +| message | string | + +## SiteMembershipBodyUpdate + +**Properties** + +| Name | Type | +|----------|--------| +| **role** | string | + +### SiteMembershipBodyUpdate.RoleEnum + +* `SiteConsumer` (value: `'SiteConsumer'`) +* `SiteCollaborator` (value: `'SiteCollaborator'`) +* `SiteContributor` (value: `'SiteContributor'`) +* `SiteManager` (value: `'SiteManager'`) + +## SiteMembershipBodyCreate + +**Properties** + +| Name | Type | +|----------|--------| +| **role** | string | +| **id** | string | + +### SiteMembershipBodyCreate.RoleEnum + +* `SiteConsumer` (value: `'SiteConsumer'`) +* `SiteCollaborator` (value: `'SiteCollaborator'`) +* `SiteContributor` (value: `'SiteContributor'`) +* `SiteManager` (value: `'SiteManager'`) + +## SiteBodyUpdate + +**Properties** + +| Name | Type | +|-------------|--------| +| title | string | +| description | string | +| visibility | string | + +### SiteBodyUpdate.VisibilityEnum + +* `PRIVATE` (value: `'PRIVATE'`) +* `MODERATED` (value: `'MODERATED'`) +* `PUBLIC` (value: `'PUBLIC'`) + +## SiteBodyCreate + +**Properties** + +| Name | Type | +|----------------|--------| +| id | string | +| **title** | string | +| description | string | +| **visibility** | string | + +### SiteBodyCreate.VisibilityEnum + +* `PUBLIC` (value: `'PUBLIC'`) +* `PRIVATE` (value: `'PRIVATE'`) +* `MODERATED` (value: `'MODERATED'`) + +## SiteContainerPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------------------| +| list | [SiteContainerPagingList](#SiteContainerPagingList) | + +## SiteContainerPagingList + +**Properties** + +| Name | Type | +|----------------|---------------------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [SiteContainerEntry[]](#SiteContainerEntry) | + +## SiteContainerEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------------| +| **entry** | [SiteContainer](#SiteContainer) | + +## SiteContainer + +**Properties** + +| Name | Type | +|--------------|--------| +| **id** | string | +| **folderId** | string | + +## SiteMembershipRequestBodyCreate + +**Properties** + +| Name | Type | Description | +|---------|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| message | **string** | | +| **id** | **string** | | +| title | **string** | | +| client | **string** | Optional client name used when sending an email to the end user, defaults to \"share\" if not provided. **Note:** The client must be registered before this API can send an email. **Note:** This is available in Alfresco 7.0.0 and newer versions. | + + +## SiteMembershipRequestBodyUpdate + +**Properties** + +| Name | Type | +|---------|--------| +| message | string | + +## SiteMembershipRejectionBody + +**Properties** + +| Name | Type | +|---------|--------| +| comment | string | + +## SiteMembershipRequestWithPersonPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------------------------------------------------------| +| list | [SiteMembershipRequestWithPersonPagingList](#SiteMembershipRequestWithPersonPagingList) | + +## SiteMembershipRequestWithPersonPagingList + +**Properties** + +| Name | Type | +|----------------|---------------------------------------------------------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [SiteMembershipRequestWithPersonEntry[]](#SiteMembershipRequestWithPersonEntry) | + + +## SiteMembershipRequestWithPersonEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------------------------------------------------| +| **entry** | [SiteMembershipRequestWithPerson](#SiteMembershipRequestWithPerson) | + +## SiteMembershipRequestWithPerson + +**Properties** + +| Name | Type | +|---------------|---------------------| +| **id** | string | +| **createdAt** | Date | +| **site** | [Site](Site.md) | +| **person** | [Person](Person.md) | +| message | **string** | + +## SiteMemberPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------------| +| list | [SiteMemberPagingList](#SiteMemberPagingList) | + +## SiteMemberPagingList + +**Properties** + +| Name | Type | +|----------------|---------------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [SiteMemberEntry[]](#SiteMemberEntry) | + +## SiteMemberEntry + +**Properties** + +| Name | Type | +|-----------|---------------------------| +| **entry** | [SiteMember](#SiteMember) | + + +## SiteMember + +**Properties** + +| Name | Type | +|-----------------|---------------------| +| **id** | string | +| **person** | [Person](Person.md) | +| **role** | string | +| isMemberOfGroup | boolean | + +### SiteMember.RoleEnum + +* `SiteConsumer` (value: `'SiteConsumer'`) +* `SiteCollaborator` (value: `'SiteCollaborator'`) +* `SiteContributor` (value: `'SiteContributor'`) +* `SiteManager` (value: `'SiteManager'`) + +## SiteGroupPaging + +**Properties** + +| Name | Type | +|------|---------------------------------------------| +| list | [SiteGroupPagingList](#SiteGroupPagingList) | + +## SiteGroupPagingList + +**Properties** + +| Name | Type | +|----------------|-------------------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [SiteGroupEntry[]](#SiteGroupEntry) | + +## SiteGroupEntry + +**Properties** + +| Name | Type | +|-----------|-------------------------| +| **entry** | [SiteGroup](#SiteGroup) | + +## SiteGroup + +**Properties** + +| Name | Type | +|-----------|-------------------------------| +| **id** | string | +| **group** | [GroupMember](GroupMember.md) | +| **role** | string | + +### Enum: SiteGroup.RoleEnum + +* `SiteConsumer` (value: `'SiteConsumer'`) +* `SiteCollaborator` (value: `'SiteCollaborator'`) +* `SiteContributor` (value: `'SiteContributor'`) +* `SiteManager` (value: `'SiteManager'`) + diff --git a/lib/js-api/src/api/content-rest-api/docs/TagsApi.md b/lib/js-api/src/api/content-rest-api/docs/TagsApi.md new file mode 100644 index 0000000000..cf3915921b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/TagsApi.md @@ -0,0 +1,361 @@ +# TagsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------| +| [createTagForNode](#createTagForNode) | **POST** /nodes/{nodeId}/tags | Create a tag for a node | +| [deleteTagFromNode](#deleteTagFromNode) | **DELETE** /nodes/{nodeId}/tags/{tagId} | Delete a tag from a node | +| [getTag](#getTag) | **GET** /tags/{tagId} | Get a tag | +| [listTags](#listTags) | **GET** /tags | List tags | +| [listTagsForNode](#listTagsForNode) | **GET** /nodes/{nodeId}/tags | List tags for a node | +| [updateTag](#updateTag) | **PUT** /tags/{tagId} | Update a tag | +| [deleteTag](#deleteTag) | **DELETE** /tags/{tagId} | Completely deletes a tag | +| [createTags](#createTags) | **POST** /tags | Create list of tags | +| [assignTagsToNode](#assignTagsToNode) | **POST** /nodes/{nodeId}/tags | Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned. | + +## createTagForNode + +Creates a tag on the node **nodeId**. You specify the tag in a JSON body like this: + +```json +{ + "tag":"test-tag-1" +} +``` + +**Note:** You can create more than one tag by +specifying a list of tags in the JSON body like this: + +```json +[ + { + "tag": "test-tag-1" + }, + { + "tag": "test-tag-2" + } +] +``` + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +```json +{ + "list": { + "pagination": { + "count": 2, + "hasMoreItems": false, + "totalItems": 2, + "skipCount": 0, + "maxItems": 100 + }, + "entries": [ + { + "entry": { + } + }, + { + "entry": { + } + } + ] + } +} +``` + +**Example** + +```javascript +import { AlfrescoApi, TagsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); +const tagBodyCreate = {}; +const opts = {}; + +tagsApi.createTagForNode(nodeId, tagBodyCreate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +**Parameters** + +| Name | Type | Description | +|-------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **tagBodyCreate** | [TagBody](#TagBody) | The new tag | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [TagEntry](#TagEntry) + +## deleteTagFromNode + +Delete a tag from a node + +**Parameters** + +| Name | Type | Description | +|------------|--------|---------------------------| +| **nodeId** | string | The identifier of a node. | +| **tagId** | string | The identifier of a tag. | + +**Example** + +```javascript +import { AlfrescoApi, TagsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); + +tagsApi.deleteTagFromNode(`<nodeId>`, `<tagId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## getTag + +Get a tag + +**Parameters** + +| Name | Type | Description | +|-------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **tagId** | string | The identifier of a tag. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [TagEntry](#TagEntry) + +**Example** + +```javascript +import { AlfrescoApi, TagsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); +const opts = {}; + +tagsApi.getTag(`<tagId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listTags + +Gets a list of tags in this repository. + +You can use the **include** parameter to return additional **values** information. +You can also use **name** parameter to return tags only for specified name. + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | +| opts.include | string[] | Returns additional information about the tag. The following optional fields can be requested: `count` | | + +**Return type**: [TagPaging](#TagPaging) + +**Example** + +```javascript +import { AlfrescoApi, TagsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); +const opts = {}; + +tagsApi.listTags(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listTagsForNode + +List tags for a node + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| **nodeId** | string | The identifier of a node. | | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | | + +**Return type**: [TagPaging](#TagPaging) + +**Example** + +```javascript +import { AlfrescoApi, TagsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); +const opts = {}; + +tagsApi.listTagsForNode(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## updateTag + +Update a tag + +**Parameters** + +| Name | Type | Description | +|-------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **tagId** | string | The identifier of a tag. | +| **tagBodyUpdate** | [TagBody](#TagBody) | The updated tag | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [TagEntry](#TagEntry) + +**Example** + +```javascript +import { AlfrescoApi, TagsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); +const tagBodyUpdate = {}; +const opts = {}; + +tagsApi.updateTag(`<tagId>`, tagBodyUpdate, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## createTags + +Create specified by **tags** list of tags. + +**Parameters** + +| Name | Type | Description | +|----------|-----------------------|-------------------------| +| **tags** | [TagBody[]](#TagBody) | List of tags to create. | + +**Return type**: [TagEntry[]](#TagEntry) + +**Example** + +```javascript +import { AlfrescoApi, TagsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); +const tags = []; + +tagsApi.createTags(tags).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## deleteTag + +Deletes the tag with **tagId**. This will cause the tag to be removed from all nodes. + +> You must have admin rights to delete a tag. + +**Parameters** + +| Name | Type | Description | +|-----------|--------|--------------------------| +| **tagId** | string | The identifier of a tag. | + +**Example** + +```javascript +import { AlfrescoApi, TagsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); + +tagsApi.deleteTag(`<tagId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## assignTagsToNode + +Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned. + +**Parameters** + +| Name | Type | Description | Notes | +|------------|-----------------------|-------------------------------------------------------------------------|-------| +| **nodeId** | string | Id of node to which tags should be assigned. | +| **tags** | [TagBody[]](#TagBody) | List of tags to create and assign or just assign if they already exist. | + +**Return type**: [TagPaging](#TagPaging) | [TagEntry](#TagEntry) + +**Example** + +```javascript +import { AlfrescoApi, TagsApi, TagBody } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const tagsApi = new TagsApi(alfrescoApi); + +const tag1 = new TagBody({ tag: 'tag-test-1' }); +const tag2 = new TagBody({ tag: 'tag-test-2' }); + +tagsApi.assignTagsToNode('someNodeId', [tag1, tag2]).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## TagPaging + +**Properties** + +| Name | Type | +|------|---------------------------------| +| list | [TagPagingList](#TagPagingList) | + +## TagPagingList + +**Properties** + +| Name | Type | +|----------------|-----------------------------| +| **pagination** | [Pagination](Pagination.md) | +| **entries** | [TagEntry[]](#TagEntry) | + +## TagEntry + +**Properties** + +| Name | Type | +|-----------|-------------| +| **entry** | [Tag](#Tag) | + +## TagBody + +**Properties** + +| Name | Type | +|---------|--------| +| **tag** | string | + +## Tag + +**Properties** + +| Name | Type | +|---------|--------| +| **id** | string | +| **tag** | string | +| count | number | + + + + + diff --git a/lib/js-api/src/api/content-rest-api/docs/TrashcanApi.md b/lib/js-api/src/api/content-rest-api/docs/TrashcanApi.md new file mode 100644 index 0000000000..ae179944d0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/TrashcanApi.md @@ -0,0 +1,403 @@ +# TrashcanApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|---------------------------------------------------------------------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------| +| [deleteDeletedNode](#deleteDeletedNode) | **DELETE** /deleted-nodes/{nodeId} | Permanently delete a deleted node | +| [getArchivedNodeRendition](#getArchivedNodeRendition) | **GET** /deleted-nodes/{nodeId}/renditions/{renditionId} | Get rendition information for a deleted node | +| [getArchivedNodeRenditionContent](#getArchivedNodeRenditionContent) | **GET** /deleted-nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content of a deleted node | +| [getDeletedNode](#getDeletedNode) | **GET** /deleted-nodes/{nodeId} | Get a deleted node | +| [getDeletedNodeContent](#getDeletedNodeContent) | **GET** /deleted-nodes/{nodeId}/content | Get deleted node content | +| [listDeletedNodeRenditions](#listDeletedNodeRenditions) | **GET** /deleted-nodes/{nodeId}/renditions | List renditions for a deleted node | +| [listDeletedNodes](#listDeletedNodes) | **GET** /deleted-nodes | List deleted nodes | +| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /deleted-nodes/{nodeId}/request-direct-access-url | Generate a direct access content url for a given deleted node | +| [requestRenditionDirectAccessUrl](#requestRenditionDirectAccessUrl) | **POST** /deleted-nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url | Generate a direct access content url for a given rendition of a deleted node | +| [restoreDeletedNode](#restoreDeletedNode) | **POST** /deleted-nodes/{nodeId}/restore | Restore a deleted node | + +## deleteDeletedNode + +Permanently delete a deleted node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|-------------|--------|--------------------------------------------------------------------| +| nodeId | string | The identifier of a node. | + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); + +trashcanApi.deleteDeletedNode(`<nodeId>`).then(() => { + console.log('API called successfully.'); +}); +``` + +## getArchivedNodeRendition + +Get rendition information for a deleted node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|-------------|--------|--------------------------------------------------------------------| +| nodeId | string | The identifier of a node. | +| renditionId | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. | + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); + +trashcanApi.getArchivedNodeRendition('node-id', 'rendition-id').then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +**Return type**: [RenditionEntry](RenditionEntry.md) + +## getArchivedNodeRenditionContent + +Get rendition content of a deleted node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| nodeId | string | The identifier of a node. | +| renditionId | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. | +| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| ifModifiedSince | boolean | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. | +| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. | +| placeholder | boolean | If **true** and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. | + +**Return type**: **Blob** + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); + +trashcanApi.getArchivedNodeRenditionContent('node-id', 'rendition-id').then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getDeletedNode + +Get a deleted node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| include | string | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`,`isLocked`, `path`, `permissions`, `definition` | + +**Return type**: [DeletedNodeEntry](#DeletedNodeEntry) + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); + +trashcanApi.getDeletedNode('nodeId').then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getDeletedNodeContent + +Get deleted node content + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. | +| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. | + +**Return type**: Blob + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); + +trashcanApi.getDeletedNodeContent('nodeId').then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listDeletedNodeRenditions + +List renditions for a deleted node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of the rendition information for each rendition of the file **nodeId**, including the rendition id. + +Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested. + +You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where** +clause will return just the `CREATED` renditions: + +```text +(status='CREATED') +``` + +**Parameters** + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| opts.where | string | A string to restrict the returned objects by using a predicate. | + +**Return type**: [RenditionPaging](RenditionPaging.md) + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); + +trashcanApi.listDeletedNodeRenditions(`<nodeId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listDeletedNodes + +List deleted nodes + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets a list of deleted nodes for the current user. + +If the current user is an administrator deleted nodes for all users will be returned. + +The list of deleted nodes will be ordered with the most recently deleted node at the top of the list. + +**Parameters** + +| Name | Type | Description | Notes | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties`, `permissions` | | + +**Return type**: [DeletedNodesPaging](#DeletedNodesPaging) + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); +const opts = {}; + +trashcanApi.listDeletedNodes(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## requestDirectAccessUrl + +Generate a direct access content url for a given deleted node + +> this endpoint is available in **Alfresco 7.1** and newer versions. + +**Parameters** + +| Name | Type | Description | +|------------|--------|---------------------------| +| **nodeId** | string | The identifier of a node. | + +**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); +const nodeId = 'da2e6953-3850-408b-8284-3534dd777417'; + +trashcanApi.requestDirectAccessUrl(nodeId).then((data) => { + console.log('URL generated successfully: ', data.contentUrl); +}); +``` + +## requestRenditionDirectAccessUrl + +Generate a direct access content url for a given rendition of a deleted node + +> this endpoint is available in **Alfresco 7.1** and newer versions. + +**Parameters** + +| Name | Type | Description | +|-----------------|--------|--------------------------------| +| **nodeId** | string | The identifier of a node. | +| **renditionId** | string | The identifier of a rendition. | + +**Return type**: [**DirectAccessUrlEntry**](DirectAccessUrlEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); + +const nodeId = 'da2e6953-3850-408b-8284-3534dd777417'; +const renditionId = 'avatar'; + +trashcanApi.requestRenditionDirectAccessUrl(nodeId, renditionId).then((data) => { + console.log('URL generated successfully: ', data.contentUrl); +}); +``` + +## restoreDeletedNode + +Restore a deleted node + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Attempts to restore the deleted node **nodeId** to its original location or to a new location. + +If the node is successfully restored to its former primary parent, then only the +primary child association will be restored, including recursively for any primary +children. It should be noted that no other secondary child associations or peer +associations will be restored, for any of the nodes within the primary parent-child +hierarchy of restored nodes, irrespective of whether these associations were to +nodes within or outside the restored hierarchy. + +Also, any previously shared link will not be restored since it is deleted at the time +of delete of each node. + +**Parameters** + +| Name | Type | Description | +|-----------------------------|---------------------------------------------------|---------------------------------------------------------------| +| nodeId | string | The identifier of a node. | +| opts.fields | string | A list of field names. | +| opts.deletedNodeBodyRestore | [DeletedNodeBodyRestore](#DeletedNodeBodyRestore) | The targetParentId if the node is restored to a new location. | + +**Return type**: [NodeEntry](NodeEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const trashcanApi = new TrashcanApi(alfrescoApi); +const nodeId = '<guid>'; + +trashcanApi.restoreDeletedNode(nodeId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## DeletedNodesPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------------------| +| list | [DeletedNodesPagingList](DeletedNodesPagingList.md) | + + +## DeletedNodesPagingList + +**Properties** + +| Name | Type | +|------------|-----------------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [DeletedNodeEntry[]](#DeletedNodeEntry) | + +## DeletedNodeEntry + +**Properties** + +| Name | Type | +|-----------|-----------------------------| +| **entry** | [DeletedNode](#DeletedNode) | + +## DeletedNode + +**Properties** + +| Name | Type | Description | +|---------------------|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **id** | string | | +| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ?` : and ` \| `. The character `.` must not be used at the end of the name. | +| **nodeType** | string | | +| **isFolder** | boolean | | +| **isFile** | boolean | | +| isLocked | boolean | | +| **modifiedAt** | Date | | +| **modifiedByUser** | [UserInfo](UserInfo.md) | | +| **createdAt** | Date | | +| **createdByUser** | [UserInfo](UserInfo.md) | | +| parentId | string | | +| isLink | boolean | | +| isFavorite | boolean | | +| content | [ContentInfo](ContentInfo.md) | | +| aspectNames | string[] | | +| properties | any | | +| allowableOperations | string[] | | +| path | [PathInfo](PathInfo.md) | | +| permissions | [PermissionsInfo](PermissionsInfo.md) | | +| definition | [Definition](Definition.md) | | +| **archivedByUser** | [UserInfo](UserInfo.md) | | +| **archivedAt** | Date | | + +## DeletedNodeBodyRestore + +**Properties** + +| Name | Type | +|----------------|--------| +| targetParentId | string | +| assocType | string | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/UserInfo.md b/lib/js-api/src/api/content-rest-api/docs/UserInfo.md new file mode 100644 index 0000000000..8695f59808 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/UserInfo.md @@ -0,0 +1,10 @@ +# UserInfo + +**Properties** + +| Name | Type | +|-----------------|--------| +| **displayName** | string | +| **id** | string | + + diff --git a/lib/js-api/src/api/content-rest-api/docs/VersionsApi.md b/lib/js-api/src/api/content-rest-api/docs/VersionsApi.md new file mode 100644 index 0000000000..c3674eaaf4 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/docs/VersionsApi.md @@ -0,0 +1,434 @@ +# VersionsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------------------------------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------| +| [createVersionRendition](#createVersionRendition) | **POST** /nodes/{nodeId}/versions/{versionId}/renditions | Create rendition for a file version | +| [deleteVersion](#deleteVersion) | **DELETE** /nodes/{nodeId}/versions/{versionId} | Delete a version | +| [getVersion](#getVersion) | **GET** /nodes/{nodeId}/versions/{versionId} | Get version information | +| [getVersionContent](#getVersionContent) | **GET** /nodes/{nodeId}/versions/{versionId}/content | Get version content | +| [getVersionRendition](#getVersionRendition) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId} | Get rendition information for a file version | +| [getVersionRenditionContent](#getVersionRenditionContent) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content | Get rendition content for a file version | +| [listVersionHistory](#listVersionHistory) | **GET** /nodes/{nodeId}/versions | List version history | +| [listVersionRenditions](#listVersionRenditions) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions | List renditions for a file version | +| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /nodes/{nodeId}/versions/{versionId}/request-direct-access-url | Generate a direct access content url for a given version of a node | +| [revertVersion](#revertVersion) | **POST** /nodes/{nodeId}/versions/{versionId}/revert | Revert a version | + +## createVersionRendition + +Create rendition for a file version + +> this endpoint is available in **Alfresco 7.0.0** and newer versions. + +An asynchronous request to create a rendition for version of file **nodeId** and **versionId**. + +The version rendition is specified by name **id** in the request body: + +```json +{ + "id": "doclib" +} +``` + +Multiple names may be specified as a comma separated list or using a list format: + +```json +[ + { + "id": "doclib" + }, + { + "id": "avatar" + } +] +``` + +**Parameters** + +| Name | Type | Description | +|-------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | +| **renditionBodyCreate** | [RenditionBodyCreate](RenditionBodyCreate.md) | The rendition "id". | + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); +const renditionBodyCreate = {}; + +versionsApi.createVersionRendition(`<nodeId>`, `<versionId>`, renditionBodyCreate).then(() => { + console.log('API called successfully.'); +}); +``` + +## deleteVersion + +Delete a version + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Delete the version identified by **versionId** and **nodeId*. + +**Parameters** + +| Name | Type | Description | Notes | +|---------------|--------|---------------------------------------------------------------------------------------|-------| +| **nodeId** | string | The identifier of a node. | +| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | + +If the version is successfully deleted then the content and metadata for that versioned node +will be deleted and will no longer appear in the version history. This operation cannot be undone. + +If the most recent version is deleted the live node will revert to the next most recent version. + +We currently do not allow the last version to be deleted. If you wish to clear the history then you +can remove the `cm:versionable` aspect (via update node) which will also disable versioning. In this +case, you can re-enable versioning by adding back the `cm:versionable` aspect or using the version +params (majorVersion and comment) on a subsequent file content update. + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); + +versionsApi.deleteVersion(nodeId, versionId).then(() => { + console.log('API called successfully.'); +}); +``` + +## getVersion + +Get version information + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +**Parameters** + +| Name | Type | Description | +|---------------|------------|---------------------------------------------------------------------------------------| +| **nodeId** | **string** | The identifier of a node. | +| **versionId** | **string** | The identifier of a version, ie. version label, within the version history of a node. | + +**Return type**: [VersionEntry](#VersionEntry) + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); + +versionsApi.getVersion(`<nodeId>`, `<versionId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getVersionContent + +Get version content + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets the version content for **versionId** of file node **nodeId**. + +**Parameters** + +| Name | Type | Description | +|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | +| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided.Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. | +| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. | + +**Return type**: Blob + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); +const opts = {}; + +versionsApi.getVersionContent(`<nodeId>`, `<versionId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getVersionRendition + +Get rendition information for a file version + +> this endpoint is available in **Alfresco 7.0.0** and newer versions. + +Gets the rendition information for **renditionId** of version of file **nodeId** and **versionId**. + +**Parameters** + +| Name | Type | Description | +|-----------------|--------|---------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | +| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. | + +**Return type**: [RenditionEntry](RenditionEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); + +versionsApi.getVersionRendition(`<nodeId>`, `<versionId>`, `<renditionId>`).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## getVersionRenditionContent + +Get rendition content for a file version + +> this endpoint is available in **Alfresco 7.0.0** and newer versions. + +Gets the rendition content for **renditionId** of version of file **nodeId** and **versionId**. + +**Parameters** + +| Name | Type | Description | +|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | +| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. | +| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. | +| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. | +| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. | +| placeholder | boolean | If **true** (default: false) and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. | + +**Return type**: Blob + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); +const opts = {}; + +versionsApi.getVersionRenditionContent(`<nodeId>`, `<versionId>`, `<renditionId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listVersionHistory + +List version history + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Gets the version history as an ordered list of versions for the specified **nodeId**. + +The list is ordered in descending modified order. So the most recent version is first and +the original version is last in the list. + +**Parameters** + +| Name | Type | Description | +|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| opts.include | string[] | Returns additional information about the version node. The following optional fields can be requested: `properties`, `aspectNames` | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | + +**Return type**: [VersionPaging](#VersionPaging) + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); +const opts = {}; + +versionsApi.listVersionHistory(`<nodeId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listVersionRenditions + +List renditions for a file version + +> this endpoint is available in **Alfresco 7.0.0** and newer versions. + +Gets a list of the rendition information for each rendition of the version of file **nodeId** and **versionId**, including the rendition id. + +Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested. + +You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where** +clause will return just the `CREATED` renditions: + +```text +(status='CREATED') +``` + +**Parameters** + +| Name | Type | Description | Notes | +|---------------|--------|---------------------------------------------------------------------------------------|------------| +| **nodeId** | string | The identifier of a node. | | +| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | | +| opts.where | string | A string to restrict the returned objects by using a predicate. | [optional] | + +**Return type**: [RenditionPaging](RenditionPaging.md) + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); +const opts = {}; + +versionsApi.listVersionRenditions(`<nodeId>`, `<versionId>`, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## requestDirectAccessUrl + +Generate a direct access content url for a given version of a node + +> this endpoint is available in **Alfresco 7.1** and newer versions. + +**Parameters** + +| Name | Type | Description | +|---------------|------------|------------------------------| +| **nodeId** | **string** | The identifier of a node. | +| **versionId** | **string** | The identifier of a version. | + +**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md) + +### Example + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); + +const nodeId = 'da2e6953-3850-408b-8284-3534dd777417'; +const versionId = '1.0'; + +versionsApi.requestDirectAccessUrl(nodeId, versionId).then((data) => { + console.log('URL generated successfully: ', data.contentUrl); +}); +``` + +## revertVersion + +Revert a version + +> this endpoint is available in **Alfresco 5.2** and newer versions. + +Attempts to revert the version identified by **versionId** and **nodeId** to the live node. + +If the node is successfully reverted then the content and metadata for that versioned node +will be promoted to the live node and a new version will appear in the version history. + +**Parameters** + +| Name | Type | Description | +|----------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **nodeId** | string | The identifier of a node. | +| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | +| **revertBody** | [RevertBody](#RevertBody) | Optionally, specify a version comment and whether this should be a major version, or not. | +| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | + +**Return type**: [VersionEntry](#VersionEntry) + +**Example** + +```javascript +import { AlfrescoApi, VersionsApi } from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi(/*..*/); +const versionsApi = new VersionsApi(alfrescoApi); +const revertBody = {}; +const opts = {}; + +versionsApi.revertVersion(`<nodeId>`, `<versionId>`, revertBody, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +# Models + +## RevertBody + +**Properties** + +| Name | Type | +|--------------|---------| +| majorVersion | boolean | +| comment | string | + +## VersionPaging + +**Properties** + +| Name | Type | +|------|-----------------------------------------| +| list | [VersionPagingList](#VersionPagingList) | + +## VersionPagingList + +**Properties** + +| Name | Type | +|------------|---------------------------------| +| pagination | [Pagination](Pagination.md) | +| entries | [VersionEntry[]](#VersionEntry) | + +## VersionEntry + +**Properties** + +| Name | Type | +|-------|---------------------| +| entry | [Version](#Version) | + +## Version + +**Properties** + +| Name | Type | Description | +|--------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **id** | string | | +| versionComment | string | | +| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|` . The character . must not be used at the end of the name. | +| **nodeType** | string | | +| **isFolder** | boolean | | +| **isFile** | boolean | | +| **modifiedAt** | Date | | +| **modifiedByUser** | [UserInfo](UserInfo.md) | | +| content | [ContentInfo](ContentInfo.md) | | +| aspectNames | string[] | | +| properties | any | | \ No newline at end of file diff --git a/lib/js-api/src/api/content-rest-api/index.ts b/lib/js-api/src/api/content-rest-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/content-rest-api/model/CategoryLinkBody.ts b/lib/js-api/src/api/content-rest-api/model/CategoryLinkBody.ts new file mode 100644 index 0000000000..d3073ae630 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/CategoryLinkBody.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class CategoryLinkBody { + categoryId: string; + + constructor(input?: Partial<CategoryLinkBody>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/actionBodyExec.ts b/lib/js-api/src/api/content-rest-api/model/actionBodyExec.ts new file mode 100644 index 0000000000..b3d2843b5b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/actionBodyExec.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ActionBodyExec { + actionDefinitionId: string; + /** + * The entity upon which to execute the action, typically a node ID or similar. + */ + targetId?: string; + params?: any; +} diff --git a/lib/js-api/src/api/content-rest-api/model/actionDefinition.ts b/lib/js-api/src/api/content-rest-api/model/actionDefinition.ts new file mode 100644 index 0000000000..f1dfb41e13 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/actionDefinition.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActionParameterDefinition } from './actionParameterDefinition'; + +export interface ActionDefinition { + /** + * Identifier of the action definition — used for example when executing an action + */ + id: string; + /** + * name of the action definition, e.g. \"move\" + */ + name?: string; + /** + * title of the action definition, e.g. \"Move\" + */ + title?: string; + /** + * describes the action definition, e.g. \"This will move the matched item to another space.\" + */ + description?: string; + /** + * QNames of the types this action applies to + */ + applicableTypes: string[]; + /** + * whether the basic action definition supports action tracking or not + */ + trackStatus: boolean; + parameterDefinitions?: ActionParameterDefinition[]; +} diff --git a/lib/js-api/src/api/content-rest-api/model/actionDefinitionEntry.ts b/lib/js-api/src/api/content-rest-api/model/actionDefinitionEntry.ts new file mode 100644 index 0000000000..555d055546 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/actionDefinitionEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActionDefinition } from './actionDefinition'; + +export interface ActionDefinitionEntry { + entry: ActionDefinition; +} diff --git a/lib/js-api/src/api/content-rest-api/model/actionDefinitionList.ts b/lib/js-api/src/api/content-rest-api/model/actionDefinitionList.ts new file mode 100644 index 0000000000..17b25ccbf7 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/actionDefinitionList.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActionDefinitionListList } from './actionDefinitionListList'; + +export class ActionDefinitionList { + list?: ActionDefinitionListList; + + constructor(input?: ActionDefinitionList) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new ActionDefinitionListList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/actionDefinitionListList.ts b/lib/js-api/src/api/content-rest-api/model/actionDefinitionListList.ts new file mode 100644 index 0000000000..8172d4db13 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/actionDefinitionListList.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActionDefinition } from './actionDefinition'; +import { Pagination } from './pagination'; + +export class ActionDefinitionListList { + pagination?: Pagination; + entries?: ActionDefinition[]; + + constructor(input?: Partial<ActionDefinitionListList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/actionExecResult.ts b/lib/js-api/src/api/content-rest-api/model/actionExecResult.ts new file mode 100644 index 0000000000..c3e5f201ea --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/actionExecResult.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ActionExecResult { + /** + * The unique identifier of the action pending execution + */ + id: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/actionExecResultEntry.ts b/lib/js-api/src/api/content-rest-api/model/actionExecResultEntry.ts new file mode 100644 index 0000000000..d0179d6578 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/actionExecResultEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActionExecResult } from './actionExecResult'; + +export interface ActionExecResultEntry { + entry: ActionExecResult; +} diff --git a/lib/js-api/src/api/content-rest-api/model/actionParameterDefinition.ts b/lib/js-api/src/api/content-rest-api/model/actionParameterDefinition.ts new file mode 100644 index 0000000000..cc2645da8c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/actionParameterDefinition.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ActionParameterDefinition { + name?: string; + type?: string; + multiValued?: boolean; + mandatory?: boolean; + displayLabel?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/activity.ts b/lib/js-api/src/api/content-rest-api/model/activity.ts new file mode 100644 index 0000000000..c8465db537 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/activity.ts @@ -0,0 +1,61 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +/** + * Activities describe any past activity in a site, + * for example creating an item of content, commenting on a node, + * liking an item of content. + */ +export class Activity { + /** + * The id of the person who performed the activity + */ + postPersonId: string; + /** + * The unique id of the activity + */ + id: number; + /** + * The unique id of the site on which the activity was performed + */ + siteId?: string; + /** + * The date time at which the activity was performed + */ + postedAt?: Date; + /** + * The feed on which this activity was posted + */ + feedPersonId: string; + /** + * An object summarizing the activity + */ + activitySummary?: { [key: string]: string }; + /** + * The type of the activity posted + */ + activityType: string; + + constructor(input?: Partial<Activity>) { + if (input) { + Object.assign(this, input); + this.postedAt = input.postedAt ? DateAlfresco.parseDate(input.postedAt) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/activityEntry.ts b/lib/js-api/src/api/content-rest-api/model/activityEntry.ts new file mode 100644 index 0000000000..67a81c6f46 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/activityEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Activity } from './activity'; + +export class ActivityEntry { + entry: Activity; + + constructor(input?: Partial<ActivityEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Activity(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/activityPaging.ts b/lib/js-api/src/api/content-rest-api/model/activityPaging.ts new file mode 100644 index 0000000000..1e12ae795a --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/activityPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActivityPagingList } from './activityPagingList'; + +export class ActivityPaging { + list?: ActivityPagingList; + + constructor(input?: Partial<ActivityPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new ActivityPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/activityPagingList.ts b/lib/js-api/src/api/content-rest-api/model/activityPagingList.ts new file mode 100644 index 0000000000..803fe3fa10 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/activityPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ActivityEntry } from './activityEntry'; +import { Pagination } from './pagination'; + +export class ActivityPagingList { + pagination: Pagination; + entries: ActivityEntry[]; + + constructor(input?: Partial<ActivityPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new ActivityEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/association.ts b/lib/js-api/src/api/content-rest-api/model/association.ts new file mode 100644 index 0000000000..32d73bd6a5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/association.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Association { + targetId: string; + assocType: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/associationBody.ts b/lib/js-api/src/api/content-rest-api/model/associationBody.ts new file mode 100644 index 0000000000..87dea1cea6 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/associationBody.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class AssociationBody { + targetId: string; + assocType: string; + + constructor(input?: Partial<AssociationBody>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/associationEntry.ts b/lib/js-api/src/api/content-rest-api/model/associationEntry.ts new file mode 100644 index 0000000000..82bb9e5227 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/associationEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Association } from './association'; + +export interface AssociationEntry { + entry: Association; +} diff --git a/lib/js-api/src/api/content-rest-api/model/associationInfo.ts b/lib/js-api/src/api/content-rest-api/model/associationInfo.ts new file mode 100644 index 0000000000..830824b64e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/associationInfo.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AssociationInfo { + assocType: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditApp.ts b/lib/js-api/src/api/content-rest-api/model/auditApp.ts new file mode 100644 index 0000000000..66d14b6cfb --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditApp.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AuditApp { + id: string; + name?: string; + isEnabled?: boolean; + maxEntryId?: number; + minEntryId?: number; +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditAppEntry.ts b/lib/js-api/src/api/content-rest-api/model/auditAppEntry.ts new file mode 100644 index 0000000000..cf75724838 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditAppEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditApp } from './auditApp'; + +export interface AuditAppEntry { + entry?: AuditApp; +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditAppPaging.ts b/lib/js-api/src/api/content-rest-api/model/auditAppPaging.ts new file mode 100644 index 0000000000..bb22344060 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditAppPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditAppPagingList } from './auditAppPagingList'; + +export class AuditAppPaging { + list?: AuditAppPagingList; + + constructor(input?: Partial<AuditAppPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new AuditAppPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditAppPagingList.ts b/lib/js-api/src/api/content-rest-api/model/auditAppPagingList.ts new file mode 100644 index 0000000000..72dc0ea337 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditAppPagingList.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditAppEntry } from './auditAppEntry'; +import { Pagination } from './pagination'; + +export class AuditAppPagingList { + pagination?: Pagination; + entries?: AuditAppEntry[]; + + constructor(input?: Partial<AuditAppPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditBodyUpdate.ts b/lib/js-api/src/api/content-rest-api/model/auditBodyUpdate.ts new file mode 100644 index 0000000000..ffeb1f2a3f --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditBodyUpdate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AuditBodyUpdate { + isEnabled?: boolean; +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditEntry.ts b/lib/js-api/src/api/content-rest-api/model/auditEntry.ts new file mode 100644 index 0000000000..dd9340bcc2 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditEntry.ts @@ -0,0 +1,36 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { UserInfo } from './userInfo'; + +export class AuditEntry { + id: string; + auditApplicationId: string; + createdByUser: UserInfo; + createdAt: Date; + values?: any; + + constructor(input?: Partial<AuditEntry>) { + if (input) { + Object.assign(this, input); + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditEntryEntry.ts b/lib/js-api/src/api/content-rest-api/model/auditEntryEntry.ts new file mode 100644 index 0000000000..d44d061f2e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditEntryEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditEntry } from './auditEntry'; + +export class AuditEntryEntry { + entry?: AuditEntry; + + constructor(input?: Partial<AuditEntryEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new AuditEntry(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditEntryPaging.ts b/lib/js-api/src/api/content-rest-api/model/auditEntryPaging.ts new file mode 100644 index 0000000000..e7e8cd83bf --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditEntryPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditEntryPagingList } from './auditEntryPagingList'; + +export class AuditEntryPaging { + list?: AuditEntryPagingList; + + constructor(input?: Partial<AuditEntryPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new AuditEntryPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/auditEntryPagingList.ts b/lib/js-api/src/api/content-rest-api/model/auditEntryPagingList.ts new file mode 100644 index 0000000000..5557ea4483 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/auditEntryPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuditEntryEntry } from './auditEntryEntry'; +import { Pagination } from './pagination'; + +export class AuditEntryPagingList { + pagination?: Pagination; + entries?: AuditEntryEntry[]; + + constructor(input?: Partial<AuditEntryPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new AuditEntryEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/capabilities.ts b/lib/js-api/src/api/content-rest-api/model/capabilities.ts new file mode 100644 index 0000000000..dec575ceae --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/capabilities.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Capabilities { + isAdmin?: boolean; + isGuest?: boolean; + isMutable?: boolean; +} diff --git a/lib/js-api/src/api/content-rest-api/model/category.ts b/lib/js-api/src/api/content-rest-api/model/category.ts new file mode 100644 index 0000000000..f5b50c71fb --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/category.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class Category { + id: string; + name: string; + parentId?: string; + hasChildren?: boolean; + count?: number; + path?: string; + + constructor(input?: Partial<Category>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/categoryBody.ts b/lib/js-api/src/api/content-rest-api/model/categoryBody.ts new file mode 100644 index 0000000000..22b7a14076 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/categoryBody.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface CategoryBody { + name: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/categoryEntry.ts b/lib/js-api/src/api/content-rest-api/model/categoryEntry.ts new file mode 100644 index 0000000000..845b8f1f2e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/categoryEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Category } from './category'; + +export class CategoryEntry { + entry: Category; + + constructor(input?: Partial<CategoryEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Category(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/categoryPaging.ts b/lib/js-api/src/api/content-rest-api/model/categoryPaging.ts new file mode 100644 index 0000000000..889bddfe80 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/categoryPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CategoryPagingList } from './categoryPagingList'; + +export class CategoryPaging { + list?: CategoryPagingList; + + constructor(input?: Partial<CategoryPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new CategoryPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/categoryPagingList.ts b/lib/js-api/src/api/content-rest-api/model/categoryPagingList.ts new file mode 100644 index 0000000000..d6e24efa7e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/categoryPagingList.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { CategoryEntry } from './categoryEntry'; + +export class CategoryPagingList { + pagination: Pagination; + entries: CategoryEntry[]; + + constructor(input?: Partial<CategoryPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new CategoryEntry(item)); + } + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/childAssociation.ts b/lib/js-api/src/api/content-rest-api/model/childAssociation.ts new file mode 100644 index 0000000000..76dc53cede --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/childAssociation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ChildAssociation { + childId: string; + assocType: string; + + constructor(input?: Partial<ChildAssociation>) { + if (input) { + Object.assign(this, input); + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/childAssociationBody.ts b/lib/js-api/src/api/content-rest-api/model/childAssociationBody.ts new file mode 100644 index 0000000000..239ab86fb0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/childAssociationBody.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ChildAssociationBody { + childId: string; + assocType: string; + + constructor(input?: Partial<ChildAssociationBody>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/childAssociationEntry.ts b/lib/js-api/src/api/content-rest-api/model/childAssociationEntry.ts new file mode 100644 index 0000000000..fcb6d6fbef --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/childAssociationEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChildAssociation } from './childAssociation'; + +export class ChildAssociationEntry { + entry: ChildAssociation; + + constructor(input?: Partial<ChildAssociationEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new ChildAssociation(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/childAssociationInfo.ts b/lib/js-api/src/api/content-rest-api/model/childAssociationInfo.ts new file mode 100644 index 0000000000..00c05ce3b1 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/childAssociationInfo.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ChildAssociationInfo { + assocType: string; + isPrimary: boolean; + + constructor(input?: Partial<ChildAssociationInfo>) { + if (input) { + Object.assign(this, input); + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/clientBody.ts b/lib/js-api/src/api/content-rest-api/model/clientBody.ts new file mode 100644 index 0000000000..6c6ee63dbc --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/clientBody.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ClientBody { + /** + * the client name + */ + client: string; + + constructor(input?: Partial<ClientBody>) { + if (input) { + Object.assign(this, input); + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/comment.ts b/lib/js-api/src/api/content-rest-api/model/comment.ts new file mode 100644 index 0000000000..b44f336f29 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/comment.ts @@ -0,0 +1,43 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { Person } from './person'; + +export class Comment { + id: string; + title: string; + content: string; + createdBy: Person; + createdAt: Date; + edited: boolean; + modifiedBy: Person; + modifiedAt: Date; + canEdit: boolean; + canDelete: boolean; + + constructor(input?: Partial<Comment>) { + if (input) { + Object.assign(this, input); + this.createdBy = input.createdBy ? new Person(input.createdBy) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.modifiedBy = input.modifiedBy ? new Person(input.modifiedBy) : undefined; + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/commentBody.ts b/lib/js-api/src/api/content-rest-api/model/commentBody.ts new file mode 100644 index 0000000000..2f9db1cdef --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/commentBody.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface CommentBody { + content: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/commentEntry.ts b/lib/js-api/src/api/content-rest-api/model/commentEntry.ts new file mode 100644 index 0000000000..7958aa6c33 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/commentEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Comment } from './comment'; + +export class CommentEntry { + entry: Comment; + + constructor(input?: Partial<CommentEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Comment(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/commentPaging.ts b/lib/js-api/src/api/content-rest-api/model/commentPaging.ts new file mode 100644 index 0000000000..fe7c77fe02 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/commentPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommentPagingList } from './commentPagingList'; + +export class CommentPaging { + list?: CommentPagingList; + + constructor(input?: Partial<CommentPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new CommentPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/commentPagingList.ts b/lib/js-api/src/api/content-rest-api/model/commentPagingList.ts new file mode 100644 index 0000000000..4a4f8430cc --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/commentPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommentEntry } from './commentEntry'; +import { Pagination } from './pagination'; + +export class CommentPagingList { + pagination: Pagination; + entries: CommentEntry[]; + + constructor(input?: Partial<CommentPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new CommentEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/company.ts b/lib/js-api/src/api/content-rest-api/model/company.ts new file mode 100644 index 0000000000..47220f9a95 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/company.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Company { + organization?: string; + address1?: string; + address2?: string; + address3?: string; + postcode?: string; + telephone?: string; + fax?: string; + email?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/constraint.ts b/lib/js-api/src/api/content-rest-api/model/constraint.ts new file mode 100644 index 0000000000..5b4cae3b5e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/constraint.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Constraint { + id: string; + /** + * the type of the constraint + */ + type?: string; + /** + * the human-readable constraint title + */ + title?: string; + /** + * the human-readable constraint description + */ + description?: string; + parameters?: { [key: string]: any }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/contentInfo.ts b/lib/js-api/src/api/content-rest-api/model/contentInfo.ts new file mode 100644 index 0000000000..75a8d39b91 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/contentInfo.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ContentInfo { + mimeType: string; + mimeTypeName: string; + sizeInBytes: number; + encoding?: string; + + constructor(input?: Partial<ContentInfo>) { + if (input) { + Object.assign(this, input); + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/definition.ts b/lib/js-api/src/api/content-rest-api/model/definition.ts new file mode 100644 index 0000000000..36decff345 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/definition.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Property } from './property'; + +export interface Definition { + /** + * List of property definitions effective for this node as the result of combining the type with all aspects. + */ + properties?: Property[]; +} diff --git a/lib/js-api/src/api/content-rest-api/model/deletedNode.ts b/lib/js-api/src/api/content-rest-api/model/deletedNode.ts new file mode 100644 index 0000000000..a0b940f286 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/deletedNode.ts @@ -0,0 +1,67 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ContentInfo } from './contentInfo'; +import { DateAlfresco } from '../../content-custom-api'; +import { Definition } from './definition'; +import { PathInfo } from './pathInfo'; +import { PermissionsInfo } from './permissionsInfo'; +import { UserInfo } from './userInfo'; + +export class DeletedNode { + id: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isFolder: boolean; + isFile: boolean; + isLocked?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + parentId?: string; + isLink?: boolean; + isFavorite?: boolean; + content?: ContentInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + permissions?: PermissionsInfo; + definition?: Definition; + archivedByUser: UserInfo; + archivedAt: Date; + + constructor(input?: Partial<DeletedNode>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.permissions = input.permissions ? new PermissionsInfo(input.permissions) : undefined; + this.archivedByUser = input.archivedByUser ? new UserInfo(input.archivedByUser) : undefined; + this.archivedAt = input.archivedAt ? DateAlfresco.parseDate(input.archivedAt) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/deletedNodeBodyRestore.ts b/lib/js-api/src/api/content-rest-api/model/deletedNodeBodyRestore.ts new file mode 100644 index 0000000000..d3bf161079 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/deletedNodeBodyRestore.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface DeletedNodeBodyRestore { + targetParentId?: string; + assocType?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/deletedNodeEntry.ts b/lib/js-api/src/api/content-rest-api/model/deletedNodeEntry.ts new file mode 100644 index 0000000000..2f86fa2172 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/deletedNodeEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeletedNode } from './deletedNode'; + +export class DeletedNodeEntry { + entry?: DeletedNode; + + constructor(input?: Partial<DeletedNodeEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new DeletedNode(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/deletedNodesPaging.ts b/lib/js-api/src/api/content-rest-api/model/deletedNodesPaging.ts new file mode 100644 index 0000000000..47f1d8f894 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/deletedNodesPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeletedNodesPagingList } from './deletedNodesPagingList'; + +export class DeletedNodesPaging { + list?: DeletedNodesPagingList; + + constructor(input?: Partial<DeletedNodesPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new DeletedNodesPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/deletedNodesPagingList.ts b/lib/js-api/src/api/content-rest-api/model/deletedNodesPagingList.ts new file mode 100644 index 0000000000..89e4bcddda --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/deletedNodesPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeletedNodeEntry } from './deletedNodeEntry'; +import { Pagination } from './pagination'; + +export class DeletedNodesPagingList { + pagination?: Pagination; + entries?: DeletedNodeEntry[]; + + constructor(input?: Partial<DeletedNodesPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new DeletedNodeEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/directAccessUrl.ts b/lib/js-api/src/api/content-rest-api/model/directAccessUrl.ts new file mode 100644 index 0000000000..f6caa91abf --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/directAccessUrl.ts @@ -0,0 +1,41 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class DirectAccessUrl { + /** + * The direct access URL of a binary content + */ + contentUrl: string; + /** + * Whether or not the content downloads as an attachment + */ + attachment?: boolean; + /** + * The direct access URL would become invalid when the expiry date is reached + */ + expiryTime?: Date; + + constructor(input?: Partial<DirectAccessUrl>) { + if (input) { + Object.assign(this, input); + this.expiryTime = input.expiryTime ? DateAlfresco.parseDate(input.expiryTime) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/directAccessUrlEntry.ts b/lib/js-api/src/api/content-rest-api/model/directAccessUrlEntry.ts new file mode 100644 index 0000000000..f6d57c5d40 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/directAccessUrlEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DirectAccessUrl } from './directAccessUrl'; + +export class DirectAccessUrlEntry { + entry: DirectAccessUrl; + + constructor(input?: Partial<DirectAccessUrlEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new DirectAccessUrl(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/download.ts b/lib/js-api/src/api/content-rest-api/model/download.ts new file mode 100644 index 0000000000..26c7150488 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/download.ts @@ -0,0 +1,43 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Download { + /** + * number of files added so far in the zip + */ + filesAdded?: number; + /** + * number of bytes added so far in the zip + */ + bytesAdded?: number; + /** + * the id of the download node + */ + id?: string; + /** + * the total number of files to be added in the zip + */ + totalFiles?: number; + /** + * the total number of bytes to be added in the zip + */ + totalBytes?: number; + /** + * the current status of the download node creation + */ + status?: 'PENDING' | 'CANCELLED' | 'IN_PROGRESS' | 'DONE' | 'MAX_CONTENT_SIZE_EXCEEDED' | string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/downloadBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/downloadBodyCreate.ts new file mode 100644 index 0000000000..0479a9cac5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/downloadBodyCreate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface DownloadBodyCreate { + nodeIds: string[]; +} diff --git a/lib/js-api/src/api/content-rest-api/model/downloadEntry.ts b/lib/js-api/src/api/content-rest-api/model/downloadEntry.ts new file mode 100644 index 0000000000..d94ec2c4f0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/downloadEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Download } from './download'; + +export interface DownloadEntry { + entry: Download; +} diff --git a/lib/js-api/src/api/content-rest-api/model/errorError.ts b/lib/js-api/src/api/content-rest-api/model/errorError.ts new file mode 100644 index 0000000000..70e1e53f81 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/errorError.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ErrorError { + errorKey?: string; + statusCode: number; + briefSummary: string; + stackTrace: string; + descriptionURL: string; + logId?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/favorite.ts b/lib/js-api/src/api/content-rest-api/model/favorite.ts new file mode 100644 index 0000000000..705f091e5e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/favorite.ts @@ -0,0 +1,45 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +/** + * A favorite describes an Alfresco entity that a person has marked as a favorite. + * The target can be a site, file or folder. + */ +export class Favorite { + /** + * The guid of the object that is a favorite. + */ + targetGuid: string; + /** + * The time the object was made a favorite. + */ + createdAt?: Date; + target: any; + /** + * A subset of the target favorite properties, system properties and properties already available in the target are excluded. + */ + properties?: any; + + constructor(input?: Partial<Favorite>) { + if (input) { + Object.assign(this, input); + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/favoriteBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/favoriteBodyCreate.ts new file mode 100644 index 0000000000..56f6456e06 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/favoriteBodyCreate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FavoriteBodyCreate { + target: any; +} diff --git a/lib/js-api/src/api/content-rest-api/model/favoriteEntry.ts b/lib/js-api/src/api/content-rest-api/model/favoriteEntry.ts new file mode 100644 index 0000000000..4e19e28878 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/favoriteEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Favorite } from './favorite'; + +export class FavoriteEntry { + entry: Favorite; + + constructor(input?: Partial<FavoriteEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Favorite(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/favoritePaging.ts b/lib/js-api/src/api/content-rest-api/model/favoritePaging.ts new file mode 100644 index 0000000000..4f65b9b41d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/favoritePaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FavoritePagingList } from './favoritePagingList'; + +export class FavoritePaging { + list?: FavoritePagingList; + + constructor(input?: Partial<FavoritePaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new FavoritePagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/favoritePagingList.ts b/lib/js-api/src/api/content-rest-api/model/favoritePagingList.ts new file mode 100644 index 0000000000..0b22f9a218 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/favoritePagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FavoriteEntry } from './favoriteEntry'; +import { Pagination } from './pagination'; + +export class FavoritePagingList { + pagination: Pagination; + entries: FavoriteEntry[]; + + constructor(input?: Partial<FavoritePagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new FavoriteEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/favoriteSite.ts b/lib/js-api/src/api/content-rest-api/model/favoriteSite.ts new file mode 100644 index 0000000000..af12ed3a52 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/favoriteSite.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FavoriteSite { + id: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/favoriteSiteBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/favoriteSiteBodyCreate.ts new file mode 100644 index 0000000000..dd2bb90b77 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/favoriteSiteBodyCreate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FavoriteSiteBodyCreate { + id: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/favoriteSiteEntry.ts b/lib/js-api/src/api/content-rest-api/model/favoriteSiteEntry.ts new file mode 100644 index 0000000000..340a6423a9 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/favoriteSiteEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FavoriteSite } from './favoriteSite'; + +export interface FavoriteSiteEntry { + entry: FavoriteSite; +} diff --git a/lib/js-api/src/api/content-rest-api/model/group.ts b/lib/js-api/src/api/content-rest-api/model/group.ts new file mode 100644 index 0000000000..6fc1578298 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/group.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Group { + id?: string; + displayName?: string; + isRoot?: boolean; + parentIds?: string[]; + zones?: string[]; +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/groupBodyCreate.ts new file mode 100644 index 0000000000..1015c4a43d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupBodyCreate.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface GroupBodyCreate { + id: string; + displayName: string; + parentIds?: string[]; +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupBodyUpdate.ts b/lib/js-api/src/api/content-rest-api/model/groupBodyUpdate.ts new file mode 100644 index 0000000000..b7e0cd12f3 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupBodyUpdate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface GroupBodyUpdate { + displayName: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupEntry.ts b/lib/js-api/src/api/content-rest-api/model/groupEntry.ts new file mode 100644 index 0000000000..dea5238580 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Group } from './group'; + +export interface GroupEntry { + entry: Group; +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupMember.ts b/lib/js-api/src/api/content-rest-api/model/groupMember.ts new file mode 100644 index 0000000000..cc6391e75d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupMember.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface GroupMember { + id: string; + displayName: string; + memberType: 'GROUP' | 'PERSON' | string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupMemberEntry.ts b/lib/js-api/src/api/content-rest-api/model/groupMemberEntry.ts new file mode 100644 index 0000000000..095813075d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupMemberEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GroupMember } from './groupMember'; + +export interface GroupMemberEntry { + entry: GroupMember; +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupMemberPaging.ts b/lib/js-api/src/api/content-rest-api/model/groupMemberPaging.ts new file mode 100644 index 0000000000..1fbf9d0b1c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupMemberPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GroupMemberPagingList } from './groupMemberPagingList'; + +export class GroupMemberPaging { + list?: GroupMemberPagingList; + + constructor(input?: Partial<GroupMemberPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new GroupMemberPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupMemberPagingList.ts b/lib/js-api/src/api/content-rest-api/model/groupMemberPagingList.ts new file mode 100644 index 0000000000..86739b844d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupMemberPagingList.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GroupMemberEntry } from './groupMemberEntry'; +import { Pagination } from './pagination'; + +export class GroupMemberPagingList { + pagination?: Pagination; + entries?: GroupMemberEntry[]; + + constructor(input?: Partial<GroupMemberPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupMembershipBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/groupMembershipBodyCreate.ts new file mode 100644 index 0000000000..508e82b2f6 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupMembershipBodyCreate.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class GroupMembershipBodyCreate { + id: string; + memberType: GroupMembershipBodyCreate.MemberTypeEnum | string; + + constructor(input?: Partial<GroupMembershipBodyCreate>) { + if (input) { + Object.assign(this, input); + } + } + +} +export namespace GroupMembershipBodyCreate { + export type MemberTypeEnum = 'GROUP' | 'PERSON'; + export const MemberTypeEnum = { + GROUP: 'GROUP' as MemberTypeEnum, + PERSON: 'PERSON' as MemberTypeEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupPaging.ts b/lib/js-api/src/api/content-rest-api/model/groupPaging.ts new file mode 100644 index 0000000000..3256949c17 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GroupPagingList } from './groupPagingList'; + +export class GroupPaging { + list?: GroupPagingList; + + constructor(input?: Partial<GroupPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new GroupPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/groupPagingList.ts b/lib/js-api/src/api/content-rest-api/model/groupPagingList.ts new file mode 100644 index 0000000000..927cca0e65 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/groupPagingList.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GroupEntry } from './groupEntry'; +import { Pagination } from './pagination'; + +export class GroupPagingList { + pagination?: Pagination; + entries?: GroupEntry[]; + + constructor(input?: Partial<GroupPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/index.ts b/lib/js-api/src/api/content-rest-api/model/index.ts new file mode 100644 index 0000000000..2339fe1c89 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/index.ts @@ -0,0 +1,201 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './actionBodyExec'; +export * from './actionDefinition'; +export * from './actionDefinitionEntry'; +export * from './actionDefinitionList'; +export * from './actionDefinitionListList'; +export * from './actionExecResult'; +export * from './actionExecResultEntry'; +export * from './actionParameterDefinition'; +export * from './activity'; +export * from './activityEntry'; +export * from './activityPaging'; +export * from './activityPagingList'; +export * from './association'; +export * from './associationBody'; +export * from './associationEntry'; +export * from './associationInfo'; +export * from './auditApp'; +export * from './auditAppEntry'; +export * from './auditAppPaging'; +export * from './auditAppPagingList'; +export * from './auditBodyUpdate'; +export * from './auditEntry'; +export * from './auditEntryEntry'; +export * from './auditEntryPaging'; +export * from './auditEntryPagingList'; +export * from './capabilities'; +export * from './childAssociation'; +export * from './childAssociationBody'; +export * from './childAssociationEntry'; +export * from './childAssociationInfo'; +export * from './clientBody'; +export * from './category'; +export * from './categoryBody'; +export * from './categoryEntry'; +export * from './CategoryLinkBody'; +export * from './categoryPaging'; +export * from './categoryPagingList'; +export * from './comment'; +export * from './commentBody'; +export * from './commentEntry'; +export * from './commentPaging'; +export * from './commentPagingList'; +export * from './company'; +export * from './constraint'; +export * from './contentInfo'; +export * from './definition'; +export * from './deletedNodeBodyRestore'; +export * from './deletedNodeEntry'; +export * from './deletedNodesPaging'; +export * from './deletedNodesPagingList'; +export * from './directAccessUrl'; +export * from './directAccessUrlEntry'; +export * from './download'; +export * from './downloadBodyCreate'; +export * from './downloadEntry'; +export * from './errorError'; +export * from './favorite'; +export * from './favoriteBodyCreate'; +export * from './favoriteEntry'; +export * from './favoritePaging'; +export * from './favoritePagingList'; +export * from './favoriteSite'; +export * from './favoriteSiteBodyCreate'; +export * from './favoriteSiteEntry'; +export * from './group'; +export * from './groupBodyCreate'; +export * from './groupBodyUpdate'; +export * from './groupEntry'; +export * from './groupMember'; +export * from './groupMemberEntry'; +export * from './groupMemberPaging'; +export * from './groupMemberPagingList'; +export * from './groupMembershipBodyCreate'; +export * from './groupPaging'; +export * from './groupPagingList'; +export * from './modelError'; +export * from './networkQuota'; +export * from './node'; +export * from './nodeAssociationEntry'; +export * from './nodeAssociationPaging'; +export * from './nodeAssociationPagingList'; +export * from './nodeBodyCopy'; +export * from './nodeBodyCreate'; +export * from './nodeBodyCreateAssociation'; +export * from './nodeBodyLock'; +export * from './nodeBodyMove'; +export * from './nodeBodyUpdate'; +export * from './nodeChildAssociationEntry'; +export * from './nodeChildAssociationPaging'; +export * from './nodeChildAssociationPagingList'; +export * from './nodeEntry'; +export * from './nodePaging'; +export * from './nodePagingList'; +export * from './pagination'; +export * from './passwordResetBody'; +export * from './pathElement'; +export * from './pathInfo'; +export * from './permissionElement'; +export * from './permissionsBody'; +export * from './permissionsInfo'; +export * from './person'; +export * from './personBodyCreate'; +export * from './personBodyUpdate'; +export * from './personEntry'; +export * from './personNetwork'; +export * from './personNetworkEntry'; +export * from './personNetworkPaging'; +export * from './personNetworkPagingList'; +export * from './personPaging'; +export * from './personPagingList'; +export * from './preference'; +export * from './preferenceEntry'; +export * from './preferencePaging'; +export * from './preferencePagingList'; +export * from './probeEntry'; +export * from './probeEntryEntry'; +export * from './property'; +export * from './rating'; +export * from './ratingAggregate'; +export * from './ratingBody'; +export * from './ratingEntry'; +export * from './ratingPaging'; +export * from './ratingPagingList'; +export * from './rendition'; +export * from './renditionBodyCreate'; +export * from './renditionEntry'; +export * from './renditionPaging'; +export * from './renditionPagingList'; +export * from './revertBody'; +export * from './sharedLink'; +export * from './sharedLinkBodyCreate'; +export * from './sharedLinkBodyEmail'; +export * from './sharedLinkEntry'; +export * from './sharedLinkPaging'; +export * from './sharedLinkPagingList'; +export * from './site'; +export * from './siteBodyCreate'; +export * from './siteBodyUpdate'; +export * from './siteContainer'; +export * from './siteContainerEntry'; +export * from './siteContainerPaging'; +export * from './siteContainerPagingList'; +export * from './siteEntry'; +export * from './siteMember'; +export * from './siteMemberEntry'; +export * from './siteMemberPaging'; +export * from './siteMemberPagingList'; +export * from './siteGroup'; +export * from './siteGroupEntry'; +export * from './siteGroupPaging'; +export * from './siteGroupPagingList'; +export * from './siteMembershipApprovalBody'; +export * from './siteMembershipBodyCreate'; +export * from './siteMembershipBodyUpdate'; +export * from './siteMembershipRejectionBody'; +export * from './siteMembershipRequest'; +export * from './siteMembershipRequestBodyCreate'; +export * from './siteMembershipRequestBodyUpdate'; +export * from './siteMembershipRequestEntry'; +export * from './siteMembershipRequestPaging'; +export * from './siteMembershipRequestPagingList'; +export * from './siteMembershipRequestWithPerson'; +export * from './siteMembershipRequestWithPersonEntry'; +export * from './siteMembershipRequestWithPersonPaging'; +export * from './siteMembershipRequestWithPersonPagingList'; +export * from './sitePaging'; +export * from './sitePagingList'; +export * from './siteRole'; +export * from './siteRoleEntry'; +export * from './siteRolePaging'; +export * from './siteRolePagingList'; +export * from './tag'; +export * from './tagBody'; +export * from './tagEntry'; +export * from './tagPaging'; +export * from './tagPagingList'; +export * from './userInfo'; +export * from './version'; +export * from './versionEntry'; +export * from './versionPaging'; +export * from './versionPagingList'; +export * from './deletedNode'; +export * from './nodeAssociation'; +export * from './nodeChildAssociation'; diff --git a/lib/js-api/src/api/content-rest-api/model/modelError.ts b/lib/js-api/src/api/content-rest-api/model/modelError.ts new file mode 100644 index 0000000000..627a167056 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/modelError.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ErrorError } from './errorError'; + +export interface ModelError { + error?: ErrorError; +} diff --git a/lib/js-api/src/api/content-rest-api/model/networkQuota.ts b/lib/js-api/src/api/content-rest-api/model/networkQuota.ts new file mode 100644 index 0000000000..c7ad79d2a3 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/networkQuota.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Limits and usage of each quota. A network will have quotas for File space, + * the number of sites in the network, the number of people in the network, + * and the number of network administrators + */ +export interface NetworkQuota { + id: string; + limit: number; + usage: number; +} diff --git a/lib/js-api/src/api/content-rest-api/model/node.ts b/lib/js-api/src/api/content-rest-api/model/node.ts new file mode 100644 index 0000000000..f7242054f7 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/node.ts @@ -0,0 +1,63 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ContentInfo } from './contentInfo'; +import { DateAlfresco } from '../../content-custom-api'; +import { Definition } from './definition'; +import { PathInfo } from './pathInfo'; +import { PermissionsInfo } from './permissionsInfo'; +import { UserInfo } from './userInfo'; + +export class Node { + id: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isFolder: boolean; + isFile: boolean; + isLocked?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + parentId?: string; + isLink?: boolean; + isFavorite?: boolean; + content?: ContentInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + permissions?: PermissionsInfo; + definition?: Definition; + + constructor(input?: Partial<Node>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.permissions = input.permissions ? new PermissionsInfo(input.permissions) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeAssociation.ts b/lib/js-api/src/api/content-rest-api/model/nodeAssociation.ts new file mode 100644 index 0000000000..432492c57d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeAssociation.ts @@ -0,0 +1,65 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AssociationInfo } from './associationInfo'; +import { ContentInfo } from './contentInfo'; +import { DateAlfresco } from '../../content-custom-api'; +import { Definition } from './definition'; +import { PathInfo } from './pathInfo'; +import { PermissionsInfo } from './permissionsInfo'; +import { UserInfo } from './userInfo'; + +export class NodeAssociation { + id: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isFolder: boolean; + isFile: boolean; + isLocked?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + parentId?: string; + isLink?: boolean; + isFavorite?: boolean; + content?: ContentInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + permissions?: PermissionsInfo; + definition?: Definition; + association?: AssociationInfo; + + constructor(input?: Partial<NodeAssociation>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.permissions = input.permissions ? new PermissionsInfo(input.permissions) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeAssociationEntry.ts b/lib/js-api/src/api/content-rest-api/model/nodeAssociationEntry.ts new file mode 100644 index 0000000000..ec6d8255c7 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeAssociationEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeAssociation } from './nodeAssociation'; + +export class NodeAssociationEntry { + entry: NodeAssociation; + + constructor(input?: Partial<NodeAssociationEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new NodeAssociation(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeAssociationPaging.ts b/lib/js-api/src/api/content-rest-api/model/nodeAssociationPaging.ts new file mode 100644 index 0000000000..7191029430 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeAssociationPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeAssociationPagingList } from './nodeAssociationPagingList'; + +export class NodeAssociationPaging { + list?: NodeAssociationPagingList; + + constructor(input?: Partial<NodeAssociationPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new NodeAssociationPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeAssociationPagingList.ts b/lib/js-api/src/api/content-rest-api/model/nodeAssociationPagingList.ts new file mode 100644 index 0000000000..5c471474ef --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeAssociationPagingList.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Node } from './node'; +import { NodeAssociationEntry } from './nodeAssociationEntry'; +import { Pagination } from './pagination'; + +export class NodeAssociationPagingList { + pagination?: Pagination; + entries?: NodeAssociationEntry[]; + source?: Node; + + constructor(input?: Partial<NodeAssociationPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new NodeAssociationEntry(item)); + } + this.source = input.source ? new Node(input.source) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeBodyCopy.ts b/lib/js-api/src/api/content-rest-api/model/nodeBodyCopy.ts new file mode 100644 index 0000000000..76c1c29304 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeBodyCopy.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface NodeBodyCopy { + targetParentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/nodeBodyCreate.ts new file mode 100644 index 0000000000..f7466060f9 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeBodyCreate.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AssociationBody } from './associationBody'; +import { ChildAssociationBody } from './childAssociationBody'; +import { Definition } from './definition'; +import { NodeBodyCreateAssociation } from './nodeBodyCreateAssociation'; +import { PermissionsBody } from './permissionsBody'; + +export class NodeBodyCreate { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + aspectNames?: string[]; + properties?: any; + permissions?: PermissionsBody; + definition?: Definition; + relativePath?: string; + association?: NodeBodyCreateAssociation; + secondaryChildren?: ChildAssociationBody[]; + targets?: AssociationBody[]; + + constructor(input?: Partial<NodeBodyCreate>) { + if (input) { + Object.assign(this, input); + this.permissions = input.permissions ? new PermissionsBody(input.permissions) : undefined; + if (input.secondaryChildren) { + this.secondaryChildren = input.secondaryChildren.map((item) => new ChildAssociationBody(item)); + } + if (input.targets) { + this.targets = input.targets.map((item) => new AssociationBody(item)); + } + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeBodyCreateAssociation.ts b/lib/js-api/src/api/content-rest-api/model/nodeBodyCreateAssociation.ts new file mode 100644 index 0000000000..57cbde53bd --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeBodyCreateAssociation.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface NodeBodyCreateAssociation { + assocType?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeBodyLock.ts b/lib/js-api/src/api/content-rest-api/model/nodeBodyLock.ts new file mode 100644 index 0000000000..f22dc50d49 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeBodyLock.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface NodeBodyLock { + timeToExpire?: number; + type?: 'ALLOW_OWNER_CHANGES' | 'FULL' | string; + lifetime?: 'PERSISTENT' | 'EPHEMERAL' | string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeBodyMove.ts b/lib/js-api/src/api/content-rest-api/model/nodeBodyMove.ts new file mode 100644 index 0000000000..d9f43e27ef --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeBodyMove.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface NodeBodyMove { + targetParentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeBodyUpdate.ts b/lib/js-api/src/api/content-rest-api/model/nodeBodyUpdate.ts new file mode 100644 index 0000000000..e4ec1f0a20 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeBodyUpdate.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PermissionsBody } from './permissionsBody'; + +export class NodeBodyUpdate { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name?: string; + nodeType?: string; + aspectNames?: string[]; + properties?: { [key: string]: string }; + permissions?: PermissionsBody; + + constructor(input?: Partial<NodeBodyUpdate>) { + if (input) { + Object.assign(this, input); + this.permissions = input.permissions ? new PermissionsBody(input.permissions) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeChildAssociation.ts b/lib/js-api/src/api/content-rest-api/model/nodeChildAssociation.ts new file mode 100644 index 0000000000..00c60123b9 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeChildAssociation.ts @@ -0,0 +1,66 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChildAssociationInfo } from './childAssociationInfo'; +import { ContentInfo } from './contentInfo'; +import { DateAlfresco } from '../../content-custom-api'; +import { Definition } from './definition'; +import { PathInfo } from './pathInfo'; +import { PermissionsInfo } from './permissionsInfo'; +import { UserInfo } from './userInfo'; + +export class NodeChildAssociation { + id: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isFolder: boolean; + isFile: boolean; + isLocked?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + parentId?: string; + isLink?: boolean; + isFavorite?: boolean; + content?: ContentInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + permissions?: PermissionsInfo; + definition?: Definition; + association?: ChildAssociationInfo; + + constructor(input?: Partial<NodeChildAssociation>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.permissions = input.permissions ? new PermissionsInfo(input.permissions) : undefined; + this.association = input.association ? new ChildAssociationInfo(input.association) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationEntry.ts b/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationEntry.ts new file mode 100644 index 0000000000..b8c8ce09fc --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeChildAssociation } from './nodeChildAssociation'; + +export class NodeChildAssociationEntry { + entry: NodeChildAssociation; + + constructor(input?: Partial<NodeChildAssociationEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new NodeChildAssociation(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationPaging.ts b/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationPaging.ts new file mode 100644 index 0000000000..80b73537d3 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeChildAssociationPagingList } from './nodeChildAssociationPagingList'; + +export class NodeChildAssociationPaging { + list?: NodeChildAssociationPagingList; + + constructor(input?: Partial<NodeChildAssociationPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new NodeChildAssociationPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationPagingList.ts b/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationPagingList.ts new file mode 100644 index 0000000000..a722457f73 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeChildAssociationPagingList.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Node } from './node'; +import { NodeChildAssociationEntry } from './nodeChildAssociationEntry'; +import { Pagination } from './pagination'; + +export class NodeChildAssociationPagingList { + pagination?: Pagination; + entries?: NodeChildAssociationEntry[]; + source?: Node; + + constructor(input?: Partial<NodeChildAssociationPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new NodeChildAssociationEntry(item)); + } + this.source = input.source ? new Node(input.source) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodeEntry.ts b/lib/js-api/src/api/content-rest-api/model/nodeEntry.ts new file mode 100644 index 0000000000..93fb7603c4 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodeEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Node } from './node'; + +export class NodeEntry { + entry: Node; + + constructor(input?: Partial<NodeEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Node(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodePaging.ts b/lib/js-api/src/api/content-rest-api/model/nodePaging.ts new file mode 100644 index 0000000000..929c00bdc9 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodePaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodePagingList } from './nodePagingList'; + +export class NodePaging { + list?: NodePagingList; + + constructor(input?: Partial<NodePaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new NodePagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/nodePagingList.ts b/lib/js-api/src/api/content-rest-api/model/nodePagingList.ts new file mode 100644 index 0000000000..d1de8d0dfb --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/nodePagingList.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Node } from './node'; +import { NodeEntry } from './nodeEntry'; +import { Pagination } from './pagination'; + +export class NodePagingList { + pagination?: Pagination; + entries?: NodeEntry[]; + source?: Node; + + constructor(input?: Partial<NodePagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new NodeEntry(item)); + } + this.source = input.source ? new Node(input.source) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/pagination.ts b/lib/js-api/src/api/content-rest-api/model/pagination.ts new file mode 100644 index 0000000000..4c32c49547 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/pagination.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class Pagination { + /** + * The number of objects in the entries array. + */ + count?: number; + /** + * A boolean value which is **true** if there are more entities in the collection + * beyond those in this response. A true value means a request with a larger value + * for the **skipCount** or the **maxItems** parameter will return more entities. + */ + hasMoreItems?: boolean; + /** + * An integer describing the total number of entities in the collection. + * The API might not be able to determine this value, + * in which case this property will not be present. + */ + totalItems?: number; + /** + * An integer describing how many entities exist in the collection before + * those included in this list. If there was no **skipCount** parameter then the + * default value is 0. + */ + skipCount?: number; + /** + * The value of the **maxItems** parameter used to generate this list. + * If there was no **maxItems** parameter then the default value is 100. + */ + maxItems?: number; + + constructor(input?: Partial<Pagination>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/passwordResetBody.ts b/lib/js-api/src/api/content-rest-api/model/passwordResetBody.ts new file mode 100644 index 0000000000..36202d3e14 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/passwordResetBody.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface PasswordResetBody { + /** + * the new password + */ + password: string; + /** + * the workflow id provided in the reset password email + */ + id: string; + /** + * the workflow key provided in the reset password email + */ + key: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/pathElement.ts b/lib/js-api/src/api/content-rest-api/model/pathElement.ts new file mode 100644 index 0000000000..2c13a1c34b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/pathElement.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface PathElement { + id?: string; + name?: string; + nodeType?: string; + aspectNames?: string[]; +} diff --git a/lib/js-api/src/api/content-rest-api/model/pathInfo.ts b/lib/js-api/src/api/content-rest-api/model/pathInfo.ts new file mode 100644 index 0000000000..87068a2c2d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/pathInfo.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PathElement } from './pathElement'; + +export class PathInfo { + elements?: PathElement[]; + name?: string; + isComplete?: boolean; + + constructor(input?: Partial<PathInfo>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/permissionElement.ts b/lib/js-api/src/api/content-rest-api/model/permissionElement.ts new file mode 100644 index 0000000000..8032aa97cd --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/permissionElement.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class PermissionElement { + authorityId?: string; + name?: string; + accessStatus?: 'ALLOWED' | 'DENIED' | string; + + constructor(input?: Partial<PermissionElement>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/permissionsBody.ts b/lib/js-api/src/api/content-rest-api/model/permissionsBody.ts new file mode 100644 index 0000000000..cceee39a90 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/permissionsBody.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PermissionElement } from './permissionElement'; + +export class PermissionsBody { + isInheritanceEnabled?: boolean; + locallySet?: PermissionElement[]; + + constructor(input?: Partial<PermissionsBody>) { + if (input) { + Object.assign(this, input); + if (input.locallySet) { + this.locallySet = input.locallySet.map((item) => new PermissionElement(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/permissionsInfo.ts b/lib/js-api/src/api/content-rest-api/model/permissionsInfo.ts new file mode 100644 index 0000000000..6c5c10f9ff --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/permissionsInfo.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PermissionElement } from './permissionElement'; + +export class PermissionsInfo { + isInheritanceEnabled?: boolean; + inherited?: PermissionElement[]; + locallySet?: PermissionElement[]; + settable?: string[]; + + constructor(input?: Partial<PermissionsInfo>) { + if (input) { + Object.assign(this, input); + if (input.inherited) { + this.inherited = input.inherited.map((item) => new PermissionElement(item)); + } + if (input.locallySet) { + this.locallySet = input.locallySet.map((item) => new PermissionElement(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/person.ts b/lib/js-api/src/api/content-rest-api/model/person.ts new file mode 100644 index 0000000000..c7dfd3a666 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/person.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Capabilities } from './capabilities'; +import { Company } from './company'; +import { DateAlfresco } from '../../content-custom-api'; + +export class Person { + id: string; + firstName: string; + lastName?: string; + displayName?: string; + description?: string; + avatarId?: string; + email: string; + skypeId?: string; + googleId?: string; + instantMessageId?: string; + jobTitle?: string; + location?: string; + company?: Company; + mobile?: string; + telephone?: string; + statusUpdatedAt?: Date; + userStatus?: string; + enabled: boolean; + emailNotificationsEnabled?: boolean; + aspectNames?: string[]; + properties?: { [key: string]: string }; + capabilities?: Capabilities; + + constructor(input?: Partial<Person>) { + if (input) { + Object.assign(this, input); + this.statusUpdatedAt = input.statusUpdatedAt ? DateAlfresco.parseDate(input.statusUpdatedAt) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/personBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/personBodyCreate.ts new file mode 100644 index 0000000000..d233cbc4de --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personBodyCreate.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Company } from './company'; + +export interface PersonBodyCreate { + id: string; + firstName: string; + lastName?: string; + description?: string; + email: string; + skypeId?: string; + googleId?: string; + instantMessageId?: string; + jobTitle?: string; + location?: string; + company?: Company; + mobile?: string; + telephone?: string; + userStatus?: string; + enabled?: boolean; + emailNotificationsEnabled?: boolean; + password: string; + aspectNames?: string[]; + properties?: any; +} diff --git a/lib/js-api/src/api/content-rest-api/model/personBodyUpdate.ts b/lib/js-api/src/api/content-rest-api/model/personBodyUpdate.ts new file mode 100644 index 0000000000..2859f9d5fe --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personBodyUpdate.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Company } from './company'; + +export interface PersonBodyUpdate { + firstName?: string; + lastName?: string; + description?: string; + email?: string; + skypeId?: string; + googleId?: string; + instantMessageId?: string; + jobTitle?: string; + location?: string; + company?: Company; + mobile?: string; + telephone?: string; + userStatus?: string; + enabled?: boolean; + emailNotificationsEnabled?: boolean; + password?: string; + oldPassword?: string; + aspectNames?: string[]; + properties?: any; +} diff --git a/lib/js-api/src/api/content-rest-api/model/personEntry.ts b/lib/js-api/src/api/content-rest-api/model/personEntry.ts new file mode 100644 index 0000000000..c7f598e2b3 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Person } from './person'; + +export class PersonEntry { + entry: Person; + + constructor(input?: Partial<PersonEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Person(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/personNetwork.ts b/lib/js-api/src/api/content-rest-api/model/personNetwork.ts new file mode 100644 index 0000000000..928a6d1da1 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personNetwork.ts @@ -0,0 +1,47 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { NetworkQuota } from './networkQuota'; + +/** + * A network is the group of users and sites that belong to an organization. + * Networks are organized by email domain. When a user signs up for an + * Alfresco account , their email domain becomes their Home Network. + */ +export class PersonNetwork { + /** + * This network's unique id + */ + id: string; + /** + * Is this the home network? + */ + homeNetwork?: boolean; + isEnabled: boolean; + createdAt?: Date; + paidNetwork?: boolean; + subscriptionLevel?: 'Free' | 'Standard' | 'Enterprise' | string; + quotas?: NetworkQuota[]; + + constructor(input?: Partial<PersonNetwork>) { + if (input) { + Object.assign(this, input); + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/personNetworkEntry.ts b/lib/js-api/src/api/content-rest-api/model/personNetworkEntry.ts new file mode 100644 index 0000000000..37aac7197f --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personNetworkEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PersonNetwork } from './personNetwork'; + +export class PersonNetworkEntry { + entry: PersonNetwork; + + constructor(input?: Partial<PersonNetworkEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new PersonNetwork(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/personNetworkPaging.ts b/lib/js-api/src/api/content-rest-api/model/personNetworkPaging.ts new file mode 100644 index 0000000000..113ed8b147 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personNetworkPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PersonNetworkPagingList } from './personNetworkPagingList'; + +export class PersonNetworkPaging { + list?: PersonNetworkPagingList; + + constructor(input?: Partial<PersonNetworkPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new PersonNetworkPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/personNetworkPagingList.ts b/lib/js-api/src/api/content-rest-api/model/personNetworkPagingList.ts new file mode 100644 index 0000000000..87e9ef4d48 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personNetworkPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { PersonNetworkEntry } from './personNetworkEntry'; + +export class PersonNetworkPagingList { + pagination: Pagination; + entries: PersonNetworkEntry[]; + + constructor(input?: Partial<PersonNetworkPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new PersonNetworkEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/personPaging.ts b/lib/js-api/src/api/content-rest-api/model/personPaging.ts new file mode 100644 index 0000000000..960531b452 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PersonPagingList } from './personPagingList'; + +export class PersonPaging { + list?: PersonPagingList; + + constructor(input?: Partial<PersonPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new PersonPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/personPagingList.ts b/lib/js-api/src/api/content-rest-api/model/personPagingList.ts new file mode 100644 index 0000000000..197ff17299 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/personPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { PersonEntry } from './personEntry'; + +export class PersonPagingList { + pagination?: Pagination; + entries?: PersonEntry[]; + + constructor(input?: Partial<PersonPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new PersonEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/preference.ts b/lib/js-api/src/api/content-rest-api/model/preference.ts new file mode 100644 index 0000000000..7a6a2fa963 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/preference.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A specific preference. + */ +export interface Preference { + /** + * The unique id of the preference + */ + id: string; + /** + * The value of the preference. Note that this can be of any JSON type. + */ + value?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/preferenceEntry.ts b/lib/js-api/src/api/content-rest-api/model/preferenceEntry.ts new file mode 100644 index 0000000000..ef275f072c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/preferenceEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Preference } from './preference'; + +export interface PreferenceEntry { + entry: Preference; +} diff --git a/lib/js-api/src/api/content-rest-api/model/preferencePaging.ts b/lib/js-api/src/api/content-rest-api/model/preferencePaging.ts new file mode 100644 index 0000000000..24792d9a02 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/preferencePaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PreferencePagingList } from './preferencePagingList'; + +export class PreferencePaging { + list?: PreferencePagingList; + + constructor(input?: Partial<PreferencePaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new PreferencePagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/preferencePagingList.ts b/lib/js-api/src/api/content-rest-api/model/preferencePagingList.ts new file mode 100644 index 0000000000..8803b3f3f8 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/preferencePagingList.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { PreferenceEntry } from './preferenceEntry'; + +export class PreferencePagingList { + pagination: Pagination; + entries: PreferenceEntry[]; + + constructor(input?: Partial<PreferencePagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/probeEntry.ts b/lib/js-api/src/api/content-rest-api/model/probeEntry.ts new file mode 100644 index 0000000000..bf085e1bc1 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/probeEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ProbeEntryEntry } from './probeEntryEntry'; + +export interface ProbeEntry { + entry?: ProbeEntryEntry; +} diff --git a/lib/js-api/src/api/content-rest-api/model/probeEntryEntry.ts b/lib/js-api/src/api/content-rest-api/model/probeEntryEntry.ts new file mode 100644 index 0000000000..19f450957d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/probeEntryEntry.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ProbeEntryEntry { + message: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/property.ts b/lib/js-api/src/api/content-rest-api/model/property.ts new file mode 100644 index 0000000000..8bd5d6c5ab --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/property.ts @@ -0,0 +1,58 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Constraint } from './constraint'; + +export interface Property { + id: string; + /** + * the human-readable title + */ + title?: string; + /** + * the human-readable description + */ + description?: string; + /** + * the default value + */ + defaultValue?: string; + /** + * the name of the property type (i.g. d:text) + */ + dataType?: string; + /** + * define if the property is multi-valued + */ + isMultiValued?: boolean; + /** + * define if the property is mandatory + */ + isMandatory?: boolean; + /** + * define if the presence of mandatory properties is enforced + */ + isMandatoryEnforced?: boolean; + /** + * define if the property is system maintained + */ + isProtected?: boolean; + /** + * list of constraints defined for the property + */ + constraints?: Constraint[]; +} diff --git a/lib/js-api/src/api/content-rest-api/model/rating.ts b/lib/js-api/src/api/content-rest-api/model/rating.ts new file mode 100644 index 0000000000..aedc3ace07 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/rating.ts @@ -0,0 +1,41 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { RatingAggregate } from './ratingAggregate'; + +/** + * A person can rate an item of content by liking it. They can also remove + * their like of an item of content. API methods exist to get a list of + * ratings and to add a new rating. + */ +export class Rating { + id: string; + aggregate?: RatingAggregate; + ratedAt?: Date; + /** + * The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. + */ + myRating?: string; + + constructor(input?: Partial<Rating>) { + if (input) { + Object.assign(this, input); + this.ratedAt = input.ratedAt ? DateAlfresco.parseDate(input.ratedAt) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/ratingAggregate.ts b/lib/js-api/src/api/content-rest-api/model/ratingAggregate.ts new file mode 100644 index 0000000000..c13bb9d42d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/ratingAggregate.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RatingAggregate { + numberOfRatings: number; + average?: number; +} diff --git a/lib/js-api/src/api/content-rest-api/model/ratingBody.ts b/lib/js-api/src/api/content-rest-api/model/ratingBody.ts new file mode 100644 index 0000000000..edf58128c3 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/ratingBody.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RatingBody { + /** + * The rating scheme type. Possible values are likes and fiveStar. + */ + id: 'likes' | 'fiveStar' | string; + /** + * The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar + */ + myRating: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/ratingEntry.ts b/lib/js-api/src/api/content-rest-api/model/ratingEntry.ts new file mode 100644 index 0000000000..8790065dfb --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/ratingEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Rating } from './rating'; + +export class RatingEntry { + entry: Rating; + + constructor(input?: Partial<RatingEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Rating(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/ratingPaging.ts b/lib/js-api/src/api/content-rest-api/model/ratingPaging.ts new file mode 100644 index 0000000000..d7940f45c5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/ratingPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RatingPagingList } from './ratingPagingList'; + +export class RatingPaging { + list?: RatingPagingList; + + constructor(input?: Partial<RatingPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new RatingPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/ratingPagingList.ts b/lib/js-api/src/api/content-rest-api/model/ratingPagingList.ts new file mode 100644 index 0000000000..7cf3f2a00c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/ratingPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { RatingEntry } from './ratingEntry'; + +export class RatingPagingList { + pagination: Pagination; + entries: RatingEntry[]; + + constructor(input?: Partial<RatingPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new RatingEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/rendition.ts b/lib/js-api/src/api/content-rest-api/model/rendition.ts new file mode 100644 index 0000000000..2bc27d555b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/rendition.ts @@ -0,0 +1,39 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ContentInfo } from './contentInfo'; + +export class Rendition { + id?: string; + content?: ContentInfo; + status?: Rendition.StatusEnum | string; + + constructor(input?: Partial<Rendition>) { + if (input) { + Object.assign(this, input); + this.content = input.content ? new ContentInfo(input.content) : undefined; + } + } + +} +export namespace Rendition { + export type StatusEnum = 'CREATED' | 'NOT_CREATED'; + export const StatusEnum = { + CREATED: 'CREATED' as StatusEnum, + NOTCREATED: 'NOT_CREATED' as StatusEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/renditionBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/renditionBodyCreate.ts new file mode 100644 index 0000000000..f0693cbc9c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/renditionBodyCreate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RenditionBodyCreate { + id: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/renditionEntry.ts b/lib/js-api/src/api/content-rest-api/model/renditionEntry.ts new file mode 100644 index 0000000000..519681199e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/renditionEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Rendition } from './rendition'; + +export class RenditionEntry { + entry: Rendition; + + constructor(input?: Partial<RenditionEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Rendition(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/renditionPaging.ts b/lib/js-api/src/api/content-rest-api/model/renditionPaging.ts new file mode 100644 index 0000000000..fdbf115edf --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/renditionPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RenditionPagingList } from './renditionPagingList'; + +export class RenditionPaging { + list?: RenditionPagingList; + + constructor(input?: Partial<RenditionPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new RenditionPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/renditionPagingList.ts b/lib/js-api/src/api/content-rest-api/model/renditionPagingList.ts new file mode 100644 index 0000000000..1637f46ee0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/renditionPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { RenditionEntry } from './renditionEntry'; + +export class RenditionPagingList { + pagination?: Pagination; + entries?: RenditionEntry[]; + + constructor(input?: Partial<RenditionPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item: any) => new RenditionEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/revertBody.ts b/lib/js-api/src/api/content-rest-api/model/revertBody.ts new file mode 100644 index 0000000000..55634f3de3 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/revertBody.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RevertBody { + majorVersion?: boolean; + comment?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/sharedLink.ts b/lib/js-api/src/api/content-rest-api/model/sharedLink.ts new file mode 100644 index 0000000000..aeb87560bd --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/sharedLink.ts @@ -0,0 +1,63 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ContentInfo } from './contentInfo'; +import { DateAlfresco } from '../../content-custom-api'; +import { UserInfo } from './userInfo'; + +export class SharedLink { + id?: string; + expiresAt?: Date; + nodeId?: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name?: string; + title?: string; + description?: string; + modifiedAt?: Date; + modifiedByUser?: UserInfo; + sharedByUser?: UserInfo; + content?: ContentInfo; + /** + * The allowable operations for the `Quickshare` link itself. See allowableOperationsOnTarget for the + * allowable operations pertaining to the linked content node. + */ + allowableOperations?: string[]; + /** + * The allowable operations for the content node being shared. + */ + allowableOperationsOnTarget?: string[]; + isFavorite?: boolean; + /** + * A subset of the target node's properties, system properties and properties already available in the SharedLink are excluded. + */ + properties?: any; + aspectNames?: string[]; + + constructor(input?: Partial<SharedLink>) { + if (input) { + Object.assign(this, input); + this.expiresAt = input.expiresAt ? DateAlfresco.parseDate(input.expiresAt) : undefined; + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.sharedByUser = input.sharedByUser ? new UserInfo(input.sharedByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/sharedLinkBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/sharedLinkBodyCreate.ts new file mode 100644 index 0000000000..f415cdab32 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/sharedLinkBodyCreate.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export class SharedLinkBodyCreate { + nodeId: string; + expiresAt?: Date; + + constructor(input?: Partial<SharedLinkBodyCreate>) { + if (input) { + Object.assign(this, input); + this.expiresAt = input.expiresAt ? DateAlfresco.parseDate(input.expiresAt) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/sharedLinkBodyEmail.ts b/lib/js-api/src/api/content-rest-api/model/sharedLinkBodyEmail.ts new file mode 100644 index 0000000000..52971f76a5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/sharedLinkBodyEmail.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SharedLinkBodyEmail { + client?: string; + message?: string; + locale?: string; + recipientEmails?: string[]; +} diff --git a/lib/js-api/src/api/content-rest-api/model/sharedLinkEntry.ts b/lib/js-api/src/api/content-rest-api/model/sharedLinkEntry.ts new file mode 100644 index 0000000000..6b39bdb4b7 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/sharedLinkEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SharedLink } from './sharedLink'; + +export class SharedLinkEntry { + entry: SharedLink; + + constructor(input?: Partial<SharedLinkEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new SharedLink(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/sharedLinkPaging.ts b/lib/js-api/src/api/content-rest-api/model/sharedLinkPaging.ts new file mode 100644 index 0000000000..8c5db86a84 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/sharedLinkPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SharedLinkPagingList } from './sharedLinkPagingList'; + +export class SharedLinkPaging { + list?: SharedLinkPagingList; + + constructor(input?: Partial<SharedLinkPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new SharedLinkPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/sharedLinkPagingList.ts b/lib/js-api/src/api/content-rest-api/model/sharedLinkPagingList.ts new file mode 100644 index 0000000000..9e6f1cf581 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/sharedLinkPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { SharedLinkEntry } from './sharedLinkEntry'; + +export class SharedLinkPagingList { + pagination: Pagination; + entries: SharedLinkEntry[]; + + constructor(input?: Partial<SharedLinkPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new SharedLinkEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/site.ts b/lib/js-api/src/api/content-rest-api/model/site.ts new file mode 100644 index 0000000000..7d400850b0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/site.ts @@ -0,0 +1,48 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class Site { + id: string; + guid: string; + title: string; + description?: string; + visibility: Site.VisibilityEnum | string; + preset?: string; + role?: Site.RoleEnum | string; + + constructor(input?: Partial<Site>) { + if (input) { + Object.assign(this, input); + } + } + +} +export namespace Site { + export type VisibilityEnum = 'PRIVATE' | 'MODERATED' | 'PUBLIC'; + export const VisibilityEnum = { + PRIVATE: 'PRIVATE' as VisibilityEnum, + MODERATED: 'MODERATED' as VisibilityEnum, + PUBLIC: 'PUBLIC' as VisibilityEnum + }; + export type RoleEnum = 'SiteConsumer' | 'SiteCollaborator' | 'SiteContributor' | 'SiteManager'; + export const RoleEnum = { + SiteConsumer: 'SiteConsumer' as RoleEnum, + SiteCollaborator: 'SiteCollaborator' as RoleEnum, + SiteContributor: 'SiteContributor' as RoleEnum, + SiteManager: 'SiteManager' as RoleEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/siteBodyCreate.ts new file mode 100644 index 0000000000..a4bd9ceda8 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteBodyCreate.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class SiteBodyCreate { + id?: string; + title: string; + description?: string; + visibility: SiteBodyCreate.VisibilityEnum | string; + + constructor(input?: Partial<SiteBodyCreate>) { + if (input) { + Object.assign(this, input); + } + } + +} +export namespace SiteBodyCreate { + export type VisibilityEnum = 'PUBLIC' | 'PRIVATE' | 'MODERATED'; + export const VisibilityEnum = { + PUBLIC: 'PUBLIC' as VisibilityEnum, + PRIVATE: 'PRIVATE' as VisibilityEnum, + MODERATED: 'MODERATED' as VisibilityEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteBodyUpdate.ts b/lib/js-api/src/api/content-rest-api/model/siteBodyUpdate.ts new file mode 100644 index 0000000000..3041955d32 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteBodyUpdate.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class SiteBodyUpdate { + title?: string; + description?: string; + visibility?: SiteBodyUpdate.VisibilityEnum | string; + + constructor(input?: Partial<SiteBodyUpdate>) { + if (input) { + Object.assign(this, input); + } + } + +} +export namespace SiteBodyUpdate { + export type VisibilityEnum = 'PRIVATE' | 'MODERATED' | 'PUBLIC'; + export const VisibilityEnum = { + PRIVATE: 'PRIVATE' as VisibilityEnum, + MODERATED: 'MODERATED' as VisibilityEnum, + PUBLIC: 'PUBLIC' as VisibilityEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteContainer.ts b/lib/js-api/src/api/content-rest-api/model/siteContainer.ts new file mode 100644 index 0000000000..430456eae6 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteContainer.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SiteContainer { + id: string; + folderId: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteContainerEntry.ts b/lib/js-api/src/api/content-rest-api/model/siteContainerEntry.ts new file mode 100644 index 0000000000..56039b47c1 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteContainerEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteContainer } from './siteContainer'; + +export interface SiteContainerEntry { + entry: SiteContainer; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteContainerPaging.ts b/lib/js-api/src/api/content-rest-api/model/siteContainerPaging.ts new file mode 100644 index 0000000000..5ab49bf919 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteContainerPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteContainerPagingList } from './siteContainerPagingList'; + +export class SiteContainerPaging { + list?: SiteContainerPagingList; + + constructor(input?: Partial<SiteContainerPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new SiteContainerPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteContainerPagingList.ts b/lib/js-api/src/api/content-rest-api/model/siteContainerPagingList.ts new file mode 100644 index 0000000000..5ee6489b39 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteContainerPagingList.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { SiteContainerEntry } from './siteContainerEntry'; + +export class SiteContainerPagingList { + pagination: Pagination; + entries: SiteContainerEntry[]; + + constructor(input?: Partial<SiteContainerPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteEntry.ts b/lib/js-api/src/api/content-rest-api/model/siteEntry.ts new file mode 100644 index 0000000000..354685cd6c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteEntry.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Site } from './site'; +import { SiteEntryRelations } from './siteEntryRelations'; + +export class SiteEntry { + entry: Site; + relations?: SiteEntryRelations; + + constructor(input?: Partial<SiteEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Site(input.entry) : undefined; + this.relations = input.relations ? new SiteEntryRelations(input.relations) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteEntryRelations.ts b/lib/js-api/src/api/content-rest-api/model/siteEntryRelations.ts new file mode 100644 index 0000000000..c240114298 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteEntryRelations.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteMemberPaging } from './siteMemberPaging'; + +export class SiteEntryRelations { + members: SiteMemberPaging; + + constructor(input?: Partial<SiteEntryRelations>) { + if (input) { + Object.assign(this, input); + this.members = input.members ? new SiteMemberPaging(input.members) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteGroup.ts b/lib/js-api/src/api/content-rest-api/model/siteGroup.ts new file mode 100644 index 0000000000..51cb184a8b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteGroup.ts @@ -0,0 +1,39 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GroupMember } from './groupMember'; + +export class SiteGroup { + id: string; + group: GroupMember; + role: SiteGroup.RoleEnum | string; + + constructor(input?: Partial<SiteGroup>) { + if (input) { + Object.assign(this, input); + } + } +} +export namespace SiteGroup { + export type RoleEnum = 'SiteConsumer' | 'SiteCollaborator' | 'SiteContributor' | 'SiteManager'; + export const RoleEnum = { + SiteConsumer: 'SiteConsumer' as RoleEnum, + SiteCollaborator: 'SiteCollaborator' as RoleEnum, + SiteContributor: 'SiteContributor' as RoleEnum, + SiteManager: 'SiteManager' as RoleEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteGroupEntry.ts b/lib/js-api/src/api/content-rest-api/model/siteGroupEntry.ts new file mode 100644 index 0000000000..e9f9df8ff0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteGroupEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteGroup } from './siteGroup'; + +export class SiteGroupEntry { + entry: SiteGroup; + + constructor(input?: Partial<SiteGroupEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new SiteGroup(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteGroupPaging.ts b/lib/js-api/src/api/content-rest-api/model/siteGroupPaging.ts new file mode 100644 index 0000000000..9b6437955f --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteGroupPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteGroupPagingList } from './siteGroupPagingList'; + +export class SiteGroupPaging { + list?: SiteGroupPagingList; + + constructor(input?: Partial<SiteGroupPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new SiteGroupPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteGroupPagingList.ts b/lib/js-api/src/api/content-rest-api/model/siteGroupPagingList.ts new file mode 100644 index 0000000000..d64ddc4253 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteGroupPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { SiteGroupEntry } from './siteGroupEntry'; + +export class SiteGroupPagingList { + pagination: Pagination; + entries: SiteGroupEntry[]; + + constructor(input?: Partial<SiteGroupPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new SiteGroupEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMember.ts b/lib/js-api/src/api/content-rest-api/model/siteMember.ts new file mode 100644 index 0000000000..7f21e30cfc --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMember.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Person } from './person'; + +export class SiteMember { + id: string; + person: Person; + role: SiteMember.RoleEnum | string; + isMemberOfGroup?: boolean; + + constructor(input?: Partial<SiteMember>) { + if (input) { + Object.assign(this, input); + this.person = input.person ? new Person(input.person) : undefined; + } + } + +} +export namespace SiteMember { + export type RoleEnum = 'SiteConsumer' | 'SiteCollaborator' | 'SiteContributor' | 'SiteManager'; + export const RoleEnum = { + SiteConsumer: 'SiteConsumer' as RoleEnum, + SiteCollaborator: 'SiteCollaborator' as RoleEnum, + SiteContributor: 'SiteContributor' as RoleEnum, + SiteManager: 'SiteManager' as RoleEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMemberEntry.ts b/lib/js-api/src/api/content-rest-api/model/siteMemberEntry.ts new file mode 100644 index 0000000000..a9c704a4b5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMemberEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteMember } from './siteMember'; + +export class SiteMemberEntry { + entry: SiteMember; + + constructor(input?: Partial<SiteMemberEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new SiteMember(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMemberPaging.ts b/lib/js-api/src/api/content-rest-api/model/siteMemberPaging.ts new file mode 100644 index 0000000000..fdec8af18e --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMemberPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteMemberPagingList } from './siteMemberPagingList'; + +export class SiteMemberPaging { + list?: SiteMemberPagingList; + + constructor(input?: Partial<SiteMemberPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new SiteMemberPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMemberPagingList.ts b/lib/js-api/src/api/content-rest-api/model/siteMemberPagingList.ts new file mode 100644 index 0000000000..57779f5acc --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMemberPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { SiteMemberEntry } from './siteMemberEntry'; + +export class SiteMemberPagingList { + pagination: Pagination; + entries: SiteMemberEntry[]; + + constructor(input?: Partial<SiteMemberPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new SiteMemberEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipApprovalBody.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipApprovalBody.ts new file mode 100644 index 0000000000..4a05b76be5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipApprovalBody.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SiteMembershipApprovalBody { + role?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipBodyCreate.ts new file mode 100644 index 0000000000..df6d40757c --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipBodyCreate.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class SiteMembershipBodyCreate { + role: SiteMembershipBodyCreate.RoleEnum | string; + id: string; // contains both user and groupId + + constructor(input?: Partial<SiteMembershipBodyCreate>) { + if (input) { + Object.assign(this, input); + } + } + +} +export namespace SiteMembershipBodyCreate { + export type RoleEnum = 'SiteConsumer' | 'SiteCollaborator' | 'SiteContributor' | 'SiteManager'; + export const RoleEnum = { + SiteConsumer: 'SiteConsumer' as RoleEnum, + SiteCollaborator: 'SiteCollaborator' as RoleEnum, + SiteContributor: 'SiteContributor' as RoleEnum, + SiteManager: 'SiteManager' as RoleEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipBodyUpdate.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipBodyUpdate.ts new file mode 100644 index 0000000000..e638c28565 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipBodyUpdate.ts @@ -0,0 +1,36 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class SiteMembershipBodyUpdate { + role: SiteMembershipBodyUpdate.RoleEnum | string; + + constructor(input?: Partial<SiteMembershipBodyUpdate>) { + if (input) { + Object.assign(this, input); + } + } + +} +export namespace SiteMembershipBodyUpdate { + export type RoleEnum = 'SiteConsumer' | 'SiteCollaborator' | 'SiteContributor' | 'SiteManager'; + export const RoleEnum = { + SiteConsumer: 'SiteConsumer' as RoleEnum, + SiteCollaborator: 'SiteCollaborator' as RoleEnum, + SiteContributor: 'SiteContributor' as RoleEnum, + SiteManager: 'SiteManager' as RoleEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRejectionBody.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRejectionBody.ts new file mode 100644 index 0000000000..3ef9ab8e92 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRejectionBody.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class SiteMembershipRejectionBody { + comment?: string; + + constructor(input?: Partial<SiteMembershipRejectionBody>) { + if (input) { + Object.assign(this, input); + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequest.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequest.ts new file mode 100644 index 0000000000..73a690d1a0 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequest.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { Site } from './site'; + +export class SiteMembershipRequest { + id: string; + createdAt: Date; + site: Site; + message?: string; + + constructor(input?: Partial<SiteMembershipRequest>) { + if (input) { + Object.assign(this, input); + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.site = input.site ? new Site(input.site) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestBodyCreate.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestBodyCreate.ts new file mode 100644 index 0000000000..8f3cafd2d3 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestBodyCreate.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SiteMembershipRequestBodyCreate { + message?: string; + id: string; + title?: string; + /** + * Optional client name used when sending an email to the end user, defaults to \"share\" if not provided. + * **Note:** The client must be registered before this API can send an email. + * **Note:** This is available in Alfresco 7.0.0 and newer versions. + */ + client?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestBodyUpdate.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestBodyUpdate.ts new file mode 100644 index 0000000000..f5a8775bd8 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestBodyUpdate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SiteMembershipRequestBodyUpdate { + message?: string; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestEntry.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestEntry.ts new file mode 100644 index 0000000000..8fa66a7ad2 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteMembershipRequest } from './siteMembershipRequest'; + +export class SiteMembershipRequestEntry { + entry: SiteMembershipRequest; + + constructor(input?: Partial<SiteMembershipRequestEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new SiteMembershipRequest(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestPaging.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestPaging.ts new file mode 100644 index 0000000000..4bd5acc82b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteMembershipRequestPagingList } from './siteMembershipRequestPagingList'; + +export class SiteMembershipRequestPaging { + list?: SiteMembershipRequestPagingList; + + constructor(input?: Partial<SiteMembershipRequestPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new SiteMembershipRequestPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestPagingList.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestPagingList.ts new file mode 100644 index 0000000000..42204d771d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { SiteMembershipRequestEntry } from './siteMembershipRequestEntry'; + +export class SiteMembershipRequestPagingList { + pagination: Pagination; + entries: SiteMembershipRequestEntry[]; + + constructor(input?: Partial<SiteMembershipRequestPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new SiteMembershipRequestEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPerson.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPerson.ts new file mode 100644 index 0000000000..0e3c84f7ed --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPerson.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { Person } from './person'; +import { Site } from './site'; + +export class SiteMembershipRequestWithPerson { + id: string; + createdAt: Date; + site: Site; + person: Person; + message?: string; + + constructor(input?: Partial<SiteMembershipRequestWithPerson>) { + if (input) { + Object.assign(this, input); + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.site = input.site ? new Site(input.site) : undefined; + this.person = input.person ? new Person(input.person) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonEntry.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonEntry.ts new file mode 100644 index 0000000000..f024720dae --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteMembershipRequestWithPerson } from './siteMembershipRequestWithPerson'; + +export class SiteMembershipRequestWithPersonEntry { + entry: SiteMembershipRequestWithPerson; + + constructor(input?: Partial<SiteMembershipRequestWithPersonEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new SiteMembershipRequestWithPerson(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonPaging.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonPaging.ts new file mode 100644 index 0000000000..bb67974e5d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteMembershipRequestWithPersonPagingList } from './siteMembershipRequestWithPersonPagingList'; + +export class SiteMembershipRequestWithPersonPaging { + list?: SiteMembershipRequestWithPersonPagingList; + + constructor(input?: Partial<SiteMembershipRequestWithPersonPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new SiteMembershipRequestWithPersonPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonPagingList.ts b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonPagingList.ts new file mode 100644 index 0000000000..020d682b9b --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteMembershipRequestWithPersonPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { SiteMembershipRequestWithPersonEntry } from './siteMembershipRequestWithPersonEntry'; + +export class SiteMembershipRequestWithPersonPagingList { + pagination: Pagination; + entries: SiteMembershipRequestWithPersonEntry[]; + + constructor(input?: Partial<SiteMembershipRequestWithPersonPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new SiteMembershipRequestWithPersonEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/sitePaging.ts b/lib/js-api/src/api/content-rest-api/model/sitePaging.ts new file mode 100644 index 0000000000..741877edb5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/sitePaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SitePagingList } from './sitePagingList'; + +export class SitePaging { + list?: SitePagingList; + + constructor(input?: Partial<SitePaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new SitePagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/sitePagingList.ts b/lib/js-api/src/api/content-rest-api/model/sitePagingList.ts new file mode 100644 index 0000000000..b06eb940d9 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/sitePagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { SiteEntry } from './siteEntry'; + +export class SitePagingList { + pagination: Pagination; + entries: SiteEntry[]; + + constructor(input?: Partial<SitePagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new SiteEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteRole.ts b/lib/js-api/src/api/content-rest-api/model/siteRole.ts new file mode 100644 index 0000000000..d3918ea737 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteRole.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Site } from './site'; + +export class SiteRole { + site: Site; + id: string; + guid: string; + role: SiteRole.RoleEnum | string; + + constructor(input?: Partial<SiteRole>) { + if (input) { + Object.assign(this, input); + this.site = input.site ? new Site(input.site) : undefined; + } + } + +} +export namespace SiteRole { + export type RoleEnum = 'SiteConsumer' | 'SiteCollaborator' | 'SiteContributor' | 'SiteManager'; + export const RoleEnum = { + SiteConsumer: 'SiteConsumer' as RoleEnum, + SiteCollaborator: 'SiteCollaborator' as RoleEnum, + SiteContributor: 'SiteContributor' as RoleEnum, + SiteManager: 'SiteManager' as RoleEnum + }; +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteRoleEntry.ts b/lib/js-api/src/api/content-rest-api/model/siteRoleEntry.ts new file mode 100644 index 0000000000..6323fde947 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteRoleEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteRole } from './siteRole'; + +export class SiteRoleEntry { + entry: SiteRole; + + constructor(input?: Partial<SiteRoleEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new SiteRole(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteRolePaging.ts b/lib/js-api/src/api/content-rest-api/model/siteRolePaging.ts new file mode 100644 index 0000000000..a4bfe04692 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteRolePaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SiteRolePagingList } from './siteRolePagingList'; + +export class SiteRolePaging { + list?: SiteRolePagingList; + + constructor(input?: Partial<SiteRolePaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new SiteRolePagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/siteRolePagingList.ts b/lib/js-api/src/api/content-rest-api/model/siteRolePagingList.ts new file mode 100644 index 0000000000..1252394d33 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/siteRolePagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { SiteRoleEntry } from './siteRoleEntry'; + +export class SiteRolePagingList { + pagination: Pagination; + entries: SiteRoleEntry[]; + + constructor(input?: Partial<SiteRolePagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new SiteRoleEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/tag.ts b/lib/js-api/src/api/content-rest-api/model/tag.ts new file mode 100644 index 0000000000..abc5faa274 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/tag.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class Tag { + id: string; + tag: string; + count?: number; + + constructor(input?: Partial<Tag>) { + if (input) { + Object.assign(this, input); + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/tagBody.ts b/lib/js-api/src/api/content-rest-api/model/tagBody.ts new file mode 100644 index 0000000000..3cba0a01ba --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/tagBody.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class TagBody { + tag: string; + + constructor(input?: Partial<TagBody>) { + if (input) { + Object.assign(this, input); + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/tagEntry.ts b/lib/js-api/src/api/content-rest-api/model/tagEntry.ts new file mode 100644 index 0000000000..217e3b9b16 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/tagEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Tag } from './tag'; + +export class TagEntry { + entry: Tag; + + constructor(input?: Partial<TagEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Tag(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/tagPaging.ts b/lib/js-api/src/api/content-rest-api/model/tagPaging.ts new file mode 100644 index 0000000000..3514d2cae5 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/tagPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TagPagingList } from './tagPagingList'; + +export class TagPaging { + list?: TagPagingList; + + constructor(input?: Partial<TagPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new TagPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/tagPagingList.ts b/lib/js-api/src/api/content-rest-api/model/tagPagingList.ts new file mode 100644 index 0000000000..6807bc3033 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/tagPagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { TagEntry } from './tagEntry'; + +export class TagPagingList { + pagination: Pagination; + entries: TagEntry[]; + + constructor(input?: Partial<TagPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new TagEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/userInfo.ts b/lib/js-api/src/api/content-rest-api/model/userInfo.ts new file mode 100644 index 0000000000..451fba3816 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/userInfo.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class UserInfo { + displayName: string; + id: string; + + constructor(input?: Partial<UserInfo>) { + if (input) { + Object.assign(this, input); + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/version.ts b/lib/js-api/src/api/content-rest-api/model/version.ts new file mode 100644 index 0000000000..7ad7b05255 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/version.ts @@ -0,0 +1,47 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ContentInfo } from './contentInfo'; +import { DateAlfresco } from '../../content-custom-api'; +import { UserInfo } from './userInfo'; + +export class Version { + id: string; + versionComment?: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isFolder: boolean; + isFile: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + content?: ContentInfo; + aspectNames?: string[]; + properties?: any; + + constructor(input?: Partial<Version>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + } + } +} diff --git a/lib/js-api/src/api/content-rest-api/model/versionEntry.ts b/lib/js-api/src/api/content-rest-api/model/versionEntry.ts new file mode 100644 index 0000000000..f148a5d6a4 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/versionEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Version } from './version'; + +export class VersionEntry { + entry?: Version; + + constructor(input?: Partial<VersionEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Version(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/versionPaging.ts b/lib/js-api/src/api/content-rest-api/model/versionPaging.ts new file mode 100644 index 0000000000..55f4640139 --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/versionPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { VersionPagingList } from './versionPagingList'; + +export class VersionPaging { + list?: VersionPagingList; + + constructor(input?: Partial<VersionPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new VersionPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/content-rest-api/model/versionPagingList.ts b/lib/js-api/src/api/content-rest-api/model/versionPagingList.ts new file mode 100644 index 0000000000..056f693e1d --- /dev/null +++ b/lib/js-api/src/api/content-rest-api/model/versionPagingList.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from './pagination'; +import { VersionEntry } from './versionEntry'; + +export class VersionPagingList { + pagination?: Pagination; + entries?: VersionEntry[]; + + constructor(input?: Partial<VersionPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new VersionEntry(item)); + } + } + } +} diff --git a/lib/js-api/src/api/discovery-rest-api/README.md b/lib/js-api/src/api/discovery-rest-api/README.md new file mode 100644 index 0000000000..a1a3668e7a --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/README.md @@ -0,0 +1,30 @@ +# **Discovery API** + +Provides access to information about Alfresco Content Services. + +> Documentation updated on: 2019-10-17T13:55:16.056+01:00 + +## Methods + +All URIs are relative to: + +```text +https://localhost/alfresco/api +``` + +| Class | Method | HTTP request | Description | +|--------------|-------------------------------------------------------------------------------|--------------------|----------------------------| +| DiscoveryApi | [getRepositoryInformation](docs/DiscoveryApi.md#getRepositoryInformation) | **GET** /discovery | Get repository information | + +## Models + +- [DiscoveryEntry](docs/DiscoveryEntry.md) +- [EntitlementsInfo](docs/EntitlementsInfo.md) +- [ErrorError](docs/ErrorError.md) +- [LicenseInfo](docs/LicenseInfo.md) +- [ModelError](docs/ModelError.md) +- [ModuleInfo](docs/ModuleInfo.md) +- [RepositoryEntry](docs/RepositoryEntry.md) +- [RepositoryInfo](docs/RepositoryInfo.md) +- [StatusInfo](docs/StatusInfo.md) +- [VersionInfo](docs/VersionInfo.md) diff --git a/lib/js-api/src/api/discovery-rest-api/api/base.api.ts b/lib/js-api/src/api/discovery-rest-api/api/base.api.ts new file mode 100644 index 0000000000..ec2dedb4f1 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/api/base.api.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient } from '../../../api-clients/http-client.interface'; + +export abstract class BaseApi extends ApiClient { + override get apiClient(): LegacyHttpClient { + return this.httpClient ?? this.alfrescoApi.discoveryClient; + } +} diff --git a/lib/js-api/src/api/discovery-rest-api/api/discovery.api.ts b/lib/js-api/src/api/discovery-rest-api/api/discovery.api.ts new file mode 100644 index 0000000000..d6a12c121c --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/api/discovery.api.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DiscoveryEntry } from '../model/discoveryEntry'; +import { BaseApi } from './base.api'; + +/** + * Discovery service. + */ +export class DiscoveryApi extends BaseApi { + /** + * Get repository information + * + * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. + * + * @returns Promise<DiscoveryEntry> + */ + getRepositoryInformation(): Promise<DiscoveryEntry> { + return this.get({ + path: '/discovery', + returnType: DiscoveryEntry + }); + } +} diff --git a/lib/js-api/src/api/discovery-rest-api/api/index.ts b/lib/js-api/src/api/discovery-rest-api/api/index.ts new file mode 100644 index 0000000000..cfb56c6869 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/api/index.ts @@ -0,0 +1,18 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './discovery.api'; diff --git a/lib/js-api/src/api/discovery-rest-api/docs/DiscoveryApi.md b/lib/js-api/src/api/discovery-rest-api/docs/DiscoveryApi.md new file mode 100644 index 0000000000..fe8cb063cb --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/DiscoveryApi.md @@ -0,0 +1,42 @@ +# DiscoveryApi + +All URIs are relative to *https://localhost/alfresco/api* + +| Method | HTTP request | Description | +|--------------------------------------------------------------------------|--------------------|----------------------------| +| [**getRepositoryInformation**](DiscoveryApi.md#getRepositoryInformation) | **GET** /discovery | Get repository information | + +<a name="getRepositoryInformation"></a> +## getRepositoryInformation +> DiscoveryEntry getRepositoryInformation() + +Get repository information + +**Note:** this endpoint is available in Alfresco 5.2 and newer versions. + +Retrieves the capabilities and detailed version information from the repository. + +**Example** + +```javascript +import { AlfrescoApi, DiscoveryApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const discoveryApi = new DiscoveryApi(alfrescoApi); + +discoveryApi.getRepositoryInformation().then( + (data) => { + console.log('API called successfully. Returned data: ' + data); + }, + (error) => { + console.error(error); + }); +``` + +### Return type + +[**DiscoveryEntry**](DiscoveryEntry.md) + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/DiscoveryEntry.md b/lib/js-api/src/api/discovery-rest-api/docs/DiscoveryEntry.md new file mode 100644 index 0000000000..05e5c58a93 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/DiscoveryEntry.md @@ -0,0 +1,8 @@ +# DiscoveryEntry + +## Properties +| Name | Type | Notes | +|-----------|-------------------------------------------|-------------------| +| entry | [RepositoryEntry](RepositoryEntry.md) | [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/EntitlementsInfo.md b/lib/js-api/src/api/discovery-rest-api/docs/EntitlementsInfo.md new file mode 100644 index 0000000000..da23031818 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/EntitlementsInfo.md @@ -0,0 +1,12 @@ +# EntitlementsInfo + +## Properties + +| Name | Type | Notes | +|--------------------|---------|------------------------------| +| maxUsers | number | [optional] [default to null] | +| maxDocs | number | [optional] [default to null] | +| isClusterEnabled | boolean | [optional] [default to null] | +| isCryptodocEnabled | boolean | [optional] [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/Error.md b/lib/js-api/src/api/discovery-rest-api/docs/Error.md new file mode 100644 index 0000000000..0ac9ef0be4 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/Error.md @@ -0,0 +1,9 @@ +# ModelError + +## Properties + +| Name | Type | Description | Notes | +|-----------|---------------------------------|-------------|------------------------------| +| **error** | [**ErrorError**](ErrorError.md) | | [optional] [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/Error_error.md b/lib/js-api/src/api/discovery-rest-api/docs/Error_error.md new file mode 100644 index 0000000000..dc16da5bc9 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/Error_error.md @@ -0,0 +1,14 @@ +# ErrorError + +## Properties + +| Name | Type | Notes | +|----------------|--------|------------------------------| +| errorKey | string | [optional] [default to null] | +| statusCode | number | [default to null] | +| briefSummary | string | [default to null] | +| stackTrace | string | [default to null] | +| descriptionURL | string | [default to null] | +| logId | string | [optional] [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/LicenseInfo.md b/lib/js-api/src/api/discovery-rest-api/docs/LicenseInfo.md new file mode 100644 index 0000000000..26704a9bb4 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/LicenseInfo.md @@ -0,0 +1,14 @@ +# LicenseInfo + +## Properties + +| Name | Type | Notes | +|---------------|-----------------------------------------|------------------------------| +| issuedAt | [Date](Date.md) | [default to null] | +| expiresAt | [Date](Date.md) | [default to null] | +| remainingDays | number | [default to null] | +| holder | string | [default to null] | +| mode | string | [default to null] | +| entitlements | [EntitlementsInfo](EntitlementsInfo.md) | [optional] [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/ModuleInfo.md b/lib/js-api/src/api/discovery-rest-api/docs/ModuleInfo.md new file mode 100644 index 0000000000..12bf7cdee7 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/ModuleInfo.md @@ -0,0 +1,16 @@ +# ModuleInfo + +## Properties + +| Name | Type | Notes | +|--------------|---------------------|------------------------------| +| id | string | [optional] [default to null] | +| title | string | [optional] [default to null] | +| description | string | [optional] [default to null] | +| version | string | [optional] [default to null] | +| installDate | [**Date**](Date.md) | [optional] [default to null] | +| installState | string | [optional] [default to null] | +| versionMin | string | [optional] [default to null] | +| versionMax | string | [optional] [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/RepositoryEntry.md b/lib/js-api/src/api/discovery-rest-api/docs/RepositoryEntry.md new file mode 100644 index 0000000000..a59d6a5a7f --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/RepositoryEntry.md @@ -0,0 +1,9 @@ +# RepositoryEntry + +## Properties + +| Name | Type | Notes | +|------------|-------------------------------------|-------------------| +| repository | [RepositoryInfo](RepositoryInfo.md) | [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/RepositoryInfo.md b/lib/js-api/src/api/discovery-rest-api/docs/RepositoryInfo.md new file mode 100644 index 0000000000..6f9e2fad9b --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/RepositoryInfo.md @@ -0,0 +1,13 @@ +# RepositoryInfo + +## Properties + +| Name | Type | Notes | +|---------|-----------------------------------|------------------------------| +| edition | string | [default to null] | +| version | [VersionInfo](VersionInfo.md) | [default to null] | +| status | [StatusInfo](StatusInfo.md) | [default to null] | +| license | [LicenseInfo](LicenseInfo.md) | [optional] [default to null] | +| modules | [ModuleInfo**[]**](ModuleInfo.md) | [optional] [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/StatusInfo.md b/lib/js-api/src/api/discovery-rest-api/docs/StatusInfo.md new file mode 100644 index 0000000000..822cd5bcc8 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/StatusInfo.md @@ -0,0 +1,12 @@ +# StatusInfo + +## Properties + +| Name | Type | +|------------------------------|---------| +| isReadOnly | boolean | +| isAuditEnabled | boolean | +| isQuickShareEnabled | boolean | +| isThumbnailGenerationEnabled | boolean | +| isDirectAccessUrlEnabled | boolean | + diff --git a/lib/js-api/src/api/discovery-rest-api/docs/VersionInfo.md b/lib/js-api/src/api/discovery-rest-api/docs/VersionInfo.md new file mode 100644 index 0000000000..a181bb37e3 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/docs/VersionInfo.md @@ -0,0 +1,15 @@ +# VersionInfo + +## Properties + +| Name | Type | Notes | +|---------|--------|-------------------| +| major | string | [default to null] | +| minor | string | [default to null] | +| patch | string | [default to null] | +| hotfix | string | [default to null] | +| schema | number | [default to null] | +| label | string | [default to null] | +| display | string | [default to null] | + + diff --git a/lib/js-api/src/api/discovery-rest-api/index.ts b/lib/js-api/src/api/discovery-rest-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/discovery-rest-api/model/discoveryEntry.ts b/lib/js-api/src/api/discovery-rest-api/model/discoveryEntry.ts new file mode 100644 index 0000000000..62c663c7c2 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/discoveryEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RepositoryEntry } from './repositoryEntry'; + +export class DiscoveryEntry { + entry: RepositoryEntry; + + constructor(input?: Partial<DiscoveryEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new RepositoryEntry(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/discovery-rest-api/model/entitlementsInfo.ts b/lib/js-api/src/api/discovery-rest-api/model/entitlementsInfo.ts new file mode 100644 index 0000000000..503413d85b --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/entitlementsInfo.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class EntitlementsInfo { + maxUsers?: number; + maxDocs?: number; + isClusterEnabled?: boolean; + isCryptodocEnabled?: boolean; + + constructor(input?: Partial<EntitlementsInfo>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/discovery-rest-api/model/index.ts b/lib/js-api/src/api/discovery-rest-api/model/index.ts new file mode 100644 index 0000000000..8996228273 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/index.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './discoveryEntry'; +export * from './entitlementsInfo'; +export * from './licenseInfo'; +export * from './moduleInfo'; +export * from './repositoryEntry'; +export * from './repositoryInfo'; +export * from './statusInfo'; +export * from './versionInfo'; diff --git a/lib/js-api/src/api/discovery-rest-api/model/licenseInfo.ts b/lib/js-api/src/api/discovery-rest-api/model/licenseInfo.ts new file mode 100644 index 0000000000..0834488552 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/licenseInfo.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api/model/dateAlfresco'; +import { EntitlementsInfo } from './entitlementsInfo'; + +export class LicenseInfo { + issuedAt: Date; + expiresAt: Date; + remainingDays: number; + holder: string; + mode: string; + entitlements?: EntitlementsInfo; + + constructor(input?: Partial<LicenseInfo>) { + if (input) { + Object.assign(this, input); + this.issuedAt = input.issuedAt ? DateAlfresco.parseDate(input.issuedAt) : undefined; + this.expiresAt = input.expiresAt ? DateAlfresco.parseDate(input.expiresAt) : undefined; + this.entitlements = input.entitlements ? new EntitlementsInfo(input.entitlements) : undefined; + } + } +} diff --git a/lib/js-api/src/api/discovery-rest-api/model/moduleInfo.ts b/lib/js-api/src/api/discovery-rest-api/model/moduleInfo.ts new file mode 100644 index 0000000000..f61e26ac96 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/moduleInfo.ts @@ -0,0 +1,36 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api/model/dateAlfresco'; + +export class ModuleInfo { + id?: string; + title?: string; + description?: string; + version?: string; + installDate?: Date; + installState?: string; + versionMin?: string; + versionMax?: string; + + constructor(input?: Partial<ModuleInfo>) { + if (input) { + Object.assign(this, input); + this.installDate = input.installDate ? DateAlfresco.parseDate(input.installDate) : undefined; + } + } +} diff --git a/lib/js-api/src/api/discovery-rest-api/model/repositoryEntry.ts b/lib/js-api/src/api/discovery-rest-api/model/repositoryEntry.ts new file mode 100644 index 0000000000..9285b5a411 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/repositoryEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RepositoryInfo } from './repositoryInfo'; + +export class RepositoryEntry { + repository: RepositoryInfo; + + constructor(input?: Partial<RepositoryEntry>) { + if (input) { + Object.assign(this, input); + this.repository = input.repository ? new RepositoryInfo(input.repository) : undefined; + } + } +} diff --git a/lib/js-api/src/api/discovery-rest-api/model/repositoryInfo.ts b/lib/js-api/src/api/discovery-rest-api/model/repositoryInfo.ts new file mode 100644 index 0000000000..977d833e80 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/repositoryInfo.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LicenseInfo } from './licenseInfo'; +import { ModuleInfo } from './moduleInfo'; +import { StatusInfo } from './statusInfo'; +import { VersionInfo } from './versionInfo'; + +export class RepositoryInfo { + edition: string; + version: VersionInfo; + status: StatusInfo; + license?: LicenseInfo; + modules?: ModuleInfo[]; + + constructor(input?: Partial<RepositoryInfo>) { + if (input) { + Object.assign(this, input); + this.version = input.version ? new VersionInfo(input.version) : undefined; + this.status = input.status ? new StatusInfo(input.status) : undefined; + this.license = input.license ? new LicenseInfo(input.license) : undefined; + if (input.modules) { + this.modules = input.modules.map((item) => new ModuleInfo(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/discovery-rest-api/model/statusInfo.ts b/lib/js-api/src/api/discovery-rest-api/model/statusInfo.ts new file mode 100644 index 0000000000..55c892b9b4 --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/statusInfo.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class StatusInfo { + isReadOnly: boolean; + isAuditEnabled: boolean; + isQuickShareEnabled: boolean; + isThumbnailGenerationEnabled: boolean; + isDirectAccessUrlEnabled: boolean; + + constructor(input?: Partial<StatusInfo>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/discovery-rest-api/model/versionInfo.ts b/lib/js-api/src/api/discovery-rest-api/model/versionInfo.ts new file mode 100644 index 0000000000..1a83a1805b --- /dev/null +++ b/lib/js-api/src/api/discovery-rest-api/model/versionInfo.ts @@ -0,0 +1,32 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class VersionInfo { + major: string; + minor: string; + patch: string; + hotfix: string; + schema: number; + label: string; + display: string; + + constructor(input?: Partial<VersionInfo>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/README.md b/lib/js-api/src/api/gs-classification-rest-api/README.md new file mode 100644 index 0000000000..7fa7ff3bc6 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/README.md @@ -0,0 +1,88 @@ +Provides access to classification and security mark related features. + +- Last Build date: 2018-11-05T11:25:29.023Z + + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*.ClassificationGuidesApi* | [**combinedInstructions**](docs/ClassificationGuidesApi.md#combinedInstructions) | **POST** /combined-instructions | Combined instructions +*.ClassificationGuidesApi* | [**createClassificationGuide**](docs/ClassificationGuidesApi.md#createClassificationGuide) | **POST** /classification-guides | Create a classification guide +*.ClassificationGuidesApi* | [**createSubtopic**](docs/ClassificationGuidesApi.md#createSubtopic) | **POST** /topics/{topicId}/subtopics | Create a subtopic +*.ClassificationGuidesApi* | [**createTopic**](docs/ClassificationGuidesApi.md#createTopic) | **POST** /classification-guides/{classificationGuideId}/topics | Create a topic +*.ClassificationGuidesApi* | [**deleteClassificationGuide**](docs/ClassificationGuidesApi.md#deleteClassificationGuide) | **DELETE** /classification-guides/{classificationGuideId} | Delete a classification guide +*.ClassificationGuidesApi* | [**deleteTopic**](docs/ClassificationGuidesApi.md#deleteTopic) | **DELETE** /topics/{topicId} | Delete a topic +*.ClassificationGuidesApi* | [**listClassificationGuides**](docs/ClassificationGuidesApi.md#listClassificationGuides) | **GET** /classification-guides | List all classification guides +*.ClassificationGuidesApi* | [**listSubtopics**](docs/ClassificationGuidesApi.md#listSubtopics) | **GET** /topics/{topicId}/subtopics | List all subtopics +*.ClassificationGuidesApi* | [**listTopics**](docs/ClassificationGuidesApi.md#listTopics) | **GET** /classification-guides/{classificationGuideId}/topics | List all topics +*.ClassificationGuidesApi* | [**showClassificationGuideById**](docs/ClassificationGuidesApi.md#showClassificationGuideById) | **GET** /classification-guides/{classificationGuideId} | Get classification guide information +*.ClassificationGuidesApi* | [**showTopicById**](docs/ClassificationGuidesApi.md#showTopicById) | **GET** /topics/{topicId} | Get topic information +*.ClassificationGuidesApi* | [**updateClassificationGuide**](docs/ClassificationGuidesApi.md#updateClassificationGuide) | **PUT** /classification-guides/{classificationGuideId} | Update a classification guide +*.ClassificationGuidesApi* | [**updateTopic**](docs/ClassificationGuidesApi.md#updateTopic) | **PUT** /topics/{topicId} | Update a topic +*.ClassificationReasonsApi* | [**createClassificationReason**](docs/ClassificationReasonsApi.md#createClassificationReason) | **POST** /classification-reasons | Create a classification reason +*.ClassificationReasonsApi* | [**deleteClassificationReason**](docs/ClassificationReasonsApi.md#deleteClassificationReason) | **DELETE** /classification-reasons/{classificationReasonId} | Delete a classification reason +*.ClassificationReasonsApi* | [**listClassificationReasons**](docs/ClassificationReasonsApi.md#listClassificationReasons) | **GET** /classification-reasons | List all classification reasons +*.ClassificationReasonsApi* | [**showClassificationReasonById**](docs/ClassificationReasonsApi.md#showClassificationReasonById) | **GET** /classification-reasons/{classificationReasonId} | Get classification reason information +*.ClassificationReasonsApi* | [**updateClassificationReason**](docs/ClassificationReasonsApi.md#updateClassificationReason) | **PUT** /classification-reasons/{classificationReasonId} | Update a classification reason +*.DeclassificationExemptionsApi* | [**createDeclassificationExemption**](docs/DeclassificationExemptionsApi.md#createDeclassificationExemption) | **POST** /declassification-exemptions | Create a declassification exemption +*.DeclassificationExemptionsApi* | [**deleteDeclassificationExemption**](docs/DeclassificationExemptionsApi.md#deleteDeclassificationExemption) | **DELETE** /declassification-exemptions/{declassificationExemptionId} | Delete a declassification exemption +*.DeclassificationExemptionsApi* | [**listDeclassificationExemptions**](docs/DeclassificationExemptionsApi.md#listDeclassificationExemptions) | **GET** /declassification-exemptions | List all declassification exemptions +*.DeclassificationExemptionsApi* | [**showDeclassificationExemptionById**](docs/DeclassificationExemptionsApi.md#showDeclassificationExemptionById) | **GET** /declassification-exemptions/{declassificationExemptionId} | Get declassification exemption information +*.DeclassificationExemptionsApi* | [**updateDeclassificationExemption**](docs/DeclassificationExemptionsApi.md#updateDeclassificationExemption) | **PUT** /declassification-exemptions/{declassificationExemptionId} | Update a declassification exemption +*.DefaultClassificationValuesApi* | [**calculateDefaultDeclassificationDate**](docs/DefaultClassificationValuesApi.md#calculateDefaultDeclassificationDate) | **POST** /default-classification-values/{nodeId}/calculate-declassification-date | Calculate the default declassification date +*.SecurityControlSettingsApi* | [**getSecurityControlSetting**](docs/SecurityControlSettingsApi.md#getSecurityControlSetting) | **GET** /security-control-settings/{securityControlSettingKey} | Get security control setting value +*.SecurityControlSettingsApi* | [**updateSecurityControlSetting**](docs/SecurityControlSettingsApi.md#updateSecurityControlSetting) | **PUT** /security-control-settings/{securityControlSettingKey} | Update security control setting value + + +## Documentation for Models + + - [ClassificationGuideBody](docs/ClassificationGuideBody.md) + - [ClassificationGuideEntry](docs/ClassificationGuideEntry.md) + - [ClassificationGuidePaging](docs/ClassificationGuidePaging.md) + - [ClassificationGuidePagingList](docs/ClassificationGuidePagingList.md) + - [ClassificationGuidesBody](docs/ClassificationGuidesBody.md) + - [ClassificationGuidesEntry](docs/ClassificationGuidesEntry.md) + - [ClassificationInformation](docs/ClassificationInformation.md) + - [ClassificationReason](docs/ClassificationReason.md) + - [ClassificationReasonBody](docs/ClassificationReasonBody.md) + - [ClassificationReasonEntry](docs/ClassificationReasonEntry.md) + - [ClassificationReasonsPaging](docs/ClassificationReasonsPaging.md) + - [ClassificationReasonsPagingList](docs/ClassificationReasonsPagingList.md) + - [DeclassificationDate](docs/DeclassificationDate.md) + - [DeclassificationExemption](docs/DeclassificationExemption.md) + - [DeclassificationExemptionBody](docs/DeclassificationExemptionBody.md) + - [DeclassificationExemptionEntry](docs/DeclassificationExemptionEntry.md) + - [DeclassificationExemptionsPaging](docs/DeclassificationExemptionsPaging.md) + - [DeclassificationExemptionsPagingList](docs/DeclassificationExemptionsPagingList.md) + - [ErrorError](docs/ErrorError.md) + - [Instruction](docs/Instruction.md) + - [InstructionBody](docs/InstructionBody.md) + - [InstructionEntry](docs/InstructionEntry.md) + - [ModelError](docs/ModelError.md) + - [Pagination](docs/Pagination.md) + - [Path](docs/Path.md) + - [PathElement](docs/PathElement.md) + - [SecurityControlSetting](docs/SecurityControlSetting.md) + - [SecurityControlSettingBody](docs/SecurityControlSettingBody.md) + - [SecurityControlSettingEntry](docs/SecurityControlSettingEntry.md) + - [SecurityMark](docs/SecurityMark.md) + - [SecurityMarkBody](docs/SecurityMarkBody.md) + - [SecurityMarkInformation](docs/SecurityMarkInformation.md) + - [SecurityMarkInformationBody](docs/SecurityMarkInformationBody.md) + - [SecurityMarks](docs/SecurityMarks.md) + - [SecurityMarksBody](docs/SecurityMarksBody.md) + - [SubtopicPaging](docs/SubtopicPaging.md) + - [Topic](docs/Topic.md) + - [TopicBody](docs/TopicBody.md) + - [TopicEntry](docs/TopicEntry.md) + - [TopicPaging](docs/TopicPaging.md) + - [TopicPagingList](docs/TopicPagingList.md) + - [ClassificationGuideInTopic](docs/ClassificationGuideInTopic.md) + - [ClassificationGuidesInTopic](docs/ClassificationGuidesInTopic.md) + - [CombinedInstructionBody](docs/CombinedInstructionBody.md) + - [ClassificationGuide](docs/ClassificationGuide.md) + - [ClassificationGuides](docs/ClassificationGuides.md) + diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/authorityClearance.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/authorityClearance.api.ts new file mode 100644 index 0000000000..2b7385239c --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/authorityClearance.api.ts @@ -0,0 +1,63 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; +import { AuthorityClearanceGroupPaging, NodeSecurityMarkBody, SecurityMarkEntry, SecurityMarkPaging } from '../model'; +import { GsPagingQuery } from './types'; + +/** + * AuthorityClearanceApi service. + */ +export class AuthorityClearanceApi extends BaseApi { + /** + * Get the authority clearances for a single user/group + * + * @param authorityId The name for the authority for which the clearance is to be fetched. Can be left blank in which case it will fetch it for all users with pagination + * @param opts Optional parameters + * @returns Promise<AuthorityClearanceGroupPaging> + */ + getAuthorityClearanceForAuthority(authorityId: string, opts?: GsPagingQuery): Promise<AuthorityClearanceGroupPaging> { + const pathParams = { + authorityId + }; + + return this.get({ + path: '/cleared-authorities/{authorityId}/clearing-marks', + pathParams, + queryParams: opts + }); + } + + /** + * Updates the authority clearance. + * + * @param authorityId The name for the authority for which the clearance is to be updated + * @param authorityClearance AuthorityClearanceBody + * @returns Promise<SecurityMarkEntry | SecurityMarkPaging> + */ + updateAuthorityClearance(authorityId: string, authorityClearance: NodeSecurityMarkBody[]): Promise<SecurityMarkEntry | SecurityMarkPaging> { + const pathParams = { + authorityId + }; + + return this.post({ + path: '/cleared-authorities/{authorityId}/clearing-marks', + pathParams, + bodyParam: authorityClearance + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/base.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/base.api.ts new file mode 100644 index 0000000000..d313884ccb --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/base.api.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient } from '../../../api-clients/http-client.interface'; + +export abstract class BaseApi extends ApiClient { + override get apiClient(): LegacyHttpClient { + return this.httpClient ?? this.alfrescoApi.gsClient; + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/classificationGuides.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/classificationGuides.api.ts new file mode 100644 index 0000000000..55447b4a1a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/classificationGuides.api.ts @@ -0,0 +1,393 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + ClassificationGuideBody, + ClassificationGuideEntry, + ClassificationGuidePaging, + InstructionEntry, + SubtopicPaging, + TopicBody, + TopicEntry, + TopicPaging +} from '../model'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { GsIncludeQuery, GsPagingQuery } from './types'; + +export interface CombinedInstructionsOpts { + instructions?: any; +} + +/** + * ClassificationGuidesApi service. + */ +export class ClassificationGuidesApi extends BaseApi { + /** + * Combines instructions from the given topics and the user defined instruction, if any. + * + * @param opts Optional parameters + * @param opts.instructions Instructions + * @returns Promise<InstructionEntry> + */ + combinedInstructions(opts?: CombinedInstructionsOpts): Promise<InstructionEntry> { + return this.post({ + path: '/combined-instructions', + bodyParam: opts?.instructions + }); + } + + /** + * Create a classification guide + * + * @param classificationGuide Classification guide + * @returns Promise<ClassificationGuideEntry> + */ + createClassificationGuide(classificationGuide: ClassificationGuideBody): Promise<ClassificationGuideEntry> { + throwIfNotDefined(classificationGuide, 'classificationGuide'); + + return this.post({ + path: '/classification-guides', + bodyParam: classificationGuide + }); + } + + /** + * Create a subtopic + * + * @param topicId The identifier for the topic + * @param topic Subtopic + * @param opts Optional parameters + * @returns Promise<TopicEntry> + */ + createSubtopic(topicId: string, topic: TopicBody, opts?: GsIncludeQuery): Promise<TopicEntry> { + throwIfNotDefined(topicId, 'topicId'); + throwIfNotDefined(topic, 'topic'); + + const pathParams = { + topicId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.post({ + path: '/topics/{topicId}/subtopics', + pathParams, + queryParams, + bodyParam: topic, + returnType: TopicEntry + }); + } + + /** + * Create a topic + * + * @param classificationGuideId The identifier for the classification guide + * @param topic Topic + * @param opts Optional parameters + * @returns Promise<TopicEntry> + */ + createTopic(classificationGuideId: string, topic: TopicBody, opts?: GsIncludeQuery): Promise<TopicEntry> { + throwIfNotDefined(classificationGuideId, 'classificationGuideId'); + throwIfNotDefined(topic, 'topic'); + + const pathParams = { + classificationGuideId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.post({ + path: '/classification-guides/{classificationGuideId}/topics', + pathParams, + queryParams, + bodyParam: topic, + returnType: TopicEntry + }); + } + + /** + * Delete a classification guide + * + * @param classificationGuideId The identifier for the classification guide + * @returns Promise<{}> + */ + deleteClassificationGuide(classificationGuideId: string): Promise<void> { + throwIfNotDefined(classificationGuideId, 'classificationGuideId'); + + const pathParams = { + classificationGuideId + }; + + return this.delete({ + path: '/classification-guides/{classificationGuideId}', + pathParams + }); + } + + /** + * Delete a topic + * + * @param topicId The identifier for the topic + * @returns Promise<{}> + */ + deleteTopic(topicId: string): Promise<void> { + throwIfNotDefined(topicId, 'topicId'); + + const pathParams = { + topicId + }; + + return this.delete({ + path: '/topics/{topicId}', + pathParams + }); + } + + /** + * List all classification guides + * + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.where A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR. Fields to filter on: + * enabled - e.g. (enabled = true OR enabled = false) + * @returns Promise<ClassificationGuidePaging> + */ + listClassificationGuides(opts?: { orderBy?: string[]; where?: string } & GsPagingQuery & GsIncludeQuery): Promise<ClassificationGuidePaging> { + opts = opts || {}; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + where: opts?.where + }; + + return this.get({ + path: '/classification-guides', + queryParams + }); + } + + /** + * List all subtopics + * + * @param topicId The identifier for the topic + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.where A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR. Fields to filter on: + * - hasInstruction + * - hasSubtopics + * @param opts.includeSource Also include **source** in addition to **entries** with folder information on the parent guide/topic + * @returns Promise<SubtopicPaging> + */ + listSubtopics( + topicId: string, + opts?: { + orderBy?: string[]; + where?: string; + includeSource?: boolean; + } & GsPagingQuery & + GsIncludeQuery + ): Promise<SubtopicPaging> { + throwIfNotDefined(topicId, 'topicId'); + opts = opts || {}; + + const pathParams = { + topicId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + where: opts?.where, + includeSource: opts?.includeSource + }; + + return this.get({ + path: '/topics/{topicId}/subtopics', + pathParams, + queryParams, + returnType: SubtopicPaging + }); + } + + /** + * List all topics + * + * @param classificationGuideId The identifier for the classification guide + * @param opts Optional parameters + * @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to + * sort the list by one or more fields. + * Each field has a default sort order, which is normally ascending order. Read the API method implementation notes + * above to check if any fields used in this method have a descending default search order. + * To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + * @param opts.where A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR e.g. (instruction=true and hasSubtopics=false). Fields to filter on: + * - hasInstruction + * - hasSubtopics + * @param opts.includeSource Also include **source** in addition to **entries** with folder information on the parent guide/topic + * @returns Promise<TopicPaging> + */ + listTopics( + classificationGuideId: string, + opts?: { + orderBy?: string[]; + where?: string; + includeSource?: boolean; + } & GsPagingQuery & + GsIncludeQuery + ): Promise<TopicPaging> { + throwIfNotDefined(classificationGuideId, 'classificationGuideId'); + opts = opts || {}; + + const pathParams = { + classificationGuideId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + orderBy: buildCollectionParam(opts?.orderBy, 'csv'), + where: opts?.where, + includeSource: opts?.includeSource + }; + + return this.get({ + path: '/classification-guides/{classificationGuideId}/topics', + pathParams, + queryParams, + returnType: TopicPaging + }); + } + + /** + * Get classification guide information + * + * @param classificationGuideId The identifier for the classification guide + * @returns Promise<ClassificationGuideEntry> + */ + showClassificationGuideById(classificationGuideId: string): Promise<ClassificationGuideEntry> { + throwIfNotDefined(classificationGuideId, 'classificationGuideId'); + + const pathParams = { + classificationGuideId + }; + + return this.get({ + path: '/classification-guides/{classificationGuideId}', + pathParams + }); + } + + /** + * Get topic information + * + * @param topicId The identifier for the topic + * @param opts Optional parameters + * @returns Promise<TopicEntry> + */ + showTopicById(topicId: string, opts?: GsIncludeQuery): Promise<TopicEntry> { + throwIfNotDefined(topicId, 'topicId'); + + const pathParams = { + topicId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.post({ + path: '/topics/{topicId}', + pathParams, + queryParams, + returnType: TopicEntry + }); + } + + /** + * Update a classification guide + * + * Updates the classification guide with id **classificationGuideId**. For example, you can rename a classification guide. + * + * @param classificationGuideId The identifier for the classification guide + * @param classificationGuide Classification guide + * @returns Promise<ClassificationGuideEntry> + */ + updateClassificationGuide(classificationGuideId: string, classificationGuide: ClassificationGuideBody): Promise<ClassificationGuideEntry> { + throwIfNotDefined(classificationGuideId, 'classificationGuideId'); + throwIfNotDefined(classificationGuide, 'classificationGuide'); + + const pathParams = { + classificationGuideId + }; + + return this.put({ + path: '/classification-guides/{classificationGuideId}', + pathParams, + bodyParam: classificationGuide + }); + } + + /** + * Update a topic + * + * Updates the topic with id **topicId**. + * Use this to rename a topic or to add, edit, or remove the instruction associated with it. + * + * @param topicId The identifier for the topic + * @param topic Topic + * @param opts Optional parameters + * @returns Promise<TopicEntry> + */ + updateTopic(topicId: string, topic: TopicBody, opts?: GsIncludeQuery): Promise<TopicEntry> { + throwIfNotDefined(topicId, 'topicId'); + throwIfNotDefined(topic, 'topic'); + + const pathParams = { + topicId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.put({ + path: '/topics/{topicId}', + pathParams, + queryParams, + bodyParam: topic, + returnType: TopicEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/classificationReasons.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/classificationReasons.api.ts new file mode 100644 index 0000000000..6a4de547e6 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/classificationReasons.api.ts @@ -0,0 +1,126 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationReasonBody, ClassificationReasonEntry, ClassificationReasonsPaging } from '../model'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { GsFieldsQuery, GsPagingQuery } from './types'; + +/** + * ClassificationReasonsApi service. + */ +export class ClassificationReasonsApi extends BaseApi { + /** + * Creates a new classification reason. + * + * **Note:** You can create more than one reason by specifying a list of reasons in the JSON body. + * + * @param classificationReason Classification reason + * @returns Promise<ClassificationReasonEntry> + */ + createClassificationReason(classificationReason: ClassificationReasonBody): Promise<ClassificationReasonEntry> { + throwIfNotDefined(classificationReason, 'classificationReason'); + + return this.post({ + path: '/classification-reasons', + bodyParam: classificationReason + }); + } + + /** + * Deletes the classification reason **classificationReasonId**. + * + * You can't delete a classification reason that is being used to classify content. + * There must be at least one classification reason. + * + * @param classificationReasonId The identifier for the classification reason + * @returns Promise<{}> + */ + deleteClassificationReason(classificationReasonId: string): Promise<void> { + throwIfNotDefined(classificationReasonId, 'classificationReasonId'); + + const pathParams = { + classificationReasonId + }; + + return this.delete({ + path: '/classification-reasons/{classificationReasonId}', + pathParams + }); + } + + /** + * List all classification reasons + * + * @param opts Optional parameters + * @returns Promise<ClassificationReasonsPaging> + */ + listClassificationReasons(opts?: GsPagingQuery & GsFieldsQuery): Promise<ClassificationReasonsPaging> { + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/classification-reasons', + queryParams + }); + } + + /** + * Get classification reason information + * + * @param classificationReasonId The identifier for the classification reason + * @returns Promise<ClassificationReasonEntry> + */ + showClassificationReasonById(classificationReasonId: string): Promise<ClassificationReasonEntry> { + throwIfNotDefined(classificationReasonId, 'classificationReasonId'); + + const pathParams = { + classificationReasonId + }; + + return this.get({ + path: '/classification-reasons/{classificationReasonId}', + pathParams + }); + } + + /** + * Updates the classification reason with id **classificationReasonId**. For example, you can change a classification reason code or description. + * + * @param classificationReasonId The identifier for the classification reason + * @param classificationReason Classification reason + * @returns Promise<ClassificationReasonEntry> + */ + updateClassificationReason(classificationReasonId: string, classificationReason: ClassificationReasonBody): Promise<ClassificationReasonEntry> { + throwIfNotDefined(classificationReasonId, 'classificationReasonId'); + throwIfNotDefined(classificationReason, 'classificationReason'); + + const pathParams = { + classificationReasonId + }; + + return this.put({ + path: '/classification-reasons/{classificationReasonId}', + pathParams, + bodyParam: classificationReason + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/declassificationExemptions.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/declassificationExemptions.api.ts new file mode 100644 index 0000000000..076495fb2a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/declassificationExemptions.api.ts @@ -0,0 +1,118 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeclassificationExemptionBody, DeclassificationExemptionEntry, DeclassificationExemptionsPaging } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { GsPagingQuery } from './types'; + +/** + * DeclassificationExemptionsApi service. + */ +export class DeclassificationExemptionsApi extends BaseApi { + /** + * Create a declassification exemption + * + * @param declassificationExemption Declassification exemption + * @returns Promise<DeclassificationExemptionEntry> + */ + createDeclassificationExemption(declassificationExemption: DeclassificationExemptionBody): Promise<DeclassificationExemptionEntry> { + throwIfNotDefined(declassificationExemption, 'declassificationExemption'); + + return this.post({ + path: '/declassification-exemptions', + bodyParam: declassificationExemption + }); + } + + /** + * Deletes the declassification exemption with id **declassificationExemptionId**. + * You can't delete a classification exemption that is being used to classify content. + * + * @param declassificationExemptionId The identifier for the declassification exemption + * @returns Promise<{}> + */ + deleteDeclassificationExemption(declassificationExemptionId: string): Promise<void> { + throwIfNotDefined(declassificationExemptionId, 'declassificationExemptionId'); + + const pathParams = { + declassificationExemptionId + }; + + return this.delete({ + path: '/declassification-exemptions/{declassificationExemptionId}', + pathParams + }); + } + + /** + * List all declassification exemptions + * + * @param opts Optional parameters + * @returns Promise<DeclassificationExemptionsPaging> + */ + listDeclassificationExemptions(opts?: GsPagingQuery): Promise<DeclassificationExemptionsPaging> { + return this.get({ + path: '/declassification-exemptions', + queryParams: opts + }); + } + + /** + * Get declassification exemption information + * + * @param declassificationExemptionId The identifier for the declassification exemption + * @returns Promise<DeclassificationExemptionEntry> + */ + showDeclassificationExemptionById(declassificationExemptionId: string): Promise<DeclassificationExemptionEntry> { + throwIfNotDefined(declassificationExemptionId, 'declassificationExemptionId'); + + const pathParams = { + declassificationExemptionId + }; + + return this.get({ + path: '/declassification-exemptions/{declassificationExemptionId}', + pathParams + }); + } + + /** + * Update a declassification exemption + * + * @param declassificationExemptionId The identifier for the declassification exemption + * @param declassificationExemption Declassification exemption + * @returns Promise<DeclassificationExemptionEntry> + */ + updateDeclassificationExemption( + declassificationExemptionId: string, + declassificationExemption: DeclassificationExemptionBody + ): Promise<DeclassificationExemptionEntry> { + throwIfNotDefined(declassificationExemptionId, 'declassificationExemptionId'); + throwIfNotDefined(declassificationExemption, 'declassificationExemption'); + + const pathParams = { + declassificationExemptionId + }; + + return this.put({ + path: '/declassification-exemptions/{declassificationExemptionId}', + pathParams, + bodyParam: declassificationExemption + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/defaultClassificationValues.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/defaultClassificationValues.api.ts new file mode 100644 index 0000000000..7a8564c924 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/defaultClassificationValues.api.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeclassificationDate } from '../model'; +import { BaseApi } from './base.api'; +import { DateAlfresco } from '../../content-custom-api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * DefaultClassificationValuesApi service. + */ +export class DefaultClassificationValuesApi extends BaseApi { + /** + * Calculates the default declassification date for **nodeId** based on the properties of the node and the current declassification time frame. + * + * @param nodeId The identifier of a node. + * @returns Promise<DeclassificationDate> + */ + calculateDefaultDeclassificationDate(nodeId: string): Promise<DeclassificationDate> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + return this.post({ + path: '/default-classification-values/{nodeId}/calculate-declassification-date', + pathParams, + returnType: DateAlfresco + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/index.ts b/lib/js-api/src/api/gs-classification-rest-api/api/index.ts new file mode 100644 index 0000000000..39847e786e --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/index.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './types'; +export * from './classificationGuides.api'; +export * from './classificationReasons.api'; +export * from './declassificationExemptions.api'; +export * from './defaultClassificationValues.api'; +export * from './securityControlSettings.api'; +export * from './securityMarks.api'; +export * from './securityGroups.api'; +export * from './nodeSecurityMarks.api'; +export * from './authorityClearance.api'; diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/nodeSecurityMarks.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/nodeSecurityMarks.api.ts new file mode 100644 index 0000000000..ad5dfa5827 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/nodeSecurityMarks.api.ts @@ -0,0 +1,70 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { NodeSecurityMarkBody } from '../model/nodeSecurityMarkBody'; +import { SecurityMarkPaging } from '../model/securityMarkPaging'; +import { GsPagingQuery } from './types'; + +/** + * NodeSecurityMarksApi + */ +export class NodeSecurityMarksApi extends BaseApi { + /** + * Add/Remove security mark on a node + * + * @param nodeId The key for the node id. + * @param dataBody Array of NodeSecurityMarkBody. + * @returns Promise<SecurityMarkPaging> + */ + manageSecurityMarksOnNode(nodeId: string, dataBody: Array<NodeSecurityMarkBody>): Promise<SecurityMarkPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + throwIfNotDefined(dataBody, 'dataBody'); + + const pathParams = { + nodeId + }; + + return this.post({ + path: '/secured-nodes/{nodeId}/securing-marks', + pathParams, + bodyParam: dataBody + }); + } + + /** + * Get security marks on a node + * + * @param nodeId The key for the node id. + * @param opts Optional parameters + * @returns Promise<SecurityMarkPaging> + */ + getSecurityMarksOnNode(nodeId: string, opts?: GsPagingQuery): Promise<SecurityMarkPaging> { + throwIfNotDefined(nodeId, 'nodeId'); + + const pathParams = { + nodeId + }; + + return this.get({ + path: '/secured-nodes/{nodeId}/securing-marks', + pathParams, + queryParams: opts + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/securityControlSettings.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/securityControlSettings.api.ts new file mode 100644 index 0000000000..6e763775c0 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/securityControlSettings.api.ts @@ -0,0 +1,73 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityControlSettingBody, SecurityControlSettingEntry } from '../model'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; + +/** + * SecurityControlSettingsApi service. + * + * @module SecurityControlSettingsApi + */ +export class SecurityControlSettingsApi extends BaseApi { + /** + * Get security control setting value + * + * @param securityControlSettingKey The key for the security control setting. You can use one of the following settings: + * -declassificationTimeFrame- for the declassification time frame value set in alfresco-global.properties file + * @returns Promise<SecurityControlSettingEntry> + */ + getSecurityControlSetting(securityControlSettingKey: string): Promise<SecurityControlSettingEntry> { + throwIfNotDefined(securityControlSettingKey, 'securityControlSettingKey'); + + const pathParams = { + securityControlSettingKey + }; + + return this.get({ + path: '/security-control-settings/{securityControlSettingKey}', + pathParams + }); + } + + /** + * Update security control setting value + * + * @param securityControlSettingKey The key for the security control setting. You can use one of the following settings: + * -declassificationTimeFrame- for the declassification time frame value set in alfresco-global.properties file + * @param securityControlSettingValue The new value for the security control setting. This can be a string or number, depending on the setting key. + * @returns Promise<SecurityControlSettingEntry> + */ + updateSecurityControlSetting( + securityControlSettingKey: string, + securityControlSettingValue: SecurityControlSettingBody + ): Promise<SecurityControlSettingEntry> { + throwIfNotDefined(securityControlSettingKey, 'securityControlSettingKey'); + throwIfNotDefined(securityControlSettingValue, 'securityControlSettingValue'); + + const pathParams = { + securityControlSettingKey + }; + + return this.put({ + path: '/security-control-settings/{securityControlSettingKey}', + pathParams, + bodyParam: securityControlSettingValue + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/securityGroups.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/securityGroups.api.ts new file mode 100644 index 0000000000..81a5cfe12e --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/securityGroups.api.ts @@ -0,0 +1,109 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; +import { SecurityGroupBody, SecurityGroupEntry, SecurityGroupPaging } from '../model'; +import { GsGroupInclude, GsPagingQuery } from './types'; + +/** + * SecurityGroupsApi service. + * + * @module SecurityGroupsApi + */ +export class SecurityGroupsApi extends BaseApi { + /** + * Get All security groups + * + * @param opts Optional parameters + * @returns Promise<SecurityGroupPaging> + */ + getSecurityGroups(opts?: GsPagingQuery & GsGroupInclude): Promise<SecurityGroupPaging> { + return this.get({ + path: '/security-groups', + queryParams: opts + }); + } + + /** + * Create security group + * + * @param securityGroupBody securityGroupBody. + * @param opts Optional parameters + * @returns Promise<SecurityGroupEntry> + */ + createSecurityGroup(securityGroupBody: SecurityGroupBody, opts?: GsGroupInclude): Promise<SecurityGroupEntry> { + return this.post({ + path: '/security-groups', + queryParams: opts, + bodyParam: securityGroupBody + }); + } + + /** + * Get a security groups information + * + * @param securityGroupId The Key of Security Group id for which info is required + * @param opts Optional parameters + * @returns Promise<SecurityGroupEntry> + */ + getSecurityGroupInfo(securityGroupId: string, opts?: GsGroupInclude): Promise<SecurityGroupEntry> { + const pathParams = { + securityGroupId + }; + + return this.get({ + path: '/security-groups/{securityGroupId}', + pathParams, + queryParams: opts + }); + } + + /** + * Update a security groups information + * + * @param securityGroupId The Key of Security Group id for which info is required + * @param securityGroupBody SecurityGroupBody + * @param opts Optional parameters + * @returns Promise<SecurityGroupEntry> + */ + updateSecurityGroup(securityGroupId: string, securityGroupBody: SecurityGroupBody, opts?: GsGroupInclude): Promise<SecurityGroupEntry> { + const pathParams = { + securityGroupId + }; + + return this.put({ + path: '/security-groups/{securityGroupId}', + pathParams, + queryParams: opts, + bodyParam: securityGroupBody + }); + } + + /** + * Delete security group + * + * @param securityGroupId The key for the security group id. + * @returns Promise<SecurityMarkEntry> + */ + deleteSecurityGroup(securityGroupId: string): Promise<void> { + const pathParams = { securityGroupId }; + return this.delete({ + path: '/security-groups/{securityGroupId}', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/securityMarks.api.ts b/lib/js-api/src/api/gs-classification-rest-api/api/securityMarks.api.ts new file mode 100644 index 0000000000..913f2027ed --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/securityMarks.api.ts @@ -0,0 +1,138 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { SecurityMarkBody, SecurityMarkEntry, SecurityMarkPaging } from '../model'; +import { GsPagingQuery } from './types'; + +/** + * Security Marks API. + * + * @module SecurityMarksApi + */ +export class SecurityMarksApi extends BaseApi { + /** + * Get security mark value + * + * @param securityGroupId The key for the security group id. + * @param opts Options + * @returns Promise<SecurityMarkPaging> + */ + getSecurityMarks(securityGroupId: string, opts?: GsPagingQuery): Promise<SecurityMarkPaging> { + throwIfNotDefined(securityGroupId, 'securityGroupId'); + + const pathParams = { + securityGroupId + }; + + return this.get({ + path: '/security-groups/{securityGroupId}/security-marks', + pathParams, + queryParams: opts + }); + } + + /** + * Create security marks + * + * @param securityGroupId The key for the security group id. + * @param securityMarkBody securityMarkBody[]. + * @returns Promise<SecurityMarkEntry|SecurityMarkPaging> + */ + createSecurityMarks(securityGroupId: string, securityMarkBody: SecurityMarkBody[]): Promise<SecurityMarkPaging | SecurityMarkEntry> { + throwIfNotDefined(securityGroupId, 'securityGroupId'); + throwIfNotDefined(securityMarkBody, 'securityMarkBody'); + + const pathParams = { securityGroupId }; + + return this.post({ + path: '/security-groups/{securityGroupId}/security-marks', + pathParams, + bodyParam: securityMarkBody + }); + } + + /** + * Get security mark value information + * + * @param securityGroupId The key for the security group id. + * @param securityMarkId The key for the security mark id + * @returns Promise<SecurityMarkEntry> + */ + getSecurityMark(securityGroupId: string, securityMarkId: string): Promise<SecurityMarkEntry> { + throwIfNotDefined(securityGroupId, 'securityGroupId'); + throwIfNotDefined(securityMarkId, 'securityMarkId'); + + const pathParams = { + securityGroupId, + securityMarkId + }; + + return this.get({ + path: '/security-groups/{securityGroupId}/security-marks/{securityMarkId}', + pathParams + }); + } + + /** + * Updates Security Mark value + * + * @param securityGroupId The key for the security group id. + * @param securityMarkId The key for the security mark is in use or not. + * @param securityMarkBody securityMarkBody. + * @returns Promise<SecurityMarkEntry> + */ + updateSecurityMark(securityGroupId: string, securityMarkId: string, securityMarkBody: SecurityMarkBody): Promise<SecurityMarkEntry> { + throwIfNotDefined(securityGroupId, 'securityGroupId'); + throwIfNotDefined(securityMarkId, 'securityMarkId'); + throwIfNotDefined(securityMarkBody, 'securityMarkBody'); + + const pathParams = { + securityGroupId, + securityMarkId + }; + + return this.put({ + path: '/security-groups/{securityGroupId}/security-marks/{securityMarkId}', + pathParams, + bodyParam: securityMarkBody + }); + } + + /** + * Delete security mark + * + * @param securityGroupId The key for the security group id. + * @param securityMarkId The key for the security mark id. + * @returns Promise<any> + */ + deleteSecurityMark(securityGroupId: string, securityMarkId: string): Promise<SecurityMarkEntry> { + throwIfNotDefined(securityGroupId, 'securityGroupId'); + throwIfNotDefined(securityMarkId, 'securityMarkId'); + + const pathParams = { + securityGroupId, + securityMarkId + }; + + return this.delete({ + path: '/security-groups/{securityGroupId}/security-marks/{securityMarkId}', + pathParams + }); + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/api/types.ts b/lib/js-api/src/api/gs-classification-rest-api/api/types.ts new file mode 100644 index 0000000000..09f1a9682c --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/api/types.ts @@ -0,0 +1,60 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type GsGroupInclude = { + /** + * Returns additional information about the security group. The following optional fields can be requested: + * - inUse - A flag indicating whether the security group is in use or not. + */ + include?: string; +}; + +export type GsPagingQuery = { + /** + * The number of entities that exist in the collection before those included in this list. + */ + skipCount?: number; + + /** + * The maximum number of items to return in the list. + */ + maxItems?: number; +}; + +export type GsFieldsQuery = { + /** + * A list of field names. + * + * You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * + * The list applies to a returned individual + * entity or entries within a collection. + * + * If the API method also supports the **include** + * parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + */ + fields?: string[]; +}; + +export type GsIncludeQuery = { + /** + * Returns additional information about the record. Any optional field from the response model can be requested. + */ + include?: string[]; +}; diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroup.md b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroup.md new file mode 100644 index 0000000000..f1aac4949b --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroup.md @@ -0,0 +1,10 @@ +# AuthorityClearanceGroup + +## Properties +| Name | Type | Description | Notes | +|------------------|---------------------------------------------------------------|-------------|--------------------| +| **id** | **string** | | [default to null] | +| **displayLabel** | **string** | | [default to null] | +| **systemGroup** | **boolean** | | [default to false] | +| **type** | **string** | | [default to null] | +| **marks** | **[**AuthorityClearanceMark**](AuthorityClearanceMark.md)[]** | | [default to null] | diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupEntry.md new file mode 100644 index 0000000000..43bdd1277a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupEntry.md @@ -0,0 +1,8 @@ +# AuthorityClearanceGroupEntry + +## Properties +| Name | Type | Description | Notes | +|-----------|-----------------------------------------------------------|-------------|-------------------| +| **entry** | [**AuthorityClearanceGroup**](AuthorityClearanceGroup.md) | | [default to null] | + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupPaging.md b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupPaging.md new file mode 100644 index 0000000000..b62f189fcc --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupPaging.md @@ -0,0 +1,8 @@ +# AuthorityClearanceGroupPaging + +## Properties +| Name | Type | Description | Notes | +|----------|--------------------------------------------------------------------------------|-------------|------------------------------| +| **list** | [**AuthorityClearanceGroupPagingList**](AuthorityClearanceGroupPaging_list.md) | | [optional] [default to null] | + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupPaging_list.md b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupPaging_list.md new file mode 100644 index 0000000000..b1331abc20 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceGroupPaging_list.md @@ -0,0 +1,9 @@ +# AuthorityClearanceGroupPagingList + +## Properties +| Name | Type | Description | Notes | +|----------------|-----------------------------------------------------------------------|-------------|------------------------------| +| **pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] | +| **entries** | [**AuthorityClearanceGroupEntry[]**](AuthorityClearanceGroupEntry.md) | | [optional] [default to null] | + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceMark.md b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceMark.md new file mode 100644 index 0000000000..9720a344d5 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/AuthorityClearanceMark.md @@ -0,0 +1,9 @@ +# AuthorityClearanceMark + +## Properties +| Name | Type | Description | Notes | +|------------------|-------------|-------------|--------------------| +| **id** | **string** | | [default to null] | +| **displayLabel** | **string** | | [default to null] | +| **applied** | **boolean** | | [default to false] | +| **inherited** | **boolean** | | [default to false] | diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuide.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuide.md new file mode 100644 index 0000000000..52f17dc197 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuide.md @@ -0,0 +1,11 @@ +# ClassificationGuide + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [default to null] +**originatingOrganization** | **string** | | [default to null] +**publishedOn** | **Date** | | [default to null] +**enabled** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideBody.md new file mode 100644 index 0000000000..4ea060d73a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideBody.md @@ -0,0 +1,11 @@ +# ClassificationGuideBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [default to null] +**originatingOrganization** | **string** | | [default to null] +**publishedOn** | **Date** | | [default to null] +**enabled** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideEntry.md new file mode 100644 index 0000000000..1cc86938de --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideEntry.md @@ -0,0 +1,8 @@ +# ClassificationGuideEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**ClassificationGuide**](ClassificationGuide.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideInTopic.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideInTopic.md new file mode 100644 index 0000000000..95636a8a07 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuideInTopic.md @@ -0,0 +1,11 @@ +# ClassificationGuideInTopic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [default to null] +**originatingOrganization** | **string** | | [default to null] +**publishedOn** | **Date** | | [default to null] +**enabled** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidePaging.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidePaging.md new file mode 100644 index 0000000000..76a2493c0d --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidePaging.md @@ -0,0 +1,8 @@ +# ClassificationGuidePaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**ClassificationGuidePagingList**](ClassificationGuidePagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidePaging_list.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidePaging_list.md new file mode 100644 index 0000000000..0b7e1fe93a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidePaging_list.md @@ -0,0 +1,9 @@ +# ClassificationGuidePagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**ClassificationGuidesEntry[]**](ClassificationGuidesEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuides.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuides.md new file mode 100644 index 0000000000..d8edee1800 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuides.md @@ -0,0 +1,12 @@ +# ClassificationGuides + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [default to null] +**originatingOrganization** | **string** | | [default to null] +**publishedOn** | **Date** | | [default to null] +**enabled** | **boolean** | | [optional] [default to null] +**hasTopics** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesApi.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesApi.md new file mode 100644 index 0000000000..542436a80a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesApi.md @@ -0,0 +1,715 @@ +# ClassificationGuidesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**combinedInstructions**](ClassificationGuidesApi.md#combinedInstructions) | **POST** /combined-instructions | Combined instructions +[**createClassificationGuide**](ClassificationGuidesApi.md#createClassificationGuide) | **POST** /classification-guides | Create a classification guide +[**createSubtopic**](ClassificationGuidesApi.md#createSubtopic) | **POST** /topics/{topicId}/subtopics | Create a subtopic +[**createTopic**](ClassificationGuidesApi.md#createTopic) | **POST** /classification-guides/{classificationGuideId}/topics | Create a topic +[**deleteClassificationGuide**](ClassificationGuidesApi.md#deleteClassificationGuide) | **DELETE** /classification-guides/{classificationGuideId} | Delete a classification guide +[**deleteTopic**](ClassificationGuidesApi.md#deleteTopic) | **DELETE** /topics/{topicId} | Delete a topic +[**listClassificationGuides**](ClassificationGuidesApi.md#listClassificationGuides) | **GET** /classification-guides | List all classification guides +[**listSubtopics**](ClassificationGuidesApi.md#listSubtopics) | **GET** /topics/{topicId}/subtopics | List all subtopics +[**listTopics**](ClassificationGuidesApi.md#listTopics) | **GET** /classification-guides/{classificationGuideId}/topics | List all topics +[**showClassificationGuideById**](ClassificationGuidesApi.md#showClassificationGuideById) | **GET** /classification-guides/{classificationGuideId} | Get classification guide information +[**showTopicById**](ClassificationGuidesApi.md#showTopicById) | **GET** /topics/{topicId} | Get topic information +[**updateClassificationGuide**](ClassificationGuidesApi.md#updateClassificationGuide) | **PUT** /classification-guides/{classificationGuideId} | Update a classification guide +[**updateTopic**](ClassificationGuidesApi.md#updateTopic) | **PUT** /topics/{topicId} | Update a topic + + +<a name="combinedInstructions"></a> +# **combinedInstructions** +> InstructionEntry combinedInstructions(opts) + +Combined instructions + +Combines instructions from the given topics and the user defined instruction, if any. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + +let opts = { + 'instructions': // | Instructions +}; + +classificationguidesApi.combinedInstructions(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instructions** | [**CombinedInstructionBody**](CombinedInstructionBody.md)| Instructions | [optional] + +### Return type + +[**InstructionEntry**](InstructionEntry.md) + +<a name="createClassificationGuide"></a> +# **createClassificationGuide** +> ClassificationGuideEntry createClassificationGuide(classificationGuide) + +Create a classification guide + +Creates a new classification guide. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + + +classificationguidesApi.createClassificationGuide(classificationGuide).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationGuide** | [**ClassificationGuideBody**](ClassificationGuideBody.md)| Classification guide | + +### Return type + +[**ClassificationGuideEntry**](ClassificationGuideEntry.md) + +<a name="createSubtopic"></a> +# **createSubtopic** +> TopicEntry createSubtopic(topicIdtopicopts) + +Create a subtopic + +Creates a new subtopic of a topic. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + +}; + +classificationguidesApi.createSubtopic(topicIdtopicopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **topicId** | **string**| The identifier for the topic | + **topic** | [**TopicBody**](TopicBody.md)| Subtopic | + **include** | [**string**](string.md)| Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + | [optional] + +### Return type + +[**TopicEntry**](TopicEntry.md) + +<a name="createTopic"></a> +# **createTopic** +> TopicEntry createTopic(classificationGuideIdtopicopts) + +Create a topic + +Creates a new topic. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + +}; + +classificationguidesApi.createTopic(classificationGuideIdtopicopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationGuideId** | **string**| The identifier for the classification guide | + **topic** | [**TopicBody**](TopicBody.md)| Topic | + **include** | [**string**](string.md)| Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + | [optional] + +### Return type + +[**TopicEntry**](TopicEntry.md) + +<a name="deleteClassificationGuide"></a> +# **deleteClassificationGuide** +> deleteClassificationGuide(classificationGuideId) + +Delete a classification guide + +Deletes the classification guide with id **classificationGuideId**, including any topics and instructions. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + + +classificationguidesApi.deleteClassificationGuide(classificationGuideId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationGuideId** | **string**| The identifier for the classification guide | + +### Return type + +null (empty response body) + +<a name="deleteTopic"></a> +# **deleteTopic** +> deleteTopic(topicId) + +Delete a topic + +Deletes the topic with id **topicId**, including any subtopics and instructions. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + + +classificationguidesApi.deleteTopic(topicId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **topicId** | **string**| The identifier for the topic | + +### Return type + +null (empty response body) + +<a name="listClassificationGuides"></a> +# **listClassificationGuides** +> ClassificationGuidePaging listClassificationGuides(opts) + +List all classification guides + +Gets all classification guides. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the guide. The following optional fields can be requested: +* hasTopics - A flag indicating whether the guide already contains any topics. + + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'orderBy': // | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to +sort the list by one or more fields. + +Each field has a default sort order, which is normally ascending order. Read the API method implementation notes +above to check if any fields used in this method have a descending default search order. + +To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + + 'where': where_example // | A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR. Fields to filter on: +* enabled - e.g. (enabled = true OR enabled = false) + +}; + +classificationguidesApi.listClassificationGuides(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | [**string**](string.md)| Returns additional information about the guide. The following optional fields can be requested: +* hasTopics - A flag indicating whether the guide already contains any topics. + | [optional] + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **orderBy** | [**string**](string.md)| A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to +sort the list by one or more fields. + +Each field has a default sort order, which is normally ascending order. Read the API method implementation notes +above to check if any fields used in this method have a descending default search order. + +To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + | [optional] + **where** | **string**| A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR. Fields to filter on: +* enabled - e.g. (enabled = true OR enabled = false) + | [optional] + +### Return type + +[**ClassificationGuidePaging**](ClassificationGuidePaging.md) + +<a name="listSubtopics"></a> +# **listSubtopics** +> SubtopicPaging listSubtopics(topicIdopts) + +List all subtopics + +Gets all subtopics of a topic. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'orderBy': // | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to +sort the list by one or more fields. + +Each field has a default sort order, which is normally ascending order. Read the API method implementation notes +above to check if any fields used in this method have a descending default search order. + +To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + + 'where': where_example // | A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR. Fields to filter on: +* hasInstruction +* hasSubtopics + + 'includeSource': true // | Also include **source** in addition to **entries** with folder information on the parent guide/topic +}; + +classificationguidesApi.listSubtopics(topicIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **topicId** | **string**| The identifier for the topic | + **include** | [**string**](string.md)| Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + | [optional] + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **orderBy** | [**string**](string.md)| A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to +sort the list by one or more fields. + +Each field has a default sort order, which is normally ascending order. Read the API method implementation notes +above to check if any fields used in this method have a descending default search order. + +To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + | [optional] + **where** | **string**| A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR. Fields to filter on: +* hasInstruction +* hasSubtopics + | [optional] + **includeSource** | **boolean**| Also include **source** in addition to **entries** with folder information on the parent guide/topic | [optional] + +### Return type + +[**SubtopicPaging**](SubtopicPaging.md) + +<a name="listTopics"></a> +# **listTopics** +> TopicPaging listTopics(classificationGuideIdopts) + +List all topics + +Gets all topics. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'orderBy': // | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to +sort the list by one or more fields. + +Each field has a default sort order, which is normally ascending order. Read the API method implementation notes +above to check if any fields used in this method have a descending default search order. + +To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + + 'where': where_example // | A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR e.g. (instruction=true and hasSubtopics=false). Fields to filter on: +* hasInstruction +* hasSubtopics + + 'includeSource': true // | Also include **source** in addition to **entries** with folder information on the parent guide/topic +}; + +classificationguidesApi.listTopics(classificationGuideIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationGuideId** | **string**| The identifier for the classification guide | + **include** | [**string**](string.md)| Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + | [optional] + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **orderBy** | [**string**](string.md)| A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to +sort the list by one or more fields. + +Each field has a default sort order, which is normally ascending order. Read the API method implementation notes +above to check if any fields used in this method have a descending default search order. + +To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. + | [optional] + **where** | **string**| A string to restrict the returned objects by using a predicate. Supported operations are AND, NOT, and OR e.g. (instruction=true and hasSubtopics=false). Fields to filter on: +* hasInstruction +* hasSubtopics + | [optional] + **includeSource** | **boolean**| Also include **source** in addition to **entries** with folder information on the parent guide/topic | [optional] + +### Return type + +[**TopicPaging**](TopicPaging.md) + +<a name="showClassificationGuideById"></a> +# **showClassificationGuideById** +> ClassificationGuideEntry showClassificationGuideById(classificationGuideId) + +Get classification guide information + +Gets the classification guide with id **classificationGuideId**. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + + +classificationguidesApi.showClassificationGuideById(classificationGuideId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationGuideId** | **string**| The identifier for the classification guide | + +### Return type + +[**ClassificationGuideEntry**](ClassificationGuideEntry.md) + +<a name="showTopicById"></a> +# **showTopicById** +> TopicEntry showTopicById(topicIdopts) + +Get topic information + +Gets the topic with id **topicId**. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + +}; + +classificationguidesApi.showTopicById(topicIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **topicId** | **string**| The identifier for the topic | + **include** | [**string**](string.md)| Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + | [optional] + +### Return type + +[**TopicEntry**](TopicEntry.md) + +<a name="updateClassificationGuide"></a> +# **updateClassificationGuide** +> ClassificationGuideEntry updateClassificationGuide(classificationGuideIdclassificationGuide) + +Update a classification guide + +Updates the classification guide with id **classificationGuideId**. For example, you can rename a classification guide. + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + + +classificationguidesApi.updateClassificationGuide(classificationGuideIdclassificationGuide).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationGuideId** | **string**| The identifier for the classification guide | + **classificationGuide** | [**ClassificationGuideBody**](ClassificationGuideBody.md)| Classification guide | + +### Return type + +[**ClassificationGuideEntry**](ClassificationGuideEntry.md) + +<a name="updateTopic"></a> +# **updateTopic** +> TopicEntry updateTopic(topicIdtopicopts) + +Update a topic + +Updates the topic with id **topicId**. + +Use this to rename a topic or to add, edit, or remove the instruction associated with it. + + +### Example +```javascript +import ClassificationGuidesApi from 'ClassificationGuidesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationguidesApi = new ClassificationGuidesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + +}; + +classificationguidesApi.updateTopic(topicIdtopicopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **topicId** | **string**| The identifier for the topic | + **topic** | [**TopicBody**](TopicBody.md)| Topic | + **include** | [**string**](string.md)| Returns additional information about the topic. The following optional fields can be requested: +* hasSubtopics - A flag indicating whether the topic already contains any subtopics. +* instruction - Contains details of any instruction in the topic. +* path - An ordered list of id-name pairs of all ancestor topics and the classification guide. +* classificationGuide - The classification guide this topic is in. + | [optional] + +### Return type + +[**TopicEntry**](TopicEntry.md) + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesBody.md new file mode 100644 index 0000000000..3f1d3c99cc --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesBody.md @@ -0,0 +1,12 @@ +# ClassificationGuidesBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [default to null] +**originatingOrganization** | **string** | | [default to null] +**publishedOn** | **Date** | | [default to null] +**enabled** | **boolean** | | [optional] [default to null] +**hasTopics** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesEntry.md new file mode 100644 index 0000000000..6ba796a218 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesEntry.md @@ -0,0 +1,8 @@ +# ClassificationGuidesEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**ClassificationGuides**](ClassificationGuides.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesInTopic.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesInTopic.md new file mode 100644 index 0000000000..085db74079 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationGuidesInTopic.md @@ -0,0 +1,12 @@ +# ClassificationGuidesInTopic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [default to null] +**originatingOrganization** | **string** | | [default to null] +**publishedOn** | **Date** | | [default to null] +**enabled** | **boolean** | | [optional] [default to null] +**hasTopics** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationInformation.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationInformation.md new file mode 100644 index 0000000000..11bee32372 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationInformation.md @@ -0,0 +1,16 @@ +# ClassificationInformation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**level** | **string** | | [default to null] +**classificationAgency** | **string** | | [optional] [default to null] +**reasonIds** | **string[]** | | [default to null] +**downgradeOn** | **Date** | | [optional] [default to null] +**downgradeEvent** | **string** | | [optional] [default to null] +**downgradeInstructions** | **string** | | [optional] [default to null] +**declassifyOn** | **Date** | | [optional] [default to null] +**declassificationEvent** | **string** | | [optional] [default to null] +**exemptionIds** | **string[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReason.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReason.md new file mode 100644 index 0000000000..c6ac9a9e64 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReason.md @@ -0,0 +1,10 @@ +# ClassificationReason + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**code** | **string** | | [default to null] +**description** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonBody.md new file mode 100644 index 0000000000..b001edf318 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonBody.md @@ -0,0 +1,9 @@ +# ClassificationReasonBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | | [default to null] +**description** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonEntry.md new file mode 100644 index 0000000000..3bc5be54b9 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonEntry.md @@ -0,0 +1,8 @@ +# ClassificationReasonEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**ClassificationReason**](ClassificationReason.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsApi.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsApi.md new file mode 100644 index 0000000000..5010a63335 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsApi.md @@ -0,0 +1,281 @@ +# ClassificationReasonsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createClassificationReason**](ClassificationReasonsApi.md#createClassificationReason) | **POST** /classification-reasons | Create a classification reason +[**deleteClassificationReason**](ClassificationReasonsApi.md#deleteClassificationReason) | **DELETE** /classification-reasons/{classificationReasonId} | Delete a classification reason +[**listClassificationReasons**](ClassificationReasonsApi.md#listClassificationReasons) | **GET** /classification-reasons | List all classification reasons +[**showClassificationReasonById**](ClassificationReasonsApi.md#showClassificationReasonById) | **GET** /classification-reasons/{classificationReasonId} | Get classification reason information +[**updateClassificationReason**](ClassificationReasonsApi.md#updateClassificationReason) | **PUT** /classification-reasons/{classificationReasonId} | Update a classification reason + + +<a name="createClassificationReason"></a> +# **createClassificationReason** +> ClassificationReasonEntry createClassificationReason(classificationReason) + +Create a classification reason + +Creates a new classification reason. + +**Note:** You can create more than one reason by specifying a list of reasons in the JSON body. +For example, the following JSON body creates two classification reasons: +JSON +[ + { + \"code\":\"My Code1\", + \"description\":\"My Description1\" + }, + { + \"code\":\"My Code2\", + \"description\":\"My Description2\" + } +] + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +JSON +{ + \"list\": { + \"pagination\": { + \"count\": 2, + \"hasMoreItems\": false, + \"totalItems\": 2, + \"skipCount\": 0, + \"maxItems\": 100 + }, + \"entries\": [ + { + \"entry\": { + ... + } + }, + { + \"entry\": { + ... + } + } + ] + } +} + + + +### Example +```javascript +import ClassificationReasonsApi from 'ClassificationReasonsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationreasonsApi = new ClassificationReasonsApi(this.alfrescoApi); + + +classificationreasonsApi.createClassificationReason(classificationReason).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationReason** | [**ClassificationReasonBody**](ClassificationReasonBody.md)| Classification reason | + +### Return type + +[**ClassificationReasonEntry**](ClassificationReasonEntry.md) + +<a name="deleteClassificationReason"></a> +# **deleteClassificationReason** +> deleteClassificationReason(classificationReasonId) + +Delete a classification reason + +Deletes the classification reason **classificationReasonId**. You can't delete a classification reason that is being used to classify content. There must be at least one classification reason. + +### Example +```javascript +import ClassificationReasonsApi from 'ClassificationReasonsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationreasonsApi = new ClassificationReasonsApi(this.alfrescoApi); + + +classificationreasonsApi.deleteClassificationReason(classificationReasonId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationReasonId** | **string**| The identifier for the classification reason | + +### Return type + +null (empty response body) + +<a name="listClassificationReasons"></a> +# **listClassificationReasons** +> ClassificationReasonsPaging listClassificationReasons(opts) + +List all classification reasons + +Gets all classification reasons. + +### Example +```javascript +import ClassificationReasonsApi from 'ClassificationReasonsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationreasonsApi = new ClassificationReasonsApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +classificationreasonsApi.listClassificationReasons(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**ClassificationReasonsPaging**](ClassificationReasonsPaging.md) + +<a name="showClassificationReasonById"></a> +# **showClassificationReasonById** +> ClassificationReasonEntry showClassificationReasonById(classificationReasonId) + +Get classification reason information + +Gets the classification reason **classificationReasonId**. + +### Example +```javascript +import ClassificationReasonsApi from 'ClassificationReasonsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationreasonsApi = new ClassificationReasonsApi(this.alfrescoApi); + + +classificationreasonsApi.showClassificationReasonById(classificationReasonId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationReasonId** | **string**| The identifier for the classification reason | + +### Return type + +[**ClassificationReasonEntry**](ClassificationReasonEntry.md) + +<a name="updateClassificationReason"></a> +# **updateClassificationReason** +> ClassificationReasonEntry updateClassificationReason(classificationReasonIdclassificationReason) + +Update a classification reason + +Updates the classification reason with id **classificationReasonId**. For example, you can change a classification reason code or description. + +### Example +```javascript +import ClassificationReasonsApi from 'ClassificationReasonsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let classificationreasonsApi = new ClassificationReasonsApi(this.alfrescoApi); + + +classificationreasonsApi.updateClassificationReason(classificationReasonIdclassificationReason).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **classificationReasonId** | **string**| The identifier for the classification reason | + **classificationReason** | [**ClassificationReasonBody**](ClassificationReasonBody.md)| Classification reason | + +### Return type + +[**ClassificationReasonEntry**](ClassificationReasonEntry.md) + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsPaging.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsPaging.md new file mode 100644 index 0000000000..046b30e402 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsPaging.md @@ -0,0 +1,8 @@ +# ClassificationReasonsPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**ClassificationReasonsPagingList**](ClassificationReasonsPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsPaging_list.md b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsPaging_list.md new file mode 100644 index 0000000000..ddade49532 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/ClassificationReasonsPaging_list.md @@ -0,0 +1,9 @@ +# ClassificationReasonsPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**ClassificationReasonEntry[]**](ClassificationReasonEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/CombinedInstructionBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/CombinedInstructionBody.md new file mode 100644 index 0000000000..f217033bac --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/CombinedInstructionBody.md @@ -0,0 +1,9 @@ +# CombinedInstructionBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**classificationInformation** | [**ClassificationInformation**](ClassificationInformation.md) | | [optional] [default to null] +**securityMarkInformation** | [**SecurityMarkInformationBody**](SecurityMarkInformationBody.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationDate.md b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationDate.md new file mode 100644 index 0000000000..f6fc34db31 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationDate.md @@ -0,0 +1,7 @@ +# DeclassificationDate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemption.md b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemption.md new file mode 100644 index 0000000000..5577e9942f --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemption.md @@ -0,0 +1,10 @@ +# DeclassificationExemption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**code** | **string** | | [default to null] +**description** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionBody.md new file mode 100644 index 0000000000..b5b5ca3374 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionBody.md @@ -0,0 +1,9 @@ +# DeclassificationExemptionBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | | [default to null] +**description** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionEntry.md new file mode 100644 index 0000000000..b1bcf5a23a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionEntry.md @@ -0,0 +1,8 @@ +# DeclassificationExemptionEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**DeclassificationExemption**](DeclassificationExemption.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsApi.md b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsApi.md new file mode 100644 index 0000000000..cf58e0c758 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsApi.md @@ -0,0 +1,257 @@ +# DeclassificationExemptionsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createDeclassificationExemption**](DeclassificationExemptionsApi.md#createDeclassificationExemption) | **POST** /declassification-exemptions | Create a declassification exemption +[**deleteDeclassificationExemption**](DeclassificationExemptionsApi.md#deleteDeclassificationExemption) | **DELETE** /declassification-exemptions/{declassificationExemptionId} | Delete a declassification exemption +[**listDeclassificationExemptions**](DeclassificationExemptionsApi.md#listDeclassificationExemptions) | **GET** /declassification-exemptions | List all declassification exemptions +[**showDeclassificationExemptionById**](DeclassificationExemptionsApi.md#showDeclassificationExemptionById) | **GET** /declassification-exemptions/{declassificationExemptionId} | Get declassification exemption information +[**updateDeclassificationExemption**](DeclassificationExemptionsApi.md#updateDeclassificationExemption) | **PUT** /declassification-exemptions/{declassificationExemptionId} | Update a declassification exemption + + +<a name="createDeclassificationExemption"></a> +# **createDeclassificationExemption** +> DeclassificationExemptionEntry createDeclassificationExemption(declassificationExemption) + +Create a declassification exemption + +Creates a new declassification exemption. + +**Note:** You can create more than one exemption by specifying a list of exemptions in the JSON body. +For example, the following JSON body creates two declassification exemptions: +JSON +[ + { + \"code\":\"My Code1\", + \"description\":\"My Description1\" + }, + { + \"code\":\"My Code2\", + \"description\":\"My Description2\" + } +] + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +JSON +{ + \"list\": { + \"pagination\": { + \"count\": 2, + \"hasMoreItems\": false, + \"totalItems\": 2, + \"skipCount\": 0, + \"maxItems\": 100 + }, + \"entries\": [ + { + \"entry\": { + ... + } + }, + { + \"entry\": { + ... + } + } + ] + } +} + + + +### Example +```javascript +import DeclassificationExemptionsApi from 'DeclassificationExemptionsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let declassificationexemptionsApi = new DeclassificationExemptionsApi(this.alfrescoApi); + + +declassificationexemptionsApi.createDeclassificationExemption(declassificationExemption).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **declassificationExemption** | [**DeclassificationExemptionBody**](DeclassificationExemptionBody.md)| Declassification exemption | + +### Return type + +[**DeclassificationExemptionEntry**](DeclassificationExemptionEntry.md) + +<a name="deleteDeclassificationExemption"></a> +# **deleteDeclassificationExemption** +> deleteDeclassificationExemption(declassificationExemptionId) + +Delete a declassification exemption + +Deletes the declassification exemption with id **declassificationExemptionId**. You can't delete a classification exemption that is being used to classify content. + +### Example +```javascript +import DeclassificationExemptionsApi from 'DeclassificationExemptionsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let declassificationexemptionsApi = new DeclassificationExemptionsApi(this.alfrescoApi); + + +declassificationexemptionsApi.deleteDeclassificationExemption(declassificationExemptionId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **declassificationExemptionId** | **string**| The identifier for the declassification exemption | + +### Return type + +null (empty response body) + +<a name="listDeclassificationExemptions"></a> +# **listDeclassificationExemptions** +> DeclassificationExemptionsPaging listDeclassificationExemptions(opts) + +List all declassification exemptions + +Gets all declassification exemptions. + +### Example +```javascript +import DeclassificationExemptionsApi from 'DeclassificationExemptionsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let declassificationexemptionsApi = new DeclassificationExemptionsApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. +}; + +declassificationexemptionsApi.listDeclassificationExemptions(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + +### Return type + +[**DeclassificationExemptionsPaging**](DeclassificationExemptionsPaging.md) + +<a name="showDeclassificationExemptionById"></a> +# **showDeclassificationExemptionById** +> DeclassificationExemptionEntry showDeclassificationExemptionById(declassificationExemptionId) + +Get declassification exemption information + +Gets the declassification exemption with id **declassificationExemptionId**. + +### Example +```javascript +import DeclassificationExemptionsApi from 'DeclassificationExemptionsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let declassificationexemptionsApi = new DeclassificationExemptionsApi(this.alfrescoApi); + + +declassificationexemptionsApi.showDeclassificationExemptionById(declassificationExemptionId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **declassificationExemptionId** | **string**| The identifier for the declassification exemption | + +### Return type + +[**DeclassificationExemptionEntry**](DeclassificationExemptionEntry.md) + +<a name="updateDeclassificationExemption"></a> +# **updateDeclassificationExemption** +> DeclassificationExemptionEntry updateDeclassificationExemption(declassificationExemptionIddeclassificationExemption) + +Update a declassification exemption + +Updates the declassification exemption with id **declassificationExemptionId**. For example, you can rename a declassification exemption. + +### Example +```javascript +import DeclassificationExemptionsApi from 'DeclassificationExemptionsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let declassificationexemptionsApi = new DeclassificationExemptionsApi(this.alfrescoApi); + + +declassificationexemptionsApi.updateDeclassificationExemption(declassificationExemptionIddeclassificationExemption).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **declassificationExemptionId** | **string**| The identifier for the declassification exemption | + **declassificationExemption** | [**DeclassificationExemptionBody**](DeclassificationExemptionBody.md)| Declassification exemption | + +### Return type + +[**DeclassificationExemptionEntry**](DeclassificationExemptionEntry.md) + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsPaging.md b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsPaging.md new file mode 100644 index 0000000000..8bc68ba1aa --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsPaging.md @@ -0,0 +1,8 @@ +# DeclassificationExemptionsPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**DeclassificationExemptionsPagingList**](DeclassificationExemptionsPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsPaging_list.md b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsPaging_list.md new file mode 100644 index 0000000000..c42344ecb1 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/DeclassificationExemptionsPaging_list.md @@ -0,0 +1,9 @@ +# DeclassificationExemptionsPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**DeclassificationExemptionEntry[]**](DeclassificationExemptionEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/DefaultClassificationValuesApi.md b/lib/js-api/src/api/gs-classification-rest-api/docs/DefaultClassificationValuesApi.md new file mode 100644 index 0000000000..dd76de6c10 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/DefaultClassificationValuesApi.md @@ -0,0 +1,48 @@ +# DefaultClassificationValuesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**calculateDefaultDeclassificationDate**](DefaultClassificationValuesApi.md#calculateDefaultDeclassificationDate) | **POST** /default-classification-values/{nodeId}/calculate-declassification-date | Calculate the default declassification date + + +<a name="calculateDefaultDeclassificationDate"></a> +# **calculateDefaultDeclassificationDate** +> DeclassificationDate calculateDefaultDeclassificationDate(nodeId) + +Calculate the default declassification date + +Calculates the default declassification date for **nodeId** based on the properties of the node and the current declassification time frame. + +### Example +```javascript +import DefaultClassificationValuesApi from 'DefaultClassificationValuesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let defaultclassificationvaluesApi = new DefaultClassificationValuesApi(this.alfrescoApi); + + +defaultclassificationvaluesApi.calculateDefaultDeclassificationDate(nodeId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **nodeId** | **string**| The identifier of a node. | + +### Return type + +[**DeclassificationDate**](DeclassificationDate.md) + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/Error.md b/lib/js-api/src/api/gs-classification-rest-api/docs/Error.md new file mode 100644 index 0000000000..9beb7f2852 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/Error.md @@ -0,0 +1,8 @@ +# ModelError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorError**](ErrorError.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/Error_error.md b/lib/js-api/src/api/gs-classification-rest-api/docs/Error_error.md new file mode 100644 index 0000000000..c0cc6bf5e7 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/Error_error.md @@ -0,0 +1,12 @@ +# ErrorError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errorKey** | **string** | | [optional] [default to null] +**statusCode** | **number** | | [default to null] +**briefSummary** | **string** | | [default to null] +**stackTrace** | **string** | | [default to null] +**descriptionURL** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/Instruction.md b/lib/js-api/src/api/gs-classification-rest-api/docs/Instruction.md new file mode 100644 index 0000000000..fb78dd35b8 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/Instruction.md @@ -0,0 +1,9 @@ +# Instruction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**classificationInformation** | [**ClassificationInformation**](ClassificationInformation.md) | | [optional] [default to null] +**securityMarkInformation** | [**SecurityMarkInformation**](SecurityMarkInformation.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/InstructionBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/InstructionBody.md new file mode 100644 index 0000000000..86f8876f27 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/InstructionBody.md @@ -0,0 +1,9 @@ +# InstructionBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**classificationInformation** | [**ClassificationInformation**](ClassificationInformation.md) | | [optional] [default to null] +**securityMarkInformation** | [**SecurityMarkInformationBody**](SecurityMarkInformationBody.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/InstructionEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/InstructionEntry.md new file mode 100644 index 0000000000..a575bdc937 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/InstructionEntry.md @@ -0,0 +1,8 @@ +# InstructionEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Instruction**](Instruction.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/NodeSecurityMarkBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/NodeSecurityMarkBody.md new file mode 100644 index 0000000000..1f5dc2f3a7 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/NodeSecurityMarkBody.md @@ -0,0 +1,11 @@ +# NodeSecurityMarkBody + +## Properties +| Name | Type | Description | Notes | +|-------------|------------|-------------|-------------------| +| **id** | **string** | | [default to null] | +| **groupId** | **string** | | [default to null] | +| **op** | **string** | | [default to null] | + + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/Pagination.md b/lib/js-api/src/api/gs-classification-rest-api/docs/Pagination.md new file mode 100644 index 0000000000..132172b802 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/Pagination.md @@ -0,0 +1,23 @@ +# Pagination + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **number** | The number of objects in the entries array. + | [default to null] +**hasMoreItems** | **boolean** | A boolean value which is **true** if there are more entities in the collection +beyond those in this response. A true value means a request with a larger value +for the **skipCount** or the **maxItems** parameter will return more entities. + | [default to null] +**totalItems** | **number** | An integer describing the total number of entities in the collection. +The API might not be able to determine this value, +in which case this property will not be present. + | [optional] [default to null] +**skipCount** | **number** | An integer describing how many entities exist in the collection before +those included in this list. + | [default to null] +**maxItems** | **number** | The value of the **maxItems** parameter used to generate this list, +or if there was no **maxItems** parameter the default value is 100 + | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/Path.md b/lib/js-api/src/api/gs-classification-rest-api/docs/Path.md new file mode 100644 index 0000000000..47ab772dd4 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/Path.md @@ -0,0 +1,7 @@ +# Path + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/PathElement.md b/lib/js-api/src/api/gs-classification-rest-api/docs/PathElement.md new file mode 100644 index 0000000000..99db41da10 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/PathElement.md @@ -0,0 +1,9 @@ +# PathElement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**name** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSetting.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSetting.md new file mode 100644 index 0000000000..36033c588e --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSetting.md @@ -0,0 +1,9 @@ +# SecurityControlSetting + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | | [default to null] +**value** | **any** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingBody.md new file mode 100644 index 0000000000..63cd5f45e5 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingBody.md @@ -0,0 +1,8 @@ +# SecurityControlSettingBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **any** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingEntry.md new file mode 100644 index 0000000000..06ab0ae46a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingEntry.md @@ -0,0 +1,8 @@ +# SecurityControlSettingEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**SecurityControlSetting**](SecurityControlSetting.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingsApi.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingsApi.md new file mode 100644 index 0000000000..de091ff9d9 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityControlSettingsApi.md @@ -0,0 +1,93 @@ +# SecurityControlSettingsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getSecurityControlSetting**](SecurityControlSettingsApi.md#getSecurityControlSetting) | **GET** /security-control-settings/{securityControlSettingKey} | Get security control setting value +[**updateSecurityControlSetting**](SecurityControlSettingsApi.md#updateSecurityControlSetting) | **PUT** /security-control-settings/{securityControlSettingKey} | Update security control setting value + + +<a name="getSecurityControlSetting"></a> +# **getSecurityControlSetting** +> SecurityControlSettingEntry getSecurityControlSetting(securityControlSettingKey) + +Get security control setting value + +Gets the value for a selected **securityControlSettingKey**. + +### Example +```javascript +import SecurityControlSettingsApi from 'SecurityControlSettingsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let securitycontrolsettingsApi = new SecurityControlSettingsApi(this.alfrescoApi); + + +securitycontrolsettingsApi.getSecurityControlSetting(securityControlSettingKey).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **securityControlSettingKey** | **string**| The key for the security control setting. You can use one of the following settings: +* -declassificationTimeFrame- for the declassification time frame value set in alfresco-global.properties file + | + +### Return type + +[**SecurityControlSettingEntry**](SecurityControlSettingEntry.md) + +<a name="updateSecurityControlSetting"></a> +# **updateSecurityControlSetting** +> SecurityControlSettingEntry updateSecurityControlSetting(securityControlSettingKeysecurityControlSettingValue) + +Update security control setting value + +Updates the value of a selected **securityControlSettingKey**. + +### Example +```javascript +import SecurityControlSettingsApi from 'SecurityControlSettingsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let securitycontrolsettingsApi = new SecurityControlSettingsApi(this.alfrescoApi); + + +securitycontrolsettingsApi.updateSecurityControlSetting(securityControlSettingKeysecurityControlSettingValue).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **securityControlSettingKey** | **string**| The key for the security control setting. You can use one of the following settings: +* -declassificationTimeFrame- for the declassification time frame value set in alfresco-global.properties file + | + **securityControlSettingValue** | [**SecurityControlSettingBody**](SecurityControlSettingBody.md)| The new value for the security control setting. This can be a string or number, depending on the setting key. | + +### Return type + +[**SecurityControlSettingEntry**](SecurityControlSettingEntry.md) + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroup.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroup.md new file mode 100644 index 0000000000..3adb049c3d --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroup.md @@ -0,0 +1,9 @@ +# SecurityGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**groupName** | **string** | | [default to null] +**groupType** | **string** | | [default to null] +**inUse** | **boolean** | | [default to null] diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupBody.md new file mode 100644 index 0000000000..c4c8978af0 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupBody.md @@ -0,0 +1,9 @@ +# SecurityGroupBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**groupName** | **string** | | [default to null] +**groupType** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupEntry.md new file mode 100644 index 0000000000..32c9e10b9d --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupEntry.md @@ -0,0 +1,8 @@ +# SecurityMarkEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**SecurityGroup**](SecurityGroup.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupPaging.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupPaging.md new file mode 100644 index 0000000000..3710b92976 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupPaging.md @@ -0,0 +1,8 @@ +# SecurityMarkPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**SecurityGroupPagingList**](SecurityGroupPaging_list.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupPaging_list.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupPaging_list.md new file mode 100644 index 0000000000..cc8b963aee --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityGroupPaging_list.md @@ -0,0 +1,9 @@ +# SecurityGroupPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**SecurityGroupEntry[]**](SecurityGroupEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMark.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMark.md new file mode 100644 index 0000000000..c9c847c5c1 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMark.md @@ -0,0 +1,10 @@ +# SecurityMark + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**name** | **string** | | [default to null] +**groupId** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkBody.md new file mode 100644 index 0000000000..d6b6217c2f --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkBody.md @@ -0,0 +1,8 @@ +# SecurityMarkBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkEntry.md new file mode 100644 index 0000000000..d21206f396 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkEntry.md @@ -0,0 +1,8 @@ +# SecurityMarkEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**SecurityMark**](SecurityMark.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkInformation.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkInformation.md new file mode 100644 index 0000000000..e6adee0da9 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkInformation.md @@ -0,0 +1,8 @@ +# SecurityMarkInformation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**add** | [**SecurityMarks**](SecurityMarks.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkInformationBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkInformationBody.md new file mode 100644 index 0000000000..dd52b15b50 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkInformationBody.md @@ -0,0 +1,8 @@ +# SecurityMarkInformationBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**add** | [**SecurityMarksBody**](SecurityMarksBody.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkPaging.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkPaging.md new file mode 100644 index 0000000000..558e6e6c61 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkPaging.md @@ -0,0 +1,8 @@ +# SecurityMarkPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**SecurityMarkPagingList**](SecurityMarkPaging_list.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkPaging_list.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkPaging_list.md new file mode 100644 index 0000000000..b000a2da18 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarkPaging_list.md @@ -0,0 +1,9 @@ +# SecurityMarkPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**SecurityMarkEntry[]**](SecurityMarkEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarks.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarks.md new file mode 100644 index 0000000000..ae266aab45 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarks.md @@ -0,0 +1,7 @@ +# SecurityMarks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarksBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarksBody.md new file mode 100644 index 0000000000..0e1afb9a0d --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SecurityMarksBody.md @@ -0,0 +1,7 @@ +# SecurityMarksBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/SubtopicPaging.md b/lib/js-api/src/api/gs-classification-rest-api/docs/SubtopicPaging.md new file mode 100644 index 0000000000..678f9f6a7e --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/SubtopicPaging.md @@ -0,0 +1,8 @@ +# SubtopicPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**TopicPagingList**](TopicPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/Topic.md b/lib/js-api/src/api/gs-classification-rest-api/docs/Topic.md new file mode 100644 index 0000000000..81f5d5277a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/Topic.md @@ -0,0 +1,16 @@ +# Topic + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**name** | **string** | | [default to null] +**description** | **string** | | [optional] [default to null] +**hasInstruction** | **boolean** | Flag indicating whether the topic has an instruction or not. | [default to null] +**instruction** | [**Instruction**](Instruction.md) | | [optional] [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**hasSubtopics** | **boolean** | Flag indicating whether the topic has subtopics. This field is only included when requested. | [optional] [default to null] +**path** | [**Path**](Path.md) | | [optional] [default to null] +**classificationGuide** | [**ClassificationGuideInTopic**](ClassificationGuideInTopic.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/TopicBody.md b/lib/js-api/src/api/gs-classification-rest-api/docs/TopicBody.md new file mode 100644 index 0000000000..c21c38f68a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/TopicBody.md @@ -0,0 +1,10 @@ +# TopicBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [default to null] +**description** | **string** | | [optional] [default to null] +**instruction** | [**InstructionBody**](InstructionBody.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/TopicEntry.md b/lib/js-api/src/api/gs-classification-rest-api/docs/TopicEntry.md new file mode 100644 index 0000000000..8371b44200 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/TopicEntry.md @@ -0,0 +1,8 @@ +# TopicEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Topic**](Topic.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/TopicPaging.md b/lib/js-api/src/api/gs-classification-rest-api/docs/TopicPaging.md new file mode 100644 index 0000000000..679e476dff --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/TopicPaging.md @@ -0,0 +1,8 @@ +# TopicPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**TopicPagingList**](TopicPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/docs/TopicPaging_list.md b/lib/js-api/src/api/gs-classification-rest-api/docs/TopicPaging_list.md new file mode 100644 index 0000000000..a5f9457a49 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/docs/TopicPaging_list.md @@ -0,0 +1,9 @@ +# TopicPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**TopicEntry[]**](TopicEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-classification-rest-api/index.ts b/lib/js-api/src/api/gs-classification-rest-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroup.ts b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroup.ts new file mode 100644 index 0000000000..89f53b209b --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroup.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuthorityClearanceMark } from './authorityClearanceMark'; + +export interface AuthorityClearanceGroup { + id: string; + displayLabel: string; + systemGroup: boolean; + type: string; + marks: AuthorityClearanceMark[]; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupEntry.ts new file mode 100644 index 0000000000..1524591de3 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuthorityClearanceGroup } from './authorityClearanceGroup'; + +export interface AuthorityClearanceGroupEntry { + entry: AuthorityClearanceGroup; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupPaging.ts b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupPaging.ts new file mode 100644 index 0000000000..d31ebb0013 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupPaging.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuthorityClearanceGroupPagingList } from './authorityClearanceGroupPagingList'; + +export interface AuthorityClearanceGroupPaging { + list?: AuthorityClearanceGroupPagingList; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupPagingList.ts b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupPagingList.ts new file mode 100644 index 0000000000..c4f8c13a88 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceGroupPagingList.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { AuthorityClearanceGroupEntry } from './authorityClearanceGroupEntry'; + +export interface AuthorityClearanceGroupPagingList { + pagination: Pagination; + entries?: AuthorityClearanceGroupEntry[]; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceMark.ts b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceMark.ts new file mode 100644 index 0000000000..2d8de0e790 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/authorityClearanceMark.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AuthorityClearanceMark { + id: string; + displayLabel: string; + applied: boolean; + inherited: boolean; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuide.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuide.ts new file mode 100644 index 0000000000..9bd98c379c --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuide.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A classification guide. + */ +export interface ClassificationGuide { + name: string; + originatingOrganization: string; + publishedOn: Date; + enabled?: boolean; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideBody.ts new file mode 100644 index 0000000000..fb0a416bc9 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideBody.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ClassificationGuideBody { + name: string; + originatingOrganization: string; + publishedOn: Date; + enabled?: boolean; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideEntry.ts new file mode 100644 index 0000000000..8bf5b6977b --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationGuide } from './classificationGuide'; + +export interface ClassificationGuideEntry { + entry: ClassificationGuide; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideInTopic.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideInTopic.ts new file mode 100644 index 0000000000..a363fc00b8 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuideInTopic.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The classification guide which the topic is contained in. This field is only returned when requested. + */ +export interface ClassificationGuideInTopic { + name: string; + originatingOrganization: string; + publishedOn: Date; + enabled?: boolean; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidePaging.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidePaging.ts new file mode 100644 index 0000000000..4a83692d42 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidePaging.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationGuidePagingList } from './classificationGuidePagingList'; + +export interface ClassificationGuidePaging { + list?: ClassificationGuidePagingList; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidePagingList.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidePagingList.ts new file mode 100644 index 0000000000..f3f289c680 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidePagingList.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationGuidesEntry } from './classificationGuidesEntry'; +import { Pagination } from '../../content-rest-api'; + +export interface ClassificationGuidePagingList { + pagination?: Pagination; + entries?: ClassificationGuidesEntry[]; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuides.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuides.ts new file mode 100644 index 0000000000..2927ce4ce0 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuides.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A classification guide in a list. + */ +export interface ClassificationGuides { + name: string; + originatingOrganization: string; + publishedOn: Date; + enabled?: boolean; + hasTopics?: boolean; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesBody.ts new file mode 100644 index 0000000000..90d5b38853 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesBody.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ClassificationGuidesBody { + name: string; + originatingOrganization: string; + publishedOn: Date; + enabled?: boolean; + hasTopics?: boolean; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesEntry.ts new file mode 100644 index 0000000000..2da0ecc3b3 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationGuides } from './classificationGuides'; + +export interface ClassificationGuidesEntry { + entry: ClassificationGuides; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesInTopic.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesInTopic.ts new file mode 100644 index 0000000000..722e17069c --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationGuidesInTopic.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The classification guide which the topic is contained in. This field is only returned when requested. + */ +export interface ClassificationGuidesInTopic { + name: string; + originatingOrganization: string; + publishedOn: Date; + enabled?: boolean; + hasTopics?: boolean; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationInformation.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationInformation.ts new file mode 100644 index 0000000000..8e04e40409 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationInformation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ClassificationInformation { + level: string; + classificationAgency?: string; + reasonIds: string[]; + downgradeOn?: Date; + downgradeEvent?: string; + downgradeInstructions?: string; + declassifyOn?: Date; + declassificationEvent?: string; + exemptionIds?: string[]; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationReason.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReason.ts new file mode 100644 index 0000000000..02308b27cd --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReason.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ClassificationReason { + id: string; + code: string; + description: string; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonBody.ts new file mode 100644 index 0000000000..9093adf77c --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonBody.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ClassificationReasonBody { + code: string; + description: string; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonEntry.ts new file mode 100644 index 0000000000..ea09516581 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationReason } from './classificationReason'; + +export interface ClassificationReasonEntry { + entry: ClassificationReason; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonsPaging.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonsPaging.ts new file mode 100644 index 0000000000..092a895a22 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonsPaging.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationReasonsPagingList } from './classificationReasonsPagingList'; + +export interface ClassificationReasonsPaging { + list?: ClassificationReasonsPagingList; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonsPagingList.ts b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonsPagingList.ts new file mode 100644 index 0000000000..6d602b7cdf --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/classificationReasonsPagingList.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationReasonEntry } from './classificationReasonEntry'; +import { Pagination } from '../../content-rest-api'; + +export interface ClassificationReasonsPagingList { + pagination?: Pagination; + entries?: ClassificationReasonEntry[]; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/combinedInstructionBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/combinedInstructionBody.ts new file mode 100644 index 0000000000..9f21903f79 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/combinedInstructionBody.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationInformation } from './classificationInformation'; +import { SecurityMarkInformationBody } from './securityMarkInformationBody'; + +export interface CombinedInstructionBody { + classificationInformation?: ClassificationInformation; + securityMarkInformation?: SecurityMarkInformationBody; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/declassificationDate.ts b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationDate.ts new file mode 100644 index 0000000000..e30d98ea4c --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationDate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; + +export type DeclassificationDate = DateAlfresco; diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemption.ts b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemption.ts new file mode 100644 index 0000000000..911bd4a3e1 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemption.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface DeclassificationExemption { + id: string; + code: string; + description: string; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionBody.ts new file mode 100644 index 0000000000..df6789c4ad --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionBody.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface DeclassificationExemptionBody { + code: string; + description: string; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionEntry.ts new file mode 100644 index 0000000000..f61365134b --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeclassificationExemption } from './declassificationExemption'; + +export interface DeclassificationExemptionEntry { + entry: DeclassificationExemption; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionsPaging.ts b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionsPaging.ts new file mode 100644 index 0000000000..37a1dee72b --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionsPaging.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeclassificationExemptionsPagingList } from './declassificationExemptionsPagingList'; + +export interface DeclassificationExemptionsPaging { + list?: DeclassificationExemptionsPagingList; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionsPagingList.ts b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionsPagingList.ts new file mode 100644 index 0000000000..c994466e96 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/declassificationExemptionsPagingList.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DeclassificationExemptionEntry } from './declassificationExemptionEntry'; +import { Pagination } from '../../content-rest-api'; + +export interface DeclassificationExemptionsPagingList { + pagination?: Pagination; + entries?: DeclassificationExemptionEntry[]; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/index.ts b/lib/js-api/src/api/gs-classification-rest-api/model/index.ts new file mode 100644 index 0000000000..6af87d6181 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/index.ts @@ -0,0 +1,73 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './authorityClearanceGroupEntry'; +export * from './authorityClearanceGroupPaging'; +export * from './authorityClearanceGroupPagingList'; +export * from './authorityClearanceGroup'; +export * from './authorityClearanceMark'; +export * from './classificationGuideEntry'; +export * from './classificationGuidePaging'; +export * from './classificationGuidePagingList'; +export * from './classificationGuideBody'; +export * from './classificationGuidesBody'; +export * from './classificationGuidesEntry'; +export * from './classificationInformation'; +export * from './classificationReason'; +export * from './classificationReasonBody'; +export * from './classificationReasonEntry'; +export * from './classificationReasonsPaging'; +export * from './classificationReasonsPagingList'; +export * from './declassificationDate'; +export * from './declassificationExemption'; +export * from './declassificationExemptionBody'; +export * from './declassificationExemptionEntry'; +export * from './declassificationExemptionsPaging'; +export * from './declassificationExemptionsPagingList'; +export * from './instruction'; +export * from './instructionBody'; +export * from './instructionEntry'; +export * from './path'; +export * from './securityControlSetting'; +export * from './securityControlSettingBody'; +export * from './securityControlSettingEntry'; +export * from './securityGroup'; +export * from './securityGroupBody'; +export * from './securityGroupEntry'; +export * from './securityGroupPaging'; +export * from './securityGroupPagingList'; +export * from './securityMark'; +export * from './securityMarkBody'; +export * from './securityMarkEntry'; +export * from './securityMarkInformation'; +export * from './securityMarkInformationBody'; +export * from './securityMarkPaging'; +export * from './securityMarkPagingList'; +export * from './securityMarks'; +export * from './securityMarksBody'; +export * from './subtopicPaging'; +export * from './topic'; +export * from './topicBody'; +export * from './topicEntry'; +export * from './topicPaging'; +export * from './topicPagingList'; +export * from './classificationGuideInTopic'; +export * from './classificationGuidesInTopic'; +export * from './combinedInstructionBody'; +export * from './classificationGuide'; +export * from './classificationGuides'; +export * from './nodeSecurityMarkBody'; diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/instruction.ts b/lib/js-api/src/api/gs-classification-rest-api/model/instruction.ts new file mode 100644 index 0000000000..7034c446a0 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/instruction.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationInformation } from './classificationInformation'; +import { SecurityMarkInformation } from './securityMarkInformation'; + +/** + * Information about how a piece of content should be secured. This field is only included when requested. + */ +export interface Instruction { + classificationInformation?: ClassificationInformation; + securityMarkInformation?: SecurityMarkInformation; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/instructionBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/instructionBody.ts new file mode 100644 index 0000000000..362ae7ee80 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/instructionBody.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationInformation } from './classificationInformation'; +import { SecurityMarkInformationBody } from './securityMarkInformationBody'; + +export interface InstructionBody { + classificationInformation?: ClassificationInformation; + securityMarkInformation?: SecurityMarkInformationBody; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/instructionEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/instructionEntry.ts new file mode 100644 index 0000000000..627f85af9d --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/instructionEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Instruction } from './instruction'; + +export interface InstructionEntry { + entry: Instruction; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/nodeSecurityMarkBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/nodeSecurityMarkBody.ts new file mode 100644 index 0000000000..f12aeb5de7 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/nodeSecurityMarkBody.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface NodeSecurityMarkBody { + id: string; + groupId: string; + op: string; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/path.ts b/lib/js-api/src/api/gs-classification-rest-api/model/path.ts new file mode 100644 index 0000000000..dcf5e6b5d5 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/path.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { PathElement } from '../../content-rest-api'; + +/** + * An ordered list of ancestors starting with the classification guide and ending with the parent of this topic. + * This field is only returned when requested. + */ +export interface Path extends Array<PathElement> {} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSetting.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSetting.ts new file mode 100644 index 0000000000..c58bdd8d86 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSetting.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SecurityControlSetting { + key: string; + value: any; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSettingBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSettingBody.ts new file mode 100644 index 0000000000..64ce8b834a --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSettingBody.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SecurityControlSettingBody { + value: any; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSettingEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSettingEntry.ts new file mode 100644 index 0000000000..057cc85e72 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityControlSettingEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityControlSetting } from './securityControlSetting'; + +export interface SecurityControlSettingEntry { + entry: SecurityControlSetting; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityGroup.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroup.ts new file mode 100644 index 0000000000..3777526828 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroup.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SecurityGroup { + id?: string; + groupName?: string; + groupType?: string; + inUse?: boolean; + systemGroup?: boolean; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupBody.ts new file mode 100644 index 0000000000..3daa09718e --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupBody.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SecurityGroupBody { + groupName?: string; + groupType?: string; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupEntry.ts new file mode 100644 index 0000000000..86d763a112 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityGroup } from './securityGroup'; + +export interface SecurityGroupEntry { + entry: SecurityGroup; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupPaging.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupPaging.ts new file mode 100644 index 0000000000..d8263e0e3d --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupPaging.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityGroupPagingList } from './securityGroupPagingList'; + +export interface SecurityGroupPaging { + list?: SecurityGroupPagingList; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupPagingList.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupPagingList.ts new file mode 100644 index 0000000000..dd070ac13b --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityGroupPagingList.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { SecurityGroupEntry } from './securityGroupEntry'; + +export interface SecurityGroupPagingList { + pagination?: Pagination; + entries?: SecurityGroupEntry[]; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMark.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMark.ts new file mode 100644 index 0000000000..0adb5848e3 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMark.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SecurityMark { + id: string; + name: string; + groupId: string; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkBody.ts new file mode 100644 index 0000000000..375d49769e --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkBody.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SecurityMarkBody { + name: string; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkEntry.ts new file mode 100644 index 0000000000..c11857c613 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityMark } from './securityMark'; + +export interface SecurityMarkEntry { + entry: SecurityMark; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkInformation.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkInformation.ts new file mode 100644 index 0000000000..a07b1b7ce3 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkInformation.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityMarks } from './securityMarks'; + +export interface SecurityMarkInformation { + add: SecurityMarks; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkInformationBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkInformationBody.ts new file mode 100644 index 0000000000..59b4de7d06 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkInformationBody.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityMarksBody } from './securityMarksBody'; + +export interface SecurityMarkInformationBody { + add: SecurityMarksBody; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkPaging.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkPaging.ts new file mode 100644 index 0000000000..7ef42ef65d --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkPaging.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityMarkPagingList } from './securityMarkPagingList'; + +export interface SecurityMarkPaging { + list?: SecurityMarkPagingList; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkPagingList.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkPagingList.ts new file mode 100644 index 0000000000..95d8ec4612 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarkPagingList.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { SecurityMarkEntry } from './securityMarkEntry'; + +export interface SecurityMarkPagingList { + pagination?: Pagination; + entries?: SecurityMarkEntry[]; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMarks.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarks.ts new file mode 100644 index 0000000000..59eee0dc66 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarks.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityMark } from './securityMark'; + +export interface SecurityMarks extends Array<SecurityMark> {} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/securityMarksBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarksBody.ts new file mode 100644 index 0000000000..6d9df2434f --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/securityMarksBody.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SecurityMarkBody } from './securityMarkBody'; + +export interface SecurityMarksBody extends Array<SecurityMarkBody> {} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/subtopicPaging.ts b/lib/js-api/src/api/gs-classification-rest-api/model/subtopicPaging.ts new file mode 100644 index 0000000000..f2e5d76dc5 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/subtopicPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TopicPagingList } from './topicPagingList'; + +export class SubtopicPaging { + list?: TopicPagingList; + + constructor(input?: Partial<SubtopicPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new TopicPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/topic.ts b/lib/js-api/src/api/gs-classification-rest-api/model/topic.ts new file mode 100644 index 0000000000..eba7801ea7 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/topic.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ClassificationGuideInTopic } from './classificationGuideInTopic'; +import { DateAlfresco } from '../../content-custom-api'; +import { Instruction } from './instruction'; +import { Path } from './path'; + +export class Topic { + id: string; + name: string; + description?: string; + /** + * Flag indicating whether the topic has an instruction or not. + */ + hasInstruction: boolean; + instruction?: Instruction; + createdAt: Date; + /** + * Flag indicating whether the topic has subtopics. This field is only included when requested. + */ + hasSubtopics?: boolean; + path?: Path; + classificationGuide?: ClassificationGuideInTopic; + + constructor(input?: Partial<Topic>) { + if (input) { + Object.assign(this, input); + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/topicBody.ts b/lib/js-api/src/api/gs-classification-rest-api/model/topicBody.ts new file mode 100644 index 0000000000..df8423f068 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/topicBody.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { InstructionBody } from './instructionBody'; + +export interface TopicBody { + name: string; + description?: string; + instruction?: InstructionBody; +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/topicEntry.ts b/lib/js-api/src/api/gs-classification-rest-api/model/topicEntry.ts new file mode 100644 index 0000000000..b3ce30392c --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/topicEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Topic } from './topic'; + +export class TopicEntry { + entry: Topic; + + constructor(input?: Partial<TopicEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Topic(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/topicPaging.ts b/lib/js-api/src/api/gs-classification-rest-api/model/topicPaging.ts new file mode 100644 index 0000000000..169710e92b --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/topicPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TopicPagingList } from './topicPagingList'; + +export class TopicPaging { + list?: TopicPagingList; + + constructor(input?: Partial<TopicPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new TopicPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-classification-rest-api/model/topicPagingList.ts b/lib/js-api/src/api/gs-classification-rest-api/model/topicPagingList.ts new file mode 100644 index 0000000000..6a2b3126d1 --- /dev/null +++ b/lib/js-api/src/api/gs-classification-rest-api/model/topicPagingList.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { TopicEntry } from './topicEntry'; + +export class TopicPagingList { + pagination?: Pagination; + entries?: TopicEntry[]; + + constructor(input?: Partial<TopicPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new TopicEntry(item)); + } + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/README.md b/lib/js-api/src/api/gs-core-rest-api/README.md new file mode 100644 index 0000000000..7c7fbaa2ac --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/README.md @@ -0,0 +1,125 @@ +**GS Core API** + +Provides access to the core features of Alfresco Governance Services. + + +- Last Build date: 2018-11-05T11:25:35.010Z + + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*.FilePlansApi* | [**createFilePlanCategories**](docs/FilePlansApi.md#createFilePlanCategories) | **POST** /file-plans/{filePlanId}/categories | Create record categories for a file plan +*.FilePlansApi* | [**getFilePlan**](docs/FilePlansApi.md#getFilePlan) | **GET** /file-plans/{filePlanId} | Get a file plan +*.FilePlansApi* | [**getFilePlanCategories**](docs/FilePlansApi.md#getFilePlanCategories) | **GET** /file-plans/{filePlanId}/categories | List file plans's children +*.FilePlansApi* | [**updateFilePlan**](docs/FilePlansApi.md#updateFilePlan) | **PUT** /file-plans/{filePlanId} | Update a file plan +*.FilesApi* | [**declareRecord**](docs/FilesApi.md#declareRecord) | **POST** /files/{fileId}/declare | Declare as record +*.GssitesApi* | [**createRMSite**](docs/GssitesApi.md#createRMSite) | **POST** /gs-sites | Create the Records Management (RM) site +*.GssitesApi* | [**deleteRMSite**](docs/GssitesApi.md#deleteRMSite) | **DELETE** /gs-sites/rm | Delete the Records Management (RM) site +*.GssitesApi* | [**getRMSite**](docs/GssitesApi.md#getRMSite) | **GET** /gs-sites/rm | Get the Records Management (RM) site +*.GssitesApi* | [**updateRMSite**](docs/GssitesApi.md#updateRMSite) | **PUT** /gs-sites/rm | Update the Records Management (RM) site +*.RecordCategoriesApi* | [**createRecordCategoryChild**](docs/RecordCategoriesApi.md#createRecordCategoryChild) | **POST** /record-categories/{recordCategoryId}/children | Create a record category or a record folder +*.RecordCategoriesApi* | [**deleteRecordCategory**](docs/RecordCategoriesApi.md#deleteRecordCategory) | **DELETE** /record-categories/{recordCategoryId} | Delete a record category +*.RecordCategoriesApi* | [**getRecordCategory**](docs/RecordCategoriesApi.md#getRecordCategory) | **GET** /record-categories/{recordCategoryId} | Get a record category +*.RecordCategoriesApi* | [**listRecordCategoryChildren**](docs/RecordCategoriesApi.md#listRecordCategoryChildren) | **GET** /record-categories/{recordCategoryId}/children | List record category's children +*.RecordCategoriesApi* | [**updateRecordCategory**](docs/RecordCategoriesApi.md#updateRecordCategory) | **PUT** /record-categories/{recordCategoryId} | Update a record category +*.RecordFoldersApi* | [**createRecordFolderChild**](docs/RecordFoldersApi.md#createRecordFolderChild) | **POST** /record-folders/{recordFolderId}/records | Create a record +*.RecordFoldersApi* | [**deleteRecordFolder**](docs/RecordFoldersApi.md#deleteRecordFolder) | **DELETE** /record-folders/{recordFolderId} | Delete a record folder +*.RecordFoldersApi* | [**getRecordFolder**](docs/RecordFoldersApi.md#getRecordFolder) | **GET** /record-folders/{recordFolderId} | Get a record folder +*.RecordFoldersApi* | [**listRecordFolderChildren**](docs/RecordFoldersApi.md#listRecordFolderChildren) | **GET** /record-folders/{recordFolderId}/records | List records +*.RecordFoldersApi* | [**updateRecordFolder**](docs/RecordFoldersApi.md#updateRecordFolder) | **PUT** /record-folders/{recordFolderId} | Update a record folder +*.RecordsApi* | [**completeRecord**](docs/RecordsApi.md#completeRecord) | **POST** /records/{recordId}/complete | Complete a record +*.RecordsApi* | [**deleteRecord**](docs/RecordsApi.md#deleteRecord) | **DELETE** /records/{recordId} | Delete a record +*.RecordsApi* | [**fileRecord**](docs/RecordsApi.md#fileRecord) | **POST** /records/{recordId}/file | File a record +*.RecordsApi* | [**getRecord**](docs/RecordsApi.md#getRecord) | **GET** /records/{recordId} | Get a record +*.RecordsApi* | [**getRecordContent**](docs/RecordsApi.md#getRecordContent) | **GET** /records/{recordId}/content | Get record content +*.RecordsApi* | [**updateRecord**](docs/RecordsApi.md#updateRecord) | **PUT** /records/{recordId} | Update record +*.TransferContainersApi* | [**getTransferContainer**](docs/TransferContainersApi.md#getTransferContainer) | **GET** /transfer-containers/{transferContainerId} | Get a transfer container +*.TransferContainersApi* | [**listTransfers**](docs/TransferContainersApi.md#listTransfers) | **GET** /transfer-containers/{transferContainerId}/transfers | List transfer container's children +*.TransferContainersApi* | [**updateTransferContainer**](docs/TransferContainersApi.md#updateTransferContainer) | **PUT** /transfer-containers/{transferContainerId} | Update transfer container +*.TransfersApi* | [**getTransfer**](docs/TransfersApi.md#getTransfer) | **GET** /transfers/{transferId} | Get a transfer +*.TransfersApi* | [**listTransfersChildren**](docs/TransfersApi.md#listTransfersChildren) | **GET** /transfers/{transferId}/children | List transfer's children +*.UnfiledContainersApi* | [**createUnfiledContainerChildren**](docs/UnfiledContainersApi.md#createUnfiledContainerChildren) | **POST** /unfiled-containers/{unfiledContainerId}/children | Create a record or an unfiled record folder +*.UnfiledContainersApi* | [**getUnfiledContainer**](docs/UnfiledContainersApi.md#getUnfiledContainer) | **GET** /unfiled-containers/{unfiledContainerId} | Get the unfiled records container +*.UnfiledContainersApi* | [**listUnfiledContainerChildren**](docs/UnfiledContainersApi.md#listUnfiledContainerChildren) | **GET** /unfiled-containers/{unfiledContainerId}/children | List unfiled record container's children +*.UnfiledContainersApi* | [**updateUnfiledContainer**](docs/UnfiledContainersApi.md#updateUnfiledContainer) | **PUT** /unfiled-containers/{unfiledContainerId} | Update an unfiled record container +*.UnfiledRecordFoldersApi* | [**createUnfiledRecordFolderChildren**](docs/UnfiledRecordFoldersApi.md#createUnfiledRecordFolderChildren) | **POST** /unfiled-record-folders/{unfiledRecordFolderId}/children | Create a record or an unfiled record folder +*.UnfiledRecordFoldersApi* | [**deleteUnfiledRecordFolder**](docs/UnfiledRecordFoldersApi.md#deleteUnfiledRecordFolder) | **DELETE** /unfiled-record-folders/{unfiledRecordFolderId} | Delete an unfiled record folder. Deleted file plan components cannot be recovered, they are deleted permanently. +*.UnfiledRecordFoldersApi* | [**getUnfiledRecordFolder**](docs/UnfiledRecordFoldersApi.md#getUnfiledRecordFolder) | **GET** /unfiled-record-folders/{unfiledRecordFolderId} | Get the unfiled record folder +*.UnfiledRecordFoldersApi* | [**listUnfiledRecordFolderChildren**](docs/UnfiledRecordFoldersApi.md#listUnfiledRecordFolderChildren) | **GET** /unfiled-record-folders/{unfiledRecordFolderId}/children | List unfiled record folder's children +*.UnfiledRecordFoldersApi* | [**updateUnfiledRecordFolder**](docs/UnfiledRecordFoldersApi.md#updateUnfiledRecordFolder) | **PUT** /unfiled-record-folders/{unfiledRecordFolderId} | Update an unfiled record folder + + +## Documentation for Models + + - [ChildAssociationInfo](docs/ChildAssociationInfo.md) + - [ContentInfo](docs/ContentInfo.md) + - [ErrorError](docs/ErrorError.md) + - [FilePlan](docs/FilePlan.md) + - [FilePlanBodyUpdate](docs/FilePlanBodyUpdate.md) + - [FilePlanComponentBodyUpdate](docs/FilePlanComponentBodyUpdate.md) + - [FilePlanEntry](docs/FilePlanEntry.md) + - [ModelError](docs/ModelError.md) + - [Pagination](docs/Pagination.md) + - [PathElement](docs/PathElement.md) + - [PathInfo](docs/PathInfo.md) + - [RMNodeBodyCreate](docs/RMNodeBodyCreate.md) + - [RMNodeBodyCreateWithRelativePath](docs/RMNodeBodyCreateWithRelativePath.md) + - [RMSite](docs/RMSite.md) + - [RMSiteBodyCreate](docs/RMSiteBodyCreate.md) + - [RMSiteBodyUpdate](docs/RMSiteBodyUpdate.md) + - [RMSiteEntry](docs/RMSiteEntry.md) + - [Record](docs/Record.md) + - [RecordCategory](docs/RecordCategory.md) + - [RecordCategoryChild](docs/RecordCategoryChild.md) + - [RecordCategoryChildEntry](docs/RecordCategoryChildEntry.md) + - [RecordCategoryChildPaging](docs/RecordCategoryChildPaging.md) + - [RecordCategoryChildPagingList](docs/RecordCategoryChildPagingList.md) + - [RecordCategoryEntry](docs/RecordCategoryEntry.md) + - [RecordCategoryPaging](docs/RecordCategoryPaging.md) + - [RecordCategoryPagingList](docs/RecordCategoryPagingList.md) + - [RecordEntry](docs/RecordEntry.md) + - [RecordFolder](docs/RecordFolder.md) + - [RecordFolderAssociationPaging](docs/RecordFolderAssociationPaging.md) + - [RecordFolderAssociationPagingList](docs/RecordFolderAssociationPagingList.md) + - [RecordFolderChildAssociationEntry](docs/RecordFolderChildAssociationEntry.md) + - [RecordFolderEntry](docs/RecordFolderEntry.md) + - [RequestBodyFile](docs/RequestBodyFile.md) + - [RootCategoryBodyCreate](docs/RootCategoryBodyCreate.md) + - [Transfer](docs/Transfer.md) + - [TransferAssociationPaging](docs/TransferAssociationPaging.md) + - [TransferAssociationPagingList](docs/TransferAssociationPagingList.md) + - [TransferChild](docs/TransferChild.md) + - [TransferChildAssociationEntry](docs/TransferChildAssociationEntry.md) + - [TransferContainer](docs/TransferContainer.md) + - [TransferContainerAssociationPaging](docs/TransferContainerAssociationPaging.md) + - [TransferContainerAssociationPagingList](docs/TransferContainerAssociationPagingList.md) + - [TransferContainerBodyUpdate](docs/TransferContainerBodyUpdate.md) + - [TransferContainerChild](docs/TransferContainerChild.md) + - [TransferContainerChildAssociationEntry](docs/TransferContainerChildAssociationEntry.md) + - [TransferContainerEntry](docs/TransferContainerEntry.md) + - [TransferEntry](docs/TransferEntry.md) + - [UnfiledContainer](docs/UnfiledContainer.md) + - [UnfiledContainerAssociationPaging](docs/UnfiledContainerAssociationPaging.md) + - [UnfiledContainerAssociationPagingList](docs/UnfiledContainerAssociationPagingList.md) + - [UnfiledContainerChild](docs/UnfiledContainerChild.md) + - [UnfiledContainerChildAssociationEntry](docs/UnfiledContainerChildAssociationEntry.md) + - [UnfiledContainerEntry](docs/UnfiledContainerEntry.md) + - [UnfiledRecordContainerBodyUpdate](docs/UnfiledRecordContainerBodyUpdate.md) + - [UnfiledRecordFolder](docs/UnfiledRecordFolder.md) + - [UnfiledRecordFolderAssociationPaging](docs/UnfiledRecordFolderAssociationPaging.md) + - [UnfiledRecordFolderAssociationPagingList](docs/UnfiledRecordFolderAssociationPagingList.md) + - [UnfiledRecordFolderBodyUpdate](docs/UnfiledRecordFolderBodyUpdate.md) + - [UnfiledRecordFolderChild](docs/UnfiledRecordFolderChild.md) + - [UnfiledRecordFolderChildAssociationEntry](docs/UnfiledRecordFolderChildAssociationEntry.md) + - [UnfiledRecordFolderEntry](docs/UnfiledRecordFolderEntry.md) + - [UserInfo](docs/UserInfo.md) + - [RecordFolderChildAssociation](docs/RecordFolderChildAssociation.md) + - [TransferChildAssociation](docs/TransferChildAssociation.md) + - [TransferContainerChildAssociation](docs/TransferContainerChildAssociation.md) + - [UnfiledContainerChildAssociation](docs/UnfiledContainerChildAssociation.md) + - [UnfiledRecordFolderChildAssociation](docs/UnfiledRecordFolderChildAssociation.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/api/base.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/base.api.ts new file mode 100644 index 0000000000..d313884ccb --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/base.api.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient } from '../../../api-clients/http-client.interface'; + +export abstract class BaseApi extends ApiClient { + override get apiClient(): LegacyHttpClient { + return this.httpClient ?? this.alfrescoApi.gsClient; + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/filePlans.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/filePlans.api.ts new file mode 100644 index 0000000000..475c8f0a3c --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/filePlans.api.ts @@ -0,0 +1,165 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FilePlanBodyUpdate } from '../model/filePlanBodyUpdate'; +import { FilePlanEntry } from '../model/filePlanEntry'; +import { RecordCategoryEntry } from '../model/recordCategoryEntry'; +import { RecordCategoryPaging } from '../model/recordCategoryPaging'; +import { RootCategoryBodyCreate } from '../model/rootCategoryBodyCreate'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery, RecordsPagingQuery, RecordsSourceQuery } from './types'; + +/** + * FilePlansApi service. + */ +export class FilePlansApi extends BaseApi { + /** + * Create record categories for a file plan + * + * @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias. + * @param nodeBodyCreate The node information to create. + * @param opts Optional parameters + * @param opts.autoRename If `true`, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + * @returns Promise<RecordCategoryEntry> + */ + createFilePlanCategories( + filePlanId: string, + nodeBodyCreate: RootCategoryBodyCreate, + opts?: { + autoRename?: boolean; + } & RecordsIncludeQuery + ): Promise<RecordCategoryEntry> { + throwIfNotDefined(filePlanId, 'filePlanId'); + throwIfNotDefined(nodeBodyCreate, 'nodeBodyCreate'); + + const pathParams = { + filePlanId + }; + + const queryParams = { + autoRename: opts?.autoRename, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/file-plans/{filePlanId}/categories', + pathParams, + queryParams, + contentTypes: ['application/json', 'multipart/form-data'], + bodyParam: nodeBodyCreate, + returnType: RecordCategoryEntry + }); + } + + /** + * Get a file plan + * + * Mandatory fields and the file plan's aspects and properties are returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias. + * @param opts Optional parameters + * @returns Promise<FilePlanEntry> + */ + getFilePlan(filePlanId: string, opts?: RecordsIncludeQuery): Promise<FilePlanEntry> { + throwIfNotDefined(filePlanId, 'filePlanId'); + + const pathParams = { + filePlanId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/file-plans/{filePlanId}', + pathParams, + queryParams, + returnType: FilePlanEntry + }); + } + + /** + * List file plans's children + * + * Minimal information for each child is returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias. + * @param opts Optional parameters + * @returns Promise<RecordCategoryPaging> + */ + getFilePlanCategories(filePlanId: string, opts?: RecordsIncludeQuery & RecordsPagingQuery & RecordsSourceQuery): Promise<RecordCategoryPaging> { + throwIfNotDefined(filePlanId, 'filePlanId'); + + const pathParams = { + filePlanId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + include: buildCollectionParam(opts?.include, 'csv'), + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/file-plans/{filePlanId}/categories', + pathParams, + queryParams, + returnType: RecordCategoryPaging + }); + } + + /** + * Update a file plan + * + * **Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + * + * @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias. + * @param filePlanBodyUpdate The file plan information to update. + * @param opts Optional parameters + * @returns Promise<FilePlanEntry> + */ + updateFilePlan(filePlanId: string, filePlanBodyUpdate: FilePlanBodyUpdate, opts?: RecordsIncludeQuery): Promise<FilePlanEntry> { + throwIfNotDefined(filePlanId, 'filePlanId'); + throwIfNotDefined(filePlanBodyUpdate, 'filePlanBodyUpdate'); + + const pathParams = { + filePlanId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/file-plans/{filePlanId}', + pathParams, + queryParams, + bodyParam: filePlanBodyUpdate, + returnType: FilePlanEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/files.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/files.api.ts new file mode 100644 index 0000000000..a0b3d92812 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/files.api.ts @@ -0,0 +1,67 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RecordEntry } from '../model/recordEntry'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery } from './types'; + +/** + * Files service. + * + * @module FilesApi + */ +export class FilesApi extends BaseApi { + /** + * Declare as record + * + * Declares the file **fileId** in the unfiled records container. The original file is moved to the Records Management site and a secondary parent association is created in the file's original site. + * + * @param fileId The identifier of a non-record file. + * @param opts Optional parameters + * @param opts.hideRecord Flag to indicate whether the record should be hidden from the current parent folder. (default to false) + * @returns Promise<RecordEntry> + */ + declareRecord( + fileId: string, + opts?: { + hideRecord?: boolean; + parentId?: string; + } & RecordsIncludeQuery + ): Promise<RecordEntry> { + throwIfNotDefined(fileId, 'fileId'); + + const pathParams = { + fileId + }; + + const queryParams = { + hideRecord: opts?.hideRecord, + parentId: opts?.parentId, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/files/{fileId}/declare', + pathParams, + queryParams, + returnType: RecordEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/gsSites.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/gsSites.api.ts new file mode 100644 index 0000000000..c3a13fa852 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/gsSites.api.ts @@ -0,0 +1,100 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RMSiteBodyCreate, RMSiteBodyUpdate, RMSiteEntry } from '../model'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsFieldsQuery } from './types'; + +/** + * GsSitesApi service. + */ +export class GsSitesApi extends BaseApi { + /** + * Create the Records Management (RM) site + * + * The creator will be added as a member with Site Manager role. + * When you create the RM site, the **filePlan** structure is also created including special containers, such as containers for transfers, holds and, unfiled records. + * + * @param siteBodyCreate The site details + * @param opts Optional parameters + * @param opts.skipAddToFavorites Flag to indicate whether the RM site should not be added to the user's site favorites. (default to false) + * @returns Promise<RMSiteEntry> + */ + createRMSite(siteBodyCreate: RMSiteBodyCreate, opts?: { skipAddToFavorites?: boolean }): Promise<RMSiteEntry> { + throwIfNotDefined(siteBodyCreate, 'siteBodyCreate'); + + return this.post({ + path: '/gs-sites', + queryParams: opts, + bodyParam: siteBodyCreate + }); + } + + /** + * Delete the Records Management (RM) site + * + * @returns Promise<{}> + */ + deleteRMSite(): Promise<void> { + return this.delete({ + path: '/gs-sites/rm' + }); + } + + /** + * Get the Records Management (RM) site + * + * @param opts Optional parameters + * @returns Promise<RMSiteEntry> + */ + getRMSite(opts?: RecordsFieldsQuery): Promise<RMSiteEntry> { + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/gs-sites/rm', + queryParams + }); + } + + /** + * Update the Records Management (RM) site + * + * Update the details for the RM site. Site Manager or other (site) admin can update title or description. + * **Note**: the id, site visibility, or compliance of the RM site cannot be updated once the site has been created. + * + * @param siteBodyUpdate The RM site information to update. + * @param opts Optional parameters + * @returns Promise<RMSiteEntry> + */ + updateRMSite(siteBodyUpdate: RMSiteBodyUpdate, opts?: RecordsFieldsQuery): Promise<RMSiteEntry> { + throwIfNotDefined(siteBodyUpdate, 'siteBodyUpdate'); + + const queryParams = { + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/gs-sites/rm', + queryParams, + bodyParam: siteBodyUpdate + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/index.ts b/lib/js-api/src/api/gs-core-rest-api/api/index.ts new file mode 100644 index 0000000000..ac09af2d58 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/index.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './types'; +export * from './filePlans.api'; +export * from './files.api'; +export * from './gsSites.api'; +export * from './recordCategories.api'; +export * from './recordFolders.api'; +export * from './records.api'; +export * from './transferContainers.api'; +export * from './transfers.api'; +export * from './unfiledContainers.api'; +export * from './unfiledRecordFolders.api'; diff --git a/lib/js-api/src/api/gs-core-rest-api/api/recordCategories.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/recordCategories.api.ts new file mode 100644 index 0000000000..8fef9fb1a9 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/recordCategories.api.ts @@ -0,0 +1,214 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + FilePlanComponentBodyUpdate, + RecordCategoryChildEntry, + RecordCategoryChildPaging, + RecordCategoryEntry, + RMNodeBodyCreateWithRelativePath +} from '../model'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery, RecordsPagingQuery, RecordsSourceQuery } from './types'; + +/** + * RecordCategoriesApi service. + */ +export class RecordCategoriesApi extends BaseApi { + /** + * Create a record category or a record folder + * + * @param recordCategoryId The identifier of a record category. + * @param nodeBodyCreate The node information to create. + * @param opts Optional parameters + * @param opts.autoRename If `true`, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + * @returns Promise<RecordCategoryChildEntry> + */ + createRecordCategoryChild( + recordCategoryId: string, + nodeBodyCreate: RMNodeBodyCreateWithRelativePath, + opts?: { + autoRename?: boolean; + } & RecordsIncludeQuery + ): Promise<RecordCategoryChildEntry> { + throwIfNotDefined(recordCategoryId, 'recordCategoryId'); + throwIfNotDefined(nodeBodyCreate, 'nodeBodyCreate'); + + const pathParams = { + recordCategoryId + }; + + const queryParams = { + autoRename: opts?.autoRename, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/record-categories/{recordCategoryId}/children', + pathParams, + queryParams, + bodyParam: nodeBodyCreate, + returnType: RecordCategoryChildEntry + }); + } + + /** + * Delete a record category + * + * @param recordCategoryId The identifier of a record category. + * @returns Promise<{}> + */ + deleteRecordCategory(recordCategoryId: string): Promise<void> { + throwIfNotDefined(recordCategoryId, 'recordCategoryId'); + + const pathParams = { + recordCategoryId + }; + + return this.delete({ + path: '/record-categories/{recordCategoryId}', + pathParams + }); + } + + /** + * Get a record category + * + * Mandatory fields and the record category's aspects and properties are returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param recordCategoryId The identifier of a record category. + * @param opts Optional parameters + * @param opts.relativePath Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**. + * @returns Promise<RecordCategoryEntry> + */ + getRecordCategory( + recordCategoryId: string, + opts?: { + relativePath?: string; + } & RecordsIncludeQuery + ): Promise<RecordCategoryEntry> { + throwIfNotDefined(recordCategoryId, 'recordCategoryId'); + + const pathParams = { + recordCategoryId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + relativePath: opts?.relativePath, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/record-categories/{recordCategoryId}', + pathParams, + queryParams, + returnType: RecordCategoryEntry + }); + } + + /** + * List record category's children + * + * Minimal information for each child is returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * The list of child nodes includes primary children and secondary children, if there are any. + * + * @param recordCategoryId The identifier of a record category. + * @param opts Optional parameters + * @param opts.where Optionally filter the list. Here are some examples: + * where=(nodeType='rma:recordFolder') + * where=(nodeType='rma:recordCategory') + * where=(isRecordFolder=true AND isClosed=false) + * @param opts.relativePath Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**. + * @returns Promise<RecordCategoryChildPaging> + */ + listRecordCategoryChildren( + recordCategoryId: string, + opts?: { + where?: string; + relativePath?: string; + } & RecordsIncludeQuery & + RecordsPagingQuery & + RecordsSourceQuery + ): Promise<RecordCategoryChildPaging> { + throwIfNotDefined(recordCategoryId, 'recordCategoryId'); + + const pathParams = { + recordCategoryId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + relativePath: opts?.relativePath, + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/record-categories/{recordCategoryId}/children', + pathParams, + queryParams, + returnType: RecordCategoryChildPaging + }); + } + + /** + * Update a record category + * + * **Note:** If you want to add or remove aspects, then you must use **GET /record-categories/{recordCategoryId}** first to get the complete set of *aspectNames*. + * **Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + * + * @param recordCategoryId The identifier of a record category. + * @param recordCategoryBodyUpdate The record category information to update. + * @param opts Optional parameters + * @returns Promise<RecordCategoryEntry> + */ + updateRecordCategory( + recordCategoryId: string, + recordCategoryBodyUpdate: FilePlanComponentBodyUpdate, + opts?: RecordsIncludeQuery + ): Promise<RecordCategoryEntry> { + throwIfNotDefined(recordCategoryId, 'recordCategoryId'); + throwIfNotDefined(recordCategoryBodyUpdate, 'recordCategoryBodyUpdate'); + + const pathParams = { + recordCategoryId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/record-categories/{recordCategoryId}', + pathParams, + queryParams, + bodyParam: recordCategoryBodyUpdate, + returnType: RecordCategoryEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/recordFolders.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/recordFolders.api.ts new file mode 100644 index 0000000000..7b7b36cd9e --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/recordFolders.api.ts @@ -0,0 +1,193 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FilePlanComponentBodyUpdate, RecordEntry, RecordFolderAssociationPaging, RecordFolderEntry, RMNodeBodyCreate } from '../model'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery, RecordsPagingQuery, RecordsSourceQuery } from './types'; + +/** + * Record Folders service. + */ +export class RecordFoldersApi extends BaseApi { + /** + * Create a record + * + * Create a record as a primary child of **recordFolderId**. + * This endpoint supports both JSON and multipart/form-data (file upload). + * + * @param recordFolderId The identifier of a record folder. + * @param recordBodyCreate The record information to create. This field is ignored for multipart/form-data content uploads. + * @param opts Optional parameters + * @returns Promise<RecordEntry> + */ + createRecordFolderChild(recordFolderId: string, recordBodyCreate: RMNodeBodyCreate, opts?: RecordsIncludeQuery): Promise<RecordEntry> { + throwIfNotDefined(recordFolderId, 'recordFolderId'); + throwIfNotDefined(recordBodyCreate, 'recordBodyCreate'); + + const pathParams = { + recordFolderId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/record-folders/{recordFolderId}/records', + pathParams, + queryParams, + bodyParam: recordBodyCreate, + returnType: RecordEntry + }); + } + + /** + * Deletes record folder **recordFolderId**. + * Deleted file plan components cannot be recovered, they are deleted permanently. + * + * @param recordFolderId The identifier of a record folder. + * @returns Promise<{}> + */ + deleteRecordFolder(recordFolderId: string): Promise<void> { + throwIfNotDefined(recordFolderId, 'recordFolderId'); + + const pathParams = { + recordFolderId + }; + + return this.delete({ + path: '/record-folders/{recordFolderId}', + pathParams + }); + } + + /** + * Get a record folder + * + * Mandatory fields and the record folder's aspects and properties are returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param recordFolderId The identifier of a record folder. + * @param opts Optional parameters + * @returns Promise<RecordFolderEntry> + */ + getRecordFolder(recordFolderId: string, opts?: RecordsIncludeQuery): Promise<RecordFolderEntry> { + throwIfNotDefined(recordFolderId, 'recordFolderId'); + + const pathParams = { + recordFolderId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/record-folders/{recordFolderId}', + pathParams, + queryParams, + returnType: RecordFolderEntry + }); + } + + /** + * List records + * + * Minimal information for each record is returned by default. + * The list of records includes primary children and secondary children, if there are any. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param recordFolderId The identifier of a record folder. + * @param opts Optional parameters + * @param opts.where Optionally filter the list. Here are some examples: + * - where=(nodeType='my:specialNodeType') + * - where=(nodeType='my:specialNodeType INCLUDESUBTYPES') + * - where=(isPrimary=true) + * @returns Promise<RecordFolderAssociationPaging> + */ + listRecordFolderChildren( + recordFolderId: string, + opts?: { + where?: string; + } & RecordsPagingQuery & + RecordsIncludeQuery & + RecordsSourceQuery + ): Promise<RecordFolderAssociationPaging> { + throwIfNotDefined(recordFolderId, 'recordFolderId'); + + const pathParams = { + recordFolderId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/record-folders/{recordFolderId}/records', + pathParams, + queryParams, + returnType: RecordFolderAssociationPaging + }); + } + + /** + * Updates record folder **recordFolderId**. For example, you can rename a record folder: + * + * **Note:** if you want to add or remove aspects, then you must use **GET /record-folders/{recordFolderId}** first to get the complete set of *aspectNames*. + * **Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + * + * @param recordFolderId The identifier of a record folder. + * @param recordFolderBodyUpdate The record folder information to update. + * @param opts Optional parameters + * @returns Promise<RecordFolderEntry> + */ + updateRecordFolder( + recordFolderId: string, + recordFolderBodyUpdate: FilePlanComponentBodyUpdate, + opts?: RecordsIncludeQuery + ): Promise<RecordFolderEntry> { + throwIfNotDefined(recordFolderId, 'recordFolderId'); + throwIfNotDefined(recordFolderBodyUpdate, 'recordFolderBodyUpdate'); + + const pathParams = { + recordFolderId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/record-folders/{recordFolderId}', + pathParams, + queryParams, + bodyParam: recordFolderBodyUpdate, + returnType: RecordFolderEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/records.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/records.api.ts new file mode 100644 index 0000000000..dcd5c07f07 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/records.api.ts @@ -0,0 +1,236 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FilePlanComponentBodyUpdate } from '../model/filePlanComponentBodyUpdate'; +import { RecordEntry } from '../model/recordEntry'; +import { RequestBodyFile } from '../model/requestBodyFile'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery } from './types'; + +/** + * Records service. + * + * @module RecordsApi + */ +export class RecordsApi extends BaseApi { + /** + * Complete a record + * + * @param recordId The identifier of a record. + * @param opts Optional parameters + * @returns Promise<RecordEntry> + */ + completeRecord(recordId: string, opts?: RecordsIncludeQuery): Promise<RecordEntry> { + throwIfNotDefined(recordId, 'recordId'); + + const pathParams = { + recordId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/records/{recordId}/complete', + pathParams, + queryParams, + returnType: RecordEntry + }); + } + + /** + * Delete a record. Deleted file plan components cannot be recovered, they are deleted permanently. + * + * @param recordId The identifier of a record. + * @returns Promise<{}> + */ + deleteRecord(recordId: string): Promise<void> { + throwIfNotDefined(recordId, 'recordId'); + + const pathParams = { + recordId + }; + + return this.delete({ + path: '/records/{recordId}', + pathParams + }); + } + + /** + * File a record + * + * You need to specify the target record folder by providing its id **targetParentId** + * If the record is already filed, a link to the target record folder is created. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param recordId The identifier of a record. + * @param nodeBodyFile The target record folder id + * @param opts Optional parameters + * @returns Promise<RecordEntry> + */ + fileRecord(recordId: string, nodeBodyFile: RequestBodyFile, opts?: RecordsIncludeQuery): Promise<RecordEntry> { + throwIfNotDefined(recordId, 'recordId'); + throwIfNotDefined(nodeBodyFile, 'nodeBodyFile'); + + const pathParams = { + recordId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/records/{recordId}/file', + pathParams, + queryParams, + bodyParam: nodeBodyFile, + returnType: RecordEntry + }); + } + + /** + * Get a record + * + * Mandatory fields and the record's aspects and properties are returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param recordId The identifier of a record. + * @param opts Optional parameters + * @returns Promise<RecordEntry> + */ + getRecord(recordId: string, opts?: RecordsIncludeQuery): Promise<RecordEntry> { + throwIfNotDefined(recordId, 'recordId'); + + const pathParams = { + recordId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/records/{recordId}', + pathParams, + queryParams, + returnType: RecordEntry + }); + } + + /** + * Get record content + * + * @param recordId The identifier of a record. + * @param opts Optional parameters + * @param opts.attachment **true** enables a web browser to download the file as an attachment. + * **false** means a web browser may preview the file in a new tab or window, but not download the file. + * + * You can only set this parameter to **false** if the content type of the file is in the supported list; + * for example, certain image files and PDF files. + * + * If the content type is not supported for preview, then a value of **false** is ignored, and + * the attachment will be returned in the response. (default to true) + * @param opts.ifModifiedSince Only returns the content if it has been modified since the date provided. + * Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + * @returns Promise<{}> + */ + getRecordContent( + recordId: string, + opts?: { + attachment?: boolean; + ifModifiedSince?: string; + } + ): Promise<any> { + throwIfNotDefined(recordId, 'recordId'); + + const pathParams = { + recordId + }; + + const queryParams = { + attachment: opts?.attachment + }; + + const headerParams = { + 'If-Modified-Since': opts?.ifModifiedSince + }; + + return this.get({ + path: '/records/{recordId}/content', + pathParams, + queryParams, + headerParams + }); + } + + /** + * Update record + * + * Updates the record **recordId**. For example, you can rename a record: + * JSON + * { + * \"name\":\"My new name\" + * } + * + * You can also set or update one or more properties: + * JSON + * { + * \"properties\": + * { + * \"cm:title\":\"New title\", + * \"cm:description\":\"New description\" + * } + * } + * + * **Note:** if you want to add or remove aspects, then you must use **GET /records/{recordId}** first to get the complete set of *aspectNames*. + * **Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + * + * @param recordId The identifier of a record. + * @param recordBodyUpdate The record information to update. + * @param opts Optional parameters + * @returns Promise<RecordEntry> + */ + updateRecord(recordId: string, recordBodyUpdate: FilePlanComponentBodyUpdate, opts?: RecordsIncludeQuery): Promise<RecordEntry> { + throwIfNotDefined(recordId, 'recordId'); + throwIfNotDefined(recordBodyUpdate, 'recordBodyUpdate'); + + const pathParams = { + recordId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/records/{recordId}', + pathParams, + queryParams, + bodyParam: recordBodyUpdate, + returnType: RecordEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/transferContainers.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/transferContainers.api.ts new file mode 100644 index 0000000000..c992bc4f35 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/transferContainers.api.ts @@ -0,0 +1,131 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TransferContainerAssociationPaging } from '../model/transferContainerAssociationPaging'; +import { TransferContainerBodyUpdate } from '../model/transferContainerBodyUpdate'; +import { TransferContainerEntry } from '../model/transferContainerEntry'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery, RecordsPagingQuery, RecordsSourceQuery } from './types'; + +/** + * TransferContainersApi service. + */ +export class TransferContainersApi extends BaseApi { + /** + * Get a transfer container + * + * Mandatory fields and the transfer container's aspects and properties are returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param transferContainerId The identifier of a transfer container. You can also use the -transfers- alias. + * @param opts Optional parameters + * @returns Promise<TransferContainerEntry> + */ + getTransferContainer(transferContainerId: string, opts?: RecordsIncludeQuery): Promise<TransferContainerEntry> { + throwIfNotDefined(transferContainerId, 'transferContainerId'); + + const pathParams = { + transferContainerId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/transfer-containers/{transferContainerId}', + pathParams, + queryParams, + returnType: TransferContainerEntry + }); + } + + /** + * List transfer container's children + * + * Minimal information for each child is returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param transferContainerId The identifier of a transfer container. You can also use the -transfers- alias. + * @param opts Optional parameters + * @returns Promise<TransferContainerAssociationPaging> + */ + listTransfers( + transferContainerId: string, + opts?: RecordsSourceQuery & RecordsIncludeQuery & RecordsPagingQuery + ): Promise<TransferContainerAssociationPaging> { + throwIfNotDefined(transferContainerId, 'transferContainerId'); + opts = opts || {}; + + const pathParams = { + transferContainerId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + include: buildCollectionParam(opts?.include, 'csv'), + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/transfer-containers/{transferContainerId}/transfers', + pathParams, + queryParams, + returnType: TransferContainerAssociationPaging + }); + } + + /** + * Update transfer container + * + * @param transferContainerId The identifier of a transfer container. You can also use the -transfers- alias. + * @param nodeBodyUpdate The node information to update. + * @param opts Optional parameters + * @returns Promise<TransferContainerEntry> + */ + updateTransferContainer( + transferContainerId: string, + nodeBodyUpdate: TransferContainerBodyUpdate, + opts?: RecordsIncludeQuery + ): Promise<TransferContainerEntry> { + throwIfNotDefined(transferContainerId, 'transferContainerId'); + throwIfNotDefined(nodeBodyUpdate, 'nodeBodyUpdate'); + opts = opts || {}; + + const pathParams = { + transferContainerId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/transfer-containers/{transferContainerId}', + pathParams, + queryParams, + bodyParam: nodeBodyUpdate, + returnType: TransferContainerEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/transfers.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/transfers.api.ts new file mode 100644 index 0000000000..6e1884c1c3 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/transfers.api.ts @@ -0,0 +1,96 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TransferAssociationPaging } from '../model/transferAssociationPaging'; +import { TransferEntry } from '../model/transferEntry'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery, RecordsPagingQuery, RecordsSourceQuery } from './types'; + +/** + * Transfers service. + * + * @module TransfersApi + */ +export class TransfersApi extends BaseApi { + /** + * Get a transfer + * + * Mandatory fields and the transfer's aspects and properties are returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param transferId The identifier of a transfer. + * @param opts Optional parameters + * @returns Promise<TransferEntry> + */ + getTransfer(transferId: string, opts?: RecordsIncludeQuery): Promise<TransferEntry> { + throwIfNotDefined(transferId, 'transferId'); + + const pathParams = { + transferId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/transfers/{transferId}', + pathParams, + queryParams, + returnType: TransferEntry + }); + } + + /** + * List transfer's children + * + * Minimal information for each child is returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param transferId The identifier of a transfer. + * @param opts Optional parameters + * @returns Promise<TransferAssociationPaging> + */ + listTransfersChildren( + transferId: string, + opts?: RecordsSourceQuery & RecordsIncludeQuery & RecordsPagingQuery + ): Promise<TransferAssociationPaging> { + throwIfNotDefined(transferId, 'transferId'); + + const pathParams = { + transferId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + include: buildCollectionParam(opts?.include, 'csv'), + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/transfers/{transferId}/children', + pathParams, + queryParams, + returnType: TransferAssociationPaging + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/types.ts b/lib/js-api/src/api/gs-core-rest-api/api/types.ts new file mode 100644 index 0000000000..1838a5bac1 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/types.ts @@ -0,0 +1,59 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type RecordsPagingQuery = { + /** + * The number of entities that exist in the collection before those included in this list. + */ + skipCount?: number; + + /** + * The maximum number of items to return in the list. + */ + maxItems?: number; +}; + +export type RecordsIncludeQuery = { + /** + * Returns additional information about the record. Any optional field from the response model can be requested. + */ + include?: string[]; +} & RecordsFieldsQuery; + +export type RecordsFieldsQuery = { + /** + * A list of field names. + * + * You can use this parameter to restrict the fields + * returned within a response if, for example, you want to save on overall bandwidth. + * + * The list applies to a returned individual + * entity or entries within a collection. + * + * If the API method also supports the **include** + * parameter, then the fields specified in the **include** + * parameter are returned in addition to those specified in the **fields** parameter. + */ + fields?: string[]; +}; + +export type RecordsSourceQuery = { + /** + * Also include **source** (in addition to **entries**) + */ + includeSource?: boolean; +}; diff --git a/lib/js-api/src/api/gs-core-rest-api/api/unfiledContainers.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/unfiledContainers.api.ts new file mode 100644 index 0000000000..9f78cd8e3c --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/unfiledContainers.api.ts @@ -0,0 +1,186 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RMNodeBodyCreate, UnfiledContainerAssociationPaging, UnfiledContainerEntry, UnfiledRecordContainerBodyUpdate } from '../model'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery, RecordsPagingQuery, RecordsSourceQuery } from './types'; + +/** + * Unfiled containers service. + * + * @module UnfiledContainersApi + */ +export class UnfiledContainersApi extends BaseApi { + /** + * Creates a record or an unfiled record folder as a primary child of **unfiledContainerId**. + * + * @param unfiledContainerId The identifier of an unfiled records container. You can use the **-unfiled-** alias. + * @param nodeBodyCreate The node information to create. + * @param opts Optional parameters + * @param opts.autoRename If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + * @returns Promise<UnfiledContainerAssociationPaging> + */ + createUnfiledContainerChildren( + unfiledContainerId: string, + nodeBodyCreate: RMNodeBodyCreate, + opts?: { + autoRename?: boolean; + } & RecordsIncludeQuery + ): Promise<UnfiledContainerAssociationPaging> { + throwIfNotDefined(unfiledContainerId, 'unfiledContainerId'); + throwIfNotDefined(nodeBodyCreate, 'nodeBodyCreate'); + + const pathParams = { + unfiledContainerId + }; + + const queryParams = { + autoRename: opts?.autoRename, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + const contentTypes = ['application/json', 'multipart/form-data']; + + return this.post({ + path: '/unfiled-containers/{unfiledContainerId}/children', + pathParams, + queryParams, + contentTypes, + bodyParam: nodeBodyCreate, + returnType: UnfiledContainerAssociationPaging + }); + } + + /** + * Get the unfiled records container + * + * Gets information for unfiled records container **unfiledContainerId** + * Mandatory fields and the unfiled records container's aspects and properties are returned by default. + * + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param unfiledContainerId The identifier of an unfiled records container. You can use the **-unfiled-** alias. + * @param opts Optional parameters + * @returns Promise<UnfiledContainerEntry> + */ + getUnfiledContainer(unfiledContainerId: string, opts?: RecordsIncludeQuery): Promise<UnfiledContainerEntry> { + throwIfNotDefined(unfiledContainerId, 'unfiledContainerId'); + + const pathParams = { + unfiledContainerId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/unfiled-containers/{unfiledContainerId}', + pathParams, + queryParams, + returnType: UnfiledContainerEntry + }); + } + + /** + * List unfiled record container's children + * + * Returns a list of records or unfiled record folders. + * + * Minimal information for each child is returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param unfiledContainerId The identifier of an unfiled records container. You can use the **-unfiled-** alias. + * @param opts Optional parameters + * @param opts.where Optionally filter the list. Here are some examples: + * - where=(isRecord=true) + * - where=(isUnfiledRecordFolder=false) + * - where=(nodeType='cm:content INCLUDESUBTYPES') + * @param opts.includeSource Also include **source** (in addition to **entries**) with folder information on the parent node – the specified parent **unfiledContainerId** + * @returns Promise<UnfiledContainerAssociationPaging> + */ + listUnfiledContainerChildren( + unfiledContainerId: string, + opts?: { + where?: string; + } & RecordsSourceQuery & + RecordsIncludeQuery & + RecordsPagingQuery + ): Promise<UnfiledContainerAssociationPaging> { + throwIfNotDefined(unfiledContainerId, 'unfiledContainerId'); + + const pathParams = { + unfiledContainerId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/unfiled-containers/{unfiledContainerId}/children', + pathParams, + queryParams, + returnType: UnfiledContainerAssociationPaging + }); + } + + /** + * Update an unfiled record container + * + * **Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + * + * @param unfiledContainerId The identifier of an unfiled records container. You can use the **-unfiled-** alias. + * @param unfiledContainerBodyUpdate The unfiled record container information to update. + * @param opts Optional parameters + * @returns Promise<UnfiledContainerEntry> + */ + updateUnfiledContainer( + unfiledContainerId: string, + unfiledContainerBodyUpdate: UnfiledRecordContainerBodyUpdate, + opts?: RecordsIncludeQuery + ): Promise<UnfiledContainerEntry> { + throwIfNotDefined(unfiledContainerId, 'unfiledContainerId'); + throwIfNotDefined(unfiledContainerBodyUpdate, 'unfiledContainerBodyUpdate'); + + const pathParams = { + unfiledContainerId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/unfiled-containers/{unfiledContainerId}', + pathParams, + queryParams, + bodyParam: unfiledContainerBodyUpdate, + returnType: UnfiledContainerEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/api/unfiledRecordFolders.api.ts b/lib/js-api/src/api/gs-core-rest-api/api/unfiledRecordFolders.api.ts new file mode 100644 index 0000000000..ee54efe5f4 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/api/unfiledRecordFolders.api.ts @@ -0,0 +1,212 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RMNodeBodyCreateWithRelativePath } from '../model/rMNodeBodyCreateWithRelativePath'; +import { UnfiledRecordFolderAssociationPaging } from '../model/unfiledRecordFolderAssociationPaging'; +import { UnfiledRecordFolderBodyUpdate } from '../model/unfiledRecordFolderBodyUpdate'; +import { UnfiledRecordFolderEntry } from '../model/unfiledRecordFolderEntry'; +import { BaseApi } from './base.api'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; +import { throwIfNotDefined } from '../../../assert'; +import { RecordsIncludeQuery, RecordsPagingQuery, RecordsSourceQuery } from './types'; + +/** + * UnfiledRecordFoldersApi service. + * + * @module UnfiledRecordFoldersApi + */ +export class UnfiledRecordFoldersApi extends BaseApi { + /** + * Create a record or an unfiled record folder + * + * @param unfiledRecordFolderId The identifier of an unfiled record folder. + * @param nodeBodyCreate The node information to create. + * @param opts Optional parameters + * @param opts.autoRename If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + * @returns Promise<UnfiledRecordFolderAssociationPaging> + */ + createUnfiledRecordFolderChildren( + unfiledRecordFolderId: string, + nodeBodyCreate: RMNodeBodyCreateWithRelativePath, + opts?: { + autoRename?: boolean; + } & RecordsIncludeQuery + ): Promise<UnfiledRecordFolderAssociationPaging> { + throwIfNotDefined(unfiledRecordFolderId, 'unfiledRecordFolderId'); + throwIfNotDefined(nodeBodyCreate, 'nodeBodyCreate'); + + const pathParams = { + unfiledRecordFolderId + }; + + const queryParams = { + autoRename: opts?.autoRename, + include: buildCollectionParam(opts?.include, 'csv'), + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.post({ + path: '/unfiled-record-folders/{unfiledRecordFolderId}/children', + pathParams, + queryParams, + bodyParam: nodeBodyCreate, + contentTypes: ['application/json', 'multipart/form-data'], + returnType: UnfiledRecordFolderAssociationPaging + }); + } + + /** + * Delete an unfiled record folder. Deleted file plan components cannot be recovered, they are deleted permanently. + * + * @param unfiledRecordFolderId The identifier of an unfiled record folder. + * @returns Promise<{}> + */ + deleteUnfiledRecordFolder(unfiledRecordFolderId: string): Promise<void> { + throwIfNotDefined(unfiledRecordFolderId, 'unfiledRecordFolderId'); + + const pathParams = { + unfiledRecordFolderId + }; + + return this.delete({ + path: '/unfiled-record-folders/{unfiledRecordFolderId}', + pathParams + }); + } + + /** + * Get the unfiled record folder + * + * Mandatory fields and the unfiled record folder's aspects and properties are returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param unfiledRecordFolderId The identifier of an unfiled record folder. + * @param opts Optional parameters + * @param opts.relativePath Return information on children in the unfiled records container resolved by this path. The path is relative to **unfiledRecordFolderId**. + * @returns Promise<UnfiledRecordFolderEntry> + */ + getUnfiledRecordFolder( + unfiledRecordFolderId: string, + opts?: { + relativePath?: string; + } & RecordsIncludeQuery + ): Promise<UnfiledRecordFolderEntry> { + throwIfNotDefined(unfiledRecordFolderId, 'unfiledRecordFolderId'); + + const pathParams = { + unfiledRecordFolderId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + relativePath: opts?.relativePath, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/unfiled-record-folders/{unfiledRecordFolderId}', + pathParams, + queryParams, + returnType: UnfiledRecordFolderEntry + }); + } + + /** + * List unfiled record folder's children + * + * Minimal information for each child is returned by default. + * You can use the **include** parameter (include=allowableOperations) to return additional information. + * + * @param unfiledRecordFolderId The identifier of an unfiled record folder. + * @param opts Optional parameters + * @param opts.where Optionally filter the list. Here are some examples: + * - where=(isRecord=true) + * - where=(isUnfiledRecordFolder=false) + * - where=(nodeType='cm:content INCLUDESUBTYPES') + * @param opts.relativePath Return information on children in the unfiled records container resolved by this path. The path is relative to **unfiledRecordFolderId**. + * @returns Promise<UnfiledRecordFolderAssociationPaging> + */ + listUnfiledRecordFolderChildren( + unfiledRecordFolderId: string, + opts?: { + where?: string; + relativePath?: string[]; + } & RecordsIncludeQuery & + RecordsPagingQuery & + RecordsSourceQuery + ): Promise<UnfiledRecordFolderAssociationPaging> { + throwIfNotDefined(unfiledRecordFolderId, 'unfiledRecordFolderId'); + opts = opts || {}; + + const pathParams = { + unfiledRecordFolderId + }; + + const queryParams = { + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + where: opts?.where, + include: buildCollectionParam(opts?.include, 'csv'), + relativePath: opts?.relativePath, + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.get({ + path: '/unfiled-record-folders/{unfiledRecordFolderId}/children', + pathParams, + queryParams, + returnType: UnfiledRecordFolderAssociationPaging + }); + } + + /** + * Updates unfiled record folder **unfiledRecordFolderId**. + * For example, you can rename a record folder: + * + * @param unfiledRecordFolderId The identifier of an unfiled record folder. + * @param unfiledRecordFolderBodyUpdate The record folder information to update. + * @param opts Optional parameters + * @returns Promise<UnfiledRecordFolderEntry> + */ + updateUnfiledRecordFolder( + unfiledRecordFolderId: string, + unfiledRecordFolderBodyUpdate: UnfiledRecordFolderBodyUpdate, + opts?: RecordsIncludeQuery & RecordsSourceQuery + ): Promise<UnfiledRecordFolderEntry> { + throwIfNotDefined(unfiledRecordFolderId, 'unfiledRecordFolderId'); + throwIfNotDefined(unfiledRecordFolderBodyUpdate, 'unfiledRecordFolderBodyUpdate'); + + const pathParams = { + unfiledRecordFolderId + }; + + const queryParams = { + include: buildCollectionParam(opts?.include, 'csv'), + includeSource: opts?.includeSource, + fields: buildCollectionParam(opts?.fields, 'csv') + }; + + return this.put({ + path: '/unfiled-record-folders/{unfiledRecordFolderId}', + pathParams, + queryParams, + bodyParam: unfiledRecordFolderBodyUpdate, + returnType: UnfiledRecordFolderEntry + }); + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/ChildAssociationInfo.md b/lib/js-api/src/api/gs-core-rest-api/docs/ChildAssociationInfo.md new file mode 100644 index 0000000000..f220f6cb85 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/ChildAssociationInfo.md @@ -0,0 +1,9 @@ +# ChildAssociationInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assocType** | **string** | | [default to null] +**isPrimary** | **boolean** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/ContentInfo.md b/lib/js-api/src/api/gs-core-rest-api/docs/ContentInfo.md new file mode 100644 index 0000000000..0008f33d61 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/ContentInfo.md @@ -0,0 +1,11 @@ +# ContentInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mimeType** | **string** | | [default to null] +**mimeTypeName** | **string** | | [default to null] +**sizeInBytes** | **number** | | [default to null] +**encoding** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/Error.md b/lib/js-api/src/api/gs-core-rest-api/docs/Error.md new file mode 100644 index 0000000000..9beb7f2852 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/Error.md @@ -0,0 +1,8 @@ +# ModelError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorError**](ErrorError.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/Error_error.md b/lib/js-api/src/api/gs-core-rest-api/docs/Error_error.md new file mode 100644 index 0000000000..f8b473d9af --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/Error_error.md @@ -0,0 +1,13 @@ +# ErrorError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errorKey** | **string** | | [optional] [default to null] +**statusCode** | **number** | | [default to null] +**briefSummary** | **string** | | [default to null] +**stackTrace** | **string** | | [default to null] +**descriptionURL** | **string** | | [default to null] +**logId** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/FilePlan.md b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlan.md new file mode 100644 index 0000000000..868e00c96b --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlan.md @@ -0,0 +1,21 @@ +# FilePlan + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanBodyUpdate.md b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanBodyUpdate.md new file mode 100644 index 0000000000..8e6b3249b6 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanBodyUpdate.md @@ -0,0 +1,8 @@ +# FilePlanBodyUpdate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | **{ [key: string]: string; }** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanComponentBodyUpdate.md b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanComponentBodyUpdate.md new file mode 100644 index 0000000000..fd01beaf01 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanComponentBodyUpdate.md @@ -0,0 +1,12 @@ +# FilePlanComponentBodyUpdate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [optional] [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **{ [key: string]: string; }** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanEntry.md new file mode 100644 index 0000000000..e1b5853550 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlanEntry.md @@ -0,0 +1,8 @@ +# FilePlanEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**FilePlan**](FilePlan.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/FilePlansApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlansApi.md new file mode 100644 index 0000000000..61be364a89 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/FilePlansApi.md @@ -0,0 +1,404 @@ +# FilePlansApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createFilePlanCategories**](FilePlansApi.md#createFilePlanCategories) | **POST** /file-plans/{filePlanId}/categories | Create record categories for a file plan +[**getFilePlan**](FilePlansApi.md#getFilePlan) | **GET** /file-plans/{filePlanId} | Get a file plan +[**getFilePlanCategories**](FilePlansApi.md#getFilePlanCategories) | **GET** /file-plans/{filePlanId}/categories | List file plans's children +[**updateFilePlan**](FilePlansApi.md#updateFilePlan) | **PUT** /file-plans/{filePlanId} | Update a file plan + + +<a name="createFilePlanCategories"></a> +# **createFilePlanCategories** +> RecordCategoryEntry createFilePlanCategories(filePlanIdnodeBodyCreateopts) + +Create record categories for a file plan + +Creates a record category as a primary child of **filePlanId**. + +You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then +the API method tries to create +a unique name using an integer suffix. + +This API method also supports record category creation using application/json. + +You must specify at least a **name**. + +You can create a category like this: +JSON +{ + \"name\":\"My Record Category\" +} + +You can set properties when creating a record category: +JSON +{ + \"name\":\"My Record Category\", + \"properties\": + { + \"rma:vitalRecordIndicator\":\"true\", + \"rma:reviewPeriod\":\"month|1\" + } +} + + +Any missing aspects are applied automatically. You can set aspects explicitly, if needed, using an **aspectNames** field. + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +JSON +{ + \"list\": { + \"pagination\": { + \"count\": 2, + \"hasMoreItems\": false, + \"totalItems\": 2, + \"skipCount\": 0, + \"maxItems\": 100 + }, + \"entries\": [ + { + \"entry\": { + ... + } + }, + { + \"entry\": { + ... + } + } + ] + } +} + + + +### Example +```javascript +import FilePlansApi from 'FilePlansApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let fileplansApi = new FilePlansApi(this.alfrescoApi); + +let opts = { + 'autoRename': true // | If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + + 'include': // | Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* hasRetentionSchedule +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +fileplansApi.createFilePlanCategories(filePlanIdnodeBodyCreateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filePlanId** | **string**| The identifier of a file plan. You can also use the -filePlan- alias. | + **nodeBodyCreate** | [**RootCategoryBodyCreate**](RootCategoryBodyCreate.md)| The node information to create. | + **autoRename** | **boolean**| If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + | [optional] + **include** | [**string**](string.md)| Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* hasRetentionSchedule +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordCategoryEntry**](RecordCategoryEntry.md) + +<a name="getFilePlan"></a> +# **getFilePlan** +> FilePlanEntry getFilePlan(filePlanIdopts) + +Get a file plan + +Gets information for file plan **filePlanId** + +Mandatory fields and the file plan's aspects and properties are returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import FilePlansApi from 'FilePlansApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let fileplansApi = new FilePlansApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the file plan. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +fileplansApi.getFilePlan(filePlanIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filePlanId** | **string**| The identifier of a file plan. You can also use the -filePlan- alias. | + **include** | [**string**](string.md)| Returns additional information about the file plan. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**FilePlanEntry**](FilePlanEntry.md) + +<a name="getFilePlanCategories"></a> +# **getFilePlanCategories** +> RecordCategoryPaging getFilePlanCategories(filePlanIdopts) + +List file plans's children + +Returns a list of record categories. + +Minimal information for each child is returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import FilePlansApi from 'FilePlansApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let fileplansApi = new FilePlansApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'include': // | Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* hasRetentionSchedule +* path +* properties + + 'includeSource': true // | Also include **source** (in addition to **entries**) with folder information on the parent node – the specified parent **filePlanId** + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +fileplansApi.getFilePlanCategories(filePlanIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filePlanId** | **string**| The identifier of a file plan. You can also use the -filePlan- alias. | + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **include** | [**string**](string.md)| Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* hasRetentionSchedule +* path +* properties + | [optional] + **includeSource** | **boolean**| Also include **source** (in addition to **entries**) with folder information on the parent node – the specified parent **filePlanId** | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordCategoryPaging**](RecordCategoryPaging.md) + +<a name="updateFilePlan"></a> +# **updateFilePlan** +> FilePlanEntry updateFilePlan(filePlanIdfilePlanBodyUpdateopts) + +Update a file plan + +Updates file plan **filePlanId**. +You can only set or update description and title properties: +JSON +{ + \"properties\": + { + \"cm:description\": \"New Description\", + \"cm:title\":\"New Title\" + } +} + + +**Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + + +### Example +```javascript +import FilePlansApi from 'FilePlansApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let fileplansApi = new FilePlansApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the file plan. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +fileplansApi.updateFilePlan(filePlanIdfilePlanBodyUpdateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filePlanId** | **string**| The identifier of a file plan. You can also use the -filePlan- alias. | + **filePlanBodyUpdate** | [**FilePlanBodyUpdate**](FilePlanBodyUpdate.md)| The file plan information to update. | + **include** | [**string**](string.md)| Returns additional information about the file plan. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**FilePlanEntry**](FilePlanEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/FilesApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/FilesApi.md new file mode 100644 index 0000000000..ac8bc7033e --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/FilesApi.md @@ -0,0 +1,88 @@ +# FilesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**declareRecord**](FilesApi.md#declareRecord) | **POST** /files/{fileId}/declare | Declare as record + + +<a name="declareRecord"></a> +# **declareRecord** +> RecordEntry declareRecord(fileIdopts) + +Declare as record + +Declares the file **fileId** in the unfiled records container. The original file is moved to the Records Management site and a secondary parent association is created in the file's original site. + +### Example +```javascript +import FilesApi from 'FilesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let filesApi = new FilesApi(this.alfrescoApi); + +let opts = { + 'hideRecord': true // | Flag to indicate whether the record should be hidden from the current parent folder. + 'include': // | Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +filesApi.declareRecord(fileIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileId** | **string**| The identifier of a non-record file. | + **hideRecord** | **boolean**| Flag to indicate whether the record should be hidden from the current parent folder. | [optional] [default to false] + **include** | [**string**](string.md)| Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordEntry**](RecordEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/GssitesApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/GssitesApi.md new file mode 100644 index 0000000000..d9fa6313a4 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/GssitesApi.md @@ -0,0 +1,243 @@ +# GssitesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createRMSite**](GssitesApi.md#createRMSite) | **POST** /gs-sites | Create the Records Management (RM) site +[**deleteRMSite**](GssitesApi.md#deleteRMSite) | **DELETE** /gs-sites/rm | Delete the Records Management (RM) site +[**getRMSite**](GssitesApi.md#getRMSite) | **GET** /gs-sites/rm | Get the Records Management (RM) site +[**updateRMSite**](GssitesApi.md#updateRMSite) | **PUT** /gs-sites/rm | Update the Records Management (RM) site + + +<a name="createRMSite"></a> +# **createRMSite** +> RMSiteEntry createRMSite(siteBodyCreateopts) + +Create the Records Management (RM) site + + +Creates the RM site with the given details. + +**Note:** The default site id is rm and the default site name is Records Management. The id of a site cannot be updated once the site has been created. + +For example, to create an RM site named \"Records Management\" with \"Records Management Description\" as description, the following body could be used: +JSON +{ + \"title\": \"Records Management\", + \"description\": \"Records Management Description\" +} + + +The creator will be added as a member with Site Manager role. + +When you create the RM site, the **filePlan** structure is also created including special containers, such as containers for transfers, holds and, unfiled records. + + +### Example +```javascript +import GssitesApi from 'GssitesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let gssitesApi = new GssitesApi(this.alfrescoApi); + +let opts = { + 'skipAddToFavorites': true // | Flag to indicate whether the RM site should not be added to the user's site favorites. +}; + +gssitesApi.createRMSite(siteBodyCreateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **siteBodyCreate** | [**RMSiteBodyCreate**](RMSiteBodyCreate.md)| The site details | + **skipAddToFavorites** | **boolean**| Flag to indicate whether the RM site should not be added to the user's site favorites. | [optional] [default to false] + +### Return type + +[**RMSiteEntry**](RMSiteEntry.md) + +<a name="deleteRMSite"></a> +# **deleteRMSite** +> deleteRMSite() + +Delete the Records Management (RM) site + + +Deletes the RM site. + + +### Example +```javascript +import GssitesApi from 'GssitesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let gssitesApi = new GssitesApi(this.alfrescoApi); + +gssitesApi.deleteRMSite().then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +<a name="getRMSite"></a> +# **getRMSite** +> RMSiteEntry getRMSite(opts) + +Get the Records Management (RM) site + + +Gets information for RM site. + + +### Example +```javascript +import GssitesApi from 'GssitesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let gssitesApi = new GssitesApi(this.alfrescoApi); + +let opts = { + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +gssitesApi.getRMSite(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RMSiteEntry**](RMSiteEntry.md) + +<a name="updateRMSite"></a> +# **updateRMSite** +> RMSiteEntry updateRMSite(siteBodyUpdateopts) + +Update the Records Management (RM) site + + +Update the details for the RM site. Site Manager or other (site) admin can update title or description. + +**Note**: the id, site visibility, or compliance of the RM site cannot be updated once the site has been created. + + +### Example +```javascript +import GssitesApi from 'GssitesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let gssitesApi = new GssitesApi(this.alfrescoApi); + +let opts = { + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +gssitesApi.updateRMSite(siteBodyUpdateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **siteBodyUpdate** | [**RMSiteBodyUpdate**](RMSiteBodyUpdate.md)| The RM site information to update. | + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RMSiteEntry**](RMSiteEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/Pagination.md b/lib/js-api/src/api/gs-core-rest-api/docs/Pagination.md new file mode 100644 index 0000000000..132172b802 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/Pagination.md @@ -0,0 +1,23 @@ +# Pagination + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **number** | The number of objects in the entries array. + | [default to null] +**hasMoreItems** | **boolean** | A boolean value which is **true** if there are more entities in the collection +beyond those in this response. A true value means a request with a larger value +for the **skipCount** or the **maxItems** parameter will return more entities. + | [default to null] +**totalItems** | **number** | An integer describing the total number of entities in the collection. +The API might not be able to determine this value, +in which case this property will not be present. + | [optional] [default to null] +**skipCount** | **number** | An integer describing how many entities exist in the collection before +those included in this list. + | [default to null] +**maxItems** | **number** | The value of the **maxItems** parameter used to generate this list, +or if there was no **maxItems** parameter the default value is 100 + | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/PathElement.md b/lib/js-api/src/api/gs-core-rest-api/docs/PathElement.md new file mode 100644 index 0000000000..dcbee68785 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/PathElement.md @@ -0,0 +1,9 @@ +# PathElement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/PathInfo.md b/lib/js-api/src/api/gs-core-rest-api/docs/PathInfo.md new file mode 100644 index 0000000000..ff295672c0 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/PathInfo.md @@ -0,0 +1,10 @@ +# PathInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**elements** | [**PathElement[]**](PathElement.md) | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**isCompleted** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RMNodeBodyCreate.md b/lib/js-api/src/api/gs-core-rest-api/docs/RMNodeBodyCreate.md new file mode 100644 index 0000000000..af559adf94 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RMNodeBodyCreate.md @@ -0,0 +1,13 @@ +# RMNodeBodyCreate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **{ [key: string]: string; }** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RMNodeBodyCreateWithRelativePath.md b/lib/js-api/src/api/gs-core-rest-api/docs/RMNodeBodyCreateWithRelativePath.md new file mode 100644 index 0000000000..cc21e6bc7e --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RMNodeBodyCreateWithRelativePath.md @@ -0,0 +1,14 @@ +# RMNodeBodyCreateWithRelativePath + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **{ [key: string]: string; }** | | [optional] [default to null] +**relativePath** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RMSite.md b/lib/js-api/src/api/gs-core-rest-api/docs/RMSite.md new file mode 100644 index 0000000000..72d3271782 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RMSite.md @@ -0,0 +1,53 @@ +# RMSite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**guid** | **string** | | [default to null] +**title** | **string** | | [default to null] +**description** | **string** | | [optional] [default to null] +**visibility** | **string** | | [default to null] +**compliance** | **string** | | [default to null] +**role** | **string** | | [optional] [default to null] + + +<a name="RMSite.VisibilityEnum"></a> +## Enum: RMSite.VisibilityEnum + + +* `PRIVATE` (value: `'PRIVATE'`) + +* `MODERATED` (value: `'MODERATED'`) + +* `PUBLIC` (value: `'PUBLIC'`) + + + + +<a name="RMSite.ComplianceEnum"></a> +## Enum: RMSite.ComplianceEnum + + +* `STANDARD` (value: `'STANDARD'`) + +* `DOD5015` (value: `'DOD5015'`) + + + + +<a name="RMSite.RoleEnum"></a> +## Enum: RMSite.RoleEnum + + +* `SiteConsumer` (value: `'SiteConsumer'`) + +* `SiteCollaborator` (value: `'SiteCollaborator'`) + +* `SiteContributor` (value: `'SiteContributor'`) + +* `SiteManager` (value: `'SiteManager'`) + + + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteBodyCreate.md b/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteBodyCreate.md new file mode 100644 index 0000000000..4c2507ef49 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteBodyCreate.md @@ -0,0 +1,21 @@ +# RMSiteBodyCreate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | | [default to null] +**description** | **string** | | [optional] [default to null] +**compliance** | **string** | | [optional] [default to null] + + +<a name="RMSiteBodyCreate.ComplianceEnum"></a> +## Enum: RMSiteBodyCreate.ComplianceEnum + + +* `STANDARD` (value: `'STANDARD'`) + +* `DOD5015` (value: `'DOD5015'`) + + + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteBodyUpdate.md b/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteBodyUpdate.md new file mode 100644 index 0000000000..19d1cfbe0d --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteBodyUpdate.md @@ -0,0 +1,9 @@ +# RMSiteBodyUpdate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteEntry.md new file mode 100644 index 0000000000..b537827fd3 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RMSiteEntry.md @@ -0,0 +1,8 @@ +# RMSiteEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**RMSite**](RMSite.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/Record.md b/lib/js-api/src/api/gs-core-rest-api/docs/Record.md new file mode 100644 index 0000000000..d880362e21 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/Record.md @@ -0,0 +1,23 @@ +# Record + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isCompleted** | **boolean** | Present only for record nodes. Indicates if the record is completed | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoriesApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoriesApi.md new file mode 100644 index 0000000000..a2e31ce8db --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoriesApi.md @@ -0,0 +1,526 @@ +# RecordCategoriesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createRecordCategoryChild**](RecordCategoriesApi.md#createRecordCategoryChild) | **POST** /record-categories/{recordCategoryId}/children | Create a record category or a record folder +[**deleteRecordCategory**](RecordCategoriesApi.md#deleteRecordCategory) | **DELETE** /record-categories/{recordCategoryId} | Delete a record category +[**getRecordCategory**](RecordCategoriesApi.md#getRecordCategory) | **GET** /record-categories/{recordCategoryId} | Get a record category +[**listRecordCategoryChildren**](RecordCategoriesApi.md#listRecordCategoryChildren) | **GET** /record-categories/{recordCategoryId}/children | List record category's children +[**updateRecordCategory**](RecordCategoriesApi.md#updateRecordCategory) | **PUT** /record-categories/{recordCategoryId} | Update a record category + + +<a name="createRecordCategoryChild"></a> +# **createRecordCategoryChild** +> RecordCategoryChildEntry createRecordCategoryChild(recordCategoryIdnodeBodyCreateopts) + +Create a record category or a record folder + +Create a record category or a record folder as a primary child of **recordCategoryId**. + +You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then +the API method tries to create +a unique name using an integer suffix. + +This API method also supports record category or record folder creation using application/json. + +You must specify at least a **name** and **nodeType**. + +You can create a category like this: +JSON +{ + \"name\":\"My Record Category\", + \"nodeType\":\"rma:recordCategory\" +} + + +You can create a record folder like this: +JSON +{ + \"name\":\"My Record Folder\", + \"nodeType\":\"rma:recordFolder\" +} + + +You can create a record folder inside a container hierarchy (applies to record categories as well): +JSON +{ + \"name\":\"My Fileplan Component\", + \"nodeType\":\"rma:recordFolder\", + \"relativePath\":\"X/Y/Z\" +} + +The **relativePath** specifies the container structure to create relative to the node (record category or record folder). Containers in the +**relativePath** that do not exist are created before the node is created. The container type is decided considering +the type of the parent container and the type of the node to be created. + +You can set properties when creating a record category (applies to record folders as well): +JSON +{ + \"name\":\"My Record Category\", + \"nodeType\":\"rma:recordCategory\", + \"properties\": + { + \"rma:vitalRecordIndicator\":\"true\", + \"rma:reviewPeriod\":\"month|1\" + } +} + + +Any missing aspects are applied automatically. You can set aspects explicitly, if needed, using an **aspectNames** field. + +**Note:** You can create more than one child by +specifying a list of nodes in the JSON body. For example, the following JSON +body creates a record category and a record folder inside the specified **categoryId**: +JSON +[ + { + \"name\":\"My Record Category\", + \"nodeType\":\"rma:recordCategory\" + }, + { + \"name\":\"My Record Folder\", + \"nodeType\":\"rma:recordFolder\" + } +] + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +JSON +{ + \"list\": { + \"pagination\": { + \"count\": 2, + \"hasMoreItems\": false, + \"totalItems\": 2, + \"skipCount\": 0, + \"maxItems\": 100 + }, + \"entries\": [ + { + \"entry\": { + ... + } + }, + { + \"entry\": { + ... + } + } + ] + } +} + + + +### Example +```javascript +import RecordCategoriesApi from 'RecordCategoriesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordcategoriesApi = new RecordCategoriesApi(this.alfrescoApi); + +let opts = { + 'autoRename': true // | If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + + 'include': // | Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* hasRetentionSchedule +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordcategoriesApi.createRecordCategoryChild(recordCategoryIdnodeBodyCreateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordCategoryId** | **string**| The identifier of a record category. | + **nodeBodyCreate** | [**RMNodeBodyCreateWithRelativePath**](RMNodeBodyCreateWithRelativePath.md)| The node information to create. + | + **autoRename** | **boolean**| If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + | [optional] + **include** | [**string**](string.md)| Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* hasRetentionSchedule +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordCategoryChildEntry**](RecordCategoryChildEntry.md) + +<a name="deleteRecordCategory"></a> +# **deleteRecordCategory** +> deleteRecordCategory(recordCategoryId) + +Delete a record category + +Deletes record category **recordCategoryId**. + + +### Example +```javascript +import RecordCategoriesApi from 'RecordCategoriesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordcategoriesApi = new RecordCategoriesApi(this.alfrescoApi); + + +recordcategoriesApi.deleteRecordCategory(recordCategoryId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordCategoryId** | **string**| The identifier of a record category. | + +### Return type + +null (empty response body) + +<a name="getRecordCategory"></a> +# **getRecordCategory** +> RecordCategoryEntry getRecordCategory(recordCategoryIdopts) + +Get a record category + +Gets information for record category **recordCategoryId** + +Mandatory fields and the record category's aspects and properties are returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import RecordCategoriesApi from 'RecordCategoriesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordcategoriesApi = new RecordCategoriesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* hasRetentionSchedule +* path + + 'relativePath': relativePath_example // | Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**. + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordcategoriesApi.getRecordCategory(recordCategoryIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordCategoryId** | **string**| The identifier of a record category. | + **include** | [**string**](string.md)| Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* hasRetentionSchedule +* path + | [optional] + **relativePath** | **string**| Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**. + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordCategoryEntry**](RecordCategoryEntry.md) + +<a name="listRecordCategoryChildren"></a> +# **listRecordCategoryChildren** +> RecordCategoryChildPaging listRecordCategoryChildren(recordCategoryIdopts) + +List record category's children + +Returns a list of record categories and/or record folders. + +Minimal information for each child is returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + +The list of child nodes includes primary children and secondary children, if there are any. + + +### Example +```javascript +import RecordCategoriesApi from 'RecordCategoriesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordcategoriesApi = new RecordCategoriesApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'where': where_example // | Optionally filter the list. Here are some examples: + +* where=(nodeType='rma:recordFolder') + +* where=(nodeType='rma:recordCategory') + +* where=(isRecordFolder=true AND isClosed=false) + + 'include': // | Returns additional information about the record category child. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* hasRetentionSchedule +* isClosed +* isRecordCategory +* isRecordFolder +* path +* properties + + 'relativePath': relativePath_example // | Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**. + + 'includeSource': true // | Also include **source** (in addition to **entries**) with folder information on the parent node – either the specified parent **recordCategoryId**, or as resolved by **relativePath**. + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordcategoriesApi.listRecordCategoryChildren(recordCategoryIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordCategoryId** | **string**| The identifier of a record category. | + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **where** | **string**| Optionally filter the list. Here are some examples: + +* where=(nodeType='rma:recordFolder') + +* where=(nodeType='rma:recordCategory') + +* where=(isRecordFolder=true AND isClosed=false) + | [optional] + **include** | [**string**](string.md)| Returns additional information about the record category child. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* hasRetentionSchedule +* isClosed +* isRecordCategory +* isRecordFolder +* path +* properties + | [optional] + **relativePath** | **string**| Return information on children in the record category resolved by this path. The path is relative to **recordCategoryId**. + | [optional] + **includeSource** | **boolean**| Also include **source** (in addition to **entries**) with folder information on the parent node – either the specified parent **recordCategoryId**, or as resolved by **relativePath**. | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordCategoryChildPaging**](RecordCategoryChildPaging.md) + +<a name="updateRecordCategory"></a> +# **updateRecordCategory** +> RecordCategoryEntry updateRecordCategory(recordCategoryIdrecordCategoryBodyUpdateopts) + +Update a record category + +Updates record category **recordCategoryId**. For example, you can rename a record category: +JSON +{ + \"name\":\"My new name\" +} + +You can also set or update one or more properties: +JSON +{ + \"properties\": + { + \"rma:vitalRecordIndicator\": true, + \"rma:reviewPeriod\":\"month|6\" + } +} + +**Note:** If you want to add or remove aspects, then you must use **GET /record-categories/{recordCategoryId}** first to get the complete set of *aspectNames*. + +**Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + + +### Example +```javascript +import RecordCategoriesApi from 'RecordCategoriesApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordcategoriesApi = new RecordCategoriesApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* hasRetentionSchedule +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordcategoriesApi.updateRecordCategory(recordCategoryIdrecordCategoryBodyUpdateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordCategoryId** | **string**| The identifier of a record category. | + **recordCategoryBodyUpdate** | [**FilePlanComponentBodyUpdate**](FilePlanComponentBodyUpdate.md)| The record category information to update. | + **include** | [**string**](string.md)| Returns additional information about the record category. Any optional field from the response model can be requested. For example: +* allowableOperations +* hasRetentionSchedule +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordCategoryEntry**](RecordCategoryEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategory.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategory.md new file mode 100644 index 0000000000..9d5d14e849 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategory.md @@ -0,0 +1,22 @@ +# RecordCategory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**hasRetentionSchedule** | **boolean** | Indicates if the record category has a retention schedule defined | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChild.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChild.md new file mode 100644 index 0000000000..58942d4653 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChild.md @@ -0,0 +1,25 @@ +# RecordCategoryChild + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**hasRetentionSchedule** | **boolean** | Indicates if the record category has a retention schedule defined | [optional] [default to null] +**isClosed** | **boolean** | Indicates if the record folder is closed | [optional] [default to null] +**isRecordCategory** | **boolean** | | [optional] [default to null] +**isRecordFolder** | **boolean** | | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildEntry.md new file mode 100644 index 0000000000..5695cfda50 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildEntry.md @@ -0,0 +1,8 @@ +# RecordCategoryChildEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**RecordCategoryChild**](RecordCategoryChild.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildPaging.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildPaging.md new file mode 100644 index 0000000000..620f0aade3 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildPaging.md @@ -0,0 +1,8 @@ +# RecordCategoryChildPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**RecordCategoryChildPagingList**](RecordCategoryChildPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildPaging_list.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildPaging_list.md new file mode 100644 index 0000000000..abfc1d64a1 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryChildPaging_list.md @@ -0,0 +1,10 @@ +# RecordCategoryChildPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**RecordCategoryChildEntry[]**](RecordCategoryChildEntry.md) | | [optional] [default to null] +**source** | [**RecordCategory**](RecordCategory.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryEntry.md new file mode 100644 index 0000000000..5482921c33 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryEntry.md @@ -0,0 +1,8 @@ +# RecordCategoryEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**RecordCategory**](RecordCategory.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryPaging.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryPaging.md new file mode 100644 index 0000000000..4c954d68bf --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryPaging.md @@ -0,0 +1,8 @@ +# RecordCategoryPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**RecordCategoryPagingList**](RecordCategoryPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryPaging_list.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryPaging_list.md new file mode 100644 index 0000000000..7c2b815fc7 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordCategoryPaging_list.md @@ -0,0 +1,10 @@ +# RecordCategoryPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**RecordCategoryEntry[]**](RecordCategoryEntry.md) | | [optional] [default to null] +**source** | [**FilePlan**](FilePlan.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordEntry.md new file mode 100644 index 0000000000..4da31798ea --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordEntry.md @@ -0,0 +1,8 @@ +# RecordEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Record**](Record.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolder.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolder.md new file mode 100644 index 0000000000..479ed05d9c --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolder.md @@ -0,0 +1,22 @@ +# RecordFolder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isClosed** | **boolean** | Indicates if the record folder is closed | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderAssociationPaging.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderAssociationPaging.md new file mode 100644 index 0000000000..17815a9eff --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderAssociationPaging.md @@ -0,0 +1,8 @@ +# RecordFolderAssociationPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**RecordFolderAssociationPagingList**](RecordFolderAssociationPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderAssociationPaging_list.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderAssociationPaging_list.md new file mode 100644 index 0000000000..b743f43508 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderAssociationPaging_list.md @@ -0,0 +1,10 @@ +# RecordFolderAssociationPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**RecordFolderChildAssociationEntry[]**](RecordFolderChildAssociationEntry.md) | | [optional] [default to null] +**source** | [**RecordFolder**](RecordFolder.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderChildAssociation.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderChildAssociation.md new file mode 100644 index 0000000000..90f0495682 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderChildAssociation.md @@ -0,0 +1,24 @@ +# RecordFolderChildAssociation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isCompleted** | **boolean** | Present only for record nodes. Indicates if the record is completed | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] +**association** | [**ChildAssociationInfo**](ChildAssociationInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderChildAssociationEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderChildAssociationEntry.md new file mode 100644 index 0000000000..aec137880a --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderChildAssociationEntry.md @@ -0,0 +1,8 @@ +# RecordFolderChildAssociationEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**RecordFolderChildAssociation**](RecordFolderChildAssociation.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderEntry.md new file mode 100644 index 0000000000..6fbf86b9e7 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFolderEntry.md @@ -0,0 +1,8 @@ +# RecordFolderEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**RecordFolder**](RecordFolder.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordFoldersApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFoldersApi.md new file mode 100644 index 0000000000..33b4fb40db --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordFoldersApi.md @@ -0,0 +1,508 @@ +# RecordFoldersApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createRecordFolderChild**](RecordFoldersApi.md#createRecordFolderChild) | **POST** /record-folders/{recordFolderId}/records | Create a record +[**deleteRecordFolder**](RecordFoldersApi.md#deleteRecordFolder) | **DELETE** /record-folders/{recordFolderId} | Delete a record folder +[**getRecordFolder**](RecordFoldersApi.md#getRecordFolder) | **GET** /record-folders/{recordFolderId} | Get a record folder +[**listRecordFolderChildren**](RecordFoldersApi.md#listRecordFolderChildren) | **GET** /record-folders/{recordFolderId}/records | List records +[**updateRecordFolder**](RecordFoldersApi.md#updateRecordFolder) | **PUT** /record-folders/{recordFolderId} | Update a record folder + + +<a name="createRecordFolderChild"></a> +# **createRecordFolderChild** +> RecordEntry createRecordFolderChild(recordFolderIdrecordBodyCreateopts) + +Create a record + +Create a record as a primary child of **recordFolderId**. + +This endpoint supports both JSON and multipart/form-data (file upload). + +**Using multipart/form-data** + +Use the **filedata** field to represent the content to upload, for example, the following curl command will +create a node with the contents of test.txt in the test user's home folder. + +curl -utest:test -X POST host:port/alfresco/api/-default-/public/gs/versions/1/record-folders/{recordFolderId}/records -F filedata=@test.txt + +This API method also supports record creation using application/json. + +You must specify at least a **name** and **nodeType**. + + +You can create a non-electronic record like this: +JSON +{ + \"name\":\"My Non-electronic Record\", + \"nodeType\":\"rma:nonElectronicDocument\", + \"properties\": + { + \"cm:description\":\"My Non-electronic Record Description\", + \"cm:title\":\"My Non-electronic Record Title\", + \"rma:box\":\"My Non-electronic Record Box\", + \"rma:file\":\"My Non-electronic Record File\", + \"rma:numberOfCopies\":1, + \"rma:physicalSize\":30, + \"rma:shelf\":\"My Non-electronic Record Shelf\", + \"rma:storageLocation\":\"My Non-electronic Record Location\" + } +} + + +You can create an empty electronic record: +JSON +{ + \"name\":\"My Electronic Record\", + \"nodeType\":\"cm:content\" +} + + +Any missing aspects are applied automatically. You can set aspects explicitly, if needed, using an **aspectNames** field. + +**Note:** You can create more than one child by +specifying a list of nodes in the JSON body. For example, the following JSON +body creates a record category and a record folder inside the specified **categoryId**: +JSON +[ + { + \"name\":\"Record 1\", + \"nodeType\":\"cm:content\" + }, + { + \"name\":\"Record 2\", + \"nodeType\":\"cm:content\" + } +] + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +JSON +{ + \"list\": { + \"pagination\": { + \"count\": 2, + \"hasMoreItems\": false, + \"totalItems\": 2, + \"skipCount\": 0, + \"maxItems\": 100 + }, + \"entries\": [ + { + \"entry\": { + ... + } + }, + { + \"entry\": { + ... + } + } + ] + } +} + + + +### Example +```javascript +import RecordFoldersApi from 'RecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordfoldersApi = new RecordFoldersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordfoldersApi.createRecordFolderChild(recordFolderIdrecordBodyCreateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordFolderId** | **string**| The identifier of a record folder. | + **recordBodyCreate** | [**RMNodeBodyCreate**](RMNodeBodyCreate.md)| The record information to create. + +This field is ignored for multipart/form-data content uploads. + | + **include** | [**string**](string.md)| Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordEntry**](RecordEntry.md) + +<a name="deleteRecordFolder"></a> +# **deleteRecordFolder** +> deleteRecordFolder(recordFolderId) + +Delete a record folder + +Deletes record folder **recordFolderId**. Deleted file plan components cannot be recovered, they are deleted permanently. + + +### Example +```javascript +import RecordFoldersApi from 'RecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordfoldersApi = new RecordFoldersApi(this.alfrescoApi); + + +recordfoldersApi.deleteRecordFolder(recordFolderId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordFolderId** | **string**| The identifier of a record folder. | + +### Return type + +null (empty response body) + +<a name="getRecordFolder"></a> +# **getRecordFolder** +> RecordFolderEntry getRecordFolder(recordFolderIdopts) + +Get a record folder + +Gets information for record folder **recordFolderId** + +Mandatory fields and the record folder's aspects and properties are returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import RecordFoldersApi from 'RecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordfoldersApi = new RecordFoldersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record folders. Any optional field from the response model can be requested. For example: +* allowableOperations +* isClosed +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordfoldersApi.getRecordFolder(recordFolderIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordFolderId** | **string**| The identifier of a record folder. | + **include** | [**string**](string.md)| Returns additional information about the record folders. Any optional field from the response model can be requested. For example: +* allowableOperations +* isClosed +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordFolderEntry**](RecordFolderEntry.md) + +<a name="listRecordFolderChildren"></a> +# **listRecordFolderChildren** +> RecordFolderAssociationPaging listRecordFolderChildren(recordFolderIdopts) + +List records + +Gets a list of records. + +Minimal information for each record is returned by default. + +The list of records includes primary children and secondary children, if there are any. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import RecordFoldersApi from 'RecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordfoldersApi = new RecordFoldersApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'where': where_example // | Optionally filter the list. Here are some examples: + +* where=(nodeType='my:specialNodeType') + +* where=(nodeType='my:specialNodeType INCLUDESUBTYPES') + +* where=(isPrimary=true) + + 'include': // | Returns additional information about the records. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* association +* content +* isCompleted +* path +* properties + + 'includeSource': true // | Also include **source** (in addition to **entries**) with record information on the parent folder – the specified parent **recordFolderId** + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordfoldersApi.listRecordFolderChildren(recordFolderIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordFolderId** | **string**| The identifier of a record folder. | + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **where** | **string**| Optionally filter the list. Here are some examples: + +* where=(nodeType='my:specialNodeType') + +* where=(nodeType='my:specialNodeType INCLUDESUBTYPES') + +* where=(isPrimary=true) + | [optional] + **include** | [**string**](string.md)| Returns additional information about the records. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* association +* content +* isCompleted +* path +* properties + | [optional] + **includeSource** | **boolean**| Also include **source** (in addition to **entries**) with record information on the parent folder – the specified parent **recordFolderId** | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordFolderAssociationPaging**](RecordFolderAssociationPaging.md) + +<a name="updateRecordFolder"></a> +# **updateRecordFolder** +> RecordFolderEntry updateRecordFolder(recordFolderIdrecordFolderBodyUpdateopts) + +Update a record folder + +Updates record folder **recordFolderId**. For example, you can rename a record folder: +JSON +{ + \"name\":\"My new name\" +} + +You can also set or update one or more properties: +JSON +{ + \"properties\": + { + \"rma:vitalRecordIndicator\": true, + \"rma:reviewPeriod\":\"month|6\" + } +} + +**Note:** if you want to add or remove aspects, then you must use **GET /record-folders/{recordFolderId}** first to get the complete set of *aspectNames*. + +**Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + + +### Example +```javascript +import RecordFoldersApi from 'RecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordfoldersApi = new RecordFoldersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record folders. Any optional field from the response model can be requested. For example: +* allowableOperations +* isClosed +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordfoldersApi.updateRecordFolder(recordFolderIdrecordFolderBodyUpdateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordFolderId** | **string**| The identifier of a record folder. | + **recordFolderBodyUpdate** | [**FilePlanComponentBodyUpdate**](FilePlanComponentBodyUpdate.md)| The record folder information to update. | + **include** | [**string**](string.md)| Returns additional information about the record folders. Any optional field from the response model can be requested. For example: +* allowableOperations +* isClosed +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordFolderEntry**](RecordFolderEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RecordsApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/RecordsApi.md new file mode 100644 index 0000000000..e0903d0951 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RecordsApi.md @@ -0,0 +1,465 @@ +# RecordsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**completeRecord**](RecordsApi.md#completeRecord) | **POST** /records/{recordId}/complete | Complete a record +[**deleteRecord**](RecordsApi.md#deleteRecord) | **DELETE** /records/{recordId} | Delete a record +[**fileRecord**](RecordsApi.md#fileRecord) | **POST** /records/{recordId}/file | File a record +[**getRecord**](RecordsApi.md#getRecord) | **GET** /records/{recordId} | Get a record +[**getRecordContent**](RecordsApi.md#getRecordContent) | **GET** /records/{recordId}/content | Get record content +[**updateRecord**](RecordsApi.md#updateRecord) | **PUT** /records/{recordId} | Update record + + +<a name="completeRecord"></a> +# **completeRecord** +> RecordEntry completeRecord(recordIdopts) + +Complete a record + +Completes the record **recordId**. + + +### Example +```javascript +import RecordsApi from 'RecordsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordsApi = new RecordsApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordsApi.completeRecord(recordIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordId** | **string**| The identifier of a record. | + **include** | [**string**](string.md)| Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordEntry**](RecordEntry.md) + +<a name="deleteRecord"></a> +# **deleteRecord** +> deleteRecord(recordId) + +Delete a record + +Deletes the record **recordId**. Deleted file plan components cannot be recovered, they are deleted permanently. + + +### Example +```javascript +import RecordsApi from 'RecordsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordsApi = new RecordsApi(this.alfrescoApi); + + +recordsApi.deleteRecord(recordId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordId** | **string**| The identifier of a record. | + +### Return type + +null (empty response body) + +<a name="fileRecord"></a> +# **fileRecord** +> RecordEntry fileRecord(recordIdnodeBodyFileopts) + +File a record + +Files the record **recordId** in the target record folder. + +You need to specify the target record folder by providing its id **targetParentId** + +If the record is already filed, a link to the target record folder is created. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import RecordsApi from 'RecordsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordsApi = new RecordsApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordsApi.fileRecord(recordIdnodeBodyFileopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordId** | **string**| The identifier of a record. | + **nodeBodyFile** | [**RequestBodyFile**](RequestBodyFile.md)| The target record folder id | + **include** | [**string**](string.md)| Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordEntry**](RecordEntry.md) + +<a name="getRecord"></a> +# **getRecord** +> RecordEntry getRecord(recordIdopts) + +Get a record + +Gets information for record **recordId** + +Mandatory fields and the record's aspects and properties are returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import RecordsApi from 'RecordsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordsApi = new RecordsApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordsApi.getRecord(recordIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordId** | **string**| The identifier of a record. | + **include** | [**string**](string.md)| Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordEntry**](RecordEntry.md) + +<a name="getRecordContent"></a> +# **getRecordContent** +> getRecordContent(recordIdopts) + +Get record content + + +Gets the content of the record with identifier **recordId**. + + +### Example +```javascript +import RecordsApi from 'RecordsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordsApi = new RecordsApi(this.alfrescoApi); + +let opts = { + 'attachment': true // | **true** enables a web browser to download the file as an attachment. +**false** means a web browser may preview the file in a new tab or window, but not +download the file. + +You can only set this parameter to **false** if the content type of the file is in the supported list; +for example, certain image files and PDF files. + +If the content type is not supported for preview, then a value of **false** is ignored, and +the attachment will be returned in the response. + + 'ifModifiedSince': 2013-10-20T19:20:30+01:00 // | Only returns the content if it has been modified since the date provided. +Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + +}; + +recordsApi.getRecordContent(recordIdopts).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordId** | **string**| The identifier of a record. | + **attachment** | **boolean**| **true** enables a web browser to download the file as an attachment. +**false** means a web browser may preview the file in a new tab or window, but not +download the file. + +You can only set this parameter to **false** if the content type of the file is in the supported list; +for example, certain image files and PDF files. + +If the content type is not supported for preview, then a value of **false** is ignored, and +the attachment will be returned in the response. + | [optional] [default to true] + **ifModifiedSince** | **Date**| Only returns the content if it has been modified since the date provided. +Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. + | [optional] + +### Return type + +null (empty response body) + +<a name="updateRecord"></a> +# **updateRecord** +> RecordEntry updateRecord(recordIdrecordBodyUpdateopts) + +Update record + +Updates the record **recordId**. For example, you can rename a record: +JSON +{ + \"name\":\"My new name\" +} + +You can also set or update one or more properties: +JSON +{ + \"properties\": + { + \"cm:title\":\"New title\", + \"cm:description\":\"New description\" + } +} + +**Note:** if you want to add or remove aspects, then you must use **GET /records/{recordId}** first to get the complete set of *aspectNames*. + +**Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + + +### Example +```javascript +import RecordsApi from 'RecordsApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let recordsApi = new RecordsApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +recordsApi.updateRecord(recordIdrecordBodyUpdateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recordId** | **string**| The identifier of a record. | + **recordBodyUpdate** | [**FilePlanComponentBodyUpdate**](FilePlanComponentBodyUpdate.md)| The record information to update. | + **include** | [**string**](string.md)| Returns additional information about the record. Any optional field from the response model can be requested. For example: +* allowableOperations +* content +* isCompleted +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**RecordEntry**](RecordEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RequestBodyFile.md b/lib/js-api/src/api/gs-core-rest-api/docs/RequestBodyFile.md new file mode 100644 index 0000000000..2c74e05bba --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RequestBodyFile.md @@ -0,0 +1,8 @@ +# RequestBodyFile + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**targetParentId** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/RootCategoryBodyCreate.md b/lib/js-api/src/api/gs-core-rest-api/docs/RootCategoryBodyCreate.md new file mode 100644 index 0000000000..156d201f26 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/RootCategoryBodyCreate.md @@ -0,0 +1,13 @@ +# RootCategoryBodyCreate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **{ [key: string]: string; }** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/Transfer.md b/lib/js-api/src/api/gs-core-rest-api/docs/Transfer.md new file mode 100644 index 0000000000..ed8879821c --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/Transfer.md @@ -0,0 +1,21 @@ +# Transfer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**transferPDFIndicator** | **boolean** | Present only for transfer nodes. | [optional] [default to null] +**transferLocation** | **string** | Present only for transfer nodes. | [optional] [default to null] +**transferAccessionIndicator** | **boolean** | Present only for transfer nodes. | [optional] [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferAssociationPaging.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferAssociationPaging.md new file mode 100644 index 0000000000..e17fc9d7f9 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferAssociationPaging.md @@ -0,0 +1,8 @@ +# TransferAssociationPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**TransferAssociationPagingList**](TransferAssociationPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferAssociationPaging_list.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferAssociationPaging_list.md new file mode 100644 index 0000000000..6d45128edb --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferAssociationPaging_list.md @@ -0,0 +1,10 @@ +# TransferAssociationPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**TransferChildAssociationEntry[]**](TransferChildAssociationEntry.md) | | [optional] [default to null] +**source** | [**Transfer**](Transfer.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferChild.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferChild.md new file mode 100644 index 0000000000..6a530fe1d3 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferChild.md @@ -0,0 +1,24 @@ +# TransferChild + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isRecordFolder** | **boolean** | | [optional] [default to null] +**isRecord** | **boolean** | | [optional] [default to null] +**isClosed** | **boolean** | Indicates if the record folder is closed | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferChildAssociation.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferChildAssociation.md new file mode 100644 index 0000000000..28aba8f2bf --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferChildAssociation.md @@ -0,0 +1,25 @@ +# TransferChildAssociation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isRecordFolder** | **boolean** | | [optional] [default to null] +**isRecord** | **boolean** | | [optional] [default to null] +**isClosed** | **boolean** | Indicates if the record folder is closed | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] +**association** | [**ChildAssociationInfo**](ChildAssociationInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferChildAssociationEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferChildAssociationEntry.md new file mode 100644 index 0000000000..f1ba05d240 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferChildAssociationEntry.md @@ -0,0 +1,8 @@ +# TransferChildAssociationEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**TransferChildAssociation**](TransferChildAssociation.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainer.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainer.md new file mode 100644 index 0000000000..9ab180b2e4 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainer.md @@ -0,0 +1,20 @@ +# TransferContainer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerAssociationPaging.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerAssociationPaging.md new file mode 100644 index 0000000000..89c9502747 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerAssociationPaging.md @@ -0,0 +1,8 @@ +# TransferContainerAssociationPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**TransferContainerAssociationPagingList**](TransferContainerAssociationPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerAssociationPaging_list.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerAssociationPaging_list.md new file mode 100644 index 0000000000..efd6c933b8 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerAssociationPaging_list.md @@ -0,0 +1,10 @@ +# TransferContainerAssociationPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**TransferContainerChildAssociationEntry[]**](TransferContainerChildAssociationEntry.md) | | [optional] [default to null] +**source** | [**TransferContainer**](TransferContainer.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerBodyUpdate.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerBodyUpdate.md new file mode 100644 index 0000000000..b2dee72a17 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerBodyUpdate.md @@ -0,0 +1,11 @@ +# TransferContainerBodyUpdate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [optional] [default to null] +**properties** | **{ [key: string]: string; }** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChild.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChild.md new file mode 100644 index 0000000000..2986d6cf10 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChild.md @@ -0,0 +1,21 @@ +# TransferContainerChild + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**transferPDFIndicator** | **boolean** | Present only for transfer nodes. | [optional] [default to null] +**transferLocation** | **string** | Present only for transfer nodes. | [optional] [default to null] +**transferAccessionIndicator** | **boolean** | Present only for transfer nodes. | [optional] [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChildAssociation.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChildAssociation.md new file mode 100644 index 0000000000..63f8864f0e --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChildAssociation.md @@ -0,0 +1,22 @@ +# TransferContainerChildAssociation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**transferPDFIndicator** | **boolean** | Present only for transfer nodes. | [optional] [default to null] +**transferLocation** | **string** | Present only for transfer nodes. | [optional] [default to null] +**transferAccessionIndicator** | **boolean** | Present only for transfer nodes. | [optional] [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**association** | [**ChildAssociationInfo**](ChildAssociationInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChildAssociationEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChildAssociationEntry.md new file mode 100644 index 0000000000..6eccd1b0c3 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerChildAssociationEntry.md @@ -0,0 +1,8 @@ +# TransferContainerChildAssociationEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**TransferContainerChildAssociation**](TransferContainerChildAssociation.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerEntry.md new file mode 100644 index 0000000000..80c5a16bbb --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainerEntry.md @@ -0,0 +1,8 @@ +# TransferContainerEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**TransferContainer**](TransferContainer.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainersApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainersApi.md new file mode 100644 index 0000000000..53abd45e20 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferContainersApi.md @@ -0,0 +1,272 @@ +# TransferContainersApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getTransferContainer**](TransferContainersApi.md#getTransferContainer) | **GET** /transfer-containers/{transferContainerId} | Get a transfer container +[**listTransfers**](TransferContainersApi.md#listTransfers) | **GET** /transfer-containers/{transferContainerId}/transfers | List transfer container's children +[**updateTransferContainer**](TransferContainersApi.md#updateTransferContainer) | **PUT** /transfer-containers/{transferContainerId} | Update transfer container + + +<a name="getTransferContainer"></a> +# **getTransferContainer** +> TransferContainerEntry getTransferContainer(transferContainerIdopts) + +Get a transfer container + +Gets information for transfer container **transferContainerId** + +Mandatory fields and the transfer container's aspects and properties are returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import TransferContainersApi from 'TransferContainersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let transfercontainersApi = new TransferContainersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the transfer container. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +transfercontainersApi.getTransferContainer(transferContainerIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **transferContainerId** | **string**| The identifier of a transfer container. You can also use the -transfers- alias. | + **include** | [**string**](string.md)| Returns additional information about the transfer container. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**TransferContainerEntry**](TransferContainerEntry.md) + +<a name="listTransfers"></a> +# **listTransfers** +> TransferContainerAssociationPaging listTransfers(transferContainerIdopts) + +List transfer container's children + +Returns a list of transfers. + +Minimal information for each child is returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import TransferContainersApi from 'TransferContainersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let transfercontainersApi = new TransferContainersApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'include': // | Returns additional information about the transfer folders. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* properties +* transferPDFIndicator +* transferLocation +* transferAccessionIndicator + + 'includeSource': true // | Also include **source** (in addition to **entries**) with folder information on the specified parent **transferContainerId**. + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +transfercontainersApi.listTransfers(transferContainerIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **transferContainerId** | **string**| The identifier of a transfer container. You can also use the -transfers- alias. | + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **include** | [**string**](string.md)| Returns additional information about the transfer folders. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* properties +* transferPDFIndicator +* transferLocation +* transferAccessionIndicator + | [optional] + **includeSource** | **boolean**| Also include **source** (in addition to **entries**) with folder information on the specified parent **transferContainerId**. | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**TransferContainerAssociationPaging**](TransferContainerAssociationPaging.md) + +<a name="updateTransferContainer"></a> +# **updateTransferContainer** +> TransferContainerEntry updateTransferContainer(transferContainerIdnodeBodyUpdateopts) + +Update transfer container + +Updates the transfer container **transferContainerId**. For example, you can rename transfer container: +JSON +{ + \"name\":\"My new name\" +} + +You can also set or update description and title properties: +JSON +{ + \"properties\": + { + \"cm:description\": \"New Description\", + \"cm:title\":\"New Title\" + } +} + +**Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + + +### Example +```javascript +import TransferContainersApi from 'TransferContainersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let transfercontainersApi = new TransferContainersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the transfer container. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +transfercontainersApi.updateTransferContainer(transferContainerIdnodeBodyUpdateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **transferContainerId** | **string**| The identifier of a transfer container. You can also use the -transfers- alias. | + **nodeBodyUpdate** | [**TransferContainerBodyUpdate**](TransferContainerBodyUpdate.md)| The node information to update. | + **include** | [**string**](string.md)| Returns additional information about the transfer container. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**TransferContainerEntry**](TransferContainerEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransferEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransferEntry.md new file mode 100644 index 0000000000..370afa6b98 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransferEntry.md @@ -0,0 +1,8 @@ +# TransferEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Transfer**](Transfer.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/TransfersApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/TransfersApi.md new file mode 100644 index 0000000000..b378fa4f18 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/TransfersApi.md @@ -0,0 +1,186 @@ +# TransfersApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getTransfer**](TransfersApi.md#getTransfer) | **GET** /transfers/{transferId} | Get a transfer +[**listTransfersChildren**](TransfersApi.md#listTransfersChildren) | **GET** /transfers/{transferId}/children | List transfer's children + + +<a name="getTransfer"></a> +# **getTransfer** +> TransferEntry getTransfer(transferIdopts) + +Get a transfer + +Gets information for transfer **transferId** + +Mandatory fields and the transfer's aspects and properties are returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import TransfersApi from 'TransfersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let transfersApi = new TransfersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the transfer folder. Any optional field from the response model can be requested. For example: +* allowableOperations +* transferPDFIndicator +* transferLocation +* transferAccessionIndicator + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +transfersApi.getTransfer(transferIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **transferId** | **string**| The identifier of a transfer. | + **include** | [**string**](string.md)| Returns additional information about the transfer folder. Any optional field from the response model can be requested. For example: +* allowableOperations +* transferPDFIndicator +* transferLocation +* transferAccessionIndicator + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**TransferEntry**](TransferEntry.md) + +<a name="listTransfersChildren"></a> +# **listTransfersChildren** +> TransferAssociationPaging listTransfersChildren(transferIdopts) + +List transfer's children + +Gets a list of transfer's children. + +Minimal information for each child is returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import TransfersApi from 'TransfersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let transfersApi = new TransfersApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'include': // | Returns additional information about the transfer's child. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* isClosed +* isRecord +* isRecordFolder +* path +* properties + + 'includeSource': true // | Also include **source** (in addition to **entries**) with folder information on the specified parent **transferId**. + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +transfersApi.listTransfersChildren(transferIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **transferId** | **string**| The identifier of a transfer. | + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **include** | [**string**](string.md)| Returns additional information about the transfer's child. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* isClosed +* isRecord +* isRecordFolder +* path +* properties + | [optional] + **includeSource** | **boolean**| Also include **source** (in addition to **entries**) with folder information on the specified parent **transferId**. | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**TransferAssociationPaging**](TransferAssociationPaging.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainer.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainer.md new file mode 100644 index 0000000000..908f6af68f --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainer.md @@ -0,0 +1,21 @@ +# UnfiledContainer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerAssociationPaging.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerAssociationPaging.md new file mode 100644 index 0000000000..d460874f43 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerAssociationPaging.md @@ -0,0 +1,8 @@ +# UnfiledContainerAssociationPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**UnfiledContainerAssociationPagingList**](UnfiledContainerAssociationPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerAssociationPaging_list.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerAssociationPaging_list.md new file mode 100644 index 0000000000..ec309ec811 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerAssociationPaging_list.md @@ -0,0 +1,10 @@ +# UnfiledContainerAssociationPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**UnfiledContainerChildAssociationEntry[]**](UnfiledContainerChildAssociationEntry.md) | | [optional] [default to null] +**source** | [**UnfiledContainer**](UnfiledContainer.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChild.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChild.md new file mode 100644 index 0000000000..650bc18453 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChild.md @@ -0,0 +1,23 @@ +# UnfiledContainerChild + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isUnfiledRecordFolder** | **boolean** | | [default to null] +**isRecord** | **boolean** | | [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChildAssociation.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChildAssociation.md new file mode 100644 index 0000000000..8085a12769 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChildAssociation.md @@ -0,0 +1,24 @@ +# UnfiledContainerChildAssociation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isUnfiledRecordFolder** | **boolean** | | [default to null] +**isRecord** | **boolean** | | [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] +**association** | [**ChildAssociationInfo**](ChildAssociationInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChildAssociationEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChildAssociationEntry.md new file mode 100644 index 0000000000..80daf0ebb8 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerChildAssociationEntry.md @@ -0,0 +1,8 @@ +# UnfiledContainerChildAssociationEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**UnfiledContainerChildAssociation**](UnfiledContainerChildAssociation.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerEntry.md new file mode 100644 index 0000000000..030063fdb6 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainerEntry.md @@ -0,0 +1,8 @@ +# UnfiledContainerEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**UnfiledContainer**](UnfiledContainer.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainersApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainersApi.md new file mode 100644 index 0000000000..c956400154 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledContainersApi.md @@ -0,0 +1,467 @@ +# UnfiledContainersApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUnfiledContainerChildren**](UnfiledContainersApi.md#createUnfiledContainerChildren) | **POST** /unfiled-containers/{unfiledContainerId}/children | Create a record or an unfiled record folder +[**getUnfiledContainer**](UnfiledContainersApi.md#getUnfiledContainer) | **GET** /unfiled-containers/{unfiledContainerId} | Get the unfiled records container +[**listUnfiledContainerChildren**](UnfiledContainersApi.md#listUnfiledContainerChildren) | **GET** /unfiled-containers/{unfiledContainerId}/children | List unfiled record container's children +[**updateUnfiledContainer**](UnfiledContainersApi.md#updateUnfiledContainer) | **PUT** /unfiled-containers/{unfiledContainerId} | Update an unfiled record container + + +<a name="createUnfiledContainerChildren"></a> +# **createUnfiledContainerChildren** +> UnfiledContainerAssociationPaging createUnfiledContainerChildren(unfiledContainerIdnodeBodyCreateopts) + +Create a record or an unfiled record folder + +Creates a record or an unfiled record folder as a primary child of **unfiledContainerId**. + +You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then +the API method tries to create a unique name using an integer suffix. + +This endpoint supports both JSON and multipart/form-data (file upload). + +**Using multipart/form-data** + +Use the **filedata** field to represent the content to upload, for example, the following curl command will +create a node with the contents of test.txt in the test user's home folder. + +curl -utest:test -X POST host:port/alfresco/api/-default-/public/gs/versions/1/unfiled-containers/{unfiledContainerId}/children -F filedata=@test.txt + +This API method also supports record and unfiled record folder creation using application/json. + +You must specify at least a **name** and **nodeType**. + +You can create a non-electronic record like this: +JSON +{ + \"name\":\"My Non-electronic Record\", + \"nodeType\":\"rma:nonElectronicDocument\", + \"properties\": + { + \"cm:description\":\"My Non-electronic Record Description\", + \"cm:title\":\"My Non-electronic Record Title\", + \"rma:box\":\"My Non-electronic Record Box\", + \"rma:file\":\"My Non-electronic Record File\", + \"rma:numberOfCopies\":1, + \"rma:physicalSize\":30, + \"rma:shelf\":\"My Non-electronic Record Shelf\", + \"rma:storageLocation\":\"My Non-electronic Record Location\" + } +} + + +You can create an empty electronic record: +JSON +{ + \"name\":\"My Electronic Record\", + \"nodeType\":\"cm:content\" +} + + +You can create an unfiled record folder like this: +JSON +{ + \"name\": \"My Unfiled Record Folder\", + \"nodeType\": \"rma:unfiledRecordFolder\", + \"properties\": + { + \"cm:title\": \"My Unfiled Record Folder Title\" + } +} + + +Any missing aspects are applied automatically. You can set aspects explicitly, if needed, using an **aspectNames** field. + +**Note:** You can create more than one child by +specifying a list of nodes in the JSON body. For example, the following JSON +body creates a record and an unfiled record folder inside the specified **unfiledContainerId**: +JSON +[ + { + \"name\":\"My Record\", + \"nodeType\":\"cm:content\" + }, + { + \"name\":\"My Unfiled Record Folder\", + \"nodeType\":\"rma:unfiledRecordFolder\" + } +] + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +JSON +{ + \"list\": { + \"pagination\": { + \"count\": 2, + \"hasMoreItems\": false, + \"totalItems\": 2, + \"skipCount\": 0, + \"maxItems\": 100 + }, + \"entries\": [ + { + \"entry\": { + ... + } + }, + { + \"entry\": { + ... + } + } + ] + } +} + + + +### Example +```javascript +import UnfiledContainersApi from 'UnfiledContainersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledcontainersApi = new UnfiledContainersApi(this.alfrescoApi); + +let opts = { + 'autoRename': true // | If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + + 'include': // | Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +unfiledcontainersApi.createUnfiledContainerChildren(unfiledContainerIdnodeBodyCreateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledContainerId** | **string**| The identifier of an unfiled records container. You can use the **-unfiled-** alias. | + **nodeBodyCreate** | [**RMNodeBodyCreate**](RMNodeBodyCreate.md)| The node information to create. | + **autoRename** | **boolean**| If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + | [optional] + **include** | [**string**](string.md)| Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**UnfiledContainerAssociationPaging**](UnfiledContainerAssociationPaging.md) + +<a name="getUnfiledContainer"></a> +# **getUnfiledContainer** +> UnfiledContainerEntry getUnfiledContainer(unfiledContainerIdopts) + +Get the unfiled records container + +Gets information for unfiled records container **unfiledContainerId** + +Mandatory fields and the unfiled records container's aspects and properties are returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import UnfiledContainersApi from 'UnfiledContainersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledcontainersApi = new UnfiledContainersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +unfiledcontainersApi.getUnfiledContainer(unfiledContainerIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledContainerId** | **string**| The identifier of an unfiled records container. You can use the **-unfiled-** alias. | + **include** | [**string**](string.md)| Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**UnfiledContainerEntry**](UnfiledContainerEntry.md) + +<a name="listUnfiledContainerChildren"></a> +# **listUnfiledContainerChildren** +> UnfiledContainerAssociationPaging listUnfiledContainerChildren(unfiledContainerIdopts) + +List unfiled record container's children + +Returns a list of records or unfiled record folders. + +Minimal information for each child is returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import UnfiledContainersApi from 'UnfiledContainersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledcontainersApi = new UnfiledContainersApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'where': where_example // | Optionally filter the list. Here are some examples: + +* where=(isRecord=true) + +* where=(isUnfiledRecordFolder=false) + +* where=(nodeType='cm:content INCLUDESUBTYPES') + + 'include': // | Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* association +* path +* properties + + 'includeSource': true // | Also include **source** (in addition to **entries**) with folder information on the parent node – the specified parent **unfiledContainerId** + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +unfiledcontainersApi.listUnfiledContainerChildren(unfiledContainerIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledContainerId** | **string**| The identifier of an unfiled records container. You can use the **-unfiled-** alias. | + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **where** | **string**| Optionally filter the list. Here are some examples: + +* where=(isRecord=true) + +* where=(isUnfiledRecordFolder=false) + +* where=(nodeType='cm:content INCLUDESUBTYPES') + | [optional] + **include** | [**string**](string.md)| Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* association +* path +* properties + | [optional] + **includeSource** | **boolean**| Also include **source** (in addition to **entries**) with folder information on the parent node – the specified parent **unfiledContainerId** | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**UnfiledContainerAssociationPaging**](UnfiledContainerAssociationPaging.md) + +<a name="updateUnfiledContainer"></a> +# **updateUnfiledContainer** +> UnfiledContainerEntry updateUnfiledContainer(unfiledContainerIdunfiledContainerBodyUpdateopts) + +Update an unfiled record container + +Updates unfiled record container **unfiledContainerId**. For example, you can rename an unfiled record container: +JSON +{ + \"name\":\"My new name\" +} + +You can also set or update description and title properties: +JSON +{ + \"properties\": + { + \"cm:description\": \"New Description\", + \"cm:title\":\"New Title\" + } +} + + +**Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + + +### Example +```javascript +import UnfiledContainersApi from 'UnfiledContainersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledcontainersApi = new UnfiledContainersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +unfiledcontainersApi.updateUnfiledContainer(unfiledContainerIdunfiledContainerBodyUpdateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledContainerId** | **string**| The identifier of an unfiled records container. You can use the **-unfiled-** alias. | + **unfiledContainerBodyUpdate** | [**UnfiledRecordContainerBodyUpdate**](UnfiledRecordContainerBodyUpdate.md)| The unfiled record container information to update. | + **include** | [**string**](string.md)| Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**UnfiledContainerEntry**](UnfiledContainerEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordContainerBodyUpdate.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordContainerBodyUpdate.md new file mode 100644 index 0000000000..fb7bdab26e --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordContainerBodyUpdate.md @@ -0,0 +1,11 @@ +# UnfiledRecordContainerBodyUpdate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [optional] [default to null] +**properties** | **{ [key: string]: string; }** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolder.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolder.md new file mode 100644 index 0000000000..3dcde9c336 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolder.md @@ -0,0 +1,23 @@ +# UnfiledRecordFolder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isUnfiledRecordFolder** | **boolean** | | [default to null] +**isRecord** | **boolean** | | [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderAssociationPaging.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderAssociationPaging.md new file mode 100644 index 0000000000..9d7a43694c --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderAssociationPaging.md @@ -0,0 +1,8 @@ +# UnfiledRecordFolderAssociationPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**UnfiledRecordFolderAssociationPagingList**](UnfiledRecordFolderAssociationPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderAssociationPaging_list.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderAssociationPaging_list.md new file mode 100644 index 0000000000..a9e7f60919 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderAssociationPaging_list.md @@ -0,0 +1,10 @@ +# UnfiledRecordFolderAssociationPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**entries** | [**UnfiledRecordFolderChildAssociationEntry[]**](UnfiledRecordFolderChildAssociationEntry.md) | | [optional] [default to null] +**source** | [**UnfiledRecordFolder**](UnfiledRecordFolder.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderBodyUpdate.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderBodyUpdate.md new file mode 100644 index 0000000000..7916e46a9d --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderBodyUpdate.md @@ -0,0 +1,11 @@ +# UnfiledRecordFolderBodyUpdate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [optional] [default to null] +**properties** | **{ [key: string]: string; }** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChild.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChild.md new file mode 100644 index 0000000000..fd5de8d525 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChild.md @@ -0,0 +1,23 @@ +# UnfiledRecordFolderChild + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isUnfiledRecordFolder** | **boolean** | | [default to null] +**isRecord** | **boolean** | | [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChildAssociation.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChildAssociation.md new file mode 100644 index 0000000000..f3a95f21cd --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChildAssociation.md @@ -0,0 +1,24 @@ +# UnfiledRecordFolderChildAssociation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**parentId** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isUnfiledRecordFolder** | **boolean** | | [default to null] +**isRecord** | **boolean** | | [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] +**association** | [**ChildAssociationInfo**](ChildAssociationInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChildAssociationEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChildAssociationEntry.md new file mode 100644 index 0000000000..ffb52d647f --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderChildAssociationEntry.md @@ -0,0 +1,8 @@ +# UnfiledRecordFolderChildAssociationEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**UnfiledRecordFolderChildAssociation**](UnfiledRecordFolderChildAssociation.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderEntry.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderEntry.md new file mode 100644 index 0000000000..01aef9c371 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFolderEntry.md @@ -0,0 +1,8 @@ +# UnfiledRecordFolderEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**UnfiledRecordFolder**](UnfiledRecordFolder.md) | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFoldersApi.md b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFoldersApi.md new file mode 100644 index 0000000000..486bc41122 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UnfiledRecordFoldersApi.md @@ -0,0 +1,519 @@ +# UnfiledRecordFoldersApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/gs/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUnfiledRecordFolderChildren**](UnfiledRecordFoldersApi.md#createUnfiledRecordFolderChildren) | **POST** /unfiled-record-folders/{unfiledRecordFolderId}/children | Create a record or an unfiled record folder +[**deleteUnfiledRecordFolder**](UnfiledRecordFoldersApi.md#deleteUnfiledRecordFolder) | **DELETE** /unfiled-record-folders/{unfiledRecordFolderId} | Delete an unfiled record folder. Deleted file plan components cannot be recovered, they are deleted permanently. +[**getUnfiledRecordFolder**](UnfiledRecordFoldersApi.md#getUnfiledRecordFolder) | **GET** /unfiled-record-folders/{unfiledRecordFolderId} | Get the unfiled record folder +[**listUnfiledRecordFolderChildren**](UnfiledRecordFoldersApi.md#listUnfiledRecordFolderChildren) | **GET** /unfiled-record-folders/{unfiledRecordFolderId}/children | List unfiled record folder's children +[**updateUnfiledRecordFolder**](UnfiledRecordFoldersApi.md#updateUnfiledRecordFolder) | **PUT** /unfiled-record-folders/{unfiledRecordFolderId} | Update an unfiled record folder + + +<a name="createUnfiledRecordFolderChildren"></a> +# **createUnfiledRecordFolderChildren** +> UnfiledRecordFolderAssociationPaging createUnfiledRecordFolderChildren(unfiledRecordFolderIdnodeBodyCreateopts) + +Create a record or an unfiled record folder + +Create a record or an unfiled record folder as a primary child of **unfiledRecordFolderId**. + +You can set the **autoRename** boolean field to automatically resolve name clashes. If there is a name clash, then +the API method tries to create a unique name using an integer suffix. + +This endpoint supports both JSON and multipart/form-data (file upload). + +**Using multipart/form-data** + +Use the **filedata** field to represent the content to upload, for example, the following curl command will +create a node with the contents of test.txt in the test user's home folder. + +curl -utest:test -X POST host:port/alfresco/api/-default-/public/gs/versions/1/unfiled-record-folders/{unfiledRecordFolderId}/children -F filedata=@test.txt + +This API method also supports record and unfiled record folder creation using application/json. + +You must specify at least a **name** and **nodeType**. + +You can create a non-electronic record like this: +JSON +{ + \"name\":\"My Non-electronic Record\", + \"nodeType\":\"rma:nonElectronicDocument\", + \"properties\": + { + \"cm:description\":\"My Non-electronic Record Description\", + \"cm:title\":\"My Non-electronic Record Title\", + \"rma:box\":\"My Non-electronic Record Box\", + \"rma:file\":\"My Non-electronic Record File\", + \"rma:numberOfCopies\":1, + \"rma:physicalSize\":30, + \"rma:shelf\":\"My Non-electronic Record Shelf\", + \"rma:storageLocation\":\"My Non-electronic Record Location\" + } +} + + +You can create an empty electronic record like this: +JSON +{ + \"name\":\"My Electronic Record\", + \"nodeType\":\"cm:content\" +} + + +You can create an unfiled record folder like this: +JSON +{ + \"name\": \"My Unfiled Record Folder\", + \"nodeType\": \"rma:unfiledRecordFolder\", + \"properties\": + { + \"cm:title\": \"My Unfiled Record Folder Title\" + } +} + + +Any missing aspects are applied automatically. You can set aspects explicitly, if needed, using an **aspectNames** field. + +**Note:** You can create more than one child by +specifying a list of nodes in the JSON body. For example, the following JSON +body creates a record and an unfiled record folder inside the specified **unfiledRecordFolderId**: +JSON +[ + { + \"name\":\"My Record\", + \"nodeType\":\"cm:content\" + }, + { + \"name\":\"My Unfiled Record Folder\", + \"nodeType\":\"rma:unfiledRecordFolder\" + } +] + +If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: + +JSON +{ + \"list\": { + \"pagination\": { + \"count\": 2, + \"hasMoreItems\": false, + \"totalItems\": 2, + \"skipCount\": 0, + \"maxItems\": 100 + }, + \"entries\": [ + { + \"entry\": { + ... + } + }, + { + \"entry\": { + ... + } + } + ] + } +} + + + +### Example +```javascript +import UnfiledRecordFoldersApi from 'UnfiledRecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledrecordfoldersApi = new UnfiledRecordFoldersApi(this.alfrescoApi); + +let opts = { + 'autoRename': true // | If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + + 'include': // | Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +unfiledrecordfoldersApi.createUnfiledRecordFolderChildren(unfiledRecordFolderIdnodeBodyCreateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledRecordFolderId** | **string**| The identifier of an unfiled record folder. | + **nodeBodyCreate** | [**RMNodeBodyCreateWithRelativePath**](RMNodeBodyCreateWithRelativePath.md)| The node information to create. | + **autoRename** | **boolean**| If true, then a name clash will cause an attempt to auto rename by finding a unique name using an integer suffix. + | [optional] + **include** | [**string**](string.md)| Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**UnfiledRecordFolderAssociationPaging**](UnfiledRecordFolderAssociationPaging.md) + +<a name="deleteUnfiledRecordFolder"></a> +# **deleteUnfiledRecordFolder** +> deleteUnfiledRecordFolder(unfiledRecordFolderId) + +Delete an unfiled record folder. Deleted file plan components cannot be recovered, they are deleted permanently. + +Deletes the unfiled record folder **unfiledRecordFolderId**. + + +### Example +```javascript +import UnfiledRecordFoldersApi from 'UnfiledRecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledrecordfoldersApi = new UnfiledRecordFoldersApi(this.alfrescoApi); + + +unfiledrecordfoldersApi.deleteUnfiledRecordFolder(unfiledRecordFolderId).then(() => { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledRecordFolderId** | **string**| The identifier of an unfiled record folder. | + +### Return type + +null (empty response body) + +<a name="getUnfiledRecordFolder"></a> +# **getUnfiledRecordFolder** +> UnfiledRecordFolderEntry getUnfiledRecordFolder(unfiledRecordFolderIdopts) + +Get the unfiled record folder + +Gets information for unfiled record folder id **unfiledRecordFolderId** + +Mandatory fields and the unfiled record folder's aspects and properties are returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import UnfiledRecordFoldersApi from 'UnfiledRecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledrecordfoldersApi = new UnfiledRecordFoldersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'relativePath': relativePath_example // | Return information on children in the unfiled records container resolved by this path. The path is relative to **unfiledRecordFolderId**. + + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +unfiledrecordfoldersApi.getUnfiledRecordFolder(unfiledRecordFolderIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledRecordFolderId** | **string**| The identifier of an unfiled record folder. | + **include** | [**string**](string.md)| Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **relativePath** | **string**| Return information on children in the unfiled records container resolved by this path. The path is relative to **unfiledRecordFolderId**. + | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**UnfiledRecordFolderEntry**](UnfiledRecordFolderEntry.md) + +<a name="listUnfiledRecordFolderChildren"></a> +# **listUnfiledRecordFolderChildren** +> UnfiledRecordFolderAssociationPaging listUnfiledRecordFolderChildren(unfiledRecordFolderIdopts) + +List unfiled record folder's children + +Returns a list of records or unfiled record folders. + +Minimal information for each child is returned by default. + +You can use the **include** parameter (include=allowableOperations) to return additional information. + + +### Example +```javascript +import UnfiledRecordFoldersApi from 'UnfiledRecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledrecordfoldersApi = new UnfiledRecordFoldersApi(this.alfrescoApi); + +let opts = { + 'skipCount': 56 // | The number of entities that exist in the collection before those included in this list. + 'maxItems': 56 // | The maximum number of items to return in the list. + 'where': where_example // | Optionally filter the list. Here are some examples: + +* where=(isRecord=true) + +* where=(isUnfiledRecordFolder=false) + +* where=(nodeType='cm:content INCLUDESUBTYPES') + + 'include': // | Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* association +* path +* properties + + 'relativePath': relativePath_example // | Return information on children in the unfiled records container resolved by this path. The path is relative to **unfiledRecordFolderId**. + + 'includeSource': true // | Also include **source** (in addition to **entries**) with folder information on the parent node – either the specified parent **unfiledRecordFolderId**, or as resolved by **relativePath**. + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +unfiledrecordfoldersApi.listUnfiledRecordFolderChildren(unfiledRecordFolderIdopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledRecordFolderId** | **string**| The identifier of an unfiled record folder. | + **skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] + **maxItems** | **number**| The maximum number of items to return in the list. | [optional] + **where** | **string**| Optionally filter the list. Here are some examples: + +* where=(isRecord=true) + +* where=(isUnfiledRecordFolder=false) + +* where=(nodeType='cm:content INCLUDESUBTYPES') + | [optional] + **include** | [**string**](string.md)| Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* aspectNames +* association +* path +* properties + | [optional] + **relativePath** | **string**| Return information on children in the unfiled records container resolved by this path. The path is relative to **unfiledRecordFolderId**. + | [optional] + **includeSource** | **boolean**| Also include **source** (in addition to **entries**) with folder information on the parent node – either the specified parent **unfiledRecordFolderId**, or as resolved by **relativePath**. | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**UnfiledRecordFolderAssociationPaging**](UnfiledRecordFolderAssociationPaging.md) + +<a name="updateUnfiledRecordFolder"></a> +# **updateUnfiledRecordFolder** +> UnfiledRecordFolderEntry updateUnfiledRecordFolder(unfiledRecordFolderIdunfiledRecordFolderBodyUpdateopts) + +Update an unfiled record folder + +Updates unfiled record folder **unfiledRecordFolderId**. For example, you can rename a record folder: +JSON +{ + \"name\":\"My new name\" +} + +You can also set or update one or more properties: +JSON +{ + \"properties\": + { + \"cm:title\":\"New title\", + \"cm:description\":\"New description\" + } +} + +**Note:** if you want to add or remove aspects, then you must use **GET /unfiled-record-folders/{unfiledRecordFolderId}** first to get the complete set of *aspectNames*. + +**Note:** Currently there is no optimistic locking for updates, so they are applied in \"last one wins\" order. + + +### Example +```javascript +import UnfiledRecordFoldersApi from 'UnfiledRecordFoldersApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let unfiledrecordfoldersApi = new UnfiledRecordFoldersApi(this.alfrescoApi); + +let opts = { + 'include': // | Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + + 'includeSource': true // | Also include **source** (in addition to **entries**) with folder information on the parent node – either the specified parent **unfiledRecordFolderId**, or as resolved by **relativePath**. + 'fields': // | A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + +}; + +unfiledrecordfoldersApi.updateUnfiledRecordFolder(unfiledRecordFolderIdunfiledRecordFolderBodyUpdateopts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unfiledRecordFolderId** | **string**| The identifier of an unfiled record folder. | + **unfiledRecordFolderBodyUpdate** | [**UnfiledRecordFolderBodyUpdate**](UnfiledRecordFolderBodyUpdate.md)| The record folder information to update. | + **include** | [**string**](string.md)| Returns additional information about the unfiled records container's children. Any optional field from the response model can be requested. For example: +* allowableOperations +* path + | [optional] + **includeSource** | **boolean**| Also include **source** (in addition to **entries**) with folder information on the parent node – either the specified parent **unfiledRecordFolderId**, or as resolved by **relativePath**. | [optional] + **fields** | [**string**](string.md)| A list of field names. + +You can use this parameter to restrict the fields +returned within a response if, for example, you want to save on overall bandwidth. + +The list applies to a returned individual +entity or entries within a collection. + +If the API method also supports the **include** +parameter, then the fields specified in the **include** +parameter are returned in addition to those specified in the **fields** parameter. + | [optional] + +### Return type + +[**UnfiledRecordFolderEntry**](UnfiledRecordFolderEntry.md) + diff --git a/lib/js-api/src/api/gs-core-rest-api/docs/UserInfo.md b/lib/js-api/src/api/gs-core-rest-api/docs/UserInfo.md new file mode 100644 index 0000000000..a700a426c0 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/docs/UserInfo.md @@ -0,0 +1,9 @@ +# UserInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**displayName** | **string** | | [default to null] +**id** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/gs-core-rest-api/index.ts b/lib/js-api/src/api/gs-core-rest-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/gs-core-rest-api/model/filePlan.ts b/lib/js-api/src/api/gs-core-rest-api/model/filePlan.ts new file mode 100644 index 0000000000..87e5b18491 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/filePlan.ts @@ -0,0 +1,49 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { PathInfo, UserInfo } from '../../content-rest-api'; + +export class FilePlan { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<FilePlan>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/filePlanBodyUpdate.ts b/lib/js-api/src/api/gs-core-rest-api/model/filePlanBodyUpdate.ts new file mode 100644 index 0000000000..32d7e41e27 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/filePlanBodyUpdate.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FilePlanBodyUpdate { + properties?: { [key: string]: string }; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/filePlanComponentBodyUpdate.ts b/lib/js-api/src/api/gs-core-rest-api/model/filePlanComponentBodyUpdate.ts new file mode 100644 index 0000000000..f6df58c1d8 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/filePlanComponentBodyUpdate.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface FilePlanComponentBodyUpdate { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name?: string; + aspectNames?: string[]; + properties?: { [key: string]: string }; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/filePlanEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/filePlanEntry.ts new file mode 100644 index 0000000000..2c03fe1438 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/filePlanEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FilePlan } from './filePlan'; + +export class FilePlanEntry { + entry: FilePlan; + + constructor(input?: Partial<FilePlanEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new FilePlan(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/index.ts b/lib/js-api/src/api/gs-core-rest-api/model/index.ts new file mode 100644 index 0000000000..f23b511d57 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/index.ts @@ -0,0 +1,76 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './filePlan'; +export * from './filePlanBodyUpdate'; +export * from './filePlanComponentBodyUpdate'; +export * from './filePlanEntry'; +export * from './rMNodeBodyCreate'; +export * from './rMNodeBodyCreateWithRelativePath'; +export * from './rMSite'; +export * from './rMSiteBodyCreate'; +export * from './rMSiteBodyUpdate'; +export * from './rMSiteEntry'; +export * from './record'; +export * from './recordCategory'; +export * from './recordCategoryChild'; +export * from './recordCategoryChildEntry'; +export * from './recordCategoryChildPaging'; +export * from './recordCategoryChildPagingList'; +export * from './recordCategoryEntry'; +export * from './recordCategoryPaging'; +export * from './recordCategoryPagingList'; +export * from './recordEntry'; +export * from './recordFolder'; +export * from './recordFolderAssociationPaging'; +export * from './recordFolderAssociationPagingList'; +export * from './recordFolderChildAssociationEntry'; +export * from './recordFolderEntry'; +export * from './requestBodyFile'; +export * from './rootCategoryBodyCreate'; +export * from './transfer'; +export * from './transferAssociationPaging'; +export * from './transferAssociationPagingList'; +export * from './transferChild'; +export * from './transferChildAssociationEntry'; +export * from './transferContainer'; +export * from './transferContainerAssociationPaging'; +export * from './transferContainerAssociationPagingList'; +export * from './transferContainerBodyUpdate'; +export * from './transferContainerChild'; +export * from './transferContainerChildAssociationEntry'; +export * from './transferContainerEntry'; +export * from './transferEntry'; +export * from './unfiledContainer'; +export * from './unfiledContainerAssociationPaging'; +export * from './unfiledContainerAssociationPagingList'; +export * from './unfiledContainerChild'; +export * from './unfiledContainerChildAssociationEntry'; +export * from './unfiledContainerEntry'; +export * from './unfiledRecordContainerBodyUpdate'; +export * from './unfiledRecordFolder'; +export * from './unfiledRecordFolderAssociationPaging'; +export * from './unfiledRecordFolderAssociationPagingList'; +export * from './unfiledRecordFolderBodyUpdate'; +export * from './unfiledRecordFolderChild'; +export * from './unfiledRecordFolderChildAssociationEntry'; +export * from './unfiledRecordFolderEntry'; +export * from './recordFolderChildAssociation'; +export * from './transferChildAssociation'; +export * from './transferContainerChildAssociation'; +export * from './unfiledContainerChildAssociation'; +export * from './unfiledRecordFolderChildAssociation'; diff --git a/lib/js-api/src/api/gs-core-rest-api/model/rMNodeBodyCreate.ts b/lib/js-api/src/api/gs-core-rest-api/model/rMNodeBodyCreate.ts new file mode 100644 index 0000000000..6fdc33a476 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/rMNodeBodyCreate.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RMNodeBodyCreate { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + aspectNames?: string[]; + properties?: { [key: string]: string }; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/rMNodeBodyCreateWithRelativePath.ts b/lib/js-api/src/api/gs-core-rest-api/model/rMNodeBodyCreateWithRelativePath.ts new file mode 100644 index 0000000000..d363af97a6 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/rMNodeBodyCreateWithRelativePath.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RMNodeBodyCreateWithRelativePath { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + aspectNames?: string[]; + properties?: { [key: string]: string }; + relativePath?: string; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/rMSite.ts b/lib/js-api/src/api/gs-core-rest-api/model/rMSite.ts new file mode 100644 index 0000000000..2bd7b612ea --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/rMSite.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RMSite { + id: string; + guid: string; + title: string; + description?: string; + visibility: 'PRIVATE' | 'MODERATED' | 'PUBLIC' | string; + compliance: 'STANDARD' | 'DOD5015' | string; + role?: 'SiteConsumer' | 'SiteCollaborator' | 'SiteContributor' | 'SiteManager' | string; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/rMSiteBodyCreate.ts b/lib/js-api/src/api/gs-core-rest-api/model/rMSiteBodyCreate.ts new file mode 100644 index 0000000000..093d50de56 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/rMSiteBodyCreate.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RMSiteBodyCreate { + title: string; + description?: string; + compliance?: 'STANDARD' | 'DOD5015' | string; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/rMSiteBodyUpdate.ts b/lib/js-api/src/api/gs-core-rest-api/model/rMSiteBodyUpdate.ts new file mode 100644 index 0000000000..dcdfbd81e4 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/rMSiteBodyUpdate.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RMSiteBodyUpdate { + title?: string; + description?: string; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/rMSiteEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/rMSiteEntry.ts new file mode 100644 index 0000000000..1f2cff8700 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/rMSiteEntry.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RMSite } from './rMSite'; + +export interface RMSiteEntry { + entry: RMSite; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/record.ts b/lib/js-api/src/api/gs-core-rest-api/model/record.ts new file mode 100644 index 0000000000..6dfac4c8b1 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/record.ts @@ -0,0 +1,55 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ContentInfo, PathInfo, UserInfo } from '../../content-rest-api'; +import { DateAlfresco } from '../../content-custom-api'; + +export class Record { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + /** + * Present only for record nodes. Indicates if the record is completed + */ + isCompleted?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + content?: ContentInfo; + path?: PathInfo; + + constructor(input?: Partial<Record>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordCategory.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordCategory.ts new file mode 100644 index 0000000000..c1853a2321 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordCategory.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { PathInfo, UserInfo } from '../../content-rest-api'; + +export class RecordCategory { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + /** + * Indicates if the record category has a retention schedule defined + */ + hasRetentionSchedule?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<RecordCategory>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChild.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChild.ts new file mode 100644 index 0000000000..c0786cebc3 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChild.ts @@ -0,0 +1,59 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { PathInfo, UserInfo } from '../../content-rest-api'; + +export class RecordCategoryChild { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + /** + * Indicates if the record category has a retention schedule defined + */ + hasRetentionSchedule?: boolean; + /** + * Indicates if the record folder is closed + */ + isClosed?: boolean; + isRecordCategory?: boolean; + isRecordFolder?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<RecordCategoryChild>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildEntry.ts new file mode 100644 index 0000000000..369a9abdf2 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RecordCategoryChild } from './recordCategoryChild'; + +export class RecordCategoryChildEntry { + entry: RecordCategoryChild; + + constructor(input?: Partial<RecordCategoryChildEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new RecordCategoryChild(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildPaging.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildPaging.ts new file mode 100644 index 0000000000..a6d89ccba9 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RecordCategoryChildPagingList } from './recordCategoryChildPagingList'; + +export class RecordCategoryChildPaging { + list?: RecordCategoryChildPagingList; + + constructor(input?: Partial<RecordCategoryChildPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new RecordCategoryChildPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildPagingList.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildPagingList.ts new file mode 100644 index 0000000000..d849bb31ef --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryChildPagingList.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { RecordCategory } from './recordCategory'; +import { RecordCategoryChildEntry } from './recordCategoryChildEntry'; + +export class RecordCategoryChildPagingList { + pagination?: Pagination; + entries?: RecordCategoryChildEntry[]; + source?: RecordCategory; + + constructor(input?: Partial<RecordCategoryChildPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new RecordCategoryChildEntry(item)); + } + this.source = input.source ? new RecordCategory(input.source) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryEntry.ts new file mode 100644 index 0000000000..e94da5a463 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RecordCategory } from './recordCategory'; + +export class RecordCategoryEntry { + entry: RecordCategory; + + constructor(input?: Partial<RecordCategoryEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new RecordCategory(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryPaging.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryPaging.ts new file mode 100644 index 0000000000..3f2c12e780 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RecordCategoryPagingList } from './recordCategoryPagingList'; + +export class RecordCategoryPaging { + list?: RecordCategoryPagingList; + + constructor(input?: Partial<RecordCategoryPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new RecordCategoryPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryPagingList.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryPagingList.ts new file mode 100644 index 0000000000..f900e6d40a --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordCategoryPagingList.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FilePlan } from './filePlan'; +import { Pagination } from '../../content-rest-api'; +import { RecordCategoryEntry } from './recordCategoryEntry'; + +export class RecordCategoryPagingList { + pagination?: Pagination; + entries?: RecordCategoryEntry[]; + source?: FilePlan; + + constructor(input?: Partial<RecordCategoryPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new RecordCategoryEntry(item)); + } + this.source = input.source ? new FilePlan(input.source) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordEntry.ts new file mode 100644 index 0000000000..38d68aec21 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Record } from './record'; + +export class RecordEntry { + entry: Record; + + constructor(input?: Partial<RecordEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Record(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordFolder.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordFolder.ts new file mode 100644 index 0000000000..302ab55f54 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordFolder.ts @@ -0,0 +1,54 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api/model/dateAlfresco'; +import { PathInfo } from '../../content-rest-api/model/pathInfo'; +import { UserInfo } from '../../content-rest-api/model/userInfo'; + +export class RecordFolder { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + /** + * Indicates if the record folder is closed + */ + isClosed?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<RecordFolder>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordFolderAssociationPaging.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderAssociationPaging.ts new file mode 100644 index 0000000000..215b5ec994 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderAssociationPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RecordFolderAssociationPagingList } from './recordFolderAssociationPagingList'; + +export class RecordFolderAssociationPaging { + list?: RecordFolderAssociationPagingList; + + constructor(input?: Partial<RecordFolderAssociationPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new RecordFolderAssociationPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordFolderAssociationPagingList.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderAssociationPagingList.ts new file mode 100644 index 0000000000..55cb2ba7d3 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderAssociationPagingList.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { RecordFolder } from './recordFolder'; +import { RecordFolderChildAssociationEntry } from './recordFolderChildAssociationEntry'; + +export class RecordFolderAssociationPagingList { + pagination?: Pagination; + entries?: RecordFolderChildAssociationEntry[]; + source?: RecordFolder; + + constructor(input?: Partial<RecordFolderAssociationPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new RecordFolderChildAssociationEntry(item)); + } + this.source = input.source ? new RecordFolder(input.source) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordFolderChildAssociation.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderChildAssociation.ts new file mode 100644 index 0000000000..d105d23ba0 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderChildAssociation.ts @@ -0,0 +1,57 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChildAssociationInfo, ContentInfo, PathInfo, UserInfo } from '../../content-rest-api'; +import { DateAlfresco } from '../../content-custom-api'; + +export class RecordFolderChildAssociation { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + /** + * Present only for record nodes. Indicates if the record is completed + */ + isCompleted?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + content?: ContentInfo; + path?: PathInfo; + association?: ChildAssociationInfo; + + constructor(input?: Partial<RecordFolderChildAssociation>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.association = input.association ? new ChildAssociationInfo(input.association) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordFolderChildAssociationEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderChildAssociationEntry.ts new file mode 100644 index 0000000000..bf1cedd009 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderChildAssociationEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RecordFolderChildAssociation } from './recordFolderChildAssociation'; + +export class RecordFolderChildAssociationEntry { + entry: RecordFolderChildAssociation; + + constructor(input?: Partial<RecordFolderChildAssociationEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new RecordFolderChildAssociation(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/recordFolderEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderEntry.ts new file mode 100644 index 0000000000..3a4ffec45a --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/recordFolderEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RecordFolder } from './recordFolder'; + +export class RecordFolderEntry { + entry: RecordFolder; + + constructor(input?: Partial<RecordFolderEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new RecordFolder(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/requestBodyFile.ts b/lib/js-api/src/api/gs-core-rest-api/model/requestBodyFile.ts new file mode 100644 index 0000000000..bf2c8f1a81 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/requestBodyFile.ts @@ -0,0 +1,20 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RequestBodyFile { + targetParentId: string; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/rootCategoryBodyCreate.ts b/lib/js-api/src/api/gs-core-rest-api/model/rootCategoryBodyCreate.ts new file mode 100644 index 0000000000..a31c3669e9 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/rootCategoryBodyCreate.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RootCategoryBodyCreate { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + aspectNames?: string[]; + properties?: { [key: string]: string }; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transfer.ts b/lib/js-api/src/api/gs-core-rest-api/model/transfer.ts new file mode 100644 index 0000000000..0373183708 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transfer.ts @@ -0,0 +1,55 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { UserInfo } from '../../content-rest-api'; + +export class Transfer { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + createdAt: Date; + createdByUser: UserInfo; + /** + * Present only for transfer nodes. + */ + transferPDFIndicator?: boolean; + /** + * Present only for transfer nodes. + */ + transferLocation?: string; + /** + * Present only for transfer nodes. + */ + transferAccessionIndicator?: boolean; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + + constructor(input?: Partial<Transfer>) { + if (input) { + Object.assign(this, input); + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferAssociationPaging.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferAssociationPaging.ts new file mode 100644 index 0000000000..21c1e2dd38 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferAssociationPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TransferAssociationPagingList } from './transferAssociationPagingList'; + +export class TransferAssociationPaging { + list?: TransferAssociationPagingList; + + constructor(input?: Partial<TransferAssociationPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new TransferAssociationPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferAssociationPagingList.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferAssociationPagingList.ts new file mode 100644 index 0000000000..dc12fc5148 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferAssociationPagingList.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api/model/pagination'; +import { Transfer } from './transfer'; +import { TransferChildAssociationEntry } from './transferChildAssociationEntry'; + +export class TransferAssociationPagingList { + pagination?: Pagination; + entries?: TransferChildAssociationEntry[]; + source?: Transfer; + + constructor(input?: Partial<TransferAssociationPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new TransferChildAssociationEntry(item)); + } + this.source = input.source ? new Transfer(input.source) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferChild.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferChild.ts new file mode 100644 index 0000000000..eb452d0747 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferChild.ts @@ -0,0 +1,55 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { PathInfo, UserInfo } from '../../content-rest-api'; + +export class TransferChild { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isRecordFolder?: boolean; + isRecord?: boolean; + /** + * Indicates if the record folder is closed + */ + isClosed?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<TransferChild>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferChildAssociation.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferChildAssociation.ts new file mode 100644 index 0000000000..66e3b2c2d5 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferChildAssociation.ts @@ -0,0 +1,57 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChildAssociationInfo, PathInfo, UserInfo } from '../../content-rest-api'; +import { DateAlfresco } from '../../content-custom-api'; + +export class TransferChildAssociation { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isRecordFolder?: boolean; + isRecord?: boolean; + /** + * Indicates if the record folder is closed + */ + isClosed?: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + association?: ChildAssociationInfo; + + constructor(input?: Partial<TransferChildAssociation>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.association = input.association ? new ChildAssociationInfo(input.association) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferChildAssociationEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferChildAssociationEntry.ts new file mode 100644 index 0000000000..e152c95d01 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferChildAssociationEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TransferChildAssociation } from './transferChildAssociation'; + +export class TransferChildAssociationEntry { + entry: TransferChildAssociation; + + constructor(input?: Partial<TransferChildAssociationEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new TransferChildAssociation(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferContainer.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferContainer.ts new file mode 100644 index 0000000000..86f53c4d6f --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferContainer.ts @@ -0,0 +1,47 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { UserInfo } from '../../content-rest-api'; + +export class TransferContainer { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + + constructor(input?: Partial<TransferContainer>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferContainerAssociationPaging.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerAssociationPaging.ts new file mode 100644 index 0000000000..5a8f29a1ef --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerAssociationPaging.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TransferContainerAssociationPagingList } from './transferContainerAssociationPagingList'; + +export class TransferContainerAssociationPaging { + list?: TransferContainerAssociationPagingList; + + constructor(input?: Partial<TransferContainerAssociationPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new TransferContainerAssociationPagingList(input.list) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferContainerAssociationPagingList.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerAssociationPagingList.ts new file mode 100644 index 0000000000..7a0563c859 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerAssociationPagingList.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { TransferContainer } from './transferContainer'; +import { TransferContainerChildAssociationEntry } from './transferContainerChildAssociationEntry'; + +export class TransferContainerAssociationPagingList { + pagination?: Pagination; + entries?: TransferContainerChildAssociationEntry[]; + source?: TransferContainer; + + constructor(input?: Partial<TransferContainerAssociationPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new TransferContainerChildAssociationEntry(item)); + } + this.source = input.source ? new TransferContainer(input.source) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferContainerBodyUpdate.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerBodyUpdate.ts new file mode 100644 index 0000000000..84b658eeb1 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerBodyUpdate.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface TransferContainerBodyUpdate { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name?: string; + properties?: { [key: string]: string }; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChild.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChild.ts new file mode 100644 index 0000000000..d39ce51784 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChild.ts @@ -0,0 +1,55 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { UserInfo } from '../../content-rest-api'; + +export class TransferContainerChild { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + createdAt: Date; + createdByUser: UserInfo; + /** + * Present only for transfer nodes. + */ + transferPDFIndicator?: boolean; + /** + * Present only for transfer nodes. + */ + transferLocation?: string; + /** + * Present only for transfer nodes. + */ + transferAccessionIndicator?: boolean; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + + constructor(input?: Partial<TransferContainerChild>) { + if (input) { + Object.assign(this, input); + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChildAssociation.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChildAssociation.ts new file mode 100644 index 0000000000..519f5cde19 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChildAssociation.ts @@ -0,0 +1,57 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChildAssociationInfo, UserInfo } from '../../content-rest-api'; +import { DateAlfresco } from '../../content-custom-api'; + +export class TransferContainerChildAssociation { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + createdAt: Date; + createdByUser: UserInfo; + /** + * Present only for transfer nodes. + */ + transferPDFIndicator?: boolean; + /** + * Present only for transfer nodes. + */ + transferLocation?: string; + /** + * Present only for transfer nodes. + */ + transferAccessionIndicator?: boolean; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + association?: ChildAssociationInfo; + + constructor(input?: Partial<TransferContainerChildAssociation>) { + if (input) { + Object.assign(this, input); + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.association = input.association ? new ChildAssociationInfo(input.association) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChildAssociationEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChildAssociationEntry.ts new file mode 100644 index 0000000000..2448de9eba --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerChildAssociationEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TransferContainerChildAssociation } from './transferContainerChildAssociation'; + +export class TransferContainerChildAssociationEntry { + entry: TransferContainerChildAssociation; + + constructor(input?: Partial<TransferContainerChildAssociationEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new TransferContainerChildAssociation(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferContainerEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerEntry.ts new file mode 100644 index 0000000000..1e83aa50f3 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferContainerEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TransferContainer } from './transferContainer'; + +export class TransferContainerEntry { + entry: TransferContainer; + + constructor(input?: Partial<TransferContainerEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new TransferContainer(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/transferEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/transferEntry.ts new file mode 100644 index 0000000000..08fd915e5e --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/transferEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Transfer } from './transfer'; + +export class TransferEntry { + entry: Transfer; + + constructor(input?: Partial<TransferEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Transfer(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainer.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainer.ts new file mode 100644 index 0000000000..0dbe522ebd --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainer.ts @@ -0,0 +1,49 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { PathInfo, UserInfo } from '../../content-rest-api'; + +export class UnfiledContainer { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<UnfiledContainer>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerAssociationPaging.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerAssociationPaging.ts new file mode 100644 index 0000000000..0d6d7995f7 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerAssociationPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UnfiledContainerAssociationPagingList } from './unfiledContainerAssociationPagingList'; + +export class UnfiledContainerAssociationPaging { + list?: UnfiledContainerAssociationPagingList; + + constructor(input?: Partial<UnfiledContainerAssociationPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new UnfiledContainerAssociationPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerAssociationPagingList.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerAssociationPagingList.ts new file mode 100644 index 0000000000..8e10f6abe7 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerAssociationPagingList.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { UnfiledContainer } from './unfiledContainer'; +import { UnfiledContainerChildAssociationEntry } from './unfiledContainerChildAssociationEntry'; + +export class UnfiledContainerAssociationPagingList { + pagination?: Pagination; + entries?: UnfiledContainerChildAssociationEntry[]; + source?: UnfiledContainer; + + constructor(input?: Partial<UnfiledContainerAssociationPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new UnfiledContainerChildAssociationEntry(item)); + } + this.source = input.source ? new UnfiledContainer(input.source) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChild.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChild.ts new file mode 100644 index 0000000000..8d51609aaa --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChild.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { PathInfo, UserInfo } from '../../content-rest-api'; + +export class UnfiledContainerChild { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isUnfiledRecordFolder: boolean; + isRecord: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<UnfiledContainerChild>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChildAssociation.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChildAssociation.ts new file mode 100644 index 0000000000..fd022a46b1 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChildAssociation.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChildAssociationInfo, PathInfo, UserInfo } from '../../content-rest-api'; +import { DateAlfresco } from '../../content-custom-api'; + +export class UnfiledContainerChildAssociation { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isUnfiledRecordFolder: boolean; + isRecord: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + association?: ChildAssociationInfo; + + constructor(input?: Partial<UnfiledContainerChildAssociation>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.association = input.association ? new ChildAssociationInfo(input.association) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChildAssociationEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChildAssociationEntry.ts new file mode 100644 index 0000000000..22e23a1d61 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerChildAssociationEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UnfiledContainerChildAssociation } from './unfiledContainerChildAssociation'; + +export class UnfiledContainerChildAssociationEntry { + entry: UnfiledContainerChildAssociation; + + constructor(input?: Partial<UnfiledContainerChildAssociationEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new UnfiledContainerChildAssociation(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerEntry.ts new file mode 100644 index 0000000000..489cdcbe6e --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledContainerEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UnfiledContainer } from './unfiledContainer'; + +export class UnfiledContainerEntry { + entry: UnfiledContainer; + + constructor(input?: Partial<UnfiledContainerEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new UnfiledContainer(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordContainerBodyUpdate.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordContainerBodyUpdate.ts new file mode 100644 index 0000000000..d0555a1926 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordContainerBodyUpdate.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface UnfiledRecordContainerBodyUpdate { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name?: string; + properties?: { [key: string]: string }; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolder.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolder.ts new file mode 100644 index 0000000000..2b83691ba4 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolder.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { PathInfo, UserInfo } from '../../content-rest-api'; + +export class UnfiledRecordFolder { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isUnfiledRecordFolder: boolean; + isRecord: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<UnfiledRecordFolder>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderAssociationPaging.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderAssociationPaging.ts new file mode 100644 index 0000000000..92ff10a58a --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderAssociationPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UnfiledRecordFolderAssociationPagingList } from './unfiledRecordFolderAssociationPagingList'; + +export class UnfiledRecordFolderAssociationPaging { + list?: UnfiledRecordFolderAssociationPagingList; + + constructor(input?: Partial<UnfiledRecordFolderAssociationPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new UnfiledRecordFolderAssociationPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderAssociationPagingList.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderAssociationPagingList.ts new file mode 100644 index 0000000000..d95734cb9d --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderAssociationPagingList.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { UnfiledRecordFolder } from './unfiledRecordFolder'; +import { UnfiledRecordFolderChildAssociationEntry } from './unfiledRecordFolderChildAssociationEntry'; + +export class UnfiledRecordFolderAssociationPagingList { + pagination?: Pagination; + entries?: UnfiledRecordFolderChildAssociationEntry[]; + source?: UnfiledRecordFolder; + + constructor(input?: Partial<UnfiledRecordFolderAssociationPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new UnfiledRecordFolderChildAssociationEntry(item)); + } + this.source = input.source ? new UnfiledRecordFolder(input.source) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderBodyUpdate.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderBodyUpdate.ts new file mode 100644 index 0000000000..f4f6c9fd88 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderBodyUpdate.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface UnfiledRecordFolderBodyUpdate { + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name?: string; + properties?: { [key: string]: string }; +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChild.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChild.ts new file mode 100644 index 0000000000..d0cde38c61 --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChild.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DateAlfresco } from '../../content-custom-api'; +import { PathInfo, UserInfo } from '../../content-rest-api'; + +export class UnfiledRecordFolderChild { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isUnfiledRecordFolder: boolean; + isRecord: boolean; + modifiedAt?: Date; + modifiedByUser?: UserInfo; + createdAt?: Date; + createdByUser?: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + + constructor(input?: Partial<UnfiledRecordFolderChild>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChildAssociation.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChildAssociation.ts new file mode 100644 index 0000000000..4f93b8217c --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChildAssociation.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ChildAssociationInfo, PathInfo, UserInfo } from '../../content-rest-api'; +import { DateAlfresco } from '../../content-custom-api'; + +export class UnfiledRecordFolderChildAssociation { + id: string; + parentId: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isUnfiledRecordFolder: boolean; + isRecord: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + association?: ChildAssociationInfo; + + constructor(input?: Partial<UnfiledRecordFolderChildAssociation>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.association = input.association ? new ChildAssociationInfo(input.association) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChildAssociationEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChildAssociationEntry.ts new file mode 100644 index 0000000000..3e3f337cfd --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderChildAssociationEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UnfiledRecordFolderChildAssociation } from './unfiledRecordFolderChildAssociation'; + +export class UnfiledRecordFolderChildAssociationEntry { + entry: UnfiledRecordFolderChildAssociation; + + constructor(input?: Partial<UnfiledRecordFolderChildAssociationEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new UnfiledRecordFolderChildAssociation(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderEntry.ts b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderEntry.ts new file mode 100644 index 0000000000..63321e081d --- /dev/null +++ b/lib/js-api/src/api/gs-core-rest-api/model/unfiledRecordFolderEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { UnfiledRecordFolder } from './unfiledRecordFolder'; + +export class UnfiledRecordFolderEntry { + entry: UnfiledRecordFolder; + + constructor(input?: Partial<UnfiledRecordFolderEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new UnfiledRecordFolder(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/model-rest-api/README.md b/lib/js-api/src/api/model-rest-api/README.md new file mode 100644 index 0000000000..b48c195c40 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/README.md @@ -0,0 +1,32 @@ +# **Model API** + +Provides access to the model features of Alfresco Content Services. + +> Documentation updated on: 2021-02-23T00:57:02.188+05:30 + +## Methods + +All URIs are relative to: + +```text +https://localhost/alfresco/api/-default-/public/alfresco/versions/1 +``` + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +AspectsApi | [**getAspect**](docs/AspectsApi.md#getAspect) | **GET** /aspects/{aspectId} | Get an aspect +AspectsApi | [**listAspects**](docs/AspectsApi.md#listAspects) | **GET** /aspects | List aspects +TypesApi | [**getType**](docs/TypesApi.md#getType) | **GET** /types/{typeId} | Get a type +TypesApi | [**listTypes**](docs/TypesApi.md#listTypes) | **GET** /types | List types + +## Models + +- [Aspect](docs/Aspect.md) +- [AspectEntry](docs/AspectEntry.md) +- [AspectPaging](docs/AspectPaging.md) +- [AspectPagingList](docs/AspectPagingList.md) +- [Model](docs/Model.md) +- [Type](docs/Type.md) +- [TypeEntry](docs/TypeEntry.md) +- [TypePaging](docs/TypePaging.md) +- [TypePagingList](docs/TypePagingList.md) diff --git a/lib/js-api/src/api/model-rest-api/api/aspects.api.ts b/lib/js-api/src/api/model-rest-api/api/aspects.api.ts new file mode 100644 index 0000000000..f1d88ed96e --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/api/aspects.api.ts @@ -0,0 +1,111 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AspectEntry } from '../model/aspectEntry'; +import { AspectPaging } from '../model/aspectPaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; + +export class ListAspectsOpts { + /** + * Optionally filter the list. Here are some examples: + * + * An aspect should be represented in the following format(prefix:name). e.g 'cm:title'. + * + * The following where clause will only return aspects from the namespace1:model and namespace2:model. + * + * - where=(modelId in ('namespace1:model','namespace2:model')) + * - where=(modelId in ('namespace1:model INCLUDESUBASPECTS','namespace2:model')) + * + * The following where clause will only return sub aspects for the given parents. + * + * - where=(parentId in ('namespace1:parent','namespace2:parent')) + * + * The following where clause will only return aspects that match the pattern. + * + * - where=(namespaceUri matches('http://www.alfresco.*')) + * + * The following where clause will only return aspects that don't match the pattern. + * + * - where=(not namespaceUri matches('http://www.alfresco.*')) + */ + where?: string; + // The number of entities that exist in the collection before those included in this list. + // If not supplied then the default value is 0. + skipCount?: number; + // The maximum number of items to return in the list. + // If not supplied then the default value is 100. + maxItems?: number; + /** + * Returns additional information about the aspect. The following optional fields can be requested: + * - properties + * - mandatoryAspects + * - associations + */ + include?: string[]; +} + +/** + * Aspects service. + */ +export class AspectsApi extends BaseApi { + /** + * Get an aspect + * + * **Note:** This is available in Alfresco 7.0.0 and newer versions. + * + * @param aspectId The `Qname` of an aspect(prefix:name) e.g 'cm:title' + * @returns Promise<AspectEntry> + */ + getAspect(aspectId: string): Promise<AspectEntry> { + throwIfNotDefined(aspectId, 'aspectId'); + + const pathParams = { + aspectId + }; + + return this.get<AspectEntry>({ + path: '/aspects/{aspectId}', + pathParams, + returnType: AspectEntry + }); + } + + /** + * List aspects + * + * **Note:** This is available in Alfresco 7.0.0 and newer versions. + * + * @param opts Optional parameters + * @returns Promise<AspectPaging> + */ + listAspects(opts?: ListAspectsOpts): Promise<AspectPaging> { + const queryParams = { + where: opts?.where, + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.get<AspectPaging>({ + path: '/aspects', + queryParams, + returnType: AspectPaging + }); + } +} diff --git a/lib/js-api/src/api/model-rest-api/api/base.api.ts b/lib/js-api/src/api/model-rest-api/api/base.api.ts new file mode 100644 index 0000000000..6af5830d9f --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/api/base.api.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient } from '../../../api-clients/http-client.interface'; + +export abstract class BaseApi extends ApiClient { + override get apiClient(): LegacyHttpClient { + return this.httpClient ?? this.alfrescoApi.contentClient; + } +} diff --git a/lib/js-api/src/api/model-rest-api/api/index.ts b/lib/js-api/src/api/model-rest-api/api/index.ts new file mode 100644 index 0000000000..8cf56e638d --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './aspects.api'; +export * from './types.api'; diff --git a/lib/js-api/src/api/model-rest-api/api/types.api.ts b/lib/js-api/src/api/model-rest-api/api/types.api.ts new file mode 100644 index 0000000000..16d782f915 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/api/types.api.ts @@ -0,0 +1,108 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TypeEntry } from '../model/typeEntry'; +import { TypePaging } from '../model/typePaging'; +import { BaseApi } from './base.api'; +import { throwIfNotDefined } from '../../../assert'; +import { buildCollectionParam } from '../../../alfrescoApiClient'; + +export interface ListTypesOpts { + /** + * Optionally filter the list. Here are some examples: + * + * A type should be represented in the following format(prefix:name). e.g 'cm:content'. + * + * The following where clause will only return types from the namespace1:model and namespace2:model. + * - where=(modelId in ('namespace1:model','namespace2:model')) + * - where=(modelId in ('namespace1:model INCLUDESUBTYPES','namespace2:model')) + * + * The following where clause will only return sub types for the given parents. + * - where=(parentId in ('namespace1:parent','namespace2:parent')) + * + * The following where clause will only return types that match the pattern. + * - where=(namespaceUri matches('http://www.alfresco.*')) + * + * The following where clause will only return types that don't match the pattern. + * - where=(not namespaceUri matches('http://www.alfresco.*')) + */ + where?: string; + // The number of entities that exist in the collection before those included in this list. + // If not supplied then the default value is 0. + skipCount?: number; + // The maximum number of items to return in the list. + // If not supplied then the default value is 100. + maxItems?: number; + /** + * Returns additional information about the type. + * The following optional fields can be requested: + * - properties + * - mandatoryAspects + * - associations + */ + include?: string[]; +} + +/** + * Types service. + */ +export class TypesApi extends BaseApi { + /** + * Get a type + * + * **Note:** This is available in Alfresco 7.0.0 and newer versions. + * + * @param typeId The `Qname` of a type(prefix:name) e.g 'cm:content' + * @returns Promise<TypeEntry> + */ + getType(typeId: string): Promise<TypeEntry> { + throwIfNotDefined(typeId, 'typeId'); + + const pathParams = { + typeId + }; + + return this.get<TypeEntry>({ + path: '/types/{typeId}', + pathParams, + returnType: TypeEntry + }); + } + + /** + * List types + * + * **Note:** This is available in Alfresco 7.0.0 and newer versions. + * + * @param opts Optional parameters + * @returns Promise<TypePaging> + */ + listTypes(opts?: ListTypesOpts): Promise<TypePaging> { + const queryParams = { + where: opts?.where, + skipCount: opts?.skipCount, + maxItems: opts?.maxItems, + include: buildCollectionParam(opts?.include, 'csv') + }; + + return this.get<TypePaging>({ + path: '/types', + queryParams, + returnType: TypePaging + }); + } +} diff --git a/lib/js-api/src/api/model-rest-api/docs/AbstractClassAssociation.md b/lib/js-api/src/api/model-rest-api/docs/AbstractClassAssociation.md new file mode 100644 index 0000000000..60882261f6 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/AbstractClassAssociation.md @@ -0,0 +1,14 @@ +# AbstractClassAssociation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**title** | **string** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**isChild** | **boolean** | | [optional] [default to null] +**isProtected** | **boolean** | | [optional] [default to null] +**source** | [**AbstractClassAssociationSource**](AbstractClassAssociationSource.md) | | [optional] [default to null] +**target** | [**AbstractClassAssociationSource**](AbstractClassAssociationSource.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/model-rest-api/docs/AbstractClassAssociationSource.md b/lib/js-api/src/api/model-rest-api/docs/AbstractClassAssociationSource.md new file mode 100644 index 0000000000..dda97dbd54 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/AbstractClassAssociationSource.md @@ -0,0 +1,12 @@ +# AbstractClassAssociationSource + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role** | **string** | | [optional] [default to null] +**cls** | **string** | | [optional] [default to null] +**isMandatory** | **boolean** | | [optional] [default to null] +**isMany** | **boolean** | | [optional] [default to null] +**isMandatoryEnforced** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/model-rest-api/docs/Aspect.md b/lib/js-api/src/api/model-rest-api/docs/Aspect.md new file mode 100644 index 0000000000..a508b39081 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/Aspect.md @@ -0,0 +1,16 @@ +# Aspect + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**title** | **string** | | [default to null] +**description** | **string** | | [optional] [default to null] +**parentId** | **string** | | [optional] [default to null] +**properties** | [**Property[]**](../../content-rest-api/docs/Property.md) | | [optional] [default to null] +**isContainer** | **boolean** | | [optional] [default to null] +**isArchive** | **boolean** | | [optional] [default to null] +**includedInSupertypeQuery** | **boolean** | | [optional] [default to null] +**mandatoryAspects** | **string[]** | | [optional] [default to null] +**associations** | [**AbstractClassAssociation[]**](AbstractClassAssociation.md) | | [optional] [default to null] +**model** | [**Model**](Model.md) | | [optional] [default to null] diff --git a/lib/js-api/src/api/model-rest-api/docs/AspectEntry.md b/lib/js-api/src/api/model-rest-api/docs/AspectEntry.md new file mode 100644 index 0000000000..5ec43eec08 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/AspectEntry.md @@ -0,0 +1,8 @@ +# AspectEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Aspect**](Aspect.md) | | [default to null] + + diff --git a/lib/js-api/src/api/model-rest-api/docs/AspectPaging.md b/lib/js-api/src/api/model-rest-api/docs/AspectPaging.md new file mode 100644 index 0000000000..9b8e8b4170 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/AspectPaging.md @@ -0,0 +1,8 @@ +# AspectPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**AspectPagingList**](AspectPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/model-rest-api/docs/AspectPaging_list.md b/lib/js-api/src/api/model-rest-api/docs/AspectPaging_list.md new file mode 100644 index 0000000000..12d12de9ea --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/AspectPaging_list.md @@ -0,0 +1,9 @@ +# AspectPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](../../content-rest-api/docs/Pagination.md) | | [optional] [default to null] +**entries** | [**AspectEntry[]**](AspectEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/model-rest-api/docs/AspectsApi.md b/lib/js-api/src/api/model-rest-api/docs/AspectsApi.md new file mode 100644 index 0000000000..6e57534a6c --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/AspectsApi.md @@ -0,0 +1,151 @@ +# AspectsApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|-----------------------------|-----------------------------|---------------| +| [getAspect](#getAspect) | **GET** /aspects/{aspectId} | Get an aspect | +| [listAspects](#listAspects) | **GET** /aspects | List aspects | + +## getAspect + +Get an aspect + +> This is available in Alfresco 7.0.0 and newer versions. + +**Parameters** + +| Name | Type | Description | +|--------------|--------|----------------------------------------------------| +| **aspectId** | string | The Qname of an aspect(prefix:name) e.g 'cm:title' | + +**Return type**: [AspectEntry](AspectEntry.md) + +**Example** + +```javascript +import { AlfrescoApi, AspectsApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const aspectsApi = new AspectsApi(alfrescoApi); + +aspectsApi.getAspect(aspectId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` + +## listAspects + +List aspects + +> This is available in Alfresco 7.0.0 and newer versions. + +Gets a list of aspects from the data dictionary. The System aspects will be ignored by default. + +```json +{ + "list": { + "pagination": { + "count": 0, + "hasMoreItems": true, + "totalItems": 0, + "skipCount": 0, + "maxItems": 0 + }, + "entries": [ + { + "entry": { + "associations": [], + "mandatoryAspects": [], + "includedInSupertypeQuery": true, + "description": "Titled", + "isContainer": false, + "model": { + "id": "cm:contentmodel", + "author": "Alfresco", + "description": "Alfresco Content Domain Model", + "namespaceUri": "http://www.alfresco.org/model/content/1.0", + "namespacePrefix": "cm" + }, + "id": "cm:titled", + "title": "Titled", + "properties": [ + { + "id": "cm:title", + "title": "Title", + "description": "Content Title", + "dataType": "d:mltext", + "isMultiValued": false, + "isMandatory": false, + "isMandatoryEnforced": false, + "isProtected": false + } + ] + } + } + ] + } +} +``` + +**Parameters** + +| Name | Type | Description | Notes | +|-------|--------|-----------------------------|------------| +| where | string | Optionally filter the list. | [optional] | + +Here are some examples: + +An aspect should represented in the following format(prefix:name). e.g 'cm:title'. + +The following where clause will only return aspects from the namespace1:model and namespace2:model. + +```text + where=(modelId in ('namespace1:model','namespace2:model')) + where=(modelId in ('namespace1:model INCLUDESUBASPECTS','namespace2:model')) +``` + +The following where clause will only return sub aspects for the given parents. + +```text + where=(parentId in ('namespace1:parent','namespace2:parent')) +``` + +The following where clause will only return aspects that match the pattern. + +```text + where=(namespaceUri matches('http://www.alfresco.*')) +``` + +The following where clause will only return aspects that don't match the pattern. + +```text + where=(not namespaceUri matches('http://www.alfresco.*')) +``` + +| Name | Type | Description | Notes | +|---------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------| +| **skipCount** | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | [optional] [default to 0] | +| **maxItems** | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | [optional] [default to 100] | +| **include** | string | Returns additional information about the aspect. The following optional fields can be requested: `properties`, `mandatoryAspects`, `associations` | [optional] | + +**Return type**: [AspectPaging](AspectPaging.md) + +**Example** + +```javascript +import { AlfrescoApi, AspectsApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const aspectsApi = new AspectsApi(alfrescoApi); + +aspectsApi.listAspects(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}); +``` \ No newline at end of file diff --git a/lib/js-api/src/api/model-rest-api/docs/Model.md b/lib/js-api/src/api/model-rest-api/docs/Model.md new file mode 100644 index 0000000000..feb1289bab --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/Model.md @@ -0,0 +1,11 @@ +# Model + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**author** | **string** | | [optional] [default to null] +**description** | **string** | | [optional] [default to null] +**namespaceUri** | **string** | | [optional] [default to null] +**namespacePrefix** | **string** | | [optional] [default to null] + diff --git a/lib/js-api/src/api/model-rest-api/docs/Type.md b/lib/js-api/src/api/model-rest-api/docs/Type.md new file mode 100644 index 0000000000..514bc10dcf --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/Type.md @@ -0,0 +1,17 @@ +# Type + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**title** | **string** | | [default to null] +**description** | **string** | | [optional] [default to null] +**parentId** | **string** | | [optional] [default to null] +**properties** | [**Property[]**](../../content-rest-api/docs/Property.md) | | [optional] [default to null] +**isContainer** | **boolean** | | [optional] [default to null] +**isArchive** | **boolean** | | [optional] [default to null] +**includedInSupertypeQuery** | **boolean** | | [optional] [default to null] +**mandatoryAspects** | **string[]** | | [optional] [default to null] +**associations** | [**AbstractClassAssociation[]**](AbstractClassAssociation.md) | | [optional] [default to null] +**model** | [**Model**](Model.md) | | [optional] [default to null] + diff --git a/lib/js-api/src/api/model-rest-api/docs/TypeEntry.md b/lib/js-api/src/api/model-rest-api/docs/TypeEntry.md new file mode 100644 index 0000000000..83df09add2 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/TypeEntry.md @@ -0,0 +1,8 @@ +# TypeEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**Type**](Type.md) | | [default to null] + + diff --git a/lib/js-api/src/api/model-rest-api/docs/TypePaging.md b/lib/js-api/src/api/model-rest-api/docs/TypePaging.md new file mode 100644 index 0000000000..f0e2ffbab7 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/TypePaging.md @@ -0,0 +1,8 @@ +# TypePaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**TypePagingList**](TypePagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/model-rest-api/docs/TypePaging_list.md b/lib/js-api/src/api/model-rest-api/docs/TypePaging_list.md new file mode 100644 index 0000000000..f21e2f74ca --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/TypePaging_list.md @@ -0,0 +1,9 @@ +# TypePagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](../../content-rest-api/docs/Pagination.md) | | [optional] [default to null] +**entries** | [**TypeEntry[]**](TypeEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/model-rest-api/docs/TypesApi.md b/lib/js-api/src/api/model-rest-api/docs/TypesApi.md new file mode 100644 index 0000000000..0ecab7b8b4 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/docs/TypesApi.md @@ -0,0 +1,170 @@ +# TypesApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1* + +| Method | HTTP request | Description | +|----------------------------------------|-------------------------|-------------| +| [**getType**](TypesApi.md#getType) | **GET** /types/{typeId} | Get a type | +| [**listTypes**](TypesApi.md#listTypes) | **GET** /types | List types | + + +<a name="getType"></a> +## getType +> TypeEntry getType(typeId) + +Get a type + +**Note:** This is available in Alfresco 7.0.0 and newer versions. +Get information for type **typeId**. + + +### Example + +```javascript +import { AlfrescoApi, TypesApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const typesApi = new TypesApi(alfrescoApi); + + +typesApi.getType(typeId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------|------------|---------------------------------------------------|-------| +| **typeId** | **string** | The Qname of a type(prefix:name) e.g 'cm:content' | + +**Return type**: [**TypeEntry**](TypeEntry.md) + +<a name="listTypes"></a> +## listTypes +> TypePaging listTypes(opts) + +List types + +**Note:** This is available in Alfresco 7.0.0 and newer versions. + +Gets a list of types from the data dictionary. The System types will be ignored by default. + +```json +{ + "list": { + "pagination": { + "count": 0, + "hasMoreItems": true, + "totalItems": 0, + "skipCount": 0, + "maxItems": 0 + }, + "entries": [ + { + "entry": { + "associations": [], + "isArchive": true, + "mandatoryAspects": [ + "cm:auditable", + "sys:referenceable", + "sys:localized" + ], + "includedInSupertypeQuery": true, + "description": "Base Content Object", + "isContainer": false, + "model": { + "id": "cm:contentmodel", + "author": "Alfresco", + "description": "Alfresco Content Domain Model", + "namespaceUri": "http://www.alfresco.org/model/content/1.0", + "namespacePrefix": "cm" + }, + "id": "cm:content", + "title": "Content", + "parentId": "cm:cmobject" + "properties": [ + { + "id": "cm:name", + "title": "Name", + "description": "Name", + "dataType": "d:text", + "isMultiValued": false, + "isMandatory": true, + "isMandatoryEnforced": true + "isProtected": false + } + ] + } + } + ] + } +} +``` + +**Example** + +```javascript +import { AlfrescoApi, TypesApi} from '@alfresco/js-api'; + +const alfrescoApi = new AlfrescoApi({ + hostEcm: 'http://127.0.0.1:8080' +}); + +const typesApi = new TypesApi(alfrescoApi); + +typesApi.listTypes(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); +``` + +### Parameters + +| Name | Type | Description | Notes | +|-----------|--------|-----------------------------|-------| +| **where** | string | Optionally filter the list. | + +Here are some examples: + +A type should be represented in the following format `(prefix:name)`. e.g 'cm:content'. + +The following where clause will only return types from the namespace1:model and namespace2:model. + +```text +where=(modelId in ('namespace1:model','namespace2:model')) +where=(modelId in ('namespace1:model INCLUDESUBTYPES','namespace2:model')) +``` + +The following where clause will only return sub types for the given parents. + +```text +where=(parentId in ('namespace1:parent','namespace2:parent')) +``` + +The following where clause will only return types that match the pattern. + +```text +where=(namespaceUri matches('http://www.alfresco.*')) +``` + +The following where clause will only return types that don't match the pattern. + +```text +where=(not namespaceUri matches('http://www.alfresco.*')) +``` + +| Name | Type | Description | Notes | +|----------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | [default to 0 | +| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 | +| opts.include | string[] | Returns additional information about the type. The following optional fields can be requested: `properties`, `mandatoryAspects`, `associations` | | + +**Return type**: [TypePaging](TypePaging.md) + diff --git a/lib/js-api/src/api/model-rest-api/index.ts b/lib/js-api/src/api/model-rest-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/model-rest-api/model/abstractClass.ts b/lib/js-api/src/api/model-rest-api/model/abstractClass.ts new file mode 100644 index 0000000000..c957f913eb --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/abstractClass.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Property } from '../../content-rest-api'; +import { AbstractClassAssociation } from './abstractClassAssociation'; +import { Model } from './model'; + +export class AbstractClass { + id: string; + title: string; + description?: string; + parentId?: string; + properties?: Property[]; + isContainer?: boolean; + isArchive?: boolean; + includedInSupertypeQuery?: boolean; + mandatoryAspects?: string[]; + associations?: AbstractClassAssociation[]; + model?: Model; + + constructor(input?: Partial<AbstractClass>) { + if (input) { + Object.assign(this, input); + } + } +} diff --git a/lib/js-api/src/api/model-rest-api/model/abstractClassAssociation.ts b/lib/js-api/src/api/model-rest-api/model/abstractClassAssociation.ts new file mode 100644 index 0000000000..935810dd53 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/abstractClassAssociation.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbstractClassAssociationSource } from './abstractClassAssociationSource'; + +export interface AbstractClassAssociation { + id: string; + title?: string; + description?: string; + isChild?: boolean; + isProtected?: boolean; + source?: AbstractClassAssociationSource; + target?: AbstractClassAssociationSource; +} diff --git a/lib/js-api/src/api/model-rest-api/model/abstractClassAssociationSource.ts b/lib/js-api/src/api/model-rest-api/model/abstractClassAssociationSource.ts new file mode 100644 index 0000000000..13151978fe --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/abstractClassAssociationSource.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface AbstractClassAssociationSource { + role?: string; + cls?: string; + isMandatory?: boolean; + isMany?: boolean; + isMandatoryEnforced?: boolean; +} diff --git a/lib/js-api/src/api/model-rest-api/model/aspect.ts b/lib/js-api/src/api/model-rest-api/model/aspect.ts new file mode 100644 index 0000000000..ab4394c7c2 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/aspect.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbstractClass } from './abstractClass'; + +export class Aspect extends AbstractClass { + +} diff --git a/lib/js-api/src/api/model-rest-api/model/aspectEntry.ts b/lib/js-api/src/api/model-rest-api/model/aspectEntry.ts new file mode 100644 index 0000000000..df25984029 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/aspectEntry.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Aspect } from './aspect'; + +export class AspectEntry { + entry: Aspect; + + constructor(input?: Partial<AspectEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Aspect(input.entry) : undefined; + } + } + +} diff --git a/lib/js-api/src/api/model-rest-api/model/aspectPaging.ts b/lib/js-api/src/api/model-rest-api/model/aspectPaging.ts new file mode 100644 index 0000000000..553df124fc --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/aspectPaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AspectPagingList } from './aspectPagingList'; + +export class AspectPaging { + list?: AspectPagingList; + + constructor(input?: Partial<AspectPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new AspectPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/model-rest-api/model/aspectPagingList.ts b/lib/js-api/src/api/model-rest-api/model/aspectPagingList.ts new file mode 100644 index 0000000000..d0b1582e9c --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/aspectPagingList.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AspectEntry } from './aspectEntry'; +import { Pagination } from '../../content-rest-api'; + +export class AspectPagingList { + pagination?: Pagination; + entries?: AspectEntry[]; + + constructor(input?: Partial<AspectPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new AspectEntry(item)); + } + } + } +} diff --git a/lib/js-api/src/api/model-rest-api/model/index.ts b/lib/js-api/src/api/model-rest-api/model/index.ts new file mode 100644 index 0000000000..987bea2b65 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/index.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './abstractClass'; +export * from './abstractClassAssociation'; +export * from './abstractClassAssociationSource'; +export * from './aspect'; +export * from './aspectEntry'; +export * from './aspectPaging'; +export * from './aspectPagingList'; +export * from './type'; +export * from './typeEntry'; +export * from './typePaging'; +export * from './typePagingList'; diff --git a/lib/js-api/src/api/model-rest-api/model/model.ts b/lib/js-api/src/api/model-rest-api/model/model.ts new file mode 100644 index 0000000000..72b8e3cec3 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/model.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Model { + id: string; + author?: string; + description?: string; + namespaceUri?: string; + namespacePrefix?: string; +} diff --git a/lib/js-api/src/api/model-rest-api/model/type.ts b/lib/js-api/src/api/model-rest-api/model/type.ts new file mode 100644 index 0000000000..d980511224 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/type.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbstractClass } from './abstractClass'; + +export class Type extends AbstractClass { + +} diff --git a/lib/js-api/src/api/model-rest-api/model/typeEntry.ts b/lib/js-api/src/api/model-rest-api/model/typeEntry.ts new file mode 100644 index 0000000000..ce5d1ee792 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/typeEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Type } from './type'; + +export class TypeEntry { + entry: Type; + + constructor(input?: Partial<TypeEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new Type(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/model-rest-api/model/typePaging.ts b/lib/js-api/src/api/model-rest-api/model/typePaging.ts new file mode 100644 index 0000000000..8747c0d957 --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/typePaging.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TypePagingList } from './typePagingList'; + +export class TypePaging { + list?: TypePagingList; + + constructor(input?: Partial<TypePaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new TypePagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/model-rest-api/model/typePagingList.ts b/lib/js-api/src/api/model-rest-api/model/typePagingList.ts new file mode 100644 index 0000000000..05ed2fc63b --- /dev/null +++ b/lib/js-api/src/api/model-rest-api/model/typePagingList.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api/model/pagination'; +import { TypeEntry } from './typeEntry'; + +export class TypePagingList { + pagination?: Pagination; + entries?: TypeEntry[]; + + constructor(input?: Partial<TypePagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new TypeEntry(item)); + } + } + } + +} diff --git a/lib/js-api/src/api/search-rest-api/README.md b/lib/js-api/src/api/search-rest-api/README.md new file mode 100644 index 0000000000..22babc58c4 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/README.md @@ -0,0 +1,72 @@ +**Search API** + +Provides access to the search features of Alfresco Content Services. + + +- Last Build date: 2018-11-05T11:25:22.205Z + + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/search/versions/1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*.SearchApi* | [**search**](docs/SearchApi.md#search) | **POST** /search | Searches Alfresco + + +## Documentation for Models + + - [ContentInfo](docs/ContentInfo.md) + - [ErrorError](docs/ErrorError.md) + - [GenericBucket](docs/GenericBucket.md) + - [GenericBucketBucketInfo](docs/GenericBucketBucketInfo.md) + - [GenericFacetResponse](docs/GenericFacetResponse.md) + - [GenericMetric](docs/GenericMetric.md) + - [ModelError](docs/ModelError.md) + - [Node](docs/Node.md) + - [Pagination](docs/Pagination.md) + - [PathElement](docs/PathElement.md) + - [PathInfo](docs/PathInfo.md) + - [RequestDefaults](docs/RequestDefaults.md) + - [RequestFacetField](docs/RequestFacetField.md) + - [RequestFacetFields](docs/RequestFacetFields.md) + - [RequestFacetIntervals](docs/RequestFacetIntervals.md) + - [RequestFacetIntervalsIntervals](docs/RequestFacetIntervalsIntervals.md) + - [RequestFacetQueries](docs/RequestFacetQueries.md) + - [RequestFacetQueriesInner](docs/RequestFacetQueriesInner.md) + - [RequestFacetSet](docs/RequestFacetSet.md) + - [RequestFields](docs/RequestFields.md) + - [RequestFilterQueries](docs/RequestFilterQueries.md) + - [RequestFilterQueriesInner](docs/RequestFilterQueriesInner.md) + - [RequestHighlight](docs/RequestHighlight.md) + - [RequestHighlightFields](docs/RequestHighlightFields.md) + - [RequestInclude](docs/RequestInclude.md) + - [RequestLimits](docs/RequestLimits.md) + - [RequestLocalization](docs/RequestLocalization.md) + - [RequestPagination](docs/RequestPagination.md) + - [RequestPivot](docs/RequestPivot.md) + - [RequestQuery](docs/RequestQuery.md) + - [RequestRange](docs/RequestRange.md) + - [RequestScope](docs/RequestScope.md) + - [RequestSortDefinition](docs/RequestSortDefinition.md) + - [RequestSortDefinitionInner](docs/RequestSortDefinitionInner.md) + - [RequestSpellcheck](docs/RequestSpellcheck.md) + - [RequestStats](docs/RequestStats.md) + - [RequestTemplates](docs/RequestTemplates.md) + - [RequestTemplatesInner](docs/RequestTemplatesInner.md) + - [ResponseConsistency](docs/ResponseConsistency.md) + - [ResultBuckets](docs/ResultBuckets.md) + - [ResultBucketsBuckets](docs/ResultBucketsBuckets.md) + - [ResultSetContext](docs/ResultSetContext.md) + - [ResultSetContextFacetQueries](docs/ResultSetContextFacetQueries.md) + - [ResultSetContextSpellcheck](docs/ResultSetContextSpellcheck.md) + - [ResultSetPaging](docs/ResultSetPaging.md) + - [ResultSetPagingList](docs/ResultSetPagingList.md) + - [ResultSetRowEntry](docs/ResultSetRowEntry.md) + - [SearchEntry](docs/SearchEntry.md) + - [SearchEntryHighlight](docs/SearchEntryHighlight.md) + - [SearchRequest](docs/SearchRequest.md) + - [UserInfo](docs/UserInfo.md) + - [ResultNode](docs/ResultNode.md) + diff --git a/lib/js-api/src/api/search-rest-api/api/index.ts b/lib/js-api/src/api/search-rest-api/api/index.ts new file mode 100644 index 0000000000..75b8feaa50 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/api/index.ts @@ -0,0 +1,18 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './search.api'; diff --git a/lib/js-api/src/api/search-rest-api/api/search.api.ts b/lib/js-api/src/api/search-rest-api/api/search.api.ts new file mode 100644 index 0000000000..7aabd7497a --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/api/search.api.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultSetPaging } from '../model/resultSetPaging'; +import { SearchRequest } from '../model/searchRequest'; +import { throwIfNotDefined } from '../../../assert'; +import { ApiClient } from '../../../api-clients/api-client'; +import { LegacyHttpClient } from '../../../api-clients/http-client.interface'; + +/** + * Search service. + * + * @module SearchApi + */ +export class SearchApi extends ApiClient { + override get apiClient(): LegacyHttpClient { + return this.httpClient ?? this.alfrescoApi.searchClient; + } + + /** + * Searches Alfresco + * + * **Note**: this endpoint is available in Alfresco 5.2 and newer versions. + * + * @param queryBody Generic query API + * @returns Promise<ResultSetPaging> + */ + search(queryBody: SearchRequest): Promise<ResultSetPaging> { + throwIfNotDefined(queryBody, 'queryBody'); + + return this.post({ + path: '/search', + bodyParam: queryBody, + returnType: ResultSetPaging + }); + } +} diff --git a/lib/js-api/src/api/search-rest-api/docs/ContentInfo.md b/lib/js-api/src/api/search-rest-api/docs/ContentInfo.md new file mode 100644 index 0000000000..420a067526 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ContentInfo.md @@ -0,0 +1,12 @@ +# ContentInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mimeType** | **string** | | [default to null] +**mimeTypeName** | **string** | | [default to null] +**sizeInBytes** | **number** | | [default to null] +**encoding** | **string** | | [optional] [default to null] +**mimeTypeGroup** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/Error.md b/lib/js-api/src/api/search-rest-api/docs/Error.md new file mode 100644 index 0000000000..9beb7f2852 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/Error.md @@ -0,0 +1,8 @@ +# ModelError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorError**](ErrorError.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/Error_error.md b/lib/js-api/src/api/search-rest-api/docs/Error_error.md new file mode 100644 index 0000000000..f8b473d9af --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/Error_error.md @@ -0,0 +1,13 @@ +# ErrorError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errorKey** | **string** | | [optional] [default to null] +**statusCode** | **number** | | [default to null] +**briefSummary** | **string** | | [default to null] +**stackTrace** | **string** | | [default to null] +**descriptionURL** | **string** | | [default to null] +**logId** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/GenericBucket.md b/lib/js-api/src/api/search-rest-api/docs/GenericBucket.md new file mode 100644 index 0000000000..8260e5fd09 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/GenericBucket.md @@ -0,0 +1,13 @@ +# GenericBucket + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | The bucket label | [optional] [default to null] +**filterQuery** | **string** | The filter query you can use to apply this facet | [optional] [default to null] +**display** | **any** | An optional field for additional display information | [optional] [default to null] +**metrics** | [**GenericMetric[]**](GenericMetric.md) | An array of buckets and values | [optional] [default to null] +**facets** | **any[]** | Additional list of nested facets | [optional] [default to null] +**bucketInfo** | [**GenericBucketBucketInfo**](GenericBucketBucketInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/GenericBucket_bucketInfo.md b/lib/js-api/src/api/search-rest-api/docs/GenericBucket_bucketInfo.md new file mode 100644 index 0000000000..a0a6a58b26 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/GenericBucket_bucketInfo.md @@ -0,0 +1,11 @@ +# GenericBucketBucketInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **string** | The start of range | [optional] [default to null] +**startInclusive** | **boolean** | Includes values greater or equal to \"start\" | [optional] [default to null] +**end** | **string** | The end of range | [optional] [default to null] +**endInclusive** | **boolean** | Includes values less than or equal to \"end\" | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/GenericFacetResponse.md b/lib/js-api/src/api/search-rest-api/docs/GenericFacetResponse.md new file mode 100644 index 0000000000..860dfb685b --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/GenericFacetResponse.md @@ -0,0 +1,10 @@ +# GenericFacetResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The facet type, eg. interval, range, pivot, stats | [optional] [default to null] +**label** | **string** | The field name or its explicit label, if provided on the request | [optional] [default to null] +**buckets** | [**GenericBucket[]**](GenericBucket.md) | An array of buckets and values | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/GenericMetric.md b/lib/js-api/src/api/search-rest-api/docs/GenericMetric.md new file mode 100644 index 0000000000..d527fce3a3 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/GenericMetric.md @@ -0,0 +1,10 @@ +# GenericMetric + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of metric, e.g. count | [optional] [default to null] +**value** | **any** | The metric value, e.g. {\"count\": 34} + | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/Node.md b/lib/js-api/src/api/search-rest-api/docs/Node.md new file mode 100644 index 0000000000..11f2ebf800 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/Node.md @@ -0,0 +1,26 @@ +# Node + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isFolder** | **boolean** | | [default to null] +**isFile** | **boolean** | | [default to null] +**isLocked** | **boolean** | | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**parentId** | **string** | | [optional] [default to null] +**isLink** | **boolean** | | [optional] [default to null] +**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/Pagination.md b/lib/js-api/src/api/search-rest-api/docs/Pagination.md new file mode 100644 index 0000000000..132172b802 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/Pagination.md @@ -0,0 +1,23 @@ +# Pagination + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **number** | The number of objects in the entries array. + | [default to null] +**hasMoreItems** | **boolean** | A boolean value which is **true** if there are more entities in the collection +beyond those in this response. A true value means a request with a larger value +for the **skipCount** or the **maxItems** parameter will return more entities. + | [default to null] +**totalItems** | **number** | An integer describing the total number of entities in the collection. +The API might not be able to determine this value, +in which case this property will not be present. + | [optional] [default to null] +**skipCount** | **number** | An integer describing how many entities exist in the collection before +those included in this list. + | [default to null] +**maxItems** | **number** | The value of the **maxItems** parameter used to generate this list, +or if there was no **maxItems** parameter the default value is 100 + | [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/PathElement.md b/lib/js-api/src/api/search-rest-api/docs/PathElement.md new file mode 100644 index 0000000000..dcbee68785 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/PathElement.md @@ -0,0 +1,9 @@ +# PathElement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/PathInfo.md b/lib/js-api/src/api/search-rest-api/docs/PathInfo.md new file mode 100644 index 0000000000..5f5ccb1e13 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/PathInfo.md @@ -0,0 +1,10 @@ +# PathInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**elements** | [**PathElement[]**](PathElement.md) | | [optional] [default to null] +**name** | **string** | | [optional] [default to null] +**isComplete** | **boolean** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestDefaults.md b/lib/js-api/src/api/search-rest-api/docs/RequestDefaults.md new file mode 100644 index 0000000000..72bb1e8e8f --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestDefaults.md @@ -0,0 +1,43 @@ +# RequestDefaults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**textAttributes** | **string[]** | A list of query fields/properties used to expand TEXT: queries. +The default is cm:content. +You could include all content properties using d:content or list all individual content properties or types. +As more terms are included the query size, complexity, memory impact and query time will increase. + | [optional] [default to null] +**defaultFTSOperator** | **string** | The default way to combine query parts when AND or OR is not explicitly stated - includes ! - + +one two three +(one two three) + | [optional] [default to null] +**defaultFTSFieldOperator** | **string** | The default way to combine query parts in field query groups when AND or OR is not explicitly stated - includes ! - + +FIELD:(one two three) + | [optional] [default to null] +**namespace** | **string** | The default name space to use if one is not provided | [optional] [default to null] +**defaultFieldName** | **string** | | [optional] [default to null] + + +<a name="RequestDefaults.DefaultFTSOperatorEnum"></a> +## Enum: RequestDefaults.DefaultFTSOperatorEnum + + +* `AND` (value: `'AND'`) + +* `OR` (value: `'OR'`) + + + + +<a name="RequestDefaults.DefaultFTSFieldOperatorEnum"></a> +## Enum: RequestDefaults.DefaultFTSFieldOperatorEnum + + +* `AND` (value: `'AND'`) + +* `OR` (value: `'OR'`) + + + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFacetField.md b/lib/js-api/src/api/search-rest-api/docs/RequestFacetField.md new file mode 100644 index 0000000000..4b87b74b9e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFacetField.md @@ -0,0 +1,42 @@ +# RequestFacetField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | The facet field | [optional] [default to null] +**label** | **string** | A label to include in place of the facet field | [optional] [default to null] +**prefix** | **string** | Restricts the possible constraints to only indexed values with a specified prefix. | [optional] [default to null] +**sort** | **string** | | [optional] [default to null] +**method** | **string** | | [optional] [default to null] +**missing** | **boolean** | When true, count results that match the query but which have no facet value for the field (in addition to the Term-based constraints). | [optional] [default to null] +**limit** | **number** | | [optional] [default to null] +**offset** | **number** | | [optional] [default to null] +**mincount** | **number** | The minimum count required for a facet field to be included in the response. | [optional] [default to null] +**facetEnumCacheMinDf** | **number** | | [optional] [default to null] +**excludeFilters** | **string[]** | Filter Queries with tags listed here will not be included in facet counts. +This is used for multi-select facetting. + | [optional] [default to null] + + +<a name="RequestFacetField.SortEnum"></a> +## Enum: RequestFacetField.SortEnum + + +* `COUNT` (value: `'COUNT'`) + +* `INDEX` (value: `'INDEX'`) + + + + +<a name="RequestFacetField.MethodEnum"></a> +## Enum: RequestFacetField.MethodEnum + + +* `ENUM` (value: `'ENUM'`) + +* `FC` (value: `'FC'`) + + + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFacetFields.md b/lib/js-api/src/api/search-rest-api/docs/RequestFacetFields.md new file mode 100644 index 0000000000..860f897dfd --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFacetFields.md @@ -0,0 +1,9 @@ +# RequestFacetFields + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facets** | [**RequestFacetField[]**](RequestFacetField.md) | Define specific fields on which to facet (adds SOLR facet.field and f.<field>.facet.* options) + | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFacetIntervals.md b/lib/js-api/src/api/search-rest-api/docs/RequestFacetIntervals.md new file mode 100644 index 0000000000..029d7bb18c --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFacetIntervals.md @@ -0,0 +1,9 @@ +# RequestFacetIntervals + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sets** | [**RequestFacetSet[]**](RequestFacetSet.md) | Sets the intervals for all fields. | [optional] [default to null] +**intervals** | [**RequestFacetIntervalsIntervals[]**](RequestFacetIntervalsIntervals.md) | Specifies the fields to facet by interval. | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFacetIntervals_intervals.md b/lib/js-api/src/api/search-rest-api/docs/RequestFacetIntervals_intervals.md new file mode 100644 index 0000000000..e6406e4299 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFacetIntervals_intervals.md @@ -0,0 +1,10 @@ +# RequestFacetIntervalsIntervals + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | The field to facet on | [optional] [default to null] +**label** | **string** | A label to use to identify the field facet | [optional] [default to null] +**sets** | [**RequestFacetSet[]**](RequestFacetSet.md) | Sets the intervals for all fields. | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFacetQueries.md b/lib/js-api/src/api/search-rest-api/docs/RequestFacetQueries.md new file mode 100644 index 0000000000..fd080a4477 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFacetQueries.md @@ -0,0 +1,7 @@ +# RequestFacetQueries + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFacetQueries_inner.md b/lib/js-api/src/api/search-rest-api/docs/RequestFacetQueries_inner.md new file mode 100644 index 0000000000..bb63e48cfc --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFacetQueries_inner.md @@ -0,0 +1,9 @@ +# RequestFacetQueriesInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | A facet query | [optional] [default to null] +**label** | **string** | A label to include in place of the facet query | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFacetSet.md b/lib/js-api/src/api/search-rest-api/docs/RequestFacetSet.md new file mode 100644 index 0000000000..ca4d74edff --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFacetSet.md @@ -0,0 +1,12 @@ +# RequestFacetSet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | A label to use to identify the set | [optional] [default to null] +**start** | **string** | The start of the range | [optional] [default to null] +**end** | **string** | The end of the range | [optional] [default to null] +**startInclusive** | **boolean** | When true, the set will include values greater or equal to \"start\" | [optional] [default to null] +**endInclusive** | **boolean** | When true, the set will include values less than or equal to \"end\" | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFields.md b/lib/js-api/src/api/search-rest-api/docs/RequestFields.md new file mode 100644 index 0000000000..6272ee2217 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFields.md @@ -0,0 +1,7 @@ +# RequestFields + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFilterQueries.md b/lib/js-api/src/api/search-rest-api/docs/RequestFilterQueries.md new file mode 100644 index 0000000000..1d392805b3 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFilterQueries.md @@ -0,0 +1,7 @@ +# RequestFilterQueries + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestFilterQueries_inner.md b/lib/js-api/src/api/search-rest-api/docs/RequestFilterQueries_inner.md new file mode 100644 index 0000000000..bae9e1539e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestFilterQueries_inner.md @@ -0,0 +1,11 @@ +# RequestFilterQueriesInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | The filter query expression. +For multi-select facets selected facets must be order together + | [optional] [default to null] +**tags** | **string[]** | Tags used exclude the filters from facet evaluation for multi-select facet support | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestHighlight.md b/lib/js-api/src/api/search-rest-api/docs/RequestHighlight.md new file mode 100644 index 0000000000..55093ddf4a --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestHighlight.md @@ -0,0 +1,15 @@ +# RequestHighlight + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prefix** | **string** | The string used to mark the start of a highlight in a fragment. | [optional] [default to null] +**postfix** | **string** | The string used to mark the end of a highlight in a fragment. | [optional] [default to null] +**snippetCount** | **number** | The maximum number of distinct highlight snippets to return for each highlight field. | [optional] [default to null] +**fragmentSize** | **number** | The character length of each snippet. | [optional] [default to null] +**maxAnalyzedChars** | **number** | The number of characters to be considered for highlighting. Matches after this count will not be shown. | [optional] [default to null] +**mergeContiguous** | **boolean** | If fragments over lap they can be merged into one larger fragment | [optional] [default to null] +**usePhraseHighlighter** | **boolean** | Should phrases be identified. | [optional] [default to null] +**fields** | [**RequestHighlightFields[]**](RequestHighlightFields.md) | The fields to highlight and field specific configuration properties for each field | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestHighlight_fields.md b/lib/js-api/src/api/search-rest-api/docs/RequestHighlight_fields.md new file mode 100644 index 0000000000..5c3028ac25 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestHighlight_fields.md @@ -0,0 +1,13 @@ +# RequestHighlightFields + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | The name of the field to highlight. | [optional] [default to null] +**snippetCount** | **number** | | [optional] [default to null] +**fragmentSize** | **number** | | [optional] [default to null] +**mergeContiguous** | **boolean** | | [optional] [default to null] +**prefix** | **string** | | [optional] [default to null] +**postfix** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestInclude.md b/lib/js-api/src/api/search-rest-api/docs/RequestInclude.md new file mode 100644 index 0000000000..39f9226278 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestInclude.md @@ -0,0 +1,7 @@ +# RequestInclude + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestLimits.md b/lib/js-api/src/api/search-rest-api/docs/RequestLimits.md new file mode 100644 index 0000000000..99e0463f2e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestLimits.md @@ -0,0 +1,9 @@ +# RequestLimits + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**permissionEvaluationTime** | **number** | Maximum time for post query permission evaluation | [optional] [default to null] +**permissionEvaluationCount** | **number** | Maximum count of post query permission evaluations | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestLocalization.md b/lib/js-api/src/api/search-rest-api/docs/RequestLocalization.md new file mode 100644 index 0000000000..0bdfc7dd0f --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestLocalization.md @@ -0,0 +1,9 @@ +# RequestLocalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timezone** | **string** | A valid timezone id supported by @see java.time.ZoneId | [optional] [default to null] +**locales** | **string[]** | A list of Locales defined by IETF BCP 47. The ordering is significant. The first locale (leftmost) is used for sort and query localization, whereas the remaining locales are used for query only. | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestPagination.md b/lib/js-api/src/api/search-rest-api/docs/RequestPagination.md new file mode 100644 index 0000000000..0ed6081fbb --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestPagination.md @@ -0,0 +1,9 @@ +# RequestPagination + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**maxItems** | **number** | The maximum number of items to return in the query results | [optional] [default to null] +**skipCount** | **number** | The number of items to skip from the start of the query set | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestPivot.md b/lib/js-api/src/api/search-rest-api/docs/RequestPivot.md new file mode 100644 index 0000000000..ab2f2968f2 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestPivot.md @@ -0,0 +1,9 @@ +# RequestPivot + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | A key corresponding to a matching field facet label or stats. | [optional] [default to null] +**pivots** | [**RequestPivot[]**](RequestPivot.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestQuery.md b/lib/js-api/src/api/search-rest-api/docs/RequestQuery.md new file mode 100644 index 0000000000..e7abe4efc2 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestQuery.md @@ -0,0 +1,23 @@ +# RequestQuery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**language** | **string** | The query language in which the query is written. | [optional] [default to null] +**userQuery** | **string** | The exact search request typed in by the user | [optional] [default to null] +**query** | **string** | The query which may have been generated in some way from the userQuery | [default to null] + + +<a name="RequestQuery.LanguageEnum"></a> +## Enum: RequestQuery.LanguageEnum + + +* `Afts` (value: `'afts'`) + +* `Lucene` (value: `'lucene'`) + +* `Cmis` (value: `'cmis'`) + + + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestRange.md b/lib/js-api/src/api/search-rest-api/docs/RequestRange.md new file mode 100644 index 0000000000..9603a4650e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestRange.md @@ -0,0 +1,16 @@ +# RequestRange + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | The name of the field to perform range | [optional] [default to null] +**start** | **string** | The start of the range | [optional] [default to null] +**end** | **string** | The end of the range | [optional] [default to null] +**gap** | **string** | Bucket size | [optional] [default to null] +**hardend** | **boolean** | If true means that the last bucket will end at “end” even if it is less than “gap” wide. | [optional] [default to null] +**other** | **string[]** | before, after, between, non, all | [optional] [default to null] +**include** | **string[]** | lower, upper, edge, outer, all | [optional] [default to null] +**label** | **string** | A label to include as a pivot reference | [optional] [default to null] +**excludeFilters** | **string[]** | Filter queries to exclude when calculating statistics | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestScope.md b/lib/js-api/src/api/search-rest-api/docs/RequestScope.md new file mode 100644 index 0000000000..10ccfb95a9 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestScope.md @@ -0,0 +1,22 @@ +# RequestScope + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**locations** | **string** | The locations to include in the query + | [optional] [default to null] + + +<a name="RequestScope.LocationsEnum"></a> +## Enum: RequestScope.LocationsEnum + + +* `Nodes` (value: `'nodes'`) + +* `Versions` (value: `'versions'`) + +* `DeletedNodes` (value: `'deleted-nodes'`) + + + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestSortDefinition.md b/lib/js-api/src/api/search-rest-api/docs/RequestSortDefinition.md new file mode 100644 index 0000000000..a5aa9b7509 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestSortDefinition.md @@ -0,0 +1,7 @@ +# RequestSortDefinition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestSortDefinition_inner.md b/lib/js-api/src/api/search-rest-api/docs/RequestSortDefinition_inner.md new file mode 100644 index 0000000000..9783e3d082 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestSortDefinition_inner.md @@ -0,0 +1,23 @@ +# RequestSortDefinitionInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | How to order - using a field, when position of the document in the index, score/relevance. | [optional] [default to null] +**field** | **string** | The name of the field | [optional] [default to null] +**ascending** | **boolean** | The sort order. (The ordering of nulls is determined by the SOLR configuration) | [optional] [default to null] + + +<a name="RequestSortDefinitionInner.TypeEnum"></a> +## Enum: RequestSortDefinitionInner.TypeEnum + + +* `FIELD` (value: `'FIELD'`) + +* `DOCUMENT` (value: `'DOCUMENT'`) + +* `SCORE` (value: `'SCORE'`) + + + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestSpellcheck.md b/lib/js-api/src/api/search-rest-api/docs/RequestSpellcheck.md new file mode 100644 index 0000000000..aef735876f --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestSpellcheck.md @@ -0,0 +1,8 @@ +# RequestSpellcheck + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestStats.md b/lib/js-api/src/api/search-rest-api/docs/RequestStats.md new file mode 100644 index 0000000000..22d39db006 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestStats.md @@ -0,0 +1,23 @@ +# RequestStats + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | The stats field | [optional] [default to null] +**label** | **string** | A label to include for reference the stats field | [optional] [default to null] +**min** | **boolean** | The minimum value of the field | [optional] [default to null] +**max** | **boolean** | The maximum value of the field | [optional] [default to null] +**sum** | **boolean** | The sum of all values of the field | [optional] [default to null] +**countValues** | **boolean** | The number which have a value for this field | [optional] [default to null] +**missing** | **boolean** | The number which do not have a value for this field | [optional] [default to null] +**mean** | **boolean** | The average | [optional] [default to null] +**stddev** | **boolean** | Standard deviation | [optional] [default to null] +**sumOfSquares** | **boolean** | Sum of all values squared | [optional] [default to null] +**distinctValues** | **boolean** | The set of all distinct values for the field (This can be very expensive to calculate) | [optional] [default to null] +**countDistinct** | **boolean** | The number of distinct values (This can be very expensive to calculate) | [optional] [default to null] +**cardinality** | **boolean** | A statistical approximation of the number of distinct values | [optional] [default to null] +**cardinalityAccuracy** | **number** | Number between 0.0 and 1.0 indicating how aggressively the algorithm should try to be accurate. Used with boolean cardinality flag. | [optional] [default to 0.3] +**excludeFilters** | **string[]** | A list of filters to exclude | [optional] [default to null] +**percentiles** | **number[]** | A list of percentile values, e.g. \"1,99,99.9\" | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestTemplates.md b/lib/js-api/src/api/search-rest-api/docs/RequestTemplates.md new file mode 100644 index 0000000000..853b1f814d --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestTemplates.md @@ -0,0 +1,7 @@ +# RequestTemplates + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/js-api/src/api/search-rest-api/docs/RequestTemplates_inner.md b/lib/js-api/src/api/search-rest-api/docs/RequestTemplates_inner.md new file mode 100644 index 0000000000..3827e5355b --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/RequestTemplates_inner.md @@ -0,0 +1,9 @@ +# RequestTemplatesInner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The template name | [optional] [default to null] +**template** | **string** | The template | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResponseConsistency.md b/lib/js-api/src/api/search-rest-api/docs/ResponseConsistency.md new file mode 100644 index 0000000000..4f86e95c67 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResponseConsistency.md @@ -0,0 +1,8 @@ +# ResponseConsistency + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lastTxId** | **number** | The id of the last indexed transaction | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultBuckets.md b/lib/js-api/src/api/search-rest-api/docs/ResultBuckets.md new file mode 100644 index 0000000000..1573a55074 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultBuckets.md @@ -0,0 +1,9 @@ +# ResultBuckets + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | The field name or its explicit label, if provided on the request | [optional] [default to null] +**buckets** | [**ResultBucketsBuckets[]**](ResultBucketsBuckets.md) | An array of buckets and values | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultBuckets_buckets.md b/lib/js-api/src/api/search-rest-api/docs/ResultBuckets_buckets.md new file mode 100644 index 0000000000..749a3a8365 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultBuckets_buckets.md @@ -0,0 +1,11 @@ +# ResultBucketsBuckets + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | The bucket label | [optional] [default to null] +**filterQuery** | **string** | The filter query you can use to apply this facet | [optional] [default to null] +**count** | **number** | The count for the bucket | [optional] [default to null] +**display** | **any** | An optional field for additional display information | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultNode.md b/lib/js-api/src/api/search-rest-api/docs/ResultNode.md new file mode 100644 index 0000000000..c7144c0177 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultNode.md @@ -0,0 +1,31 @@ +# ResultNode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [default to null] +**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. +The character . must not be used at the end of the name. + | [default to null] +**nodeType** | **string** | | [default to null] +**isFolder** | **boolean** | | [default to null] +**isFile** | **boolean** | | [default to null] +**isLocked** | **boolean** | | [optional] [default to null] +**modifiedAt** | [**Date**](Date.md) | | [default to null] +**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**createdAt** | [**Date**](Date.md) | | [default to null] +**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null] +**parentId** | **string** | | [optional] [default to null] +**isLink** | **boolean** | | [optional] [default to null] +**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null] +**aspectNames** | **string[]** | | [optional] [default to null] +**properties** | **any** | | [optional] [default to null] +**allowableOperations** | **string[]** | | [optional] [default to null] +**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null] +**search** | [**SearchEntry**](SearchEntry.md) | | [optional] [default to null] +**archivedByUser** | [**UserInfo**](UserInfo.md) | | [optional] [default to null] +**archivedAt** | [**Date**](Date.md) | | [optional] [default to null] +**versionLabel** | **string** | | [optional] [default to null] +**versionComment** | **string** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultSetContext.md b/lib/js-api/src/api/search-rest-api/docs/ResultSetContext.md new file mode 100644 index 0000000000..4df5f85992 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultSetContext.md @@ -0,0 +1,18 @@ +# ResultSetContext + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**consistency** | [**ResponseConsistency**](ResponseConsistency.md) | | [optional] [default to null] +**request** | [**SearchRequest**](SearchRequest.md) | | [optional] [default to null] +**facetQueries** | [**ResultSetContextFacetQueries[]**](ResultSetContextFacetQueries.md) | The counts from facet queries | [optional] [default to null] +**facetsFields** | [**ResultBuckets[]**](ResultBuckets.md) | The counts from field facets | [optional] [default to null] +**facets** | [**GenericFacetResponse[]**](GenericFacetResponse.md) | The faceted response | [optional] [default to null] +**spellcheck** | [**ResultSetContextSpellcheck[]**](ResultSetContextSpellcheck.md) | Suggested corrections + +If zero results were found for the original query then a single entry of type \"searchInsteadFor\" will be returned. +If alternatives were found that return more results than the original query they are returned as \"didYouMean\" options. +The highest quality suggestion is first. + | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultSetContext_facetQueries.md b/lib/js-api/src/api/search-rest-api/docs/ResultSetContext_facetQueries.md new file mode 100644 index 0000000000..de7229c37c --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultSetContext_facetQueries.md @@ -0,0 +1,10 @@ +# ResultSetContextFacetQueries + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | | [optional] [default to null] +**filterQuery** | **string** | The filter query you can use to apply this facet | [optional] [default to null] +**count** | **number** | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultSetContext_spellcheck.md b/lib/js-api/src/api/search-rest-api/docs/ResultSetContext_spellcheck.md new file mode 100644 index 0000000000..e62251a499 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultSetContext_spellcheck.md @@ -0,0 +1,20 @@ +# ResultSetContextSpellcheck + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | [optional] [default to null] +**suggestion** | **string[]** | A suggested alternative query | [optional] [default to null] + + +<a name="ResultSetContextSpellcheck.TypeEnum"></a> +## Enum: ResultSetContextSpellcheck.TypeEnum + + +* `SearchInsteadFor` (value: `'searchInsteadFor'`) + +* `DidYouMean` (value: `'didYouMean'`) + + + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultSetPaging.md b/lib/js-api/src/api/search-rest-api/docs/ResultSetPaging.md new file mode 100644 index 0000000000..5e0ab10a6f --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultSetPaging.md @@ -0,0 +1,8 @@ +# ResultSetPaging + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**ResultSetPagingList**](ResultSetPagingList.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultSetPaging_list.md b/lib/js-api/src/api/search-rest-api/docs/ResultSetPaging_list.md new file mode 100644 index 0000000000..c5dbdc3c6e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultSetPaging_list.md @@ -0,0 +1,10 @@ +# ResultSetPagingList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] [default to null] +**context** | [**ResultSetContext**](ResultSetContext.md) | | [optional] [default to null] +**entries** | [**ResultSetRowEntry[]**](ResultSetRowEntry.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/ResultSetRowEntry.md b/lib/js-api/src/api/search-rest-api/docs/ResultSetRowEntry.md new file mode 100644 index 0000000000..d77c25f7d5 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/ResultSetRowEntry.md @@ -0,0 +1,8 @@ +# ResultSetRowEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entry** | [**ResultNode**](ResultNode.md) | | [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/SearchApi.md b/lib/js-api/src/api/search-rest-api/docs/SearchApi.md new file mode 100644 index 0000000000..5d70156516 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/SearchApi.md @@ -0,0 +1,359 @@ +# SearchApi + +All URIs are relative to *https://localhost/alfresco/api/-default-/public/search/versions/1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**search**](SearchApi.md#search) | **POST** /search | Searches Alfresco + + +<a name="search"></a> +# **search** +> ResultSetPaging search(queryBody) + +Searches Alfresco + +**Note**: this endpoint is available in Alfresco 5.2 and newer versions. + +**You specify all the parameters in this API in a JSON body**, URL parameters are not supported. +A basic query looks like this: + +JSON +{ + \"query\": { + \"query\": \"foo\" + } +} + + +**Note:** These are the minimum possible query parameters. + +The default search language is **afts** ([Alfresco Full Text Search](http://docs.alfresco.com/5.1/concepts/rm-searchsyntax-intro.html)), but you can also specify **cmis**, and **lucene**. + +A basic CMIS query looks like this: + +JSON +{ + \"query\": { + \"query\": \"select * from cmis:folder\", + \"language\": \"cmis\" + } +} + + +By default, **results are limited to the first 100.** +Results can be restricted using \"paging\". For example: +JSON +\"paging\": { + \"maxItems\": \"50\", + \"skipCount\": \"28\" +} + +This example would ensure that results are **limited by Final Size**, +skipping the first 28 results and returning the next 50. + +Alternatively, you can limit the results by using the **limits JSON body parameter**. For example, +JSON +\"limits\": { + \"permissionEvaluationTime\": 20000, + \"permissionEvaluationCount\": 2000 +} + + +You can use the **include JSON body parameter** to return additional information. +This works in the same way as in the /nodes/{nodeId}/children method in the core API. For example: +JSON +\"include\": [\"aspectNames\", \"properties\", \"isLink\"] + + +You can use the **fields JSON body parameter** to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. +This works in the same way as in the /nodes/{nodeId}/children method in the core API. For example: +JSON +\"fields\": [\"id\", \"name\", \"search\"] + + +You can sort the results using the **sort JSON body parameter**, for example: +JSON +\"sort\": [{\"type\":\"FIELD\", \"field\":\"cm:description\", \"ascending\":\"true\"}] + +**Note:** the **sort** parameter is not supported for CMIS queries. + +By default, search uses the **\"nodes\" location**, which is the **content store known as workspace://SpacesStore**. +To change the scope to another location you can use the **locations JSON body parameter**. You can specify either **nodes** (the default), **versions** or **deleted-nodes**. For example, +JSON +\"scope\": { + \"locations\": [\"deleted-nodes\"] +} + +You can specify templates using the **templates JSON body parameter**, for example: +JSON +\"templates\": [{\"name\": \"_PERSON\",\"template\": \"|%firstName OR |%lastName OR |%userName\"}, + {\"name\": \"mytemplate\",\"template\": \"%cm:content\"}] + + +**Note: Spell checking only works on Search Services (Solr 6) if you have already enabled suggestions.** + +For **spell checking** you can use a query like this: +JSON +{ + \"query\": { + \"query\": \"cm:title:alfrezco\" + }, + \"spellcheck\": {\"query\": \"alfrezco\"} +} + + +If you are already specifying \"userQuery\" then the following may be easier +and produces the same result : +JSON +{ + \"query\": { + \"query\": \"cm:title:alfrezco\", + \"userQuery\": \"alfrezco\" + }, + \"spellcheck\": {} +} + + +The spellcheck response includes a spellCheck context like this: +JSON +\"context\": { + \"spellCheck\": { + \"type\": \"searchInsteadFor\", + \"suggestions\": [\"alfresco\"] + } +}, + + +To specify defaults, you use a **defaults JSON body parameter**, for example: +JSON +\"defaults\": { + \"textAttributes\": [ + \"cm:content\", \"cm:name\" + ], + \"defaultFTSOperator\": \"AND\", + \"defaultFTSFieldOperator\": \"OR\", + \"namespace\": \"cm\", + \"defaultFieldName\": \"PATH\" +} + + +You can specify several filter queries using the **filterQueries JSON body parameter**, for example: +JSON +\"filterQueries\": [{\"query\": \"TYPE:'cm:folder'\"},{\"query\": \"cm:creator:mjackson\"}] + + +You can specify several facet queries using the **facetQueries JSON body parameter**, for example: +JSON +\"facetQueries\": [{\"query\": \"created:2016\",\"label\": \"CreatedThisYear\"}] + +The response will contain a matching \"context\" section, the \"label\" will match the facet query. +JSON +\"context\": { + \"facetQueries\": [ + {\"label\": \"CreatedThisYear\",\"count\": 3} + ] +}, + + +A complete query for facetting via the content.size field looks this: +JSON +{ + \"query\": { + \"query\": \"presentation\", + \"language\": \"afts\" + }, + \"facetQueries\": [ + {\"query\": \"content.size:[0 TO 10240]\", \"label\": \"xtra small\"}, + {\"query\": \"content.size:[10240 TO 102400]\", \"label\": \"small\"}, + {\"query\": \"content.size:[102400 TO 1048576]\", \"label\": \"medium\"}, + {\"query\": \"content.size:[1048576 TO 16777216]\", \"label\": \"large\"}, + {\"query\": \"content.size:[16777216 TO 134217728]\", \"label\": \"xtra large\"}, + {\"query\": \"content.size:[134217728 TO MAX]\", \"label\": \"XX large\"} + ], + \"facetFields\": {\"facets\": [{\"field\": \"'content.size'\"}]} +} + + +The response will contain a matching \"context\" section, the \"label\" will match the facet query. +JSON +\"context\": { + \"facetQueries\": [ + { \"label\": \"small\",\"count\": 2 }, + { \"label\": \"large\",\"count\": 0 }, + { \"label\": \"xtra small\",\"count\": 5 }, + { \"label\": \"xtra large\",\"count\": 56}, + { \"label\": \"medium\",\"count\": 4 }, + { \"label\": \"XX large\", \"count\": 1 } + ] +}, + + +You can specify several facet fields using the **facetFields JSON body parameter**, for example: +JSON +\"facetFields\": {\"facets\": [{\"field\": \"creator\", \"mincount\": 1}, {\"field\": \"modifier\", \"mincount\": 1}]} + +The response will contain a matching \"context\" section, the \"label\" will match the facet field. +JSON +\"context\": { + \"facetsFields\": [ + { \"label\": \"creator\", + \"buckets\": [ + { \"label\": \"System\", \"count\": 75 }, + { \"label\": \"mjackson\", \"count\": 5 } + ]}, + { \"label\": \"modifier\", + \"buckets\": [ + { \"label\": \"System\", \"count\": 72 }, + { \"label\": \"mjackson\", \"count\": 5 }, + { \"label\": \"admin\", \"count\": 3 } + ]} + ] +}, + + +Grouping facet queries that go together can be done by specifying the group label in the fact queries as follow: +JSON + { + \"query\": { + \"query\": \"presentation\" + }, + \"facetQueries\": [ + {\"query\": \"content.size:[0 TO 102400]\", \"label\": \"small\", \"group\":\"foo\"}, + {\"query\": \"content.size:[102400 TO 1048576]\", \"label\": \"medium\",\"group\":\"foo\"}, + {\"query\": \"content.size:[1048576 TO 16777216]\", \"label\": \"large\",\"group\":\"foo\"} + ] + } + +The above query returns the results a faceted field grouped under the label foo: +JSON +{ + \"context\": {\"facetsFields\": [{ + \"label\": \"foo\", + \"buckets\": [ + { + \"count\": 109, + \"label\": \"small\", + \"filterQuery\": \"content.size:[0 TO 102400]\" + }, + { + \"count\": 0, + \"label\": \"large\", + \"filterQuery\": \"content.size:[1048576 TO 16777216]\" + }, + { + \"count\": 0, + \"label\": \"medium\", + \"filterQuery\": \"content.size:[102400 TO 1048576]\" + } + ] + }] +} + +Range Faceting is supported by the **ranges JSON body parameter**, for example: +JSON + { + \"query\": { + \"query\": \"presentation\" + }, + \"ranges\": [ + { + \"field\": \"content.size\", + \"start\": \"0\", + \"end\": \"100\", + \"gap\": \"20\", + \"hardend\": true + }, + { + \"field\": \"created\", + \"start\": \"2015-09-29T10:45:15.729Z\", + \"end\": \"2016-09-29T10:45:15.729Z\", + \"gap\": \"+100DAY\" + }] + } + +An example query for **search highlighting** could look like this: +JSON +{ + \"query\": { + \"query\": \"description:workflow\", + \"userQuery\":\"workflow\" + }, + \"highlight\": { + \"prefix\": \"¿\", + \"postfix\": \"?\", + \"mergeContiguous\": true, + \"fields\": [ + { + \"field\": \"cm:title\" + }, + { + \"field\": \"description\", + \"prefix\": \"(\", + \"postfix\": \")\" + } + + ] + } +} + +The example above changes the highlighting prefix and postfix from the + default <em> for all fields to ¿? and just for the \"description\" field to (). + The highlight information is added in each node entry response; here is + an example partial response: + +\"entry\": { + \"createdAt\": \"2016-10-12T15:24:31.202+0000\", + \"isFolder\": true, + \"search\": { + \"score\": 1, + \"highlight\": [ + { + \"field\": \"cm:title\", + \"snippets\": [ + \"Customized ¿Workflow? Process Definitions\" + ] + }, + { + \"field\": \"description\", + \"snippets\": [ + \"Customized (Workflow) Process Definitions\" + ] + } + ] + }, + + + +### Example +```javascript +import SearchApi from 'SearchApi'; +import { AlfrescoApi } from '@alfresco/js-api'; + +this.alfrescoApi = new AlfrescoApi(); +this.alfrescoApi.setConfig({ + hostEcm: 'http://127.0.0.1:8080' +}); + +let searchApi = new SearchApi(this.alfrescoApi); + + +searchApi.search(queryBody).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryBody** | [**SearchRequest**](SearchRequest.md)| Generic query API + | + +### Return type + +[**ResultSetPaging**](ResultSetPaging.md) + diff --git a/lib/js-api/src/api/search-rest-api/docs/SearchEntry.md b/lib/js-api/src/api/search-rest-api/docs/SearchEntry.md new file mode 100644 index 0000000000..8110dd636e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/SearchEntry.md @@ -0,0 +1,10 @@ +# SearchEntry + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**score** | **number** | The score for this row | [optional] [default to null] +**highlight** | [**SearchEntryHighlight[]**](SearchEntryHighlight.md) | Highlight fragments if requested and available. A match can happen in any of the requested field. + | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/SearchEntry_highlight.md b/lib/js-api/src/api/search-rest-api/docs/SearchEntry_highlight.md new file mode 100644 index 0000000000..8f4d4e3eb0 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/SearchEntry_highlight.md @@ -0,0 +1,9 @@ +# SearchEntryHighlight + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | The field where a match occurred (one of the fields defined on the request) | [optional] [default to null] +**snippets** | **string[]** | Any number of snippets for the specified field highlighting the matching text | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/SearchRequest.md b/lib/js-api/src/api/search-rest-api/docs/SearchRequest.md new file mode 100644 index 0000000000..948879c40c --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/SearchRequest.md @@ -0,0 +1,27 @@ +# SearchRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | [**RequestQuery**](RequestQuery.md) | | [default to null] +**paging** | [**RequestPagination**](RequestPagination.md) | | [optional] [default to null] +**include** | [**RequestInclude**](RequestInclude.md) | | [optional] [default to null] +**includeRequest** | **boolean** | When true, include the original request in the response | [optional] [default to null] +**fields** | [**RequestFields**](RequestFields.md) | | [optional] [default to null] +**sort** | [**RequestSortDefinition**](RequestSortDefinition.md) | | [optional] [default to null] +**templates** | [**RequestTemplates**](RequestTemplates.md) | | [optional] [default to null] +**defaults** | [**RequestDefaults**](RequestDefaults.md) | | [optional] [default to null] +**localization** | [**RequestLocalization**](RequestLocalization.md) | | [optional] [default to null] +**filterQueries** | [**RequestFilterQueries**](RequestFilterQueries.md) | | [optional] [default to null] +**facetQueries** | [**RequestFacetQueries**](RequestFacetQueries.md) | | [optional] [default to null] +**facetFields** | [**RequestFacetFields**](RequestFacetFields.md) | | [optional] [default to null] +**facetIntervals** | [**RequestFacetIntervals**](RequestFacetIntervals.md) | | [optional] [default to null] +**pivots** | [**RequestPivot[]**](RequestPivot.md) | | [optional] [default to null] +**stats** | [**RequestStats[]**](RequestStats.md) | | [optional] [default to null] +**spellcheck** | [**RequestSpellcheck**](RequestSpellcheck.md) | | [optional] [default to null] +**scope** | [**RequestScope**](RequestScope.md) | | [optional] [default to null] +**limits** | [**RequestLimits**](RequestLimits.md) | | [optional] [default to null] +**highlight** | [**RequestHighlight**](RequestHighlight.md) | | [optional] [default to null] +**ranges** | [**RequestRange[]**](RequestRange.md) | | [optional] [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/docs/UserInfo.md b/lib/js-api/src/api/search-rest-api/docs/UserInfo.md new file mode 100644 index 0000000000..a700a426c0 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/docs/UserInfo.md @@ -0,0 +1,9 @@ +# UserInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**displayName** | **string** | | [default to null] +**id** | **string** | | [default to null] + + diff --git a/lib/js-api/src/api/search-rest-api/index.ts b/lib/js-api/src/api/search-rest-api/index.ts new file mode 100644 index 0000000000..6eadb2eda9 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api'; +export * from './model'; diff --git a/lib/js-api/src/api/search-rest-api/model/contentInfo.ts b/lib/js-api/src/api/search-rest-api/model/contentInfo.ts new file mode 100644 index 0000000000..8f764a6b8b --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/contentInfo.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ContentInfo { + mimeType: string; + mimeTypeName: string; + sizeInBytes: number; + encoding?: string; + mimeTypeGroup?: string; +} diff --git a/lib/js-api/src/api/search-rest-api/model/genericBucket.ts b/lib/js-api/src/api/search-rest-api/model/genericBucket.ts new file mode 100644 index 0000000000..d636a128ae --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/genericBucket.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GenericBucketBucketInfo } from './genericBucketBucketInfo'; +import { GenericMetric } from './genericMetric'; + +/** + * A bucket of facet results + */ +export interface GenericBucket { + /** + * The bucket label + */ + label?: string; + /** + * The filter query you can use to apply this facet + */ + filterQuery?: string; + /** + * An optional field for additional display information + */ + display?: any; + /** + * An array of buckets and values + */ + metrics?: GenericMetric[]; + /** + * Additional list of nested facets + */ + facets?: any[]; + bucketInfo?: GenericBucketBucketInfo; +} diff --git a/lib/js-api/src/api/search-rest-api/model/genericBucketBucketInfo.ts b/lib/js-api/src/api/search-rest-api/model/genericBucketBucketInfo.ts new file mode 100644 index 0000000000..ceeacfcf12 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/genericBucketBucketInfo.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Additional information of nested facet + */ +export interface GenericBucketBucketInfo { + /** + * The start of range + */ + start?: string; + /** + * Includes values greater or equal to \"start\" + */ + startInclusive?: boolean; + /** + * The end of range + */ + end?: string; + /** + * Includes values less than or equal to \"end\" + */ + endInclusive?: boolean; +} diff --git a/lib/js-api/src/api/search-rest-api/model/genericFacetResponse.ts b/lib/js-api/src/api/search-rest-api/model/genericFacetResponse.ts new file mode 100644 index 0000000000..b3d0e5d1a6 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/genericFacetResponse.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GenericBucket } from './genericBucket'; + +export interface GenericFacetResponse { + /** + * The facet type, eg. interval, range, pivot, stats + */ + type?: string; + /** + * The field name or its explicit label, if provided on the request + */ + label?: string; + /** + * An array of buckets and values + */ + buckets?: GenericBucket[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/genericMetric.ts b/lib/js-api/src/api/search-rest-api/model/genericMetric.ts new file mode 100644 index 0000000000..1ac75f8863 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/genericMetric.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A metric used in faceting + */ +export interface GenericMetric { + /** + * The type of metric, e.g. count + */ + type?: string; + /** + * The metric value, e.g. {\"count\": 34} + */ + value?: any; +} diff --git a/lib/js-api/src/api/search-rest-api/model/index.ts b/lib/js-api/src/api/search-rest-api/model/index.ts new file mode 100644 index 0000000000..8016139a5e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/index.ts @@ -0,0 +1,61 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './genericBucket'; +export * from './genericBucketBucketInfo'; +export * from './genericFacetResponse'; +export * from './genericMetric'; +export * from './requestDefaults'; +export * from './requestFacetField'; +export * from './requestFacetFields'; +export * from './requestFacetIntervals'; +export * from './requestFacetIntervalsIntervals'; +export * from './requestFacetQueries'; +export * from './requestFacetQueriesInner'; +export * from './requestFacetSet'; +export * from './requestFields'; +export * from './requestFilterQueries'; +export * from './requestFilterQueriesInner'; +export * from './requestHighlight'; +export * from './requestHighlightFields'; +export * from './requestInclude'; +export * from './requestLimits'; +export * from './requestLocalization'; +export * from './requestPagination'; +export * from './requestPivot'; +export * from './requestQuery'; +export * from './requestRange'; +export * from './requestScope'; +export * from './requestSortDefinition'; +export * from './requestSortDefinitionInner'; +export * from './requestSpellcheck'; +export * from './requestStats'; +export * from './requestTemplates'; +export * from './requestTemplatesInner'; +export * from './responseConsistency'; +export * from './resultBuckets'; +export * from './resultBucketsBuckets'; +export * from './resultSetContext'; +export * from './resultSetContextFacetQueries'; +export * from './resultSetContextSpellcheck'; +export * from './resultSetPaging'; +export * from './resultSetPagingList'; +export * from './resultSetRowEntry'; +export * from './searchEntry'; +export * from './searchEntryHighlight'; +export * from './searchRequest'; +export * from './resultNode'; diff --git a/lib/js-api/src/api/search-rest-api/model/requestDefaults.ts b/lib/js-api/src/api/search-rest-api/model/requestDefaults.ts new file mode 100644 index 0000000000..773ff4b6e0 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestDefaults.ts @@ -0,0 +1,45 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Common query defaults + */ +export interface RequestDefaults { + /** + * A list of query fields/properties used to expand TEXT: queries. + * The default is cm:content. + * You could include all content properties using d:content or list all individual content properties or types. + * As more terms are included the query size, complexity, memory impact and query time will increase. + */ + textAttributes?: string[]; + /** + * The default way to combine query parts when AND or OR is not explicitly stated - includes ! - + + * one two three + * (one two three) + */ + defaultFTSOperator?: 'AND' | 'OR' | string; + /** + * The default way to combine query parts in field query groups when AND or OR is not explicitly stated - includes ! - + + * FIELD:(one two three) + */ + defaultFTSFieldOperator?: 'AND' | 'OR' | string; + /** + * The default name space to use if one is not provided + */ + namespace?: string; + defaultFieldName?: string; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFacetField.ts b/lib/js-api/src/api/search-rest-api/model/requestFacetField.ts new file mode 100644 index 0000000000..d0051a0e3e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFacetField.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A simple facet field + */ +export interface RequestFacetField { + /** + * The facet field + */ + field?: string; + /** + * A label to include in place of the facet field + */ + label?: string; + /** + * Restricts the possible constraints to only indexed values with a specified prefix. + */ + prefix?: string; + sort?: 'COUNT' | 'INDEX' | string; + method?: 'ENUM' | 'FC' | string; + /** + * When true, count results that match the query but which have no facet value for the field (in addition to the Term-based constraints). + */ + missing?: boolean; + limit?: number; + offset?: number; + /** + * The minimum count required for a facet field to be included in the response. + */ + mincount?: number; + facetEnumCacheMinDf?: number; + /** + * Filter Queries with tags listed here will not be included in facet counts. + * This is used for multi-select facetting. + */ + excludeFilters?: string[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFacetFields.ts b/lib/js-api/src/api/search-rest-api/model/requestFacetFields.ts new file mode 100644 index 0000000000..ca34d645f5 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFacetFields.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestFacetField } from './requestFacetField'; + +/** + * Simple facet fields to include + * The Properties reflect the global properties related to field facts in SOLR. + * They are described in detail by the SOLR documentation + */ +export interface RequestFacetFields { + /** + * Define specific fields on which to facet (adds SOLR facet.field and f.<field>.facet.* options) + */ + facets?: RequestFacetField[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFacetIntervals.ts b/lib/js-api/src/api/search-rest-api/model/requestFacetIntervals.ts new file mode 100644 index 0000000000..4b44781504 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFacetIntervals.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestFacetIntervalsIntervals } from './requestFacetIntervalsIntervals'; +import { RequestFacetSet } from './requestFacetSet'; + +/** + * Facet Intervals + */ +export interface RequestFacetIntervals { + /** + * Sets the intervals for all fields. + */ + sets?: RequestFacetSet[]; + /** + * Specifies the fields to facet by interval. + */ + intervals?: RequestFacetIntervalsIntervals[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFacetIntervalsIntervals.ts b/lib/js-api/src/api/search-rest-api/model/requestFacetIntervalsIntervals.ts new file mode 100644 index 0000000000..3dfc546dc6 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFacetIntervalsIntervals.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestFacetSet } from './requestFacetSet'; + +export interface RequestFacetIntervalsIntervals { + /** + * The field to facet on + */ + field?: string; + /** + * A label to use to identify the field facet + */ + label?: string; + /** + * Sets the intervals for all fields. + */ + sets?: RequestFacetSet[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFacetQueries.ts b/lib/js-api/src/api/search-rest-api/model/requestFacetQueries.ts new file mode 100644 index 0000000000..a1500fdfd1 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFacetQueries.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestFacetQueriesInner } from './requestFacetQueriesInner'; + +/** + * Facet queries to include + */ +export interface RequestFacetQueries extends Array<RequestFacetQueriesInner> {} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFacetQueriesInner.ts b/lib/js-api/src/api/search-rest-api/model/requestFacetQueriesInner.ts new file mode 100644 index 0000000000..4d6c12947b --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFacetQueriesInner.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RequestFacetQueriesInner { + /** + * A facet query + */ + query?: string; + /** + * A label to include in place of the facet query + */ + label?: string; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFacetSet.ts b/lib/js-api/src/api/search-rest-api/model/requestFacetSet.ts new file mode 100644 index 0000000000..d2969b5691 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFacetSet.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interval to Set + */ +export interface RequestFacetSet { + /** + * A label to use to identify the set + */ + label?: string; + /** + * The start of the range + */ + start?: string; + /** + * The end of the range + */ + end?: string; + /** + * When true, the set will include values greater or equal to \"start\" + */ + startInclusive?: boolean; + /** + * When true, the set will include values less than or equal to \"end\" + */ + endInclusive?: boolean; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFields.ts b/lib/js-api/src/api/search-rest-api/model/requestFields.ts new file mode 100644 index 0000000000..2264234950 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFields.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A list of field names. +You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. +The list applies to a returned individual entity or entries within a collection. +If the **include** parameter is used as well then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. + */ +export interface RequestFields extends Array<string> {} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFilterQueries.ts b/lib/js-api/src/api/search-rest-api/model/requestFilterQueries.ts new file mode 100644 index 0000000000..0491c85dee --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFilterQueries.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestFilterQueriesInner } from './requestFilterQueriesInner'; + +/** + * Filter Queries. Constraints that apply to the results set but do not affect the score of each entry. + */ +export interface RequestFilterQueries extends Array<RequestFilterQueriesInner> {} diff --git a/lib/js-api/src/api/search-rest-api/model/requestFilterQueriesInner.ts b/lib/js-api/src/api/search-rest-api/model/requestFilterQueriesInner.ts new file mode 100644 index 0000000000..54f2448bdb --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestFilterQueriesInner.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RequestFilterQueriesInner { + /** + * The filter query expression. + * For multi-select facets selected facets must be order together + */ + query?: string; + /** + * Tags used exclude the filters from facet evaluation for multi-select facet support + */ + tags?: string[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestHighlight.ts b/lib/js-api/src/api/search-rest-api/model/requestHighlight.ts new file mode 100644 index 0000000000..bbd2e387bf --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestHighlight.ts @@ -0,0 +1,57 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestHighlightFields } from './requestHighlightFields'; + +/** + * Request that highlight fragments to be added to result set rows + * The properties reflect SOLR highlighting parameters. + */ +export interface RequestHighlight { + /** + * The string used to mark the start of a highlight in a fragment. + */ + prefix?: string; + /** + * The string used to mark the end of a highlight in a fragment. + */ + postfix?: string; + /** + * The maximum number of distinct highlight snippets to return for each highlight field. + */ + snippetCount?: number; + /** + * The character length of each snippet. + */ + fragmentSize?: number; + /** + * The number of characters to be considered for highlighting. Matches after this count will not be shown. + */ + maxAnalyzedChars?: number; + /** + * If fragments over lap they can be merged into one larger fragment + */ + mergeContiguous?: boolean; + /** + * Should phrases be identified. + */ + usePhraseHighlighter?: boolean; + /** + * The fields to highlight and field specific configuration properties for each field + */ + fields?: RequestHighlightFields[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestHighlightFields.ts b/lib/js-api/src/api/search-rest-api/model/requestHighlightFields.ts new file mode 100644 index 0000000000..84d0ce49c6 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestHighlightFields.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RequestHighlightFields { + /** + * The name of the field to highlight. + */ + field?: string; + snippetCount?: number; + fragmentSize?: number; + mergeContiguous?: boolean; + prefix?: string; + postfix?: string; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestInclude.ts b/lib/js-api/src/api/search-rest-api/model/requestInclude.ts new file mode 100644 index 0000000000..6f9a115d36 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestInclude.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Returns additional information about the node. The following optional fields can be requested: + * properties + * aspectNames + * path + * isLink + * allowableOperations + * association + */ +export interface RequestInclude extends Array<string> {} diff --git a/lib/js-api/src/api/search-rest-api/model/requestLimits.ts b/lib/js-api/src/api/search-rest-api/model/requestLimits.ts new file mode 100644 index 0000000000..6e5b81f8f4 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestLimits.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Limit the time and resources used for query execution + */ +export interface RequestLimits { + /** + * Maximum time for post query permission evaluation + */ + permissionEvaluationTime?: number; + /** + * Maximum count of post query permission evaluations + */ + permissionEvaluationCount?: number; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestLocalization.ts b/lib/js-api/src/api/search-rest-api/model/requestLocalization.ts new file mode 100644 index 0000000000..4ff937070c --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestLocalization.ts @@ -0,0 +1,30 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Localization settings + */ +export interface RequestLocalization { + /** + * A valid timezone id supported by @see java.time.ZoneId + */ + timezone?: string; + /** + * A list of Locales defined by IETF BCP 47. The ordering is significant. The first locale (leftmost) is used for sort and query localization, whereas the remaining locales are used for query only. + */ + locales?: string[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestPagination.ts b/lib/js-api/src/api/search-rest-api/model/requestPagination.ts new file mode 100644 index 0000000000..6ca4c9557e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestPagination.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RequestPagination { + /** + * The maximum number of items to return in the query results + */ + maxItems?: number; + /** + * The number of items to skip from the start of the query set + */ + skipCount?: number; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestPivot.ts b/lib/js-api/src/api/search-rest-api/model/requestPivot.ts new file mode 100644 index 0000000000..9825bde0e9 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestPivot.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A list of pivots. + */ +export interface RequestPivot { + /** + * A key corresponding to a matching field facet label or stats. + */ + key?: string; + pivots?: RequestPivot[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestQuery.ts b/lib/js-api/src/api/search-rest-api/model/requestQuery.ts new file mode 100644 index 0000000000..6e4f9cd2e6 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestQuery.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Query. + */ +export interface RequestQuery { + /** + * The query language in which the query is written. + */ + language?: 'afts' | 'lucene' | 'cmis' | string; + /** + * The exact search request typed in by the user + */ + userQuery?: string; + /** + * The query which may have been generated in some way from the userQuery + */ + query: string; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestRange.ts b/lib/js-api/src/api/search-rest-api/model/requestRange.ts new file mode 100644 index 0000000000..3396886b07 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestRange.ts @@ -0,0 +1,58 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Facet range + */ +export interface RequestRange { + /** + * The name of the field to perform range + */ + field?: string; + /** + * The start of the range + */ + start?: string; + /** + * The end of the range + */ + end?: string; + /** + * Bucket size + */ + gap?: string; + /** + * If true means that the last bucket will end at “end” even if it is less than “gap” wide. + */ + hardend?: boolean; + /** + * before, after, between, non, all + */ + other?: string[]; + /** + * lower, upper, edge, outer, all + */ + include?: string[]; + /** + * A label to include as a pivot reference + */ + label?: string; + /** + * Filter queries to exclude when calculating statistics + */ + excludeFilters?: string[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestScope.ts b/lib/js-api/src/api/search-rest-api/model/requestScope.ts new file mode 100644 index 0000000000..cda4a242ac --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestScope.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Scope + */ +export interface RequestScope { + /** + * The locations to include in the query + */ + locations?: 'nodes' | 'versions' | 'deleted-nodes' | string; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestSortDefinition.ts b/lib/js-api/src/api/search-rest-api/model/requestSortDefinition.ts new file mode 100644 index 0000000000..774c6d22cf --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestSortDefinition.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestSortDefinitionInner } from './requestSortDefinitionInner'; + +/** + * How to sort the rows? An array of sort specifications. The array order defines the ordering precedence. + */ +export interface RequestSortDefinition extends Array<RequestSortDefinitionInner> {} diff --git a/lib/js-api/src/api/search-rest-api/model/requestSortDefinitionInner.ts b/lib/js-api/src/api/search-rest-api/model/requestSortDefinitionInner.ts new file mode 100644 index 0000000000..738ccb6fa2 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestSortDefinitionInner.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RequestSortDefinitionInner { + /** + * How to order - using a field, when position of the document in the index, score/relevance. + */ + type?: 'FIELD' | 'DOCUMENT' | 'SCORE' | string; + /** + * The name of the field + */ + field?: string; + /** + * The sort order. (The ordering of nulls is determined by the SOLR configuration) + */ + ascending?: boolean; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestSpellcheck.ts b/lib/js-api/src/api/search-rest-api/model/requestSpellcheck.ts new file mode 100644 index 0000000000..7a9eba6a46 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestSpellcheck.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Request that spellcheck fragments to be added to result set rows + * The properties reflect SOLR spellcheck parameters. + */ +export interface RequestSpellcheck { + query?: string; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestStats.ts b/lib/js-api/src/api/search-rest-api/model/requestStats.ts new file mode 100644 index 0000000000..431809ebed --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestStats.ts @@ -0,0 +1,86 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A list of stats request. + */ +export interface RequestStats { + /** + * The stats field + */ + field?: string; + /** + * A label to include for reference the stats field + */ + label?: string; + /** + * The minimum value of the field + */ + min?: boolean; + /** + * The maximum value of the field + */ + max?: boolean; + /** + * The sum of all values of the field + */ + sum?: boolean; + /** + * The number which have a value for this field + */ + countValues?: boolean; + /** + * The number which do not have a value for this field + */ + missing?: boolean; + /** + * The average + */ + mean?: boolean; + /** + * Standard deviation + */ + stddev?: boolean; + /** + * Sum of all values squared + */ + sumOfSquares?: boolean; + /** + * The set of all distinct values for the field (This can be very expensive to calculate) + */ + distinctValues?: boolean; + /** + * The number of distinct values (This can be very expensive to calculate) + */ + countDistinct?: boolean; + /** + * A statistical approximation of the number of distinct values + */ + cardinality?: boolean; + /** + * Number between 0.0 and 1.0 indicating how aggressively the algorithm should try to be accurate. Used with boolean cardinality flag. + */ + cardinalityAccuracy?: number; + /** + * A list of filters to exclude + */ + excludeFilters?: string[]; + /** + * A list of percentile values, e.g. \"1,99,99.9\" + */ + percentiles?: number[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/requestTemplates.ts b/lib/js-api/src/api/search-rest-api/model/requestTemplates.ts new file mode 100644 index 0000000000..e72551d682 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestTemplates.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestTemplatesInner } from './requestTemplatesInner'; + +/** + * Templates used for query expansion. + * A template called \"WOOF\" defined as \"%(cm:name cm:title)\" allows + * WOOF:example + * to generate + * cm:name:example cm:name:example + */ +export interface RequestTemplates extends Array<RequestTemplatesInner> {} diff --git a/lib/js-api/src/api/search-rest-api/model/requestTemplatesInner.ts b/lib/js-api/src/api/search-rest-api/model/requestTemplatesInner.ts new file mode 100644 index 0000000000..ea6f22b08a --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/requestTemplatesInner.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface RequestTemplatesInner { + /** + * The template name + */ + name?: string; + /** + * The template + */ + template?: string; +} diff --git a/lib/js-api/src/api/search-rest-api/model/responseConsistency.ts b/lib/js-api/src/api/search-rest-api/model/responseConsistency.ts new file mode 100644 index 0000000000..5e5a4cf4a1 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/responseConsistency.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The consistency state of the index used to execute the query + */ +export interface ResponseConsistency { + /** + * The id of the last indexed transaction + */ + lastTxId?: number; +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultBuckets.ts b/lib/js-api/src/api/search-rest-api/model/resultBuckets.ts new file mode 100644 index 0000000000..d669ed955e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultBuckets.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultBucketsBuckets } from './resultBucketsBuckets'; + +export interface ResultBuckets { + /** + * The field name or its explicit label, if provided on the request + */ + label?: string; + /** + * An array of buckets and values + */ + buckets?: ResultBucketsBuckets[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultBucketsBuckets.ts b/lib/js-api/src/api/search-rest-api/model/resultBucketsBuckets.ts new file mode 100644 index 0000000000..023f85c196 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultBucketsBuckets.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ResultBucketsBuckets { + /** + * The bucket label + */ + label?: string; + /** + * The filter query you can use to apply this facet + */ + filterQuery?: string; + /** + * The count for the bucket + */ + count?: number; + /** + * An optional field for additional display information + */ + display?: any; +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultNode.ts b/lib/js-api/src/api/search-rest-api/model/resultNode.ts new file mode 100644 index 0000000000..b9ff3199d0 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultNode.ts @@ -0,0 +1,63 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ContentInfo, PathInfo, UserInfo } from '../../content-rest-api'; +import { DateAlfresco } from '../../content-custom-api'; +import { SearchEntry } from './searchEntry'; + +export class ResultNode { + id: string; + /** + * The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. + * The character . must not be used at the end of the name. + */ + name: string; + nodeType: string; + isFolder: boolean; + isFile: boolean; + isLocked?: boolean; + modifiedAt?: Date; + modifiedByUser?: UserInfo; + createdAt?: Date; + createdByUser?: UserInfo; + parentId?: string; + isLink?: boolean; + content?: ContentInfo; + aspectNames?: string[]; + properties?: any; + allowableOperations?: string[]; + path?: PathInfo; + search?: SearchEntry; + archivedByUser?: UserInfo; + archivedAt?: Date; + versionLabel?: string; + versionComment?: string; + + constructor(input?: Partial<ResultNode>) { + if (input) { + Object.assign(this, input); + this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined; + this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined; + this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined; + this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined; + this.content = input.content ? new ContentInfo(input.content) : undefined; + this.path = input.path ? new PathInfo(input.path) : undefined; + this.archivedByUser = input.archivedByUser ? new UserInfo(input.archivedByUser) : undefined; + this.archivedAt = input.archivedAt ? DateAlfresco.parseDate(input.archivedAt) : undefined; + } + } +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultSetContext.ts b/lib/js-api/src/api/search-rest-api/model/resultSetContext.ts new file mode 100644 index 0000000000..fbeacd4e37 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultSetContext.ts @@ -0,0 +1,50 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GenericFacetResponse } from './genericFacetResponse'; +import { ResponseConsistency } from './responseConsistency'; +import { ResultBuckets } from './resultBuckets'; +import { ResultSetContextFacetQueries } from './resultSetContextFacetQueries'; +import { ResultSetContextSpellcheck } from './resultSetContextSpellcheck'; +import { SearchRequest } from './searchRequest'; + +/** + * Context that applies to the whole result set + */ +export interface ResultSetContext { + consistency?: ResponseConsistency; + request?: SearchRequest; + /** + * The counts from facet queries + */ + facetQueries?: ResultSetContextFacetQueries[]; + /** + * The counts from field facets + */ + facetsFields?: ResultBuckets[]; + /** + * The faceted response + */ + facets?: GenericFacetResponse[]; + /** + * Suggested corrections + * If zero results were found for the original query then a single entry of type \"searchInsteadFor\" will be returned. + * If alternatives were found that return more results than the original query they are returned as \"didYouMean\" options. + * The highest quality suggestion is first. + */ + spellcheck?: ResultSetContextSpellcheck[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultSetContextFacetQueries.ts b/lib/js-api/src/api/search-rest-api/model/resultSetContextFacetQueries.ts new file mode 100644 index 0000000000..cd8c67b09d --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultSetContextFacetQueries.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ResultSetContextFacetQueries { + label?: string; + /** + * The filter query you can use to apply this facet + */ + filterQuery?: string; + count?: number; +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultSetContextSpellcheck.ts b/lib/js-api/src/api/search-rest-api/model/resultSetContextSpellcheck.ts new file mode 100644 index 0000000000..2efc65185e --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultSetContextSpellcheck.ts @@ -0,0 +1,24 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface ResultSetContextSpellcheck { + type?: 'searchInsteadFor' | 'didYouMean' | string; + /** + * A suggested alternative query + */ + suggestion?: string[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultSetPaging.ts b/lib/js-api/src/api/search-rest-api/model/resultSetPaging.ts new file mode 100644 index 0000000000..92c247aaf3 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultSetPaging.ts @@ -0,0 +1,32 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultSetPagingList } from './resultSetPagingList'; + +/** + * Query results + */ +export class ResultSetPaging { + list?: ResultSetPagingList; + + constructor(input?: Partial<ResultSetPaging>) { + if (input) { + Object.assign(this, input); + this.list = input.list ? new ResultSetPagingList(input.list) : undefined; + } + } +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultSetPagingList.ts b/lib/js-api/src/api/search-rest-api/model/resultSetPagingList.ts new file mode 100644 index 0000000000..8c8d90f269 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultSetPagingList.ts @@ -0,0 +1,36 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Pagination } from '../../content-rest-api'; +import { ResultSetContext } from './resultSetContext'; +import { ResultSetRowEntry } from './resultSetRowEntry'; + +export class ResultSetPagingList { + pagination?: Pagination; + context?: ResultSetContext; + entries?: ResultSetRowEntry[]; + + constructor(input?: Partial<ResultSetPagingList>) { + if (input) { + Object.assign(this, input); + this.pagination = input.pagination ? new Pagination(input.pagination) : undefined; + if (input.entries) { + this.entries = input.entries.map((item) => new ResultSetRowEntry(item)); + } + } + } +} diff --git a/lib/js-api/src/api/search-rest-api/model/resultSetRowEntry.ts b/lib/js-api/src/api/search-rest-api/model/resultSetRowEntry.ts new file mode 100644 index 0000000000..46ac1cde2a --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/resultSetRowEntry.ts @@ -0,0 +1,32 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ResultNode } from './resultNode'; + +/** + * A row in the result set + */ +export class ResultSetRowEntry { + entry: ResultNode; + + constructor(input?: Partial<ResultSetRowEntry>) { + if (input) { + Object.assign(this, input); + this.entry = input.entry ? new ResultNode(input.entry) : undefined; + } + } +} diff --git a/lib/js-api/src/api/search-rest-api/model/searchEntry.ts b/lib/js-api/src/api/search-rest-api/model/searchEntry.ts new file mode 100644 index 0000000000..bcce64fef9 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/searchEntry.ts @@ -0,0 +1,29 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SearchEntryHighlight } from './searchEntryHighlight'; + +export interface SearchEntry { + /** + * The score for this row + */ + score?: number; + /** + * Highlight fragments if requested and available. A match can happen in any of the requested field. + */ + highlight?: SearchEntryHighlight[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/searchEntryHighlight.ts b/lib/js-api/src/api/search-rest-api/model/searchEntryHighlight.ts new file mode 100644 index 0000000000..10016134df --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/searchEntryHighlight.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface SearchEntryHighlight { + /** + * The field where a match occurred (one of the fields defined on the request) + */ + field?: string; + /** + * Any number of snippets for the specified field highlighting the matching text + */ + snippets?: string[]; +} diff --git a/lib/js-api/src/api/search-rest-api/model/searchRequest.ts b/lib/js-api/src/api/search-rest-api/model/searchRequest.ts new file mode 100644 index 0000000000..ab3e841ad1 --- /dev/null +++ b/lib/js-api/src/api/search-rest-api/model/searchRequest.ts @@ -0,0 +1,62 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RequestDefaults } from './requestDefaults'; +import { RequestFacetFields } from './requestFacetFields'; +import { RequestFacetIntervals } from './requestFacetIntervals'; +import { RequestFacetQueries } from './requestFacetQueries'; +import { RequestFields } from './requestFields'; +import { RequestFilterQueries } from './requestFilterQueries'; +import { RequestHighlight } from './requestHighlight'; +import { RequestInclude } from './requestInclude'; +import { RequestLimits } from './requestLimits'; +import { RequestLocalization } from './requestLocalization'; +import { RequestPagination } from './requestPagination'; +import { RequestPivot } from './requestPivot'; +import { RequestQuery } from './requestQuery'; +import { RequestRange } from './requestRange'; +import { RequestScope } from './requestScope'; +import { RequestSortDefinition } from './requestSortDefinition'; +import { RequestSpellcheck } from './requestSpellcheck'; +import { RequestStats } from './requestStats'; +import { RequestTemplates } from './requestTemplates'; + +export interface SearchRequest { + query: RequestQuery; + paging?: RequestPagination; + include?: RequestInclude; + /** + * When true, include the original request in the response + */ + includeRequest?: boolean; + fields?: RequestFields; + sort?: RequestSortDefinition; + templates?: RequestTemplates; + defaults?: RequestDefaults; + localization?: RequestLocalization; + filterQueries?: RequestFilterQueries; + facetQueries?: RequestFacetQueries; + facetFields?: RequestFacetFields; + facetIntervals?: RequestFacetIntervals; + pivots?: RequestPivot[]; + stats?: RequestStats[]; + spellcheck?: RequestSpellcheck; + scope?: RequestScope; + limits?: RequestLimits; + highlight?: RequestHighlight; + ranges?: RequestRange[]; +} diff --git a/lib/js-api/src/assert.ts b/lib/js-api/src/assert.ts new file mode 100644 index 0000000000..744db21d31 --- /dev/null +++ b/lib/js-api/src/assert.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Throw exception if param is not defined + * + * @param param param + * @param name param name + */ +export function throwIfNotDefined(param: any, name: string) { + if (param === null || param === undefined) { + throw new Error(`Missing param '${name}'`); + } +} diff --git a/lib/js-api/src/authentication/authentication.ts b/lib/js-api/src/authentication/authentication.ts new file mode 100644 index 0000000000..4dbf7ea9d9 --- /dev/null +++ b/lib/js-api/src/authentication/authentication.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BasicAuth } from './basicAuth'; +import { Oauth2 } from './oauth2'; + +export interface Authentication { + basicAuth?: BasicAuth; + oauth2?: Oauth2; + cookie?: string; + type?: string; +} diff --git a/lib/js-api/src/authentication/basicAuth.ts b/lib/js-api/src/authentication/basicAuth.ts new file mode 100644 index 0000000000..fcc7db0ee8 --- /dev/null +++ b/lib/js-api/src/authentication/basicAuth.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface BasicAuth { + username?: string; + password?: string; + ticket?: string; +} diff --git a/lib/js-api/src/authentication/contentAuth.ts b/lib/js-api/src/authentication/contentAuth.ts new file mode 100644 index 0000000000..297e49afe7 --- /dev/null +++ b/lib/js-api/src/authentication/contentAuth.ts @@ -0,0 +1,215 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ee from 'event-emitter'; +import { AuthenticationApi, TicketBody } from '../api/auth-rest-api'; +import { AlfrescoApiClient } from '../alfrescoApiClient'; +import { AlfrescoApiConfig } from '../alfrescoApiConfig'; +import { Authentication } from './authentication'; +import { Storage } from '../storage'; +import { AlfrescoApiType } from '../to-deprecate/alfresco-api-type'; +import { HttpClient } from '../api-clients/http-client.interface'; + +export class ContentAuth extends AlfrescoApiClient { + ticketStorageLabel: string; + ticket: string; + + authApi: AuthenticationApi; + + constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApiType, httpClient?: HttpClient) { + super(undefined, httpClient); + this.className = 'ContentAuth'; + this.storage = Storage.getInstance(); + this.storage.setDomainPrefix(config.domainPrefix); + + this.setConfig(config); + + this.authApi = new AuthenticationApi(alfrescoApi); + } + + setConfig(config: AlfrescoApiConfig) { + this.config = config; + + this.basePath = this.config.hostEcm + '/' + this.config.contextRoot + '/api/-default-/public/authentication/versions/1'; //Auth Call + + this.ticketStorageLabel = 'ticket-ECM'; + + if (this.config.ticketEcm) { + this.setTicket(config.ticketEcm); + } else if (this.storage.getItem(this.ticketStorageLabel)) { + this.setTicket(this.storage.getItem(this.ticketStorageLabel)); + } + } + + changeHost() { + this.basePath = this.config.hostEcm + '/' + this.config.contextRoot + '/api/-default-/public/authentication/versions/1'; //Auth Call + this.ticket = undefined; + } + + saveUsername(username: string) { + if (this.storage.supportsStorage()) { + this.storage.setItem('ACS_USERNAME', username); + } + } + + /** + * login Alfresco API + * + * @param username Username to login + * @param password Password to login + * @returns A promise that returns {new authentication ticket} if resolved and {error} if rejected. + */ + login(username: string, password: string): Promise<string> { + this.authentications.basicAuth.username = username; + this.authentications.basicAuth.password = password; + + const loginRequest = new TicketBody({ + userId: this.authentications.basicAuth.username, + password: this.authentications.basicAuth.password + }); + + const promise: any = new Promise<string>((resolve, reject) => { + this.authApi + .createTicket(loginRequest) + .then((data) => { + this.saveUsername(username); + this.setTicket(data.entry.id); + promise.emit('success'); + this.emit('logged-in'); + resolve(data.entry.id); + }) + .catch((error) => { + this.saveUsername(''); + if (error.status === 401) { + promise.emit('unauthorized'); + } else if (error.status === 403) { + promise.emit('forbidden'); + } else { + promise.emit('error'); + } + reject(error); + }); + }); + + ee(promise); // jshint ignore:line + return promise; + } + + /** + * validate the ticket present in this.config.ticket against the server + * + * @returns A promise that returns if resolved and {error} if rejected. + */ + validateTicket(): Promise<string> { + this.setTicket(this.config.ticketEcm); + + const promise: any = new Promise<string>((resolve, reject) => { + this.authApi.validateTicket().then( + (data) => { + this.setTicket(data.entry.id); + promise.emit('success'); + this.emit('logged-in'); + resolve(data.entry.id); + }, + (error) => { + if (error.status === 401) { + promise.emit('unauthorized'); + } + promise.emit('error'); + reject(error); + } + ); + }); + + ee(promise); // jshint ignore:line + return promise; + } + + /** + * logout Alfresco API + * + * @returns A promise that returns { authentication ticket} if resolved and {error} if rejected. + */ + logout(): Promise<void> { + this.saveUsername(''); + const promise: any = new Promise<void>((resolve, reject) => { + this.authApi.deleteTicket().then( + () => { + promise.emit('logout'); + this.invalidateSession(); + resolve(); + }, + (error) => { + if (error.status === 401) { + promise.emit('unauthorized'); + } + promise.emit('error'); + reject(error); + } + ); + }); + + ee(promise); // jshint ignore:line + return promise; + } + + /** + * Set the current Ticket + */ + setTicket(ticket: string) { + this.authentications.basicAuth.username = 'ROLE_TICKET'; + this.authentications.basicAuth.password = ticket; + this.config.ticketEcm = ticket; + this.storage.setItem(this.ticketStorageLabel, ticket); + this.ticket = ticket; + } + + /** + * Get the current Ticket + * + * @returns ticket value + */ + getTicket(): string { + return this.ticket; + } + + invalidateSession() { + this.storage.removeItem(this.ticketStorageLabel); + this.authentications.basicAuth.username = null; + this.authentications.basicAuth.password = null; + this.config.ticketEcm = null; + this.ticket = null; + } + + /** + * If the client is logged in return true + * + * @returns `true` if client is logged in, otherwise `false` + */ + isLoggedIn(): boolean { + return !!this.ticket; + } + + /** + * return the Authentication + * + * @returns authentication object + */ + getAuthentication(): Authentication { + return this.authentications; + } +} diff --git a/lib/js-api/src/authentication/oauth2.ts b/lib/js-api/src/authentication/oauth2.ts new file mode 100644 index 0000000000..0e45411c18 --- /dev/null +++ b/lib/js-api/src/authentication/oauth2.ts @@ -0,0 +1,21 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Oauth2 { + refreshToken?: string; + accessToken?: string; +} diff --git a/lib/js-api/src/authentication/oauth2Auth.ts b/lib/js-api/src/authentication/oauth2Auth.ts new file mode 100644 index 0000000000..b5e6d718f7 --- /dev/null +++ b/lib/js-api/src/authentication/oauth2Auth.ts @@ -0,0 +1,778 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ee from 'event-emitter'; +import { AlfrescoApiClient } from '../alfrescoApiClient'; +import { AlfrescoApiConfig } from '../alfrescoApiConfig'; +import { Authentication } from './authentication'; +import { AuthenticationApi } from '../api/auth-rest-api'; +import { AlfrescoApi } from '../alfrescoApi'; +import { Storage } from '../storage'; +import { HttpClient } from '../api-clients/http-client.interface'; +import { PathMatcher } from '../utils/path-matcher'; + +declare const Buffer: any; + +declare let window: Window; + +interface Userinfo { + name: string; + given_name?: string; + family_name?: string; + preferred_username?: string; + email?: string; + picture?: string; +} + +export class Oauth2Auth extends AlfrescoApiClient { + static readonly DEFAULT_AUTHORIZATION_URL = '/protocol/openid-connect/auth'; + static readonly DEFAULT_TOKEN_URL = '/protocol/openid-connect/token'; + static readonly DEFAULT_USER_INFO_ENDPOINT = '/protocol/openid-connect/userinfo'; + static readonly DEFAULT_LOGOUT_URL = '/protocol/openid-connect/logout'; + + private refreshTokenIntervalPolling: any; + private refreshTokenTimeoutIframe: any; + private checkAccessToken = true; + + hashFragmentParams: any; + token: string; + discovery: { + loginUrl?: string; + logoutUrl?: string; + tokenEndpoint?: string; + userinfoEndpoint?: string; + } = { + loginUrl: undefined, + logoutUrl: undefined, + tokenEndpoint: undefined, + userinfoEndpoint: undefined + }; + + authentications: Authentication = { + oauth2: { accessToken: '' }, + type: 'oauth2', + basicAuth: {} + }; + + iFrameHashListener: any; + pathMatcher = new PathMatcher(); + + constructor(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi, httpClient?: HttpClient) { + super(undefined, httpClient); + this.storage = Storage.getInstance(); + + this.className = 'Oauth2Auth'; + + if (config) { + this.setConfig(config, alfrescoApi); + } + } + + setConfig(config: AlfrescoApiConfig, alfrescoApi: AlfrescoApi) { + this.config = config; + this.storage.setDomainPrefix(config.domainPrefix); + + if (this.config.oauth2) { + if (this.config.oauth2.host === undefined || this.config.oauth2.host === null) { + throw new Error('Missing the required oauth2 host parameter'); + } + + if (this.config.oauth2.clientId === undefined || this.config.oauth2.clientId === null) { + throw new Error('Missing the required oauth2 clientId parameter'); + } + + if (this.config.oauth2.scope === undefined || this.config.oauth2.scope === null) { + throw new Error('Missing the required oauth2 scope parameter'); + } + + if (this.config.oauth2.secret === undefined || this.config.oauth2.secret === null) { + this.config.oauth2.secret = ''; + } + + if ((this.config.oauth2.redirectUri === undefined || this.config.oauth2.redirectUri === null) && this.config.oauth2.implicitFlow) { + throw new Error('Missing redirectUri required parameter'); + } + + if (!this.config.oauth2.refreshTokenTimeout) { + this.config.oauth2.refreshTokenTimeout = 300000; + } + + if (!this.config.oauth2.redirectSilentIframeUri) { + let context = ''; + if (typeof window !== 'undefined') { + context = window.location.origin; + } + this.config.oauth2.redirectSilentIframeUri = context + '/assets/silent-refresh.html'; + } + + this.basePath = this.config.oauth2.host; //Auth Call + + this.host = this.config.oauth2.host; + + this.discoveryUrls(); + + if (this.hasContentProvider()) { + this.exchangeTicketListener(alfrescoApi); + } + + this.initOauth(); + } + } + + initOauth() { + if (!this.config.oauth2.implicitFlow && this.isValidAccessToken()) { + const accessToken = this.storage.getItem('access_token'); + this.setToken(accessToken, null); + } + + if (this.config.oauth2.implicitFlow) { + this.checkFragment('nonce'); + } + } + + discoveryUrls() { + this.discovery.loginUrl = this.config.oauth2.authorizationUrl || this.host + Oauth2Auth.DEFAULT_AUTHORIZATION_URL; + this.discovery.logoutUrl = this.config.oauth2.logoutUrl || this.host + Oauth2Auth.DEFAULT_LOGOUT_URL; + this.discovery.tokenEndpoint = this.config.oauth2.tokenUrl || this.host + Oauth2Auth.DEFAULT_TOKEN_URL; + this.discovery.userinfoEndpoint = this.config.oauth2.userinfoEndpoint || this.host + Oauth2Auth.DEFAULT_USER_INFO_ENDPOINT; + } + + getProfile(): Promise<Userinfo> { + const postBody = {}; + const pathParams = {}; + const queryParams = {}; + + const headerParams = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + + const formParams = {}; + + const contentTypes = ['application/x-www-form-urlencoded']; + const accepts = ['application/json']; + + return this.callCustomApi( + this.discovery.userinfoEndpoint, + 'GET', + pathParams, + queryParams, + headerParams, + formParams, + postBody, + contentTypes, + accepts + ); + } + + hasContentProvider(): boolean { + return this.config.provider === 'ECM' || this.config.provider === 'ALL'; + } + + checkFragment(nonceKey?: string, externalHash?: any): any { + // jshint ignore:line + this.hashFragmentParams = this.getHashFragmentParams(externalHash); + + if (this.hashFragmentParams && this.hashFragmentParams.error === undefined) { + this.useFragmentTimeLogin(nonceKey); + } else { + this.refreshBrowserLogin(); + } + } + + private refreshBrowserLogin() { + if (this.config.oauth2.silentLogin && !this.isPublicUrl()) { + this.implicitLogin(); + } + + if (this.isValidToken() && this.isValidAccessToken()) { + const accessToken = this.storage.getItem('access_token'); + this.setToken(accessToken, null); + this.silentRefresh(); + } + } + + private useFragmentTimeLogin(nonceKey: string) { + const accessToken = this.hashFragmentParams.access_token; + const idToken = this.hashFragmentParams.id_token; + const sessionState = this.hashFragmentParams.session_state; + const expiresIn = this.hashFragmentParams.expires_in; + + if (!sessionState) { + throw new Error('session state not present'); + } + + try { + const jwt = this.processJWTToken(idToken, nonceKey); + if (jwt) { + this.storeIdToken(idToken, jwt.payload.exp); + this.storeAccessToken(accessToken, expiresIn); + this.authentications.basicAuth.username = jwt.payload.preferred_username; + this.saveUsername(jwt.payload.preferred_username); + this.silentRefresh(); + return accessToken; + } + } catch (error) { + throw new Error('Validation JWT error' + error); + } + } + + isPublicUrl(): boolean { + const publicUrls = this.config.oauth2.publicUrls || []; + + if (Array.isArray(publicUrls)) { + return publicUrls.length > 0 && publicUrls.some((urlPattern: string) => this.pathMatcher.match(window.location.href, urlPattern)); + } + return false; + } + + padBase64(base64data: any) { + while (base64data.length % 4 !== 0) { + base64data += '='; + } + return base64data; + } + + processJWTToken(jwt: any, nonceKey: string): any { + if (jwt) { + const jwtArray = jwt.split('.'); + const headerBase64 = this.padBase64(jwtArray[0]); + const headerJson = this.b64DecodeUnicode(headerBase64); + const header = JSON.parse(headerJson); + + const payloadBase64 = this.padBase64(jwtArray[1]); + const payloadJson = this.b64DecodeUnicode(payloadBase64); + const payload = JSON.parse(payloadJson); + + const savedNonce = this.storage.getItem(nonceKey); + + if (!payload.sub) { + throw new Error('Missing sub in JWT'); + } + + if (payload.nonce !== savedNonce) { + return; + } + + return { + idToken: jwt, + payload, + header + }; + } + } + + b64DecodeUnicode(b64string: string) { + const base64 = b64string.replace(/-/g, '+').replace(/_/g, '/'); + return decodeURIComponent( + atob(base64) + .split('') + .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)) + .join('') + ); + } + + storeIdToken(idToken: string, exp: number) { + this.storage.setItem('id_token', idToken); + this.storage.setItem('id_token_expires_at', Number(exp * 1000).toString()); + this.storage.setItem('id_token_stored_at', Date.now().toString()); + } + + storeAccessToken(accessToken: string, expiresIn: number, refreshToken?: string) { + this.storage.setItem('access_token', accessToken); + + const expiresInMilliSeconds = expiresIn * 1000; + const now = new Date(); + const expiresAt = now.getTime() + expiresInMilliSeconds; + + this.storage.setItem('access_token_expires_in', expiresAt); + this.storage.setItem('access_token_stored_at', Date.now().toString()); + this.setToken(accessToken, refreshToken); + } + + saveUsername(username: string) { + if (this.storage.supportsStorage()) { + this.storage.setItem('USERNAME', username); + } + } + + implicitLogin() { + if (!this.isValidToken() || !this.isValidAccessToken()) { + this.redirectLogin(); + } + } + + isValidToken(): boolean { + let validToken = false; + if (this.getIdToken()) { + const expiresAt = this.storage.getItem('id_token_expires_at'); + const now = new Date(); + if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) { + validToken = true; + } + } + + return validToken; + } + + isValidAccessToken(): boolean { + let validAccessToken = false; + + if (this.getAccessToken()) { + const expiresAt = this.storage.getItem('access_token_expires_in'); + const now = new Date(); + if (expiresAt && parseInt(expiresAt, 10) >= now.getTime()) { + validAccessToken = true; + } + } + + return validAccessToken; + } + + getIdToken(): string { + return this.storage.getItem('id_token'); + } + + getAccessToken(): string { + return this.storage.getItem('access_token'); + } + + redirectLogin(): void { + if (this.config.oauth2.implicitFlow && typeof window !== 'undefined') { + const href = this.composeImplicitLoginUrl(); + window.location.href = href; + this.emit('implicit_redirect', href); + } + } + + isRedirectionUrl() { + return window.location.hash && window.location.hash.split('&')[0].indexOf('session_state') === -1; + } + + genNonce(): string { + let text = ''; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + + for (let i = 0; i < 40; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + + return text; + } + + composeImplicitLoginUrl(): string { + const nonce = this.genNonce(); + + this.storage.setItem('nonce', nonce); + + const afterLoginUriSegment = this.isRedirectionUrl() ? window.location.hash : ''; + if (afterLoginUriSegment && afterLoginUriSegment !== '/') { + this.storage.setItem('loginFragment', afterLoginUriSegment.replace('#', '').trim()); + } + + const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?'; + + return ( + this.discovery.loginUrl + + separation + + 'client_id=' + + encodeURIComponent(this.config.oauth2.clientId) + + '&redirect_uri=' + + encodeURIComponent(this.config.oauth2.redirectUri) + + '&scope=' + + encodeURIComponent(this.config.oauth2.scope) + + '&response_type=' + + encodeURIComponent('id_token token') + + '&nonce=' + + encodeURIComponent(nonce) + ); + } + + composeIframeLoginUrl(): string { + const nonce = this.genNonce(); + + this.storage.setItem('refresh_nonce', nonce); + + const separation = this.discovery.loginUrl.indexOf('?') > -1 ? '&' : '?'; + + return ( + this.discovery.loginUrl + + separation + + 'client_id=' + + encodeURIComponent(this.config.oauth2.clientId) + + '&redirect_uri=' + + encodeURIComponent(this.config.oauth2.redirectSilentIframeUri) + + '&scope=' + + encodeURIComponent(this.config.oauth2.scope) + + '&response_type=' + + encodeURIComponent('id_token token') + + '&nonce=' + + encodeURIComponent(nonce) + + '&prompt=none' + ); + } + + hasHashCharacter(hash: string): boolean { + return hash.indexOf('#') === 0; + } + + startWithHashRoute(hash: string) { + return hash.startsWith('#/'); + } + + getHashFragmentParams(externalHash: string): string { + let hashFragmentParams = null; + + if (typeof window !== 'undefined') { + let hash: string; + + if (!externalHash) { + hash = decodeURIComponent(window.location.hash); + if (!this.startWithHashRoute(hash)) { + window.location.hash = ''; + } + } else { + hash = decodeURIComponent(externalHash); + this.removeHashFromSilentIframe(); + this.destroyIframe(); + } + + if (this.hasHashCharacter(hash) && !this.startWithHashRoute(hash)) { + const questionMarkPosition = hash.indexOf('?'); + + if (questionMarkPosition > -1) { + hash = hash.substring(questionMarkPosition + 1); + } else { + hash = hash.substring(1); + } + hashFragmentParams = this.parseQueryString(hash); + } + } + return hashFragmentParams; + } + + parseQueryString(queryString: string): any { + const data: { [key: string]: any } = {}; + let pairs: string[]; + let pair: string; + let separatorIndex: number; + let escapedKey: string; + let escapedValue: string; + let key: string; + let value: string; + + if (queryString !== null) { + pairs = queryString.split('&'); + + for (const item of pairs) { + pair = item; + separatorIndex = pair.indexOf('='); + + if (separatorIndex === -1) { + escapedKey = pair; + escapedValue = null; + } else { + escapedKey = pair.substring(0, separatorIndex); + escapedValue = pair.substring(separatorIndex + 1); + } + + key = decodeURIComponent(escapedKey); + value = decodeURIComponent(escapedValue); + + if (key.startsWith('/')) { + key = key.substring(1); + } + + data[key] = value; + } + } + + return data; + } + + silentRefresh(): void { + if (typeof document === 'undefined') { + this.pollingRefreshToken(); + return; + } + + if (this.checkAccessToken) { + this.destroyIframe(); + this.createIframe(); + this.checkAccessToken = false; + return; + } + + this.refreshTokenTimeoutIframe = setTimeout(() => { + this.destroyIframe(); + this.createIframe(); + }, this.config.oauth2.refreshTokenTimeout); + } + + removeHashFromSilentIframe() { + const iframe = document.getElementById('silent_refresh_token_iframe') as HTMLIFrameElement; + if (iframe?.contentWindow.location.hash) { + iframe.contentWindow.location.hash = ''; + } + } + + createIframe() { + const iframe = document.createElement('iframe'); + iframe.id = 'silent_refresh_token_iframe'; + const loginUrl = this.composeIframeLoginUrl(); + iframe.setAttribute('src', loginUrl); + iframe.style.display = 'none'; + document.body.appendChild(iframe); + + this.iFrameHashListener = () => { + const silentRefreshTokenIframe: any = document.getElementById('silent_refresh_token_iframe'); + const hash = silentRefreshTokenIframe.contentWindow.location.hash; + try { + this.checkFragment('refresh_nonce', hash); + } catch { + this.logOut(); + } + }; + + iframe.addEventListener('load', this.iFrameHashListener); + } + + destroyIframe() { + const iframe = document.getElementById('silent_refresh_token_iframe'); + + if (iframe) { + iframe.removeEventListener('load', this.iFrameHashListener); + document.body.removeChild(iframe); + } + } + + /** + * login Alfresco API + * + * @returns A promise that returns {new authentication token} if resolved and {error} if rejected. + */ + login(username: string, password: string): Promise<any> { + return new Promise((resolve, reject) => { + this.grantPasswordLogin(username, password, resolve, reject); + }); + } + + grantPasswordLogin(username: string, password: string, resolve: any, reject: any) { + this.invalidateSession(); + + const headerParams = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + + const formParams = { + username, + password, + grant_type: 'password', + client_id: this.config.oauth2.clientId, + client_secret: this.config.oauth2.secret + }; + + const contentTypes = ['application/x-www-form-urlencoded']; + const accepts = ['application/json']; + + const promise = this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then( + (data: any) => { + this.saveUsername(username); + this.silentRefresh(); + this.storeAccessToken(data.access_token, data.expires_in, data.refresh_token); + + resolve(data); + }, + (error) => { + if ((error.error && error.error.status === 401) || error.status === 401) { + this.emit('unauthorized'); + } + this.emit('error'); + reject(error.error); + } + ); + + ee(promise); // jshint ignore:line + } + + pollingRefreshToken() { + this.refreshTokenIntervalPolling = setInterval(async () => { + try { + await this.refreshToken(); + } catch { + /* continue regardless of error */ + } + }, this.config.oauth2.refreshTokenTimeout); + + this.refreshTokenIntervalPolling.unref(); + } + + /** + * Refresh the Token + * + * @returns promise of void + */ + refreshToken(): Promise<any> { + const auth = 'Basic ' + this.universalBtoa(this.config.oauth2.clientId + ':' + this.config.oauth2.secret); + const headerParams = { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Cache-Control': 'no-cache', + Authorization: auth + }; + const formParams = { + grant_type: 'refresh_token', + refresh_token: this.authentications.oauth2.refreshToken + }; + + const contentTypes = ['application/x-www-form-urlencoded']; + const accepts = ['application/json']; + + const promise = new Promise((resolve, reject) => { + this.callCustomApi(this.discovery.tokenEndpoint, 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then( + (data: any) => { + this.setToken(data.access_token, data.refresh_token); + resolve(data); + }, + (error) => { + if (error.error && error.error.status === 401) { + this.emit('unauthorized'); + } + this.emit('error'); + reject(error.error); + } + ); + }); + + ee(promise); // jshint ignore:line + + return promise; + } + + universalBtoa(stringToConvert: string) { + try { + return btoa(stringToConvert); + } catch (err) { + return Buffer.from(stringToConvert).toString('base64'); + } + } + + /** + * Set the current Token + */ + setToken(token: string, refreshToken: string) { + this.authentications.oauth2.accessToken = token; + this.authentications.oauth2.refreshToken = refreshToken; + this.authentications.basicAuth.password = null; + this.token = token; + + if (token) { + this.emit('token_issued'); + this.emit('logged-in'); + } + } + + /** + * Get the current Token + * + * @returns token value + */ + getToken(): string { + return this.token; + } + + /** + * return the Authentication + * + * @returns authentications + */ + getAuthentication(): Authentication { + return this.authentications; + } + + /** + * Change the Host + */ + changeHost(host: string) { + this.config.hostOauth2 = host; + } + + /** + * If the client is logged in return true + * + * @returns is logged in + */ + isLoggedIn(): boolean { + return !!this.authentications.oauth2.accessToken; + } + + /** + * Logout + */ + async logOut() { + this.checkAccessToken = true; + + const id_token = this.getIdToken(); + + this.invalidateSession(); + this.setToken(null, null); + + const separation = this.discovery.logoutUrl.indexOf('?') > -1 ? '&' : '?'; + const redirectLogout = this.config.oauth2.redirectUriLogout || this.config.oauth2.redirectUri; + const logoutUrl = + this.discovery.logoutUrl + + separation + + 'post_logout_redirect_uri=' + + encodeURIComponent(redirectLogout) + + '&id_token_hint=' + + encodeURIComponent(id_token); + + if (id_token != null && this.config.oauth2.implicitFlow && typeof window !== 'undefined') { + window.location.href = logoutUrl; + } + } + + invalidateSession() { + clearTimeout(this.refreshTokenTimeoutIframe); + clearInterval(this.refreshTokenIntervalPolling); + + this.storage.removeItem('access_token'); + this.storage.removeItem('access_token_expires_in'); + this.storage.removeItem('access_token_stored_at'); + + this.storage.removeItem('id_token'); + this.storage.removeItem('id_token'); + this.storage.removeItem('id_token_claims_obj'); + this.storage.removeItem('id_token_expires_at'); + this.storage.removeItem('id_token_stored_at'); + + this.storage.removeItem('nonce'); + } + + exchangeTicketListener(alfrescoApi: AlfrescoApi) { + this.on('token_issued', async () => { + const authContentApi: AuthenticationApi = new AuthenticationApi(alfrescoApi); + // Legacy stuff, needs deprecation, can not be more specific here because of circular dependency + (authContentApi.apiClient as unknown as any).authentications = this.authentications; + try { + const ticketEntry = await authContentApi.getTicket(); + this.config.ticketEcm = ticketEntry.entry.id; + this.emit('ticket_exchanged'); + } catch (e) { + // continue regardless of error + } + }); + } +} diff --git a/lib/js-api/src/authentication/oauth2Config.ts b/lib/js-api/src/authentication/oauth2Config.ts new file mode 100644 index 0000000000..46ee7530a8 --- /dev/null +++ b/lib/js-api/src/authentication/oauth2Config.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Oauth2Config { + clientId: string; + secret?: string; + host: string; + authorizationUrl?: string; + tokenUrl?: string; + userinfoEndpoint?: string; + logoutUrl?: string; + scope: string; + implicitFlow?: boolean; + redirectUri: string; + refreshTokenTimeout?: number; + silentLogin?: boolean; + redirectUriLogout?: string; + redirectSilentIframeUri?: string; + publicUrls?: string[]; +} diff --git a/lib/js-api/src/authentication/processAuth.ts b/lib/js-api/src/authentication/processAuth.ts new file mode 100644 index 0000000000..d9302f3024 --- /dev/null +++ b/lib/js-api/src/authentication/processAuth.ts @@ -0,0 +1,211 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ee from 'event-emitter'; +import { AlfrescoApiClient, AlfrescoApiClientPromise } from '../alfrescoApiClient'; +import { AlfrescoApiConfig } from '../alfrescoApiConfig'; +import { Authentication } from './authentication'; +import { Storage } from '../storage'; +import { HttpClient } from '../api-clients/http-client.interface'; +import { isBrowser } from '../utils'; + +export class ProcessAuth extends AlfrescoApiClient { + ticket: string; + + authentications: Authentication = { + basicAuth: { ticket: '' }, + type: 'activiti' + }; + + constructor(config: AlfrescoApiConfig, httpClient?: HttpClient) { + super(undefined, httpClient); + this.storage = Storage.getInstance(); + this.storage.setDomainPrefix(config.domainPrefix); + + this.className = 'ProcessAuth'; + + if (!isBrowser()) { + this.defaultHeaders = { + 'user-agent': 'alfresco-js-api' + }; + } + + this.setConfig(config); + } + + setConfig(config: AlfrescoApiConfig) { + this.config = config; + this.ticket = undefined; + + this.basePath = config.hostBpm + '/' + this.config.contextRootBpm; //Activiti Call + + if (this.config.ticketBpm) { + this.setTicket(config.ticketBpm); + } else if (this.storage.getItem('ticket-BPM')) { + this.setTicket(this.storage.getItem('ticket-BPM')); + } + } + + changeHost() { + this.basePath = this.config.hostBpm + '/' + this.config.contextRootBpm; //Activiti Call + this.ticket = undefined; + } + + changeCsrfConfig(disableCsrf: boolean) { + this.config.disableCsrf = disableCsrf; + } + + saveUsername(username: string) { + if (this.storage.supportsStorage()) { + this.storage.setItem('APS_USERNAME', username); + } + } + + /** + * login Activiti API + * + * @param username Username to login + * @param password Password to login + * @returns A promise that returns {new authentication ticket} if resolved and {error} if rejected. + */ + login(username: string, password: string): AlfrescoApiClientPromise<string> { + this.authentications.basicAuth.username = username; + this.authentications.basicAuth.password = password; + + const headerParams = { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Cache-Control': 'no-cache' + }; + const formParams = { + j_username: this.authentications.basicAuth.username, + j_password: this.authentications.basicAuth.password, + _spring_security_remember_me: true, + submit: 'Login' + }; + + const contentTypes = ['application/x-www-form-urlencoded']; + const accepts = ['application/json']; + + const promise: any = new Promise<string>((resolve, reject) => { + this.callApi('/app/authentication', 'POST', {}, {}, headerParams, formParams, {}, contentTypes, accepts).then( + () => { + this.saveUsername(username); + const ticket = this.basicAuth(this.authentications.basicAuth.username, this.authentications.basicAuth.password); + this.setTicket(ticket); + promise.emit('success'); + this.emit('logged-in'); + resolve(ticket); + }, + (error) => { + this.saveUsername(''); + if (error.status === 401) { + promise.emit('unauthorized'); + } else if (error.status === 403) { + promise.emit('forbidden'); + } else { + promise.emit('error'); + } + reject(error); + } + ); + }); + + ee(promise); // jshint ignore:line + return promise; + } + + /** + * logout Alfresco API + * + * @returns A promise that returns {new authentication ticket} if resolved and {error} if rejected. + */ + logout(): AlfrescoApiClientPromise<void> { + this.saveUsername(''); + + const contentTypes = ['application/json']; + const accepts = ['application/json']; + + const promise: any = new Promise<void>((resolve, reject) => { + this.callApi('/app/logout', 'GET', {}, {}, {}, {}, {}, contentTypes, accepts).then( + () => { + this.invalidateSession(); + promise.emit('logout'); + resolve(); + }, + (error) => { + if (error.status === 401) { + promise.emit('unauthorized'); + } + promise.emit('error'); + reject(error); + } + ); + }); + + ee(promise); + return promise; + } + + /** + * Set the current Ticket + * + * @param ticket Ticket value + */ + setTicket(ticket: string) { + this.authentications.basicAuth.ticket = ticket; + this.authentications.basicAuth.password = null; + this.config.ticketBpm = ticket; + this.storage.setItem('ticket-BPM', ticket); + this.ticket = ticket; + } + + invalidateSession() { + this.storage.removeItem('ticket-BPM'); + this.authentications.basicAuth.ticket = null; + this.authentications.basicAuth.password = null; + this.authentications.basicAuth.username = null; + this.config.ticketBpm = null; + this.ticket = null; + } + + /** + * Get the current Ticket + * + * @returns ticket + */ + getTicket(): string { + return this.ticket; + } + + /** + * If the client is logged in return true + * + * @returns `true` if logged in, otherwise `false` + */ + isLoggedIn(): boolean { + return !!this.ticket; + } + + /** + * return the Authentication + * + * @returns authentication object + */ + getAuthentication(): Authentication { + return this.authentications; + } +} diff --git a/lib/js-api/src/contentClient.ts b/lib/js-api/src/contentClient.ts new file mode 100644 index 0000000000..59316d6e5a --- /dev/null +++ b/lib/js-api/src/contentClient.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoApiClient } from './alfrescoApiClient'; +import { AlfrescoApiConfig } from './alfrescoApiConfig'; +import { Authentication } from './authentication/authentication'; +import { HttpClient } from './api-clients/http-client.interface'; + +export class ContentClient extends AlfrescoApiClient { + className = 'ContentClient'; + servicePath: string; + + constructor(config: AlfrescoApiConfig, servicePath: string, httpClient?: HttpClient) { + super(undefined, httpClient); + + this.setConfig(config, servicePath); + } + + setConfig(config: AlfrescoApiConfig, servicePath: string) { + this.config = config; + this.servicePath = servicePath; + + this.changeHost(); + } + + changeHost() { + this.host = this.config.hostEcm; + this.basePath = `${this.config.hostEcm}/${this.config.contextRoot}${this.servicePath}`; + } + + /** + * set the Authentications + * + * @param authentications authentications + */ + setAuthentications(authentications: Authentication): void { + this.authentications = authentications; + } +} diff --git a/lib/js-api/src/index.ts b/lib/js-api/src/index.ts new file mode 100644 index 0000000000..3a60211fa6 --- /dev/null +++ b/lib/js-api/src/index.ts @@ -0,0 +1,43 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './api/content-rest-api'; +export * from './api/content-custom-api'; +export * from './api/discovery-rest-api'; +export * from './api/gs-classification-rest-api'; +export * from './api/gs-core-rest-api'; +export * from './api/auth-rest-api'; +export * from './api/activiti-rest-api'; +export * from './api/search-rest-api'; +export * from './api/model-rest-api'; + +export * from './api/content-custom-api/api/content.api'; +export * from './authentication/contentAuth'; +export * from './authentication/processAuth'; +export * from './authentication/oauth2Auth'; +export * from './contentClient'; +export * from './processClient'; +export * from './storage'; +export * from './alfrescoApi'; +export * from './alfrescoApiClient'; +export * from './alfrescoApiConfig'; + +export * from './to-deprecate/alfresco-api-type'; + +export * from './api-clients/api-client'; +export * from './api-clients/http-client.interface'; +export * from './utils'; diff --git a/lib/js-api/src/ng-package.json b/lib/js-api/src/ng-package.json new file mode 100644 index 0000000000..84c5fadfbf --- /dev/null +++ b/lib/js-api/src/ng-package.json @@ -0,0 +1,9 @@ +{ + "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../../dist/libs/js-api", + "lib": { + "entryFile": "index.ts" + }, + "allowedNonPeerDependencies": ["event-emitter", "superagent"], + "assets": ["LICENSE.txt", "README.md"] + } diff --git a/lib/js-api/src/package.json b/lib/js-api/src/package.json new file mode 100644 index 0000000000..c93eac3299 --- /dev/null +++ b/lib/js-api/src/package.json @@ -0,0 +1,20 @@ +{ + "name": "@alfresco/js-api", + "version": "7.2.0", + "license": "Apache-2.0", + "description": "JavaScript client library for the Alfresco REST API", + "author": "Hyland Software, Inc. and its affiliates", + "keywords": ["alfresco"], + "repository": { + "type": "git", + "url": "https://github.com/Alfresco/alfresco-js-api.git" + }, + "bugs": { + "url": "https://github.com/Alfresco/alfresco-js-api/issues" + }, + "dependencies": { + "event-emitter": "^0.3.5", + "superagent": "^8.0.9", + "tslib": "^2.6.1" + } +} diff --git a/lib/js-api/src/processClient.ts b/lib/js-api/src/processClient.ts new file mode 100644 index 0000000000..1fc4008f5c --- /dev/null +++ b/lib/js-api/src/processClient.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoApiConfig } from './alfrescoApiConfig'; +import { AlfrescoApiClient } from './alfrescoApiClient'; +import { Authentication } from './authentication/authentication'; +import { HttpClient } from './api-clients/http-client.interface'; + +export class ProcessClient extends AlfrescoApiClient { + className = 'ProcessClient'; + + constructor(config: AlfrescoApiConfig, httpClient?: HttpClient) { + super(undefined, httpClient); + + this.setConfig(config); + } + + setConfig(config: AlfrescoApiConfig) { + this.config = config; + + this.changeHost(); + } + + changeHost() { + this.host = this.config.hostBpm; + this.basePath = `${this.config.hostBpm}/${this.config.contextRootBpm}`; + } + + /** + * set the authentications + * + * @param authentications Authentications value + */ + setAuthentications(authentications: Authentication) { + this.authentications = authentications; + } +} diff --git a/lib/js-api/src/storage.ts b/lib/js-api/src/storage.ts new file mode 100644 index 0000000000..0b04aa78d6 --- /dev/null +++ b/lib/js-api/src/storage.ts @@ -0,0 +1,71 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class Storage { + + private static instance: Storage; + + _storage: any; + prefix: string; + + private constructor() { + if (this.supportsStorage()) { + this._storage = window.localStorage; + } + } + + public static getInstance(){ + if(!Storage.instance){ + Storage.instance = new Storage(); + } + return Storage.instance; + } + + supportsStorage() { + try { + return 'localStorage' in window && window.localStorage !== null; + } catch (e) { + return false; + } + } + + setDomainPrefix(prefix: any) { + this.prefix = prefix ? prefix + '_' : ''; + } + + setStorage(storage: any) { + this._storage = storage; + } + + setItem(key: string, value: any) { + if (this.supportsStorage()) { + this._storage.setItem(this.prefix + key, value); + } + } + + removeItem(key: string) { + if (this.supportsStorage()) { + this._storage.removeItem(this.prefix + key); + } + } + + getItem(key: string) { + if (this.supportsStorage()) { + return this._storage.getItem(this.prefix + key); + } + } +} diff --git a/lib/js-api/src/superagentHttpClient.ts b/lib/js-api/src/superagentHttpClient.ts new file mode 100644 index 0000000000..c1c11a5f7a --- /dev/null +++ b/lib/js-api/src/superagentHttpClient.ts @@ -0,0 +1,381 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import ee, { Emitter } from 'event-emitter'; +import superagent, { Response, SuperAgentRequest } from 'superagent'; +import { Authentication } from './authentication/authentication'; +import { RequestOptions, HttpClient, SecurityOptions, Emitters } from './api-clients/http-client.interface'; +import { Oauth2 } from './authentication/oauth2'; +import { BasicAuth } from './authentication/basicAuth'; +import { isBrowser, paramToString } from './utils'; + +declare const Blob: any; +declare const Buffer: any; + +const isProgressEvent = (event: ProgressEvent | unknown): event is ProgressEvent => (event as ProgressEvent)?.lengthComputable; + +export class SuperagentHttpClient implements HttpClient { + /** + * The default HTTP timeout for all API calls. + */ + timeout: number | { deadline?: number; response?: number } = undefined; + + post<T = any>(url: string, options: RequestOptions, securityOptions: SecurityOptions, emitters: Emitters): Promise<T> { + return this.request<T>(url, { ...options, httpMethod: 'POST' }, securityOptions, emitters); + } + + put<T = any>(url: string, options: RequestOptions, securityOptions: SecurityOptions, emitters: Emitters): Promise<T> { + return this.request<T>(url, { ...options, httpMethod: 'PUT' }, securityOptions, emitters); + } + + get<T = any>(url: string, options: RequestOptions, securityOptions: SecurityOptions, emitters: Emitters): Promise<T> { + return this.request<T>(url, { ...options, httpMethod: 'GET' }, securityOptions, emitters); + } + + delete<T = void>(url: string, options: RequestOptions, securityOptions: SecurityOptions, emitters: Emitters): Promise<T> { + return this.request<T>(url, { ...options, httpMethod: 'DELETE' }, securityOptions, emitters); + } + + request<T = any>(url: string, options: RequestOptions, securityOptions: SecurityOptions, emitters: Emitters): Promise<T> { + const { httpMethod, queryParams, headerParams, formParams, bodyParam, contentType, accept, responseType, returnType } = options; + const { eventEmitter, apiClientEmitter } = emitters; + + let request = this.buildRequest( + httpMethod, + url, + queryParams, + headerParams, + formParams, + bodyParam, + contentType, + accept, + responseType, + eventEmitter, + returnType, + securityOptions + ); + + if (returnType === 'Binary') { + request = request.buffer(true).parse(superagent.parse['application/octet-stream']); + } + + const promise: any = new Promise((resolve, reject) => { + request.on('abort', () => { + eventEmitter.emit('abort'); + }); + request.end((error: any, response: Response) => { + if (error) { + apiClientEmitter.emit('error', error); + eventEmitter.emit('error', error); + + if (error.status === 401) { + apiClientEmitter.emit('unauthorized'); + eventEmitter.emit('unauthorized'); + } + + if (response?.text) { + error = error || {}; + reject(Object.assign(error, { message: response.text })); + } else { + // eslint-disable-next-line prefer-promise-reject-errors + reject({ error }); + } + } else { + if (securityOptions.isBpmRequest) { + const hasSetCookie = Object.prototype.hasOwnProperty.call(response.header, 'set-cookie'); + if (response.header && hasSetCookie) { + // mutate the passed value from AlfrescoApiClient class for backward compatibility + securityOptions.authentications.cookie = response.header['set-cookie'][0]; + } + } + let data = {}; + if (response.type === 'text/html') { + data = SuperagentHttpClient.deserialize(response); + } else { + data = SuperagentHttpClient.deserialize(response, returnType); + } + + eventEmitter.emit('success', data); + resolve(data); + } + }); + }); + + promise.abort = function() { + request.abort(); + return this; + }; + + return promise; + } + + private buildRequest( + httpMethod: string, + url: string, + queryParams: { [key: string]: any }, + headerParams: { [key: string]: any }, + formParams: { [key: string]: any }, + // eslint-disable-next-line @typescript-eslint/ban-types + bodyParam: string | Object, + contentType: string, + accept: string, + responseType: string, + eventEmitter: ee.Emitter, + returnType: string, + securityOptions: SecurityOptions + ) { + const request = superagent(httpMethod, url); + + const { isBpmRequest, authentications, defaultHeaders = {}, enableCsrf, withCredentials = false } = securityOptions; + + // apply authentications + this.applyAuthToRequest(request, authentications); + + // set query parameters + request.query(SuperagentHttpClient.normalizeParams(queryParams)); + + // set header parameters + request.set(defaultHeaders).set(SuperagentHttpClient.normalizeParams(headerParams)); + + if (isBpmRequest && enableCsrf) { + this.setCsrfToken(request); + } + + if (withCredentials) { + request.withCredentials(); + } + + // add cookie for activiti + if (isBpmRequest) { + request.withCredentials(); + if (securityOptions.authentications.cookie) { + if (!isBrowser()) { + request.set('Cookie', securityOptions.authentications.cookie); + } + } + } + + // set request timeout + request.timeout(this.timeout); + + if (contentType && contentType !== 'multipart/form-data') { + request.type(contentType); + } else if (!(request as any).header['Content-Type'] && contentType !== 'multipart/form-data') { + request.type('application/json'); + } + + if (contentType === 'application/x-www-form-urlencoded') { + request.send(SuperagentHttpClient.normalizeParams(formParams)).on('progress', (event: any) => { + this.progress(event, eventEmitter); + }); + } else if (contentType === 'multipart/form-data') { + const _formParams = SuperagentHttpClient.normalizeParams(formParams); + for (const key in _formParams) { + if (Object.prototype.hasOwnProperty.call(_formParams, key)) { + if (SuperagentHttpClient.isFileParam(_formParams[key])) { + // file field + request.attach(key, _formParams[key]).on('progress', (event: ProgressEvent) => { + // jshint ignore:line + this.progress(event, eventEmitter); + }); + } else { + request.field(key, _formParams[key]).on('progress', (event: ProgressEvent) => { + // jshint ignore:line + this.progress(event, eventEmitter); + }); + } + } + } + } else if (bodyParam) { + request.send(bodyParam).on('progress', (event: any) => { + this.progress(event, eventEmitter); + }); + } + + if (accept) { + request.accept(accept); + } + + if (returnType === 'blob' || returnType === 'Blob' || responseType === 'blob' || responseType === 'Blob') { + request.responseType('blob'); + } else if (returnType === 'String') { + request.responseType('string'); + } + + return request; + } + + setCsrfToken(request: SuperAgentRequest): void { + const token = SuperagentHttpClient.createCSRFToken(); + request.set('X-CSRF-TOKEN', token); + + if (!isBrowser()) { + request.set('Cookie', 'CSRF-TOKEN=' + token + ';path=/'); + } + + try { + document.cookie = 'CSRF-TOKEN=' + token + ';path=/'; + } catch (err) { + /* continue regardless of error */ + } + } + + /** + * Applies authentication headers to the request. + * + * @param request The request object created by a <code>superagent()</code> call. + * @param authentications authentications + */ + private applyAuthToRequest(request: SuperAgentRequest, authentications: Authentication) { + if (authentications) { + switch (authentications.type) { + case 'basic': { + const basicAuth: BasicAuth = authentications.basicAuth; + if (basicAuth.username || basicAuth.password) { + request.auth(basicAuth.username || '', basicAuth.password || ''); + } + break; + } + case 'activiti': { + if (authentications.basicAuth.ticket) { + request.set({ Authorization: authentications.basicAuth.ticket }); + } + break; + } + case 'oauth2': { + const oauth2: Oauth2 = authentications.oauth2; + if (oauth2.accessToken) { + request.set({ Authorization: 'Bearer ' + oauth2.accessToken }); + } + break; + } + default: + throw new Error('Unknown authentication type: ' + authentications.type); + } + } + } + + private progress(event: ProgressEvent | unknown, eventEmitter: Emitter): void { + if (isProgressEvent(event)) { + const percent = Math.round((event.loaded / event.total) * 100); + + const progress = { + total: event.total, + loaded: event.loaded, + percent + }; + + eventEmitter.emit('progress', progress); + } + } + + private static createCSRFToken(a?: any): string { + return a + ? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16) + : ([1e16] + (1e16).toString()).replace(/[01]/g, SuperagentHttpClient.createCSRFToken); + } + + /** + * Deserializes an HTTP response body into a value of the specified type. + * + * @param response A SuperAgent response object. + * @param returnType The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on <code>data<code> will be converted to this type. + * @returns A value of the specified type. + */ + private static deserialize(response: Response, returnType?: any): any { + if (response === null) { + return null; + } + + let data = response.body; + + if (data === null) { + data = response.text; + } + + if (returnType) { + if (returnType === 'blob' && isBrowser()) { + data = new Blob([data], { type: response.header['content-type'] }); + } else if (returnType === 'blob' && !isBrowser()) { + data = new Buffer.from(data, 'binary'); + } else if (Array.isArray(data)) { + data = data.map((element) => new returnType(element)); + } else { + data = new returnType(data); + } + } + + return data; + } + + /** + * Normalizes parameter values: + * <ul> + * <li>remove nils</li> + * <li>keep files and arrays</li> + * <li>format to string with `paramToString` for other cases</li> + * </ul> + * + * @param params The parameters as object properties. + * @returns normalized parameters. + */ + private static normalizeParams(params: { [key: string]: any }): { [key: string]: any } { + const newParams: { [key: string]: any } = {}; + + for (const key in params) { + if (Object.prototype.hasOwnProperty.call(params, key) && params[key] !== undefined && params[key] !== null) { + const value = params[key]; + if (SuperagentHttpClient.isFileParam(value) || Array.isArray(value)) { + newParams[key] = value; + } else { + newParams[key] = paramToString(value); + } + } + } + return newParams; + } + + /** + * Checks whether the given parameter value represents file-like content. + * + * @param param The parameter to check. + * @returns <code>true</code> if <code>param</code> represents a file. + */ + private static isFileParam(param: any): boolean { + // Buffer in Node.js + if (typeof Buffer === 'function' && (param instanceof Buffer || param.path)) { + return true; + } + // Blob in browser + if (typeof Blob === 'function' && param instanceof Blob) { + return true; + } + // File in browser (it seems File object is also instance of Blob, but keep this for safe) + if (typeof File === 'function' && param instanceof File) { + return true; + } + // Safari fix + if (typeof File === 'object' && param instanceof File) { + return true; + } + + return false; + } +} diff --git a/lib/js-api/src/to-deprecate/alfresco-api-type.ts b/lib/js-api/src/to-deprecate/alfresco-api-type.ts new file mode 100644 index 0000000000..0f36965d8f --- /dev/null +++ b/lib/js-api/src/to-deprecate/alfresco-api-type.ts @@ -0,0 +1,66 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoApiConfig } from '../alfrescoApiConfig'; +import { LegacyHttpClient } from '../api-clients/http-client.interface'; + +export interface LegacyTicketApi { + getAlfTicket(ticket: string): string; +} + +// Extracted from existing AlfrescoApi: +export interface AlfrescoApiType { + __type: string; + config: AlfrescoApiConfig; + contentClient: LegacyHttpClient & LegacyTicketApi; + contentPrivateClient: LegacyHttpClient & LegacyTicketApi; + processClient: LegacyHttpClient; + searchClient: LegacyHttpClient; + discoveryClient: LegacyHttpClient; + gsClient: LegacyHttpClient; + authClient: LegacyHttpClient; + processAuth: LegacyHttpClient; + + setConfig(config: AlfrescoApiConfig): void; + changeWithCredentialsConfig(withCredentials: boolean): void; + changeCsrfConfig(disableCsrf: boolean): void; + changeEcmHost(hostEcm: string): void; + changeBpmHost(hostBpm: string): void; + login(username: string, password: string): Promise<any>; + isCredentialValid(credential: string): boolean; + implicitLogin(): Promise<any>; + loginTicket(ticketEcm: string, ticketBpm: string): Promise<any>; + logout(): Promise<any>; + isLoggedIn(): boolean; + isBpmLoggedIn(): boolean; + isEcmLoggedIn(): boolean; + getBpmUsername(): string; + getEcmUsername(): string; + refreshToken(): Promise<string>; + getTicketAuth(): string; + setTicket(ticketEcm: string, TicketBpm: string): void; + invalidateSession(): void; + getTicketBpm(): string; + getTicketEcm(): string; + getTicket(): string[]; + isBpmConfiguration(): boolean; + isEcmConfiguration(): boolean; + isOauthConfiguration(): boolean; + isPublicUrl(): boolean; + isEcmBpmConfiguration(): boolean; + reply(event: string, callback?: any): void; +} diff --git a/lib/js-api/src/tsconfig.json b/lib/js-api/src/tsconfig.json new file mode 100644 index 0000000000..3145224a9e --- /dev/null +++ b/lib/js-api/src/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../tsconfig.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.lib.prod.json" + } + ], + "compilerOptions": { + "baseUrl": "src", + "target": "es2020" + }, + "angularCompilerOptions": { + "skipTemplateCodegen": true, + "strictMetadataEmit": true, + "enableResourceInlining": true, + "strictTemplates": true + } +} diff --git a/lib/js-api/src/tsconfig.lib.json b/lib/js-api/src/tsconfig.lib.json new file mode 100644 index 0000000000..45c40a7980 --- /dev/null +++ b/lib/js-api/src/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "declarationMap": true + }, + "exclude": ["./test.ts", "**/*.spec.ts", "**/*.test.ts"], + "include": ["**/*.ts"] +} diff --git a/lib/js-api/src/tsconfig.lib.prod.json b/lib/js-api/src/tsconfig.lib.prod.json new file mode 100644 index 0000000000..2a2faa884c --- /dev/null +++ b/lib/js-api/src/tsconfig.lib.prod.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, + "angularCompilerOptions": { + "compilationMode": "partial" + } +} diff --git a/lib/js-api/src/utils/index.ts b/lib/js-api/src/utils/index.ts new file mode 100644 index 0000000000..2a0c8d198d --- /dev/null +++ b/lib/js-api/src/utils/index.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './is-browser'; +export * from './param-to-string'; diff --git a/lib/js-api/src/utils/is-browser.ts b/lib/js-api/src/utils/is-browser.ts new file mode 100644 index 0000000000..d17a5e8590 --- /dev/null +++ b/lib/js-api/src/utils/is-browser.ts @@ -0,0 +1,18 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const isBrowser = (): boolean => typeof window !== 'undefined' && typeof window.document !== 'undefined'; diff --git a/lib/js-api/src/utils/param-to-string.ts b/lib/js-api/src/utils/param-to-string.ts new file mode 100644 index 0000000000..dd1cd3903e --- /dev/null +++ b/lib/js-api/src/utils/param-to-string.ts @@ -0,0 +1,32 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Returns a string representation for an actual parameter. + * + * @param param The actual parameter. + * @returns The string representation of <code>param</code>. + */ +export function paramToString(param: any): string { + if (param === undefined || param === null) { + return ''; + } + if (param instanceof Date) { + return param.toJSON(); + } + return param.toString(); +} diff --git a/lib/js-api/src/utils/path-matcher.ts b/lib/js-api/src/utils/path-matcher.ts new file mode 100644 index 0000000000..654b680f3c --- /dev/null +++ b/lib/js-api/src/utils/path-matcher.ts @@ -0,0 +1,27 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class PathMatcher { + match(path: string, pattern: string): boolean { + return new RegExp( + `^${pattern + .replace(/(^|[^*])\*(?!\*)/g, '$1([^\\/]*)') + .replace(/\/\*\*\//g, '/(.+)/|/') + .replace(/\*\*/g, '(.*)')}$` + ).test(path); + } +} diff --git a/lib/js-api/test/alfrescoApi.spec.ts b/lib/js-api/test/alfrescoApi.spec.ts new file mode 100644 index 0000000000..0202705a46 --- /dev/null +++ b/lib/js-api/test/alfrescoApi.spec.ts @@ -0,0 +1,309 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi } from '../src'; +import { BpmAuthMock, EcmAuthMock, OAuthMock } from './mockObjects'; + +describe('Basic configuration test', () => { + describe('config parameter ', () => { + it('Should basePath have a default value', () => { + const alfrescoJsApi = new AlfrescoApi({}); + + assert.equal(alfrescoJsApi.contentClient.basePath, 'http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1'); + }); + + it('should be reflected in the client', () => { + const config = { + hostEcm: 'https://testServer.com:1616', + contextRoot: 'strangeContextRoot' + }; + + const alfrescoJsApi = new AlfrescoApi(config); + + assert.equal( + alfrescoJsApi.contentClient.basePath, + 'https://testServer.com:1616/strangeContextRoot/api/-default-/public/alfresco/versions/1' + ); + }); + }); + + describe('setconfig parameter ', () => { + it('should be possible change the host in the client', () => { + const config = { + hostEcm: 'https://testServer.com:1616', + contextRoot: 'strangeContextRoot' + }; + + const alfrescoJsApi = new AlfrescoApi(config); + + assert.equal( + alfrescoJsApi.contentClient.basePath, + 'https://testServer.com:1616/strangeContextRoot/api/-default-/public/alfresco/versions/1' + ); + + const newConfig = { + hostEcm: 'https://testServer.com:2616', + contextRoot: 'strangeContextRoot' + }; + + alfrescoJsApi.setConfig(newConfig); + + assert.equal( + alfrescoJsApi.contentClient.basePath, + 'https://testServer.com:2616/strangeContextRoot/api/-default-/public/alfresco/versions/1' + ); + }); + }); + + describe('CSRF', () => { + it('should disableCsrf true parameter should be reflected in the clients', () => { + const config = { + hostEcm: 'https://testServer.com:1616', + contextRoot: 'strangeContextRoot', + disableCsrf: true + }; + + const alfrescoJsApi = new AlfrescoApi(config); + + assert.equal(alfrescoJsApi.contentClient.isCsrfEnabled(), false); + assert.equal(alfrescoJsApi.processClient.isCsrfEnabled(), false); + }); + + it('should disableCsrf false parameter should be reflected in the clients', () => { + const config = { + hostEcm: 'https://testServer.com:1616', + contextRoot: 'strangeContextRoot', + disableCsrf: false + }; + + const alfrescoJsApi = new AlfrescoApi(config); + + assert.equal(alfrescoJsApi.contentClient.isCsrfEnabled(), true); + assert.equal(alfrescoJsApi.processClient.isCsrfEnabled(), true); + }); + }); + + describe('WithCredentials', () => { + it('should withCredentials true parameter should be reflected in the clients', () => { + const config = { + hostEcm: 'https://testServer.com:1616', + contextRoot: 'strangeContextRoot', + withCredentials: true + }; + const alfrescoJsApi = new AlfrescoApi(config); + assert.equal(alfrescoJsApi.contentClient.isWithCredentials(), true); + assert.equal(alfrescoJsApi.processClient.isWithCredentials(), true); + }); + + it('should withCredentials true parameter with hostEcm should be reflected in isEcmLoggedIn', () => { + const hostEcm = 'https://127.0.0.1:8080'; + const alfrescoJsApi = new AlfrescoApi({ + hostEcm, + provider: 'ECM', + withCredentials: true + }); + + assert.equal(alfrescoJsApi.isEcmLoggedIn(), true); + }); + + it('should withCredentials true parameter with hostEcm should be reflected in isLoggedIn', () => { + const hostEcm = 'https://127.0.0.1:8080'; + const alfrescoJsApi = new AlfrescoApi({ + hostEcm, + provider: 'ECM', + withCredentials: true + }); + + assert.equal(alfrescoJsApi.isLoggedIn(), true); + }); + + it('should withCredentials true parameter with ALL provider should be reflected in isLoggedIn', () => { + const hostEcm = 'https://127.0.0.1:8080'; + const alfrescoJsApi = new AlfrescoApi({ + hostEcm, + provider: 'ALL', + withCredentials: true + }); + + assert.equal(alfrescoJsApi.isLoggedIn(), true); + }); + + it('should withCredentials false parameter should be reflected in the clients', () => { + const config = { + hostEcm: 'https://testServer.com:1616', + contextRoot: 'strangeContextRoot', + withCredentials: false + }; + const alfrescoJsApi = new AlfrescoApi(config); + assert.equal(alfrescoJsApi.contentClient.isWithCredentials(), false); + assert.equal(alfrescoJsApi.processClient.isWithCredentials(), false); + }); + }); + + describe('login', () => { + it('Should login be rejected if username or password are not provided', async () => { + const config = { + hostEcm: 'https://testServer.com:1616', + contextRoot: 'strangeContextRoot', + withCredentials: true + }; + const alfrescoJsApi = new AlfrescoApi(config); + + let error; + + try { + await alfrescoJsApi.login(undefined, undefined); + } catch (e) { + error = e.message; + } + + assert.equal(error, 'missing username or password'); + + error = undefined; + + try { + await alfrescoJsApi.login('username', undefined); + } catch (e) { + error = e.message; + } + + assert.equal(error, 'missing username or password'); + + error = undefined; + + try { + await alfrescoJsApi.login(undefined, 'password'); + } catch (e) { + error = e.message; + } + + assert.equal(error, 'missing username or password'); + + error = undefined; + + try { + await alfrescoJsApi.login('', ''); + } catch (e) { + error = e.message; + } + + assert.equal(error, 'missing username or password'); + + error = undefined; + + try { + await alfrescoJsApi.login('username', ''); + } catch (e) { + error = e.message; + } + + assert.equal(error, 'missing username or password'); + + error = undefined; + + try { + await alfrescoJsApi.login('', 'password'); + } catch (e) { + error = e.message; + } + + assert.equal(error, 'missing username or password'); + }); + + it('Should logged-in be emitted when log in ECM', (done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + const authEcmMock = new EcmAuthMock(hostEcm); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm, + provider: 'ECM' + }); + + authEcmMock.get201Response(); + + alfrescoJsApi.on('logged-in', () => { + done(); + }); + + alfrescoJsApi.login('admin', 'admin'); + }); + + it('Should logged-in be emitted when log in BPM', (done) => { + const hostBpm = 'https://127.0.0.1:9999'; + const authBpmMock = new BpmAuthMock(hostBpm); + + authBpmMock.get200Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostBpm, + contextRootBpm: 'activiti-app', + provider: 'BPM' + }); + + alfrescoJsApi.on('logged-in', () => { + done(); + }); + + alfrescoJsApi.login('admin', 'admin'); + }); + + it('Should logged-in be emitted when log in OAUTH', (done) => { + const oauth2Mock = new OAuthMock('https://myOauthUrl:30081'); + + oauth2Mock.get200Response(); + + const alfrescoJsApi = new AlfrescoApi({ + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }); + + alfrescoJsApi.on('logged-in', () => { + done(); + }); + + alfrescoJsApi.login('admin', 'admin'); + }); + + it('Should logged-in be emitted when the ticket is in the store', (done) => { + const hostBpm = 'https://127.0.0.1:9999'; + const authBpmMock = new BpmAuthMock(hostBpm); + + authBpmMock.get200Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostBpm, + contextRootBpm: 'activiti-app', + provider: 'BPM' + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + alfrescoJsApi.reply('logged-in', () => { + done(); + }); + }); + }); + }); +}); diff --git a/lib/js-api/test/alfrescoApiClient.spec.ts b/lib/js-api/test/alfrescoApiClient.spec.ts new file mode 100644 index 0000000000..495912a89b --- /dev/null +++ b/lib/js-api/test/alfrescoApiClient.spec.ts @@ -0,0 +1,79 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, DateAlfresco } from '../src'; +import { EcmAuthMock } from './mockObjects'; + +describe('Alfresco Core API Client', () => { + describe('type conversion', () => { + it('should return the username after login', (done) => { + const authResponseEcmMock = new EcmAuthMock('https://127.0.0.1:8080'); + + authResponseEcmMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm: 'https://127.0.0.1:8080' + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + assert.equal(alfrescoJsApi.getEcmUsername(), 'admin'); + done(); + }); + }); + }); + + describe('date parsing', () => { + const equalTime = (actual: Date, expected: Date) => actual.getTime() === expected.getTime(); + + it('should convert dates falling in GMT without a timezone', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-11-17T03:33:17'), new Date(Date.UTC(2015, 10, 17, 3, 33, 17))), true); + }); + + it('should convert dates falling in BST without a timezone', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-10-17T03:33:17'), new Date(Date.UTC(2015, 9, 17, 3, 33, 17))), true); + }); + + it('should convert dates with a UTC Zulu-time timezone', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-11-17T03:33:17Z'), new Date(Date.UTC(2015, 10, 17, 3, 33, 17))), true); + }); + + it('should convert dates with a UTC zero-offset timezone', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-11-17T03:33:17+0000'), new Date(Date.UTC(2015, 10, 17, 3, 33, 17))), true); + }); + + it('should convert dates with a positive offset timezone', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-11-17T03:33:17+0200'), new Date(Date.UTC(2015, 10, 17, 1, 33, 17))), true); + }); + + it('should convert dates with a negative offset timezone', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-11-17T03:33:17-0200'), new Date(Date.UTC(2015, 10, 17, 5, 33, 17))), true); + }); + + it('should convert dates with a part-hour offset', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-11-17T03:23:17-0930'), new Date(Date.UTC(2015, 10, 17, 12, 53, 17))), true); + }); + + it('should convert dates with a timezone HH:MM separator', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-11-17T03:33:17+02:00'), new Date(Date.UTC(2015, 10, 17, 1, 33, 17))), true); + }); + + it('should convert dates with a timezone with hours only', () => { + assert.equal(equalTime(DateAlfresco.parseDate('2015-11-17T03:33:17+02'), new Date(Date.UTC(2015, 10, 17, 1, 33, 17))), true); + }); + }); +}); diff --git a/lib/js-api/test/alfrescoContent.spec.ts b/lib/js-api/test/alfrescoContent.spec.ts new file mode 100644 index 0000000000..e6390e63c6 --- /dev/null +++ b/lib/js-api/test/alfrescoContent.spec.ts @@ -0,0 +1,230 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, ContentApi } from '../src'; +import { EcmAuthMock } from './mockObjects'; + +describe('AlfrescoContent', () => { + const hostEcm = 'https://127.0.0.1:8080'; + const nodesUrl = hostEcm + '/alfresco/api/-default-/public/alfresco/versions/1/nodes/'; + const sharedLinksUrl = hostEcm + '/alfresco/api/-default-/public/alfresco/versions/1/shared-links/'; + const nodeId = '1a0b110f-1e09-4ca2-b367-fe25e4964a4'; + const versionId = '1.1'; + + let authResponseMock: EcmAuthMock; + let contentApi: ContentApi; + + beforeEach((done) => { + authResponseMock = new EcmAuthMock(hostEcm); + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + contentApi = new ContentApi(alfrescoJsApi); + done(); + }); + }); + + it('outputs thumbnail url', () => { + const thumbnailUrl = contentApi.getDocumentThumbnailUrl(nodeId); + + assert.equal( + thumbnailUrl, + nodesUrl + nodeId + '/renditions/doclib/content?attachment=false&' + 'alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs thumbnail url as attachment', () => { + const thumbnailUrl = contentApi.getDocumentThumbnailUrl(nodeId, true); + + assert.equal( + thumbnailUrl, + nodesUrl + nodeId + '/renditions/doclib/content?attachment=true&' + 'alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs thumbnail url with custom ticket', () => { + const thumbnailUrl = contentApi.getDocumentThumbnailUrl(nodeId, true, 'custom_ticket'); + + assert.equal(thumbnailUrl, nodesUrl + nodeId + '/renditions/doclib/content?attachment=true&' + 'alf_ticket=custom_ticket'); + }); + + it('outputs preview url', () => { + const thumbnailUrl = contentApi.getDocumentPreviewUrl(nodeId); + + assert.equal( + thumbnailUrl, + nodesUrl + nodeId + '/renditions/imgpreview/content?attachment=false&' + 'alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs preview url as attachment', () => { + const thumbnailUrl = contentApi.getDocumentPreviewUrl(nodeId, true); + + assert.equal( + thumbnailUrl, + nodesUrl + nodeId + '/renditions/imgpreview/content?attachment=true&' + 'alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs preview url with custom ticket', () => { + const thumbnailUrl = contentApi.getDocumentPreviewUrl(nodeId, true, 'custom_ticket'); + + assert.equal(thumbnailUrl, nodesUrl + nodeId + '/renditions/imgpreview/content?attachment=true&' + 'alf_ticket=custom_ticket'); + }); + + it('outputs content url', () => { + const contentUrl = contentApi.getContentUrl(nodeId); + + assert.equal(contentUrl, nodesUrl + nodeId + '/content?attachment=false' + '&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + }); + + it('outputs content url as attachment', () => { + const contentUrl = contentApi.getContentUrl(nodeId, true); + + assert.equal(contentUrl, nodesUrl + nodeId + '/content?attachment=true' + '&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + }); + + it('outputs content url with custom ticket', () => { + const contentUrl = contentApi.getContentUrl(nodeId, true, 'custom_ticket'); + + assert.equal(contentUrl, nodesUrl + nodeId + '/content?attachment=true' + '&alf_ticket=custom_ticket'); + }); + + it('outputs rendition url', () => { + const encoding = 'pdf'; + const contentUrl = contentApi.getRenditionUrl(nodeId, encoding); + + assert.equal( + contentUrl, + nodesUrl + + nodeId + + '/renditions/' + + encoding + + '/content?attachment=false' + + '&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs rendition url as attachment', () => { + const encoding = 'pdf'; + const contentUrl = contentApi.getRenditionUrl(nodeId, encoding, true); + + assert.equal( + contentUrl, + nodesUrl + nodeId + '/renditions/' + encoding + '/content?attachment=true' + '&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs rendition url with custom ticket', () => { + const encoding = 'pdf'; + const contentUrl = contentApi.getRenditionUrl(nodeId, encoding, true, 'custom_ticket'); + + assert.equal(contentUrl, nodesUrl + nodeId + '/renditions/' + encoding + '/content?attachment=true' + '&alf_ticket=custom_ticket'); + }); + + it('outputs version rendition url', () => { + const encoding = 'pdf'; + const contentUrl = contentApi.getVersionRenditionUrl(nodeId, versionId, encoding); + + assert.equal( + contentUrl, + nodesUrl + + nodeId + + '/versions/' + + versionId + + '/renditions/' + + encoding + + '/content?attachment=false' + + '&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs version rendition url as attachment', () => { + const encoding = 'pdf'; + const contentUrl = contentApi.getVersionRenditionUrl(nodeId, versionId, encoding, true); + + assert.equal( + contentUrl, + nodesUrl + + nodeId + + '/versions/' + + versionId + + '/renditions/' + + encoding + + '/content?attachment=true' + + '&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs version rendition url with custom ticket', () => { + const encoding = 'pdf'; + const contentUrl = contentApi.getVersionRenditionUrl(nodeId, versionId, encoding, true, 'custom_ticket'); + + assert.equal( + contentUrl, + nodesUrl + nodeId + '/versions/' + versionId + '/renditions/' + encoding + '/content?attachment=true' + '&alf_ticket=custom_ticket' + ); + }); + + it('outputs version content url', () => { + const contentUrl = contentApi.getVersionContentUrl(nodeId, versionId); + + assert.equal( + contentUrl, + nodesUrl + nodeId + '/versions/' + versionId + '/content?attachment=false' + '&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs version content url as attachment', () => { + const contentUrl = contentApi.getVersionContentUrl(nodeId, versionId, true); + + assert.equal( + contentUrl, + nodesUrl + nodeId + '/versions/' + versionId + '/content?attachment=true' + '&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + }); + + it('outputs version content url with custom ticket', () => { + const contentUrl = contentApi.getVersionContentUrl(nodeId, versionId, true, 'custom_ticket'); + assert.equal(contentUrl, nodesUrl + nodeId + '/versions/' + versionId + '/content?attachment=true' + '&alf_ticket=custom_ticket'); + }); + + it('should output shared link content url', () => { + const url = contentApi.getSharedLinkContentUrl(nodeId); + assert.equal(url, sharedLinksUrl + nodeId + '/content?attachment=false'); + }); + + it('should output shared link content as attachment', () => { + const url = contentApi.getSharedLinkContentUrl(nodeId, true); + assert.equal(url, sharedLinksUrl + nodeId + '/content?attachment=true'); + }); + + it('should generate shared link rendition url', () => { + const url = contentApi.getSharedLinkRenditionUrl(nodeId, 'pdf'); + assert.equal(url, sharedLinksUrl + nodeId + '/renditions/pdf/content?attachment=false'); + }); + + it('should generate shared link rendition url for download', () => { + const url = contentApi.getSharedLinkRenditionUrl(nodeId, 'pdf', true); + assert.equal(url, sharedLinksUrl + nodeId + '/renditions/pdf/content?attachment=true'); + }); +}); diff --git a/lib/js-api/test/auth.spec.ts b/lib/js-api/test/auth.spec.ts new file mode 100644 index 0000000000..11fc5929f4 --- /dev/null +++ b/lib/js-api/test/auth.spec.ts @@ -0,0 +1,522 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { EcmAuthMock, BpmAuthMock, NodeMock, ProfileMock } from './mockObjects'; +import { NodesApi, UserProfileApi, AlfrescoApi } from '../src'; + +const NOOP = () => { + /* empty */ +}; +const ECM_HOST = 'https://127.0.0.1:8080'; +const BPM_HOST = 'https://127.0.0.1:9999'; + +interface ErrorResponse { + status: number; +} + +describe('Auth', () => { + describe('ECM Provider config', () => { + let authResponseEcmMock: EcmAuthMock; + let nodeMock: NodeMock; + let nodesApi: NodesApi; + + beforeEach(() => { + authResponseEcmMock = new EcmAuthMock(ECM_HOST); + nodeMock = new NodeMock(ECM_HOST); + }); + + describe('With Authentication', () => { + let alfrescoJsApi: AlfrescoApi; + + beforeEach(() => { + alfrescoJsApi = new AlfrescoApi({ + hostEcm: ECM_HOST + }); + + nodesApi = new NodesApi(alfrescoJsApi); + }); + + describe('login', () => { + it('should return the Ticket if all is ok', (done) => { + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin').then((data: string) => { + assert.equal(data, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + done(); + }); + }); + + it('should return an error if wrong credential are used 403 the login fails', (done) => { + authResponseEcmMock.get403Response(); + + alfrescoJsApi.login('wrong', 'name').then(NOOP, (error: ErrorResponse) => { + assert.equal(error.status, 403); + done(); + }); + }); + }); + + describe('isLoggedIn', () => { + it('should return true if the api is logged in', (done) => { + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin').then(() => { + assert.equal(alfrescoJsApi.isLoggedIn(), true); + done(); + }); + }); + + it('should return false if the api is logged out', (done) => { + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin').catch(NOOP); + + authResponseEcmMock.get204ResponseLogout(); + + alfrescoJsApi.logout().then(() => { + assert.equal(alfrescoJsApi.isLoggedIn(), false); + done(); + }); + }); + }); + + describe('Events ', () => { + it('should login fire an event if is unauthorized 401', (done) => { + authResponseEcmMock.get401Response(); + + const authPromise: any = alfrescoJsApi.login('wrong', 'name'); + + authPromise.catch(NOOP); + authPromise.on('unauthorized', () => { + done(); + }); + }); + + it('should login fire success event if is all ok 201', (done) => { + authResponseEcmMock.get201Response(); + + const authPromise: any = alfrescoJsApi.login('admin', 'admin'); + + authPromise.catch(NOOP); + authPromise.on('success', () => { + done(); + }); + }); + + it('should login fire logout event if the logout is successfull', (done) => { + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin'); + + authResponseEcmMock.get204ResponseLogout(); + + const authPromise: any = alfrescoJsApi.logout(); + + authPromise.catch(NOOP); + authPromise.on('logout', () => { + done(); + }); + }); + }); + + describe('With Ticket Authentication', () => { + it('should Ticket be present in the client', () => { + authResponseEcmMock.get400Response(); + + const api = new AlfrescoApi({ + ticketEcm: 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', + hostEcm: ECM_HOST + }); + + assert.equal('TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', api.contentClient.authentications.basicAuth.password); + }); + + it('should Ticket login be validate against the server if is valid', (done) => { + const ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'; + + authResponseEcmMock.get200ValidTicket(ticket); + + alfrescoJsApi.loginTicket(ticket, null).then((data: string) => { + assert.equal(alfrescoJsApi.contentAuth.authentications.basicAuth.password, ticket); + assert.equal(data, ticket); + done(); + }); + }); + + it('should Ticket login be validate against the server d is NOT valid', (done) => { + const ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'; + + authResponseEcmMock.get400Response(); + + alfrescoJsApi.loginTicket(ticket, null).then(NOOP, () => { + done(); + }); + }); + }); + + describe('Logout Api', () => { + beforeEach(async () => { + authResponseEcmMock.get201Response('TICKET_22d7a5a83d78b9cc9666ec4e412475e5455b33bd'); + await alfrescoJsApi.login('admin', 'admin'); + }); + + it('should Ticket be absent in the client and the resolve promise should be called', (done) => { + authResponseEcmMock.get204ResponseLogout(); + + alfrescoJsApi.logout().then(() => { + assert.equal(alfrescoJsApi.config.ticket, undefined); + done(); + }); + }); + + it('should Logout be rejected if the Ticket is already expired', (done) => { + authResponseEcmMock.get404ResponseLogout(); + alfrescoJsApi.logout().then(NOOP, (error: any) => { + assert.equal(error.error.toString(), 'Error: Not Found'); + done(); + }); + }); + }); + + describe('Unauthorized', () => { + beforeEach((done) => { + authResponseEcmMock.get201Response('TICKET_22d7a5a83d78b9cc9666ec4e412475e5455b33bd'); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + }); + + it('should 401 invalidate the ticket', (done) => { + nodeMock.get401CreationFolder(); + + nodesApi.createFolder('newFolder', null, null).then(NOOP, () => { + assert.equal(alfrescoJsApi.contentAuth.authentications.basicAuth.password, null); + done(); + }); + }); + + it('should 401 invalidate the session and logout', (done) => { + nodeMock.get401CreationFolder(); + + nodesApi.createFolder('newFolder', null, null).then(NOOP, () => { + assert.equal(alfrescoJsApi.isLoggedIn(), false); + done(); + }); + }); + + it('should emit an error event if a failing call is executed', (done) => { + alfrescoJsApi.on('error', () => { + done(); + }); + + nodeMock.get401CreationFolder(); + + nodesApi.createFolder('newFolder', null, null).then(NOOP); + }); + }); + }); + }); + + describe('BPM Provider config', () => { + let profileMock: ProfileMock; + let authResponseBpmMock: BpmAuthMock; + let alfrescoJsApi: AlfrescoApi; + let profileApi: UserProfileApi; + + beforeEach(() => { + profileMock = new ProfileMock(BPM_HOST); + authResponseBpmMock = new BpmAuthMock(BPM_HOST); + + alfrescoJsApi = new AlfrescoApi({ + hostBpm: BPM_HOST, + provider: 'BPM' + }); + + profileApi = new UserProfileApi(alfrescoJsApi); + }); + + describe('With Authentication', () => { + describe('login', () => { + it('should return the Ticket if all is ok', (done) => { + authResponseBpmMock.get200Response(); + + alfrescoJsApi.login('admin', 'admin').then((data: string) => { + assert.equal(data, 'Basic YWRtaW46YWRtaW4='); + done(); + }); + }); + + it('should return an error if wrong credential are used 401 the login fails', (done) => { + authResponseBpmMock.get401Response(); + + alfrescoJsApi.login('wrong', 'name').then(NOOP, (error: ErrorResponse) => { + assert.equal(error.status, 401); + done(); + }); + }); + }); + + describe('isLoggedIn', () => { + it('should return true if the api is logged in', (done) => { + authResponseBpmMock.get200Response(); + + alfrescoJsApi.login('admin', 'admin').then(() => { + assert.equal(alfrescoJsApi.isLoggedIn(), true); + done(); + }, NOOP); + }); + + it('should return false if the api is logged out', (done) => { + authResponseBpmMock.get200Response(); + + alfrescoJsApi.login('admin', 'admin'); + + authResponseBpmMock.get200ResponseLogout(); + + alfrescoJsApi.logout().then(() => { + assert.equal(alfrescoJsApi.isLoggedIn(), false); + done(); + }, NOOP); + }); + }); + + describe('Events ', () => { + it('should login fire an event if is unauthorized 401', (done) => { + authResponseBpmMock.get401Response(); + + const authPromise: any = alfrescoJsApi.login('wrong', 'name'); + + authPromise.catch(NOOP); + + authPromise.on('unauthorized', () => { + done(); + }); + }); + + it('should the Api fire success event if is all ok 201', (done) => { + authResponseBpmMock.get200Response(); + + const authPromise: any = alfrescoJsApi.login('admin', 'admin'); + + authPromise.catch(NOOP); + + authPromise.on('success', () => { + done(); + }); + }); + + it('should the Api fire logout event if the logout is successfull', (done) => { + authResponseBpmMock.get200Response(); + + alfrescoJsApi.login('admin', 'admin'); + + authResponseBpmMock.get200ResponseLogout(); + + const authPromise: any = alfrescoJsApi.logout(); + + authPromise.catch(NOOP); + authPromise.on('logout', () => { + done(); + }); + }); + }); + + describe('Unauthorized', () => { + beforeEach((done) => { + authResponseBpmMock.get200Response(); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + }); + + it('should 401 invalidate the ticket', (done) => { + profileMock.get401getProfile(); + + profileApi.getProfile().then(NOOP, () => { + assert.equal(alfrescoJsApi.processAuth.authentications.basicAuth.ticket, null); + done(); + }); + }); + + it('should 401 invalidate the session and logout', (done) => { + profileMock.get401getProfile(); + + profileApi.getProfile().then( + () => NOOP, + () => { + assert.equal(alfrescoJsApi.isLoggedIn(), false); + done(); + } + ); + }); + }); + }); + }); + + describe('BPM and ECM Provider config', () => { + let authResponseEcmMock: EcmAuthMock; + let authResponseBpmMock: BpmAuthMock; + let alfrescoJsApi: AlfrescoApi; + + beforeEach(() => { + authResponseEcmMock = new EcmAuthMock(ECM_HOST); + authResponseBpmMock = new BpmAuthMock(BPM_HOST); + + authResponseEcmMock.cleanAll(); + authResponseBpmMock.cleanAll(); + + alfrescoJsApi = new AlfrescoApi({ + hostEcm: ECM_HOST, + hostBpm: BPM_HOST, + provider: 'ALL' + }); + }); + + describe('With Authentication', () => { + it('should Ticket be present in the client', () => { + authResponseBpmMock.get200Response(); + authResponseEcmMock.get201Response(); + + const api = new AlfrescoApi({ + ticketEcm: 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', + ticketBpm: 'Basic YWRtaW46YWRtaW4=', + hostEcm: ECM_HOST, + hostBpm: BPM_HOST, + provider: 'ALL' + }); + + assert.equal('Basic YWRtaW46YWRtaW4=', api.processClient.authentications.basicAuth.ticket); + assert.equal('TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', api.contentClient.authentications.basicAuth.password); + }); + + describe('login', () => { + it('should return the Ticket if all is ok', (done) => { + authResponseBpmMock.get200Response(); + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin').then((data: string[]) => { + assert.equal(data[0], 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + assert.equal(data[1], 'Basic YWRtaW46YWRtaW4='); + done(); + }); + }); + + it('should fail if only ECM fail', (done) => { + authResponseBpmMock.get200Response(); + authResponseEcmMock.get401Response(); + + alfrescoJsApi.login('admin', 'admin').then(NOOP, () => { + done(); + }); + + authResponseEcmMock.cleanAll(); + }); + + it('should fail if only BPM fail', (done) => { + authResponseBpmMock.get401Response(); + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin').then(NOOP, () => { + done(); + }); + + authResponseBpmMock.cleanAll(); + }); + }); + + describe('isLoggedIn', () => { + it('should return false if the api is logged out', (done) => { + authResponseBpmMock.get200Response(); + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin'); + + authResponseBpmMock.get200ResponseLogout(); + authResponseEcmMock.get204ResponseLogout(); + + alfrescoJsApi.logout().then(() => { + assert.equal(alfrescoJsApi.isLoggedIn(), false); + done(); + }); + }); + + it('should return an error if wrong credential are used 401 the login fails', (done) => { + authResponseBpmMock.get401Response(); + authResponseEcmMock.get401Response(); + + alfrescoJsApi.login('wrong', 'name').then(NOOP, (error: ErrorResponse) => { + assert.equal(error.status, 401); + done(); + }); + }); + }); + + it('should return true if the api is logged in', (done) => { + authResponseBpmMock.get200Response(); + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin').then(() => { + assert.equal(alfrescoJsApi.isLoggedIn(), true); + done(); + }); + }); + + describe('Events ', () => { + it('should login fire an event if is unauthorized 401', (done) => { + authResponseBpmMock.get401Response(); + authResponseEcmMock.get401Response(); + + const authPromise: any = alfrescoJsApi.login('wrong', 'name'); + + authPromise.catch(NOOP); + authPromise.on('unauthorized', () => { + done(); + }); + }); + + it('should The Api fire success event if is all ok 201', (done) => { + authResponseBpmMock.get200Response(); + authResponseEcmMock.get201Response(); + + const authPromise: any = alfrescoJsApi.login('admin', 'admin'); + + authPromise.catch(NOOP); + authPromise.on('success', () => { + done(); + }); + }); + + it('should The Api fire logout event if the logout is successful', (done) => { + authResponseBpmMock.get200Response(); + authResponseEcmMock.get201Response(); + + alfrescoJsApi.login('admin', 'admin'); + + authResponseBpmMock.get200ResponseLogout(); + authResponseEcmMock.get204ResponseLogout(); + + (alfrescoJsApi.logout() as any).on('logout', () => { + done(); + }); + }); + }); + }); + }); +}); diff --git a/lib/js-api/test/bpmAuth.spec.ts b/lib/js-api/test/bpmAuth.spec.ts new file mode 100644 index 0000000000..bd0e4fb1bd --- /dev/null +++ b/lib/js-api/test/bpmAuth.spec.ts @@ -0,0 +1,304 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { ProcessAuth } from '../src'; +import { SuperagentHttpClient } from '../src/superagentHttpClient'; +import { BpmAuthMock } from './mockObjects'; + +describe('Bpm Auth test', () => { + const hostBpm = 'https://127.0.0.1:9999'; + let authBpmMock: BpmAuthMock; + + beforeEach(() => { + authBpmMock = new BpmAuthMock(hostBpm); + }); + + it('should remember username on login', () => { + const auth = new ProcessAuth({}); + auth.login('johndoe', 'password'); + assert.equal(auth.authentications.basicAuth.username, 'johndoe'); + }); + + it('should forget username on logout', (done) => { + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + authBpmMock.get200Response(); + + processAuth.login('admin', 'admin').then(() => { + assert.equal(processAuth.authentications.basicAuth.username, 'admin'); + + authBpmMock.get200ResponseLogout(); + + processAuth.logout().then(() => { + assert.equal(processAuth.authentications.basicAuth.username, null); + done(); + }); + }); + }); + + describe('With Authentication', () => { + it('login should return the Ticket if all is ok', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + processAuth.login('admin', 'admin').then((data) => { + assert.equal(data, 'Basic YWRtaW46YWRtaW4='); + done(); + }); + }); + + it('login password should be removed after login', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + processAuth.login('admin', 'admin').then((data) => { + assert.equal(data, 'Basic YWRtaW46YWRtaW4='); + assert.notEqual(processAuth.authentications.basicAuth.password, 'admin'); + done(); + }); + }); + + it('isLoggedIn should return true if the api is logged in', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + processAuth.login('admin', 'admin').then(() => { + assert.equal(processAuth.isLoggedIn(), true); + done(); + }); + }); + + it('isLoggedIn should return false if the api is logged out', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + processAuth.login('admin', 'admin'); + + authBpmMock.get200ResponseLogout(); + + processAuth.logout().then(() => { + assert.equal(processAuth.isLoggedIn(), false); + done(); + }); + }); + + it('isLoggedIn should return false if the host change', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + processAuth.login('admin', 'admin').then(() => { + assert.equal(processAuth.isLoggedIn(), true); + processAuth.changeHost(); + assert.equal(processAuth.isLoggedIn(), false); + done(); + }); + }); + + it('login should return an error if wrong credential are used 401 the login fails', (done) => { + authBpmMock.get401Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + processAuth.login('wrong', 'name').then( + () => {}, + (error) => { + assert.equal(error.status, 401); + done(); + } + ); + }); + + describe('Events ', () => { + it('login should fire an event if is unauthorized 401', (done) => { + authBpmMock.get401Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + const loginPromise = processAuth.login('wrong', 'name'); + + loginPromise.catch(() => {}); + loginPromise.on('unauthorized', () => { + done(); + }); + }); + + it('login should fire an event if is forbidden 403', (done) => { + authBpmMock.get403Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + const loginPromise = processAuth.login('wrong', 'name'); + loginPromise.catch(() => {}); + loginPromise.on('forbidden', () => { + done(); + }); + }); + + it('The Api Should fire success event if is all ok 201', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + const loginPromise = processAuth.login('admin', 'admin'); + + loginPromise.catch(() => {}); + loginPromise.on('success', () => { + done(); + }); + }); + + it('The Api Should fire logout event if the logout is successfull', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + processAuth.login('admin', 'admin'); + + authBpmMock.get200ResponseLogout(); + + const promise = processAuth.logout(); + promise.on('logout', () => { + done(); + }); + }); + }); + + describe('With Ticket Authentication', () => { + it('Ticket should be present in the client', () => { + const processAuth = new ProcessAuth({ + ticketBpm: 'Basic YWRtaW46YWRtaW4=', + hostBpm, + contextRootBpm: 'activiti-app' + }); + + assert.equal('Basic YWRtaW46YWRtaW4=', processAuth.authentications.basicAuth.ticket); + }); + }); + + describe('Logout Api', () => { + let processAuth: ProcessAuth; + + beforeEach((done) => { + authBpmMock.get200Response(); + + processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + processAuth.login('admin', 'admin').then(() => { + done(); + }); + }); + + it('Ticket should be absent in the client and the resolve promise should be called', (done) => { + authBpmMock.get200ResponseLogout(); + + processAuth.logout().then(() => { + assert.equal(processAuth.getTicket(), null); + done(); + }); + }); + }); + + describe('CSRF Token', () => { + let originalMethod: any; + let setCsrfTokenCalled = false; + + beforeEach(() => { + originalMethod = SuperagentHttpClient.prototype.setCsrfToken; + setCsrfTokenCalled = false; + + SuperagentHttpClient.prototype.setCsrfToken = () => { + setCsrfTokenCalled = true; + }; + }); + + afterEach(() => { + SuperagentHttpClient.prototype.setCsrfToken = originalMethod; + setCsrfTokenCalled = false; + }); + + it('should be enabled by default', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app' + }); + + processAuth.login('admin', 'admin').then(() => { + assert.equal(setCsrfTokenCalled, true); + done(); + }); + }); + + it('should be disabled if disableCsrf is true', (done) => { + authBpmMock.get200Response(); + + const processAuth = new ProcessAuth({ + hostBpm, + contextRootBpm: 'activiti-app', + disableCsrf: true + }); + + processAuth.login('admin', 'admin').then(() => { + assert.equal(setCsrfTokenCalled, false); + done(); + }); + }); + }); + }); +}); diff --git a/lib/js-api/test/changeConfig.spec.ts b/lib/js-api/test/changeConfig.spec.ts new file mode 100644 index 0000000000..a17285dabc --- /dev/null +++ b/lib/js-api/test/changeConfig.spec.ts @@ -0,0 +1,72 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi } from '../src'; +import { EcmAuthMock, BpmAuthMock } from './mockObjects'; + +describe('Change config', () => { + let authResponseBpmMock: BpmAuthMock; + let authResponseMock: EcmAuthMock; + let alfrescoJsApi: AlfrescoApi; + + beforeEach(async () => { + const config = { + hostBpm: 'https://127.0.0.1:9999', + hostEcm: 'https://127.0.0.1:8080', + provider: 'ALL' + }; + + authResponseBpmMock = new BpmAuthMock(config.hostBpm); + authResponseMock = new EcmAuthMock(config.hostEcm); + + authResponseMock.get201Response(); + authResponseBpmMock.get200Response(); + + alfrescoJsApi = new AlfrescoApi(config); + await alfrescoJsApi.login('admin', 'admin'); + }); + + describe('Change hosts', () => { + it('Change host Ecm', () => { + assert.equal(alfrescoJsApi.contentClient.basePath, 'https://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1'); + + alfrescoJsApi.changeEcmHost('https://differenTserverEcm:9898'); + + assert.equal(alfrescoJsApi.contentClient.basePath, 'https://differenTserverEcm:9898/alfresco/api/-default-/public/alfresco/versions/1'); + }); + + it('Change host bpm', () => { + assert.equal(alfrescoJsApi.processClient.basePath, 'https://127.0.0.1:9999/activiti-app'); + + alfrescoJsApi.changeBpmHost('https://differenTserverBpm:2222'); + + assert.equal(alfrescoJsApi.processClient.basePath, 'https://differenTserverBpm:2222/activiti-app'); + }); + + it('Change host ecm bpm', () => { + assert.equal(alfrescoJsApi.contentClient.basePath, 'https://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1'); + assert.equal(alfrescoJsApi.processClient.basePath, 'https://127.0.0.1:9999/activiti-app'); + + alfrescoJsApi.changeEcmHost('https://differenTserverEcm:9898'); + alfrescoJsApi.changeBpmHost('https://differenTserverBpm:2222'); + + assert.equal(alfrescoJsApi.contentClient.basePath, 'https://differenTserverEcm:9898/alfresco/api/-default-/public/alfresco/versions/1'); + assert.equal(alfrescoJsApi.processClient.basePath, 'https://differenTserverBpm:2222/activiti-app'); + }); + }); +}); diff --git a/lib/js-api/test/content-services/categoriesApi.spec.ts b/lib/js-api/test/content-services/categoriesApi.spec.ts new file mode 100644 index 0000000000..2b0e0f161e --- /dev/null +++ b/lib/js-api/test/content-services/categoriesApi.spec.ts @@ -0,0 +1,263 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, CategoriesApi, CategoryPaging, CategoryEntry } from '../../src'; +import { EcmAuthMock, CategoriesMock } from '../mockObjects'; + +describe('Categories', () => { + let authResponseMock: EcmAuthMock; + let categoriesMock: CategoriesMock; + let categoriesApi: CategoriesApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + categoriesMock = new CategoriesMock(hostEcm); + + authResponseMock.get201Response(); + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => done()); + categoriesApi = new CategoriesApi(alfrescoJsApi); + }); + + it('should return 200 while getting subcategories for category with categoryId if all is ok', (done) => { + categoriesMock.get200ResponseSubcategories('-root-'); + categoriesApi.getSubcategories('-root-').then((response: CategoryPaging) => { + assert.equal(response.list.pagination.count, 2); + assert.equal(response.list.entries[0].entry.parentId, '-root-'); + assert.equal(response.list.entries[0].entry.id, 'testId1'); + done(); + }); + }); + + it('should return 404 while getting subcategories for not existing category', (done) => { + categoriesMock.get404SubcategoryNotExist('notExistingId'); + categoriesApi.getSubcategories('notExistingId').then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + + it('should return 200 while getting category with categoryId if category exists', (done) => { + categoriesMock.get200ResponseCategory('testId1'); + categoriesApi.getCategory('testId1').then((response: CategoryEntry) => { + assert.equal(response.entry.parentId, '-root-'); + assert.equal(response.entry.id, 'testId1'); + done(); + }); + }); + + it('should return 404 while getting category with categoryId when category not exists', (done) => { + categoriesMock.get404CategoryNotExist('notExistingId'); + categoriesApi.getCategory('notExistingId').then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + + it('should return 200 while getting categories linked to node with nodeId if node has some categories assigned', (done) => { + categoriesMock.get200ResponseNodeCategoryLinks('testNode'); + categoriesApi.getCategoryLinksForNode('testNode').then((response: CategoryPaging) => { + assert.equal(response.list.entries[0].entry.parentId, 'testNode'); + assert.equal(response.list.entries[0].entry.id, 'testId1'); + done(); + }); + }); + + it('should return 403 while getting categories linked to node with nodeId if user has no rights to get from node', (done) => { + categoriesMock.get403NodeCategoryLinksPermissionDenied('testNode'); + categoriesApi.getCategoryLinksForNode('testNode').then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 403); + done(); + } + ); + }); + + it('should return 404 while getting categories linked to node with nodeId if node does not exist', (done) => { + categoriesMock.get404NodeNotExist('testNode'); + categoriesApi.getCategoryLinksForNode('testNode').then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + + it('should return 204 after unlinking category', (done) => { + categoriesMock.get204CategoryUnlinked('testNode', 'testId1'); + categoriesApi.unlinkNodeFromCategory('testNode', 'testId1').then(() => { + done(); + }); + }); + + it('should return 404 while unlinking category if category with categoryId or node with nodeId does not exist', (done) => { + categoriesMock.get404CategoryUnlinkNotFound('testNode', 'testId1'); + categoriesApi.unlinkNodeFromCategory('testNode', 'testId1').then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + + it('should return 403 while unlinking category if user has no rights to unlink', (done) => { + categoriesMock.get403CategoryUnlinkPermissionDenied('testNode', 'testId1'); + categoriesApi.unlinkNodeFromCategory('testNode', 'testId1').then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 403); + done(); + } + ); + }); + + it('should return 200 while updating category if all is ok', (done) => { + categoriesMock.get200ResponseCategoryUpdated('testId1'); + categoriesApi.updateCategory('testId1', { name: 'testName1' }).then((response) => { + assert.equal(response.entry.id, 'testId1'); + assert.equal(response.entry.name, 'testName1'); + done(); + }); + }); + + it('should return 404 while updating category if category with categoryId does not exist', (done) => { + categoriesMock.get404CategoryUpdateNotFound('testId1'); + categoriesApi.updateCategory('testId1', { name: 'testName1' }).then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + + it('should return 403 while updating category if user has no rights to update', (done) => { + categoriesMock.get403CategoryUpdatePermissionDenied('testId1'); + categoriesApi.updateCategory('testId1', { name: 'testName1' }).then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 403); + done(); + } + ); + }); + + it('should return 201 while creating category if all is ok', (done) => { + categoriesMock.get201ResponseCategoryCreated('testId1'); + categoriesApi.createSubcategories('testId1', [{ name: 'testName10' }]).then((response: CategoryPaging | CategoryEntry) => { + assert.equal((response as CategoryEntry).entry.parentId, 'testId1'); + assert.equal((response as CategoryEntry).entry.name, 'testName10'); + done(); + }); + }); + + it('should return 409 while creating subcategory if subcategory already exists', (done) => { + categoriesMock.get409CategoryCreateAlreadyExists('testId1'); + categoriesApi.createSubcategories('testId1', [{ name: 'testName10' }]).then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 409); + done(); + } + ); + }); + + it('should return 403 while creating category if user has no rights to create', (done) => { + categoriesMock.get403CategoryCreatedPermissionDenied('testId1'); + categoriesApi.createSubcategories('testId1', [{ name: 'testName10' }]).then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 403); + done(); + } + ); + }); + + it('should return 201 while linking category if all is ok', (done) => { + categoriesMock.get201ResponseCategoryLinked('testNode'); + categoriesApi.linkNodeToCategory('testNode', [{ categoryId: 'testId1' }]).then((response) => { + if (response instanceof CategoryEntry) { + assert.equal(response.entry.id, 'testId1'); + assert.equal(response.entry.name, 'testName1'); + done(); + } else { + assert.fail(); + } + }); + }); + + it('should return 201 while linking multiple categories if all is ok', (done) => { + categoriesMock.get201ResponseCategoryLinkedArray('testNodeArr'); + categoriesApi.linkNodeToCategory('testNodeArr', [{ categoryId: 'testId1' }, { categoryId: 'testId2' }]).then((response) => { + const categoriesPaging = response as CategoryPaging; + assert.equal(categoriesPaging.list.pagination.count, 2); + assert.equal(categoriesPaging.list.entries[0].entry.id, 'testId1'); + assert.equal(categoriesPaging.list.entries[0].entry.name, 'testName1'); + assert.equal(categoriesPaging.list.entries[1].entry.id, 'testId2'); + assert.equal(categoriesPaging.list.entries[1].entry.name, 'testName2'); + done(); + }); + }); + + it('should return 404 while linking category if node with nodeId or category with categoryId does not exist', (done) => { + categoriesMock.get404CategoryLinkNotFound('testNode'); + categoriesApi.linkNodeToCategory('testNode', [{ categoryId: 'testId1' }]).then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + + it('should return 403 while linking category if user has no rights to link', (done) => { + categoriesMock.get403CategoryLinkPermissionDenied('testNode'); + categoriesApi.linkNodeToCategory('testNode', [{ categoryId: 'testId1' }]).then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 403); + done(); + } + ); + }); + + it('should return 405 while linking category if node of this type cannot be assigned to category', (done) => { + categoriesMock.get405CategoryLinkCannotAssign('testNode'); + categoriesApi.linkNodeToCategory('testNode', [{ categoryId: 'testId1' }]).then( + () => {}, + (error: { status: number }) => { + assert.equal(error.status, 405); + done(); + } + ); + }); +}); diff --git a/lib/js-api/test/content-services/commentsApi.spec.ts b/lib/js-api/test/content-services/commentsApi.spec.ts new file mode 100644 index 0000000000..50ece3c777 --- /dev/null +++ b/lib/js-api/test/content-services/commentsApi.spec.ts @@ -0,0 +1,67 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, CommentsApi } from '../../src'; +import { CommentMock, EcmAuthMock } from '../mockObjects'; + +describe('Comments', () => { + let authResponseMock: EcmAuthMock; + let commentMock: CommentMock; + let commentsApi: CommentsApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + commentMock = new CommentMock(hostEcm); + + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + commentsApi = new CommentsApi(alfrescoJsApi); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + }); + + it('should add a comment', (done) => { + commentMock.post201Response(); + + commentsApi + .createComment('74cd8a96-8a21-47e5-9b3b-a1b3e296787d', { + content: 'This is a comment' + }) + .then((data) => { + assert.equal(data.entry.content, 'This is a comment'); + done(); + }); + }); + + it('should get a comment', (done) => { + commentMock.get200Response(); + + commentsApi.listComments('74cd8a96-8a21-47e5-9b3b-a1b3e296787d').then((data) => { + assert.equal(data.list.entries[0].entry.content, 'This is another comment'); + done(); + }); + }); +}); diff --git a/lib/js-api/test/content-services/customModelApi.spec.ts b/lib/js-api/test/content-services/customModelApi.spec.ts new file mode 100644 index 0000000000..6e286429dc --- /dev/null +++ b/lib/js-api/test/content-services/customModelApi.spec.ts @@ -0,0 +1,80 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoApi, CustomModelApi } from '../../src'; +import { EcmAuthMock, CustomModelMock } from '../mockObjects'; + +describe('Custom Model Api', () => { + let authResponseMock: EcmAuthMock; + let customModelMock: CustomModelMock; + let customModelApi: CustomModelApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + customModelMock = new CustomModelMock(hostEcm); + + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + customModelApi = new CustomModelApi(alfrescoJsApi); + }); + + describe('Get', () => { + it('All Custom Model', (done) => { + customModelMock.get200AllCustomModel(); + + customModelApi.getAllCustomModel().then(() => { + done(); + }, console.error); + }); + }); + + describe('Create', () => { + it('createCustomModel', (done) => { + customModelMock.create201CustomModel(); + + const status = 'DRAFT'; + const description = 'Test model description'; + const name = 'testModel'; + const namespaceUri = 'https://www.alfresco.org/model/testNamespace/1.0'; + const namespacePrefix = 'test'; + + customModelApi.createCustomModel(status, description, name, namespaceUri, namespacePrefix).then(() => { + done(); + }, console.error); + }); + }); + + describe('PUT', () => { + it('activateCustomModel', (done) => { + customModelMock.activateCustomModel200(); + + customModelApi.activateCustomModel('testModel').then(() => { + done(); + }, console.error); + }); + }); +}); diff --git a/lib/js-api/test/content-services/groupsApi.spec.ts b/lib/js-api/test/content-services/groupsApi.spec.ts new file mode 100644 index 0000000000..4e37d4152a --- /dev/null +++ b/lib/js-api/test/content-services/groupsApi.spec.ts @@ -0,0 +1,133 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, GroupsApi } from '../../src'; +import { EcmAuthMock, GroupsMock } from '../mockObjects'; + +describe('Groups', () => { + let authResponseMock: EcmAuthMock; + let groupsMock: GroupsMock; + let groupsApi: GroupsApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + groupsMock = new GroupsMock(hostEcm); + + authResponseMock.get201Response(); + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + groupsApi = new GroupsApi(alfrescoJsApi); + }); + + it('get groups', (done) => { + groupsMock.get200GetGroups(); + + groupsApi.listGroups().then((data) => { + assert.equal(data.list.pagination.count, 2); + assert.equal(data.list.entries[0].entry.id, 'GROUP_alfalfa'); + assert.equal(data.list.entries[1].entry.id, 'GROUP_CallCenterAA'); + done(); + }); + }); + + it('create group', (done) => { + groupsMock.get200CreateGroupResponse(); + + const groupBody = { + id: 'SUB_TEST', + displayName: 'SAMPLE' + }; + + groupsApi.createGroup(groupBody).then((data) => { + assert.equal(data.entry.id, 'GROUP_TEST'); + done(); + }); + }); + + it('delete group', (done) => { + groupsMock.getDeleteGroupSuccessfulResponse('group_test'); + groupsApi.deleteGroup('group_test').then(() => { + done(); + }); + }); + + it('get single group', (done) => { + groupsMock.get200GetSingleGroup(); + + groupsApi.getGroup('GROUP_TEST').then((data) => { + assert.equal(data.entry.id, 'GROUP_TEST'); + assert.equal(data.entry.displayName, 'SAMPLE'); + done(); + }); + }); + + it('update group', (done) => { + groupsMock.get200UpdateGroupResponse(); + + const groupBody = { + displayName: 'CHANGED' + }; + + groupsApi.updateGroup('GROUP_TEST', groupBody).then((data) => { + assert.equal(data.entry.id, 'GROUP_TEST'); + assert.equal(data.entry.displayName, 'CHANGED'); + done(); + }); + }); + + it('get group members', (done) => { + groupsMock.get200GetGroupMemberships(); + + groupsApi.listGroupMemberships('GROUP_TEST').then((data) => { + assert.equal(data.list.pagination.count, 1); + assert.equal(data.list.entries[0].entry.id, 'GROUP_SUB_TEST'); + assert.equal(data.list.entries[0].entry.displayName, 'SAMPLE'); + done(); + }); + }); + + it('add group member', (done) => { + groupsMock.get200AddGroupMembershipResponse(); + + const groupBody = { + id: 'GROUP_SUB_TEST', + memberType: 'GROUP' + }; + + groupsApi.createGroupMembership('GROUP_TEST', groupBody).then((data) => { + assert.equal(data.entry.id, 'GROUP_SUB_TEST'); + assert.equal(data.entry.displayName, 'SAMPLE'); + done(); + }); + }); + + it('delete group member', (done) => { + groupsMock.getDeleteMemberForGroupSuccessfulResponse('GROUP_TEST', 'GROUP_SUB_TEST'); + groupsApi.deleteGroupMembership('GROUP_TEST', 'GROUP_SUB_TEST').then(() => { + done(); + }); + }); +}); diff --git a/lib/js-api/test/content-services/nodeApi.spec.ts b/lib/js-api/test/content-services/nodeApi.spec.ts new file mode 100644 index 0000000000..f13144cf4b --- /dev/null +++ b/lib/js-api/test/content-services/nodeApi.spec.ts @@ -0,0 +1,153 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, NodesApi } from '../../src'; +import { EcmAuthMock, NodeMock } from '../mockObjects'; + +describe('Node', () => { + let authResponseMock: EcmAuthMock; + let nodeMock: NodeMock; + let nodesApi: NodesApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + nodeMock = new NodeMock(hostEcm); + + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + nodesApi = new NodesApi(alfrescoJsApi); + }); + + describe('Get Children Node', () => { + it('information for the node with identifier nodeId should return 200 if is all ok', (done) => { + nodeMock.get200ResponseChildren(); + + nodesApi.listNodeChildren('b4cff62a-664d-4d45-9302-98723eac1319').then((data) => { + assert.equal(data.list.pagination.count, 5); + assert.equal(data.list.entries[0].entry.name, 'dataLists'); + done(); + }); + }); + + it('information for the node with identifier nodeId should return 404 if the id is does not exist', (done) => { + nodeMock.get404ChildrenNotExist(); + + nodesApi.listNodeChildren('b4cff62a-664d-4d45-9302-98723eac1319').then( + () => {}, + (error) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + + it('dynamic augmenting object parameters', (done) => { + nodeMock.get200ResponseChildrenFutureNewPossibleValue(); + + nodesApi.listNodeChildren('b4cff62a-664d-4d45-9302-98723eac1319').then((data: any) => { + assert.equal(data.list.entries[0].entry.impossibleProperties, 'impossibleRightValue'); + done(); + }); + }); + + it('should return dates as timezone-aware', (done) => { + nodeMock.get200ResponseChildrenNonUTCTimes(); + + const equalTime = (actual: Date, expected: Date) => actual.getTime() === expected.getTime(); + + nodesApi.listNodeChildren('b4cff62a-664d-4d45-9302-98723eac1320').then((data) => { + assert.equal(data.list.entries.length, 1); + const isEqual = equalTime(data.list.entries[0].entry.createdAt, new Date(Date.UTC(2011, 2, 15, 17, 4, 54, 290))); + assert.equal(isEqual, true); + done(); + }); + }); + }); + + describe('Delete', () => { + it('delete the node with identifier nodeId', (done) => { + nodeMock.get204SuccessfullyDeleted(); + + nodesApi.deleteNode('80a94ac8-3ece-47ad-864e-5d939424c47c').then(() => { + done(); + }); + }); + + it('delete the node with identifier nodeId should return 404 if the id is does not exist', (done) => { + nodeMock.get404DeleteNotFound(); + + nodesApi.deleteNode('80a94ac8-test-47ad-864e-5d939424c47c').then( + () => {}, + (error) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + + it('delete the node with identifier nodeId should return 403 if current user does not have permission to delete', (done) => { + nodeMock.get403DeletePermissionDenied(); + + nodesApi.deleteNode('80a94ac8-3ece-47ad-864e-5d939424c47c').then( + () => {}, + () => { + done(); + } + ); + }); + }); + + describe('Delete nodes', () => { + it('should call deleteNode for every id in the given array', (done) => { + let calls = 0; + + nodesApi.deleteNode = () => { + calls++; + return Promise.resolve(); + }; + + nodesApi.deleteNodes(['80a94ac8-3ece-47ad-864e-5d939424c47c', '80a94ac8-3ece-47ad-864e-5d939424c47d']).then(() => { + assert.equal(calls, 2); + done(); + }); + }); + + it('should return throw an error if one of the promises fails', (done) => { + nodeMock.get204SuccessfullyDeleted(); + nodeMock.get404DeleteNotFound(); + + nodesApi.deleteNodes(['80a94ac8-3ece-47ad-864e-5d939424c47c', '80a94ac8-test-47ad-864e-5d939424c47c']).then( + () => {}, + (error) => { + assert.equal(error.status, 404); + done(); + } + ); + }); + }); +}); diff --git a/lib/js-api/test/content-services/peopleApi.spec.ts b/lib/js-api/test/content-services/peopleApi.spec.ts new file mode 100644 index 0000000000..3a987e9052 --- /dev/null +++ b/lib/js-api/test/content-services/peopleApi.spec.ts @@ -0,0 +1,68 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoApi, PersonBodyCreate, PeopleApi } from '../../src'; +import { EcmAuthMock, PeopleMock } from '../mockObjects'; + +describe('PeopleApi', () => { + let authResponseMock: EcmAuthMock; + let peopleMock: PeopleMock; + let peopleApi: PeopleApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + peopleMock = new PeopleMock(hostEcm); + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + peopleApi = new PeopleApi(alfrescoJsApi); + }); + + it('should add a person', (done) => { + peopleMock.get201Response(); + + const payload: PersonBodyCreate = { + id: 'chewbe', + email: 'chewbe@millenniumfalcon.com', + lastName: 'Chewbe', + firstName: 'chewbacca', + password: 'Rrrrrrrghghghghgh' + }; + + peopleApi.createPerson(payload).then(() => { + done(); + }); + }); + + it('should get list of people', (done) => { + peopleMock.get200ResponsePersons(); + + peopleApi.listPeople().then(() => { + peopleMock.play(); + done(); + }); + }); +}); diff --git a/lib/js-api/test/content-services/queriesApi.spec.ts b/lib/js-api/test/content-services/queriesApi.spec.ts new file mode 100644 index 0000000000..d098da2501 --- /dev/null +++ b/lib/js-api/test/content-services/queriesApi.spec.ts @@ -0,0 +1,77 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, QueriesApi } from '../../src'; +import { EcmAuthMock, FindNodesMock } from '../mockObjects'; + +describe('Queries', () => { + let authResponseMock: EcmAuthMock; + let nodesMock: FindNodesMock; + let queriesApi: QueriesApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + nodesMock = new FindNodesMock(hostEcm); + + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + queriesApi = new QueriesApi(alfrescoJsApi); + }); + + describe('nodes', () => { + const searchTerm = 'test'; + + it('should throw exception if no search term is provided', () => { + assert.throws(() => { + queriesApi.findNodes(null); + }, `Error: Missing param 'term'`); + }); + + it('should invoke error handler on a server error', (done) => { + nodesMock.get401Response(); + + queriesApi.findNodes(searchTerm).then( + () => {}, + () => { + done(); + } + ); + }); + + it('should return query results', (done) => { + nodesMock.get200Response(); + + queriesApi.findNodes(searchTerm).then((data) => { + assert.equal(data.list.pagination.count, 2); + assert.equal(data.list.entries[0].entry.name, 'coins1.JPG'); + assert.equal(data.list.entries[1].entry.name, 'coins2.JPG'); + done(); + }); + }); + }); +}); diff --git a/lib/js-api/test/content-services/renditionApi.spec.ts b/lib/js-api/test/content-services/renditionApi.spec.ts new file mode 100644 index 0000000000..619bf69849 --- /dev/null +++ b/lib/js-api/test/content-services/renditionApi.spec.ts @@ -0,0 +1,72 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, RenditionsApi } from '../../src'; +import { EcmAuthMock, RenditionMock } from '../mockObjects'; + +describe('Rendition', () => { + let authResponseMock: EcmAuthMock; + let renditionMock: RenditionMock; + let renditionsApi: RenditionsApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + renditionMock = new RenditionMock(hostEcm); + + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + renditionsApi = new RenditionsApi(alfrescoJsApi); + }); + + it('Get Rendition', (done) => { + renditionMock.get200RenditionResponse(); + + renditionsApi.getRendition('97a29e9c-1e4f-4d9d-bb02-1ec920dda045', 'pdf').then((data) => { + assert.equal(data.entry.id, 'pdf'); + done(); + }); + }); + + it('Create Rendition', (done) => { + renditionMock.createRendition200(); + + renditionsApi.createRendition('97a29e9c-1e4f-4d9d-bb02-1ec920dda045', { id: 'pdf' }).then(() => { + done(); + }); + }); + + it('Get Renditions list for node id', (done) => { + renditionMock.get200RenditionList(); + + renditionsApi.listRenditions('97a29e9c-1e4f-4d9d-bb02-1ec920dda045').then((data) => { + assert.equal(data.list.pagination.count, 6); + assert.equal(data.list.entries[0].entry.id, 'avatar'); + done(); + }); + }); +}); diff --git a/lib/js-api/test/content-services/tagApi.spec.ts b/lib/js-api/test/content-services/tagApi.spec.ts new file mode 100644 index 0000000000..0c2134b6f0 --- /dev/null +++ b/lib/js-api/test/content-services/tagApi.spec.ts @@ -0,0 +1,151 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, TagBody, TagEntry, TagsApi } from '../../src'; +import { EcmAuthMock, TagMock } from '../mockObjects'; + +describe('Tags', () => { + let authResponseMock: EcmAuthMock; + let tagMock: TagMock; + let tagsApi: TagsApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + tagMock = new TagMock(hostEcm); + + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + tagsApi = new TagsApi(alfrescoJsApi); + }); + + describe('listTags', () => { + it('should load list of tags', (done) => { + tagMock.get200Response(); + + tagsApi.listTags().then((data) => { + assert.equal(data.list.pagination.count, 2); + assert.equal(data.list.entries[0].entry.tag, 'tag-test-1'); + assert.equal(data.list.entries[1].entry.tag, 'tag-test-2'); + done(); + }); + }); + + it('should handle 401 error', (done) => { + tagMock.get401Response(); + + tagsApi.listTags().then( + () => {}, + () => { + done(); + } + ); + }); + + it('should return specified tag', (done) => { + tagMock.getTagsByNamesFilterByExactTag200Response(); + + tagsApi + .listTags({ + tag: 'tag-test-1' + }) + .then((data) => { + assert.equal(data.list.entries[0].entry.tag, 'tag-test-1'); + assert.equal(data.list.entries[0].entry.id, '0d89aa82-f2b8-4a37-9a54-f4c5148174d6'); + done(); + }); + }); + + it('should return tags contained specified value', (done) => { + tagMock.getTagsByNameFilteredByMatching200Response(); + + tagsApi + .listTags({ + tag: '*tag-test*', + matching: true + }) + .then((data) => { + assert.equal(data?.list.entries.length, 2); + + assert.equal(data.list.entries[0].entry.tag, 'tag-test-1'); + assert.equal(data.list.entries[0].entry.id, '0d89aa82-f2b8-4a37-9a54-f4c5148174d6'); + + assert.equal(data.list.entries[1].entry.tag, 'tag-test-2'); + assert.equal(data.list.entries[1].entry.id, 'd79bdbd0-9f55-45bb-9521-811e15bf48f6'); + + done(); + }); + }); + }); + + describe('createTags', () => { + it('should return created tags', (done: Mocha.Done) => { + tagMock.createTags201Response(); + tagsApi.createTags([new TagBody(), new TagBody()]).then((tags) => { + assert.equal(tags.length, 2); + assert.equal(tags[0].entry.tag, 'tag-test-1'); + assert.equal(tags[1].entry.tag, 'tag-test-2'); + done(); + }); + }); + + it('should throw error if tags are not passed', () => { + assert.throws(tagsApi.createTags.bind(tagsApi, null)); + }); + }); + + describe('assignTagsToNode', () => { + it('should return tags after assigning them to node', (done) => { + const tag1 = new TagBody(); + tag1.tag = 'tag-test-1'; + const tag2 = new TagBody(); + tag2.tag = 'tag-test-2'; + const tags = [tag1, tag2]; + tagMock.get201ResponseForAssigningTagsToNode(tags); + + tagsApi.assignTagsToNode('someNodeId', tags).then((tagPaging) => { + assert.equal(tagPaging.list.pagination.count, 2); + assert.equal(tagPaging.list.entries[0].entry.tag, tag1.tag); + assert.equal(tagPaging.list.entries[1].entry.tag, tag2.tag); + done(); + }); + }); + + it('should return tag after assigning it to node', (done) => { + const tag = new TagBody(); + tag.tag = 'tag-test-1'; + const tags = [tag]; + tagMock.get201ResponseForAssigningTagsToNode(tags); + + tagsApi.assignTagsToNode('someNodeId', tags).then((data) => { + const tagEntry = data as TagEntry; + assert.equal(tagEntry.entry.tag, tag.tag); + done(); + }); + }); + }); +}); diff --git a/lib/js-api/test/content-services/versionsApi.spec.ts b/lib/js-api/test/content-services/versionsApi.spec.ts new file mode 100644 index 0000000000..2a726ce1c9 --- /dev/null +++ b/lib/js-api/test/content-services/versionsApi.spec.ts @@ -0,0 +1,92 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, VersionsApi } from '../../src'; +import { EcmAuthMock, VersionMock } from '../mockObjects'; + +describe('Versions', () => { + const nodeId = '74cd8a96-8a21-47e5-9b3b-a1b3e296787d'; + const versionId = '1.0'; + const renditionId = 'pdf'; + + let authResponseMock: EcmAuthMock; + let versionMock: VersionMock; + let versionsApi: VersionsApi; + + beforeEach(async () => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + versionMock = new VersionMock(hostEcm); + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ hostEcm }); + await alfrescoJsApi.login('admin', 'admin'); + + versionsApi = new VersionsApi(alfrescoJsApi); + }); + + it('should list all node version renditions', (done) => { + versionMock.get200ResponseVersionRenditions(nodeId, versionId); + + versionsApi.listVersionRenditions(nodeId, versionId).then((data) => { + const entries = data.list.entries; + assert.equal(entries.length, 6); + assert.equal(data.list.entries[0].entry.id, 'avatar'); + done(); + }); + }); + + it('should create rendition for a node versionId', (done) => { + versionMock.create200VersionRendition(nodeId, versionId); + + versionsApi.createVersionRendition(nodeId, versionId, { id: 'pdf' }).then(() => { + done(); + }); + }); + + it('should get a node version rendition', (done) => { + versionMock.get200VersionRendition(nodeId, versionId, renditionId); + + versionsApi.getVersionRendition(nodeId, versionId, renditionId).then((data) => { + assert.equal(data.entry.id, 'pdf'); + done(); + }); + }); + + it('should get version history', (done) => { + versionMock.get200Response(nodeId); + + versionsApi.listVersionHistory(nodeId).then((data) => { + const entries = data.list.entries; + assert.equal(entries.length, 2); + assert.equal(entries[0].entry.id, '2.0'); + assert.equal(entries[1].entry.id, '1.0'); + done(); + }); + }); + + it('should revert a version', (done) => { + versionMock.post201Response(nodeId, versionId); + + versionsApi.revertVersion(nodeId, versionId, { majorVersion: true, comment: '' }).then((data) => { + assert.equal(data.entry.id, '3.0'); + done(); + }); + }); +}); diff --git a/lib/js-api/test/content-services/webScriptApi.spec.ts b/lib/js-api/test/content-services/webScriptApi.spec.ts new file mode 100644 index 0000000000..1eff25b704 --- /dev/null +++ b/lib/js-api/test/content-services/webScriptApi.spec.ts @@ -0,0 +1,111 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, WebscriptApi } from '../../src'; +import { EcmAuthMock, WebScriptMock } from '../mockObjects'; + +describe('WebScript', () => { + const hostEcm = 'https://127.0.0.1:8080'; + const contextRoot = 'script'; + const servicePath = 'alfresco'; + const scriptPath = 'testWebScript'; + + let authResponseMock: EcmAuthMock; + let webScriptMock: WebScriptMock; + let webscriptApi: WebscriptApi; + + beforeEach((done) => { + authResponseMock = new EcmAuthMock(hostEcm); + webScriptMock = new WebScriptMock(hostEcm, contextRoot, servicePath, scriptPath); + authResponseMock.get201Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + webscriptApi = new WebscriptApi(alfrescoJsApi); + }); + + it('execute webScript return 400 error if is not present on the server should be handled by reject promise', (done) => { + webScriptMock.get404Response(); + + webscriptApi.executeWebScript('GET', scriptPath, null, contextRoot, servicePath).catch((error: any) => { + assert.equal(error.status, 404); + done(); + }); + }); + + it('execute webScript GET return 200 if all is ok should be handled by resolve promise', (done) => { + webScriptMock.get200Response(); + + webscriptApi.executeWebScript('GET', scriptPath, null, contextRoot, servicePath).then(() => { + done(); + }); + }); + + it('execute webScript that return HTML should not return it as Object', (done) => { + webScriptMock.get200ResponseHTMLFormat(); + + webscriptApi.executeWebScript('GET', 'sample/folder/Company%20Home').then((data) => { + try { + JSON.parse(data); + } catch (e) { + done(); + } + }); + }); + + describe('Events', () => { + it('WebScript should fire success event at the end', (done) => { + webScriptMock.get200Response(); + + const webscriptPromise: any = webscriptApi.executeWebScript('GET', scriptPath, null, contextRoot, servicePath); + + webscriptPromise.catch(() => {}); + webscriptPromise.on('success', () => { + done(); + }); + }); + + it('WebScript should fire error event if something go wrong', (done) => { + webScriptMock.get404Response(); + + const webscriptPromise: any = webscriptApi.executeWebScript('GET', scriptPath, null, contextRoot, servicePath); + + webscriptPromise.catch(() => {}); + webscriptPromise.on('error', () => { + done(); + }); + }); + + it('WebScript should fire unauthorized event if get 401', (done) => { + webScriptMock.get401Response(); + + const webscriptPromise: any = webscriptApi.executeWebScript('GET', scriptPath, null, contextRoot, servicePath); + + webscriptPromise.catch(() => {}); + webscriptPromise.on('unauthorized', () => { + done(); + }); + }); + }); +}); diff --git a/lib/js-api/test/discoveryApi.spec.ts b/lib/js-api/test/discoveryApi.spec.ts new file mode 100644 index 0000000000..21f8216050 --- /dev/null +++ b/lib/js-api/test/discoveryApi.spec.ts @@ -0,0 +1,54 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, DiscoveryApi } from '../src'; +import { DiscoveryMock, EcmAuthMock } from './mockObjects'; + +describe('Discovery', () => { + let authResponseMock: EcmAuthMock; + let discoveryMock: DiscoveryMock; + let discoveryApi: DiscoveryApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + authResponseMock.get201Response(); + + discoveryMock = new DiscoveryMock(hostEcm); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + discoveryApi = new DiscoveryApi(alfrescoJsApi); + }); + + it('should getRepositoryInformation works', (done) => { + discoveryMock.get200Response(); + + discoveryApi.getRepositoryInformation().then((data) => { + assert.equal(data.entry.repository.edition, 'Enterprise'); + done(); + }); + }); +}); diff --git a/lib/js-api/test/ecmAuth.spec.ts b/lib/js-api/test/ecmAuth.spec.ts new file mode 100644 index 0000000000..bc6c069c9d --- /dev/null +++ b/lib/js-api/test/ecmAuth.spec.ts @@ -0,0 +1,236 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, ContentAuth } from '../src'; +import { EcmAuthMock as AuthEcmMock } from '../test/mockObjects'; + +describe('Ecm Auth test', () => { + const hostEcm = 'https://127.0.0.1:8080'; + + let alfrescoJsApi: AlfrescoApi; + let authEcmMock: AuthEcmMock; + let contentAuth: ContentAuth; + + beforeEach(() => { + authEcmMock = new AuthEcmMock(hostEcm); + + alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + contentAuth = new ContentAuth( + { + contextRoot: 'alfresco', + hostEcm + }, + alfrescoJsApi + ); + }); + + it('should remember username on login', () => { + const auth = new ContentAuth({}, alfrescoJsApi); + auth.login('johndoe', 'password'); + assert.equal(auth.authentications.basicAuth.username, 'johndoe'); + }); + + it('should forget username on logout', (done) => { + const auth = new ContentAuth({}, alfrescoJsApi); + + authEcmMock.get201Response(); + + auth.login('johndoe', 'password'); + assert.equal(auth.authentications.basicAuth.username, 'johndoe'); + + authEcmMock.get204ResponseLogout(); + + auth.logout().then(() => { + assert.equal(auth.authentications.basicAuth.username, null); + done(); + }); + }); + + describe('With Authentication', () => { + it('login should return the Ticket if all is ok', (done) => { + authEcmMock.get201Response(); + + contentAuth.login('admin', 'admin').then((data) => { + assert.equal(data, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + done(); + }); + }); + + it('login password should be removed after login', (done) => { + authEcmMock.get201Response(); + + contentAuth.login('admin', 'admin').then(() => { + assert.notEqual(contentAuth.authentications.basicAuth.password, 'admin'); + done(); + }); + }); + + it('isLoggedIn should return true if the api is logged in', (done) => { + authEcmMock.get201Response(); + + contentAuth.login('admin', 'admin').then(() => { + assert.equal(contentAuth.isLoggedIn(), true); + done(); + }); + }); + + it('isLoggedIn should return false if the host change', (done) => { + authEcmMock.get201Response(); + + contentAuth.login('admin', 'admin').then(() => { + assert.equal(contentAuth.isLoggedIn(), true); + contentAuth.changeHost(); + assert.equal(contentAuth.isLoggedIn(), false); + done(); + }); + }); + + it('isLoggedIn should return false if the api is logged out', (done) => { + authEcmMock.get201Response(); + + contentAuth.login('admin', 'admin'); + + authEcmMock.get204ResponseLogout(); + + contentAuth.logout().then(() => { + assert.equal(contentAuth.isLoggedIn(), false); + done(); + }); + }); + + it('login should return an error if wrong credential are used 403 the login fails', (done) => { + authEcmMock.get403Response(); + + contentAuth.login('wrong', 'name').then( + () => {}, + (error: any) => { + assert.equal(error.status, 403); + done(); + } + ); + }); + + it('login should return an error if wrong credential are used 400 userId and/or password are/is not provided', (done) => { + authEcmMock.get400Response(); + + contentAuth.login(null, null).then( + () => {}, + (error) => { + assert.equal(error.status, 400); + done(); + } + ); + }); + + describe('Events ', () => { + it('login should fire an event if is unauthorized 401', (done) => { + authEcmMock.get401Response(); + + const loginPromise: any = contentAuth.login('wrong', 'name'); + loginPromise.catch(() => {}); + + loginPromise.on('unauthorized', () => { + done(); + }); + }); + + it('login should fire an event if is forbidden 403', (done) => { + authEcmMock.get403Response(); + + const loginPromise: any = contentAuth.login('wrong', 'name'); + + loginPromise.catch(() => {}); + + loginPromise.on('forbidden', () => { + done(); + }); + }); + + it('The Api Should fire success event if is all ok 201', (done) => { + authEcmMock.get201Response(); + + const loginPromise: any = contentAuth.login('admin', 'admin'); + + loginPromise.catch(() => {}); + + loginPromise.on('success', () => { + done(); + }); + }); + + it('The Api Should fire logout event if the logout is successfull', (done) => { + authEcmMock.get201Response(); + contentAuth.login('admin', 'admin'); + authEcmMock.get204ResponseLogout(); + + (contentAuth.logout() as any).on('logout', () => { + done(); + }); + }); + }); + + describe('With Ticket Authentication', () => { + it('Ticket should be present in the client', () => { + authEcmMock.get400Response(); + + contentAuth = new ContentAuth( + { + ticketEcm: 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', + hostEcm + }, + alfrescoJsApi + ); + + assert.equal('TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', contentAuth.authentications.basicAuth.password); + }); + }); + + describe('Logout Api', () => { + beforeEach((done) => { + authEcmMock.get201Response('TICKET_22d7a5a83d78b9cc9666ec4e412475e5455b33bd'); + + contentAuth.login('admin', 'admin').then(() => { + done(); + }); + }); + + it('Ticket should be absent in the client and the resolve promise should be called', (done) => { + authEcmMock.get204ResponseLogout(); + + contentAuth.logout().then(() => { + assert.equal(contentAuth.config.ticket, undefined); + done(); + }); + }); + + it('Logout should be rejected if the Ticket is already expired', (done) => { + authEcmMock.get404ResponseLogout(); + contentAuth.logout().then( + () => {}, + (error) => { + assert.equal(error.error.toString(), 'Error: Not Found'); + done(); + } + ); + }); + }); + }); +}); diff --git a/lib/js-api/test/governance-services/authorityClearanceApi.spec.ts b/lib/js-api/test/governance-services/authorityClearanceApi.spec.ts new file mode 100644 index 0000000000..38d1619a41 --- /dev/null +++ b/lib/js-api/test/governance-services/authorityClearanceApi.spec.ts @@ -0,0 +1,95 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, NodeSecurityMarkBody, SecurityMarkEntry, SecurityMarkPaging, AuthorityClearanceApi } from '../../src'; +import { AuthorityClearanceMock, EcmAuthMock } from '../mockObjects'; + +const DEFAULT_OPTS = { + skipCount: 0, + maxItems: 100 +}; + +describe('Authority Clearance API test', () => { + let authResponseMock: EcmAuthMock; + let authorityClearanceMock: AuthorityClearanceMock; + let authorityClearanceApi: AuthorityClearanceApi; + const nodeSecurityMarkBodyList: Array<NodeSecurityMarkBody> = [ + { + groupId: 'securityGroupFruits', + op: 'ADD', + id: 'fruitMarkId1' + }, + { + groupId: 'securityGroupFruits', + op: 'ADD', + id: 'fruitMarkId1' + } + ]; + const nodeSecurityMarkBodySingle: Array<NodeSecurityMarkBody> = [ + { + groupId: 'securityGroupFruits', + op: 'ADD', + id: 'fruitMarkId1' + } + ]; + + beforeEach(async () => { + const hostEcm = 'https://127.0.0.1:8080'; + authResponseMock = new EcmAuthMock(hostEcm); + authResponseMock.get201Response(); + authorityClearanceMock = new AuthorityClearanceMock(hostEcm); + const alfrescoApi = new AlfrescoApi({ + hostEcm + }); + authorityClearanceApi = new AuthorityClearanceApi(alfrescoApi); + await alfrescoApi.login('admin', 'admin'); + }); + + it('get authority clearances for an authority', async () => { + const nodeId = 'testAuthorityId'; + authorityClearanceMock.get200AuthorityClearanceForAuthority(nodeId); + await authorityClearanceApi.getAuthorityClearanceForAuthority(nodeId, DEFAULT_OPTS).then((response) => { + assert.equal(response.list.entries[0].entry.id, 'securityGroupFruits'); + assert.equal(response.list.entries[0].entry.displayLabel, 'Security Group FRUITS'); + assert.equal(response.list.entries[0].entry.type, 'USER_REQUIRES_ALL'); + assert.equal(response.list.entries[0].entry.marks.length, 3); + }); + }); + + it('add single security marks to an authority', async () => { + const nodeId = 'testAuthorityId'; + authorityClearanceMock.post200AuthorityClearanceWithSingleItem(nodeId); + await authorityClearanceApi.updateAuthorityClearance(nodeId, nodeSecurityMarkBodySingle).then((data) => { + const response = data as SecurityMarkEntry; + assert.equal(response.entry.id, 'fruitMarkId1'); + assert.equal(response.entry.name, 'APPLES'); + assert.equal(response.entry.groupId, 'securityGroupFruits'); + }); + }); + + it('add multiple security marks on an authority', async () => { + const nodeId = 'testAuthorityId'; + authorityClearanceMock.post200AuthorityClearanceWithList(nodeId); + await authorityClearanceApi.updateAuthorityClearance(nodeId, nodeSecurityMarkBodyList).then((data) => { + const response = data as SecurityMarkPaging; + assert.equal(response.list.entries[0].entry.id, 'fruitMarkId1'); + assert.equal(response.list.entries[0].entry.name, 'APPLES'); + assert.equal(response.list.entries[0].entry.groupId, 'securityGroupFruits'); + }); + }); +}); diff --git a/lib/js-api/test/governance-services/gsSitesApi.spec.ts b/lib/js-api/test/governance-services/gsSitesApi.spec.ts new file mode 100644 index 0000000000..197a00491b --- /dev/null +++ b/lib/js-api/test/governance-services/gsSitesApi.spec.ts @@ -0,0 +1,50 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, GsSitesApi } from '../../src'; +import { EcmAuthMock, GsSitesApiMock } from '../mockObjects'; + +describe('Governance API test', () => { + let authResponseMock: EcmAuthMock; + let gsSitesApiMock: GsSitesApiMock; + let gsSitesApi: GsSitesApi; + + beforeEach(() => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + authResponseMock.get201Response(); + + gsSitesApiMock = new GsSitesApiMock(hostEcm); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + gsSitesApi = new GsSitesApi(alfrescoJsApi); + }); + + it('should getRMSite return the RM site', (done) => { + gsSitesApiMock.get200Response(); + + gsSitesApi.getRMSite().then((data) => { + assert.equal(data.entry.description, 'Records Management Description Test'); + done(); + }); + }); +}); diff --git a/lib/js-api/test/governance-services/nodeSecurityMarksApi.spec.ts b/lib/js-api/test/governance-services/nodeSecurityMarksApi.spec.ts new file mode 100644 index 0000000000..3542dcb3c8 --- /dev/null +++ b/lib/js-api/test/governance-services/nodeSecurityMarksApi.spec.ts @@ -0,0 +1,70 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, NodeSecurityMarksApi, NodeSecurityMarkBody } from '../../src'; +import { EcmAuthMock, NodeSecurityMarksApiMock } from '../mockObjects'; + +describe('Node Security Mark API test', () => { + let authResponseMock: EcmAuthMock; + let nodeSecurityMarksMock: NodeSecurityMarksApiMock; + let nodeSecurityMarksApi: NodeSecurityMarksApi; + const nodeSecurityMarkBody: Array<NodeSecurityMarkBody> = [ + { + groupId: 'securityGroupId1', + op: 'ADD', + id: 'Sh1G8vTQ' + }, + { + groupId: 'securityGroupId2', + op: 'ADD', + id: 'Sh1G8vTR' + } + ]; + + beforeEach(async () => { + const hostEcm = 'https://127.0.0.1:8080'; + authResponseMock = new EcmAuthMock(hostEcm); + authResponseMock.get201Response(); + nodeSecurityMarksMock = new NodeSecurityMarksApiMock(hostEcm); + const alfrescoApi = new AlfrescoApi({ + hostEcm + }); + nodeSecurityMarksApi = new NodeSecurityMarksApi(alfrescoApi); + await alfrescoApi.login('admin', 'admin'); + }); + + it('add or remove security marks on a node', async () => { + const nodeId = 'h3bdk2knw2kn'; + nodeSecurityMarksMock.post200manageSecurityMarkOnNode(nodeId); + await nodeSecurityMarksApi.manageSecurityMarksOnNode(nodeId, nodeSecurityMarkBody).then((data) => { + assert.equal(data.list.entries[0].entry.groupId, 'securityGroupId1'); + assert.equal(data.list.entries[0].entry.id, 'Sh1G8vTQ'); + assert.equal(data.list.entries[0].entry.name, 'SecurityMarkTest1'); + }); + }); + + it('get security marks on a node', async () => { + const nodeId = 'h3bdk2knw2kn'; + nodeSecurityMarksMock.get200SecurityMarkOnNode(nodeId); + await nodeSecurityMarksApi.getSecurityMarksOnNode(nodeId).then((data) => { + assert.equal(data.list.entries[1].entry.groupId, 'securityGroupId2'); + assert.equal(data.list.entries[1].entry.id, 'Sh1G8vTR'); + assert.equal(data.list.entries[1].entry.name, 'SecurityMarkTest2'); + }); + }); +}); diff --git a/lib/js-api/test/governance-services/securityGroupApi.spec.ts b/lib/js-api/test/governance-services/securityGroupApi.spec.ts new file mode 100644 index 0000000000..ac47c61e28 --- /dev/null +++ b/lib/js-api/test/governance-services/securityGroupApi.spec.ts @@ -0,0 +1,93 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoApi, SecurityGroupsApi, SecurityGroupBody } from '../../src'; +import assert from 'assert'; +import { EcmAuthMock, SecurityGroupApiMock } from '../mockObjects'; + +describe('Security Group API test', () => { + let authResponseMock: EcmAuthMock; + let securityGroupMock: SecurityGroupApiMock; + let securityGroupApi: SecurityGroupsApi; + const securityGroupBody: SecurityGroupBody = { + groupName: 'Alfresco', + groupType: 'HIERARCHICAL' + }; + let securityGroupId: string; + + beforeEach(async () => { + const hostEcm = 'https://127.0.0.1:8080'; + authResponseMock = new EcmAuthMock(hostEcm); + authResponseMock.get201Response(); + securityGroupMock = new SecurityGroupApiMock(hostEcm); + const alfrescoApi = new AlfrescoApi({ + hostEcm + }); + securityGroupApi = new SecurityGroupsApi(alfrescoApi); + await alfrescoApi.login('admin', 'admin'); + }); + + it('create Security Group', async () => { + securityGroupMock.createSecurityGroup200Response(); + await securityGroupApi.createSecurityGroup(securityGroupBody).then((data) => { + securityGroupId = data.entry.id; + assert.notEqual(data.entry.id, null); + assert.equal(data.entry.groupName, 'Alfresco'); + assert.equal(data.entry.groupType, 'HIERARCHICAL'); + }); + }); + + it('get All Security Groups', async () => { + securityGroupMock.getSecurityGroups200Response(); + await securityGroupApi.getSecurityGroups().then((data) => { + assert.equal(data.list.entries.length > 0, true); + }); + }); + + it('get Security Group Information', async () => { + securityGroupMock.getSecurityGroupInfo200Response(securityGroupId); + await securityGroupApi.getSecurityGroupInfo(securityGroupId).then((data) => { + assert.notEqual(data.entry.id, null); + assert.equal(data.entry.groupName, 'Alfresco'); + assert.equal(data.entry.groupType, 'HIERARCHICAL'); + }); + }); + + it('update Security Group', async () => { + securityGroupMock.updateSecurityGroup200Response(securityGroupId); + const updatedSecurityGroupBody: SecurityGroupBody = { + groupName: 'Nasa' + }; + await securityGroupApi.updateSecurityGroup(securityGroupId, updatedSecurityGroupBody).then((data) => { + assert.notEqual(data.entry.id, null); + assert.equal(data.entry.groupName, 'Nasa'); + assert.equal(data.entry.groupType, 'HIERARCHICAL'); + }); + }); + + it('delete Security Group', async () => { + securityGroupMock.deleteSecurityGroup200Response(securityGroupId); + await securityGroupApi + .deleteSecurityGroup(securityGroupId) + .then((data) => { + Promise.resolve(data); + }) + .catch((err) => { + Promise.reject(err); + }); + }); +}); diff --git a/lib/js-api/test/governance-services/securityMarksApi.spec.ts b/lib/js-api/test/governance-services/securityMarksApi.spec.ts new file mode 100644 index 0000000000..7083e04b1a --- /dev/null +++ b/lib/js-api/test/governance-services/securityMarksApi.spec.ts @@ -0,0 +1,130 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, SecurityGroupBody, SecurityGroupsApi, SecurityMarkBody, SecurityMarksApi, SecurityMarksBody } from '../../src'; +import { EcmAuthMock, SecurityGroupApiMock, SecurityMarkApiMock } from '../mockObjects'; + +describe('Security Mark API test', () => { + let authResponseMock: EcmAuthMock; + let securityMarkApiMock: SecurityMarkApiMock; + let securityGroupMock: SecurityGroupApiMock; + let securityGroupApi: SecurityGroupsApi; + let securityMarksApi: SecurityMarksApi; + let securityGroupId = 'a0a7b107-84ba-4c3d-b0b7-a8509e8c1c33'; + let securityMarkId = 'Sh1G8vTQ'; + const securityMarksBodySingle: SecurityMarksBody = [ + { + name: 'SecurityMarkTest' + } + ]; + const securityGroupBody: SecurityGroupBody = { + groupName: 'Alfresco', + groupType: 'HIERARCHICAL' + }; + const securityMarksBody: SecurityMarksBody = [ + { + name: 'SecurityMark3' + }, + { + name: 'SecurityMark4' + } + ]; + + beforeEach(async () => { + const hostEcm = 'https://127.0.0.1:8080'; + authResponseMock = new EcmAuthMock(hostEcm); + authResponseMock.get201Response(); + securityGroupMock = new SecurityGroupApiMock(hostEcm); + securityMarkApiMock = new SecurityMarkApiMock(hostEcm); + const alfrescoApi = new AlfrescoApi({ + hostEcm + }); + securityGroupApi = new SecurityGroupsApi(alfrescoApi); + securityMarksApi = new SecurityMarksApi(alfrescoApi); + await alfrescoApi.login('admin', 'admin'); + }); + + it('create Security Group', async () => { + securityGroupMock.createSecurityGroup200Response(); + await securityGroupApi.createSecurityGroup(securityGroupBody).then((data) => { + securityGroupId = data.entry.id; + assert.notEqual(data.entry.id, null); + assert.equal(data.entry.groupName, 'Alfresco'); + assert.equal(data.entry.groupType, 'HIERARCHICAL'); + }); + }); + + it('create Security Mark', async () => { + securityMarkApiMock.createSecurityMark200Response(securityGroupId); + await securityMarksApi.createSecurityMarks(securityGroupId, securityMarksBodySingle).then((data: any) => { + securityMarkId = data.entry.id; + assert.notEqual(data.entry.id, null); + assert.equal(data.entry.name, 'SecurityMarkTest'); + assert.equal(data.entry.groupId, securityGroupId); + }); + }); + + it('create multiple Security Mark', async () => { + securityMarkApiMock.createSecurityMarks200Response(securityGroupId); + await securityMarksApi.createSecurityMarks(securityGroupId, securityMarksBody).then((data: any) => { + assert.notEqual(data.list.entries[0].entry.id, null); + assert.equal(data.list.entries[0].entry.name, 'SecurityMark3'); + assert.equal(data.list.entries[0].entry.groupId, securityGroupId); + }); + }); + + it('get All Security Marks', async () => { + securityMarkApiMock.get200GetSecurityMark(securityGroupId); + await securityMarksApi.getSecurityMarks(securityGroupId).then((data) => { + assert.equal(data.list.entries.length > 0, true); + }); + }); + + it('get Security Mark Information', async () => { + securityMarkApiMock.get200GetSingleSecurityMark(securityGroupId, securityMarkId); + await securityMarksApi.getSecurityMark(securityGroupId, securityMarkId).then((data) => { + assert.notEqual(data.entry.id, null); + assert.equal(data.entry.name, 'SecurityMarkTest'); + assert.equal(data.entry.groupId, securityGroupId); + }); + }); + + it('update Security Mark', async () => { + const updatedSecurityMarkBody: SecurityMarkBody = { + name: 'AlfrescoSecurityMark' + }; + securityMarkApiMock.put200UpdateSecurityMarkResponse(securityGroupId, securityMarkId); + await securityMarksApi.updateSecurityMark(securityGroupId, securityMarkId, updatedSecurityMarkBody).then((data) => { + assert.notEqual(data.entry.id, null); + assert.equal(data.entry.name, 'AlfrescoSecurityMark'); + assert.equal(data.entry.groupId, securityGroupId); + }); + }); + + it('delete Security Mark', async () => { + securityMarkApiMock.getDeleteSecurityMarkSuccessfulResponse(securityGroupId, securityMarkId); + await securityGroupApi + .deleteSecurityGroup(securityGroupId) + .then((data) => { + Promise.resolve(data); + }) + .catch((err) => { + Promise.reject(err); + }); + }); +}); diff --git a/lib/js-api/test/mockObjects/assets/testFile.txt b/lib/js-api/test/mockObjects/assets/testFile.txt new file mode 100644 index 0000000000..fb2e3670e2 --- /dev/null +++ b/lib/js-api/test/mockObjects/assets/testFile.txt @@ -0,0 +1 @@ +this is a test upload File. diff --git a/lib/js-api/test/mockObjects/assets/testFile2.txt b/lib/js-api/test/mockObjects/assets/testFile2.txt new file mode 100644 index 0000000000..186c9d76c5 --- /dev/null +++ b/lib/js-api/test/mockObjects/assets/testFile2.txt @@ -0,0 +1 @@ +this is a test form multiple upload File. diff --git a/lib/js-api/test/mockObjects/base.mock.ts b/lib/js-api/test/mockObjects/base.mock.ts new file mode 100644 index 0000000000..a3f15cdb48 --- /dev/null +++ b/lib/js-api/test/mockObjects/base.mock.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; + +export class BaseMock { + host: string; + + constructor(host?: string) { + this.host = host || 'https://127.0.0.1:8080'; + } + + put200GenericResponse(scriptSlug: string): void { + nock(this.host, { encodedQueryParams: true }).put(scriptSlug).reply(200); + } + + play(): void { + nock.recorder.play(); + } + + cleanAll(): void { + nock.cleanAll(); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/categories.mock.ts b/lib/js-api/test/mockObjects/content-services/categories.mock.ts new file mode 100644 index 0000000000..aa9c2c5fa3 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/categories.mock.ts @@ -0,0 +1,347 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class CategoriesMock extends BaseMock { + get200ResponseSubcategories(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}/subcategories`) + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + id: 'testId1', + name: 'testName1', + parentId: '-root-', + hasChildren: true, + count: 0 + } + }, + { + entry: { + id: 'testId2', + name: 'testName2', + parentId: '-root-', + hasChildren: true, + count: 0 + } + } + ] + } + }); + } + + get404SubcategoryNotExist(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}/subcategories`) + .reply(404, { + error: { + errorKey: 'framework.exception.EntityNotFound', + statusCode: 404, + briefSummary: `05220073 The entity with id: ${categoryId} was not found`, + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get200ResponseCategory(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}`) + .reply(200, { + entry: { + id: 'testId1', + name: 'testName1', + parentId: '-root-', + hasChildren: true, + count: 0 + } + }); + } + + get404CategoryNotExist(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}`) + .reply(404, { + error: { + errorKey: 'framework.exception.EntityNotFound', + statusCode: 404, + briefSummary: `05220073 The entity with id: ${categoryId} was not found`, + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get200ResponseNodeCategoryLinks(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links`) + .reply(200, { + list: { + pagination: { + count: 1, + hasMoreItems: false, + totalItems: 1, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + id: 'testId1', + name: 'testName1', + parentId: 'testNode', + hasChildren: true, + count: 0 + } + } + ] + } + }); + } + + get403NodeCategoryLinksPermissionDenied(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links`) + .reply(403, { + error: { + statusCode: 403 + } + }); + } + + get404NodeNotExist(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links`) + .reply(404, { + error: { + errorKey: 'framework.exception.EntityNotFound', + statusCode: 404, + briefSummary: `05220073 The entity with id: ${nodeId} was not found`, + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get204CategoryUnlinked(nodeId: string, categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links/${categoryId}`) + .reply(204); + } + + get403CategoryUnlinkPermissionDenied(nodeId: string, categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links/${categoryId}`) + .reply(403, { + error: { + statusCode: 403 + } + }); + } + + get404CategoryUnlinkNotFound(nodeId: string, categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links/${categoryId}`) + .reply(404, { + error: { + errorKey: 'framework.exception.EntityNotFound', + statusCode: 404, + briefSummary: `05230078 The entity with id: ${nodeId} or ${categoryId} was not found`, + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get200ResponseCategoryUpdated(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}`, { name: 'testName1' }) + .reply(200, { + entry: { + id: 'testId1', + name: 'testName1', + parentId: '-root-', + hasChildren: true, + count: 0 + } + }); + } + + get403CategoryUpdatePermissionDenied(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}`, { name: 'testName1' }) + .reply(403, { + error: { + statusCode: 403 + } + }); + } + + get404CategoryUpdateNotFound(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}`, { name: 'testName1' }) + .reply(404, { + error: { + errorKey: 'framework.exception.EntityNotFound', + statusCode: 404, + briefSummary: `05230078 The entity with id: ${categoryId} was not found`, + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get201ResponseCategoryCreated(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}/subcategories`, [{ name: 'testName10' }]) + .reply(201, { + entry: { + id: 'testId10', + name: 'testName10', + parentId: categoryId, + hasChildren: true, + count: 0 + } + }); + } + + get403CategoryCreatedPermissionDenied(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}/subcategories`, [{ name: 'testName10' }]) + .reply(403, { + error: { + statusCode: 403 + } + }); + } + + get409CategoryCreateAlreadyExists(categoryId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post(`/alfresco/api/-default-/public/alfresco/versions/1/categories/${categoryId}/subcategories`, [{ name: 'testName10' }]) + .reply(409, { + error: { + errorKey: 'Duplicate child name not allowed: testName10', + statusCode: 409, + briefSummary: '06050055 Duplicate child name not allowed: testName10', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get201ResponseCategoryLinked(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links`, [{ categoryId: 'testId1' }]) + .reply(201, { + entry: { + id: 'testId1', + name: 'testName1', + parentId: nodeId, + hasChildren: true, + count: 0 + } + }); + } + + get201ResponseCategoryLinkedArray(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links`, [ + { categoryId: 'testId1' }, + { categoryId: 'testId2' } + ]) + .reply(201, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + id: 'testId1', + name: 'testName1', + parentId: 'testNodeArr', + hasChildren: true, + count: 0 + } + }, + { + entry: { + id: 'testId2', + name: 'testName2', + parentId: 'testNodeArr', + hasChildren: true, + count: 0 + } + } + ] + } + }); + } + + get403CategoryLinkPermissionDenied(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links`, [{ categoryId: 'testId1' }]) + .reply(403, { + error: { + statusCode: 403 + } + }); + } + + get404CategoryLinkNotFound(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links`, [{ categoryId: 'testId1' }]) + .reply(404, { + error: { + errorKey: 'framework.exception.EntityNotFound', + statusCode: 404, + briefSummary: `05230078 The entity with id: ${nodeId} or testId1 was not found`, + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get405CategoryLinkCannotAssign(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post(`/alfresco/api/-default-/public/alfresco/versions/1/nodes/${nodeId}/category-links`, [{ categoryId: 'testId1' }]) + .reply(405, { + error: { + errorKey: 'Cannot assign node of this type to a category', + statusCode: 405, + briefSummary: `05230078 Cannot assign a node of this type to a category`, + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/comment.mock.ts b/lib/js-api/test/mockObjects/content-services/comment.mock.ts new file mode 100644 index 0000000000..ce0ca3489a --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/comment.mock.ts @@ -0,0 +1,105 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +const adminUser = { + aspectNames: ['cm:ownable'], + firstName: 'Administrator', + emailNotificationsEnabled: true, + company: {}, + id: 'admin', + enabled: true, + email: 'admin@alfresco.com', + properties: { + 'cm:homeFolderProvider': 'bootstrapHomeFolderProvider', + 'cm:authorizationStatus': 'AUTHORIZED', + 'cm:homeFolder': '72866d2e-64ee-45a2-ae00-30a5ced96a41', + 'cm:name': '56f78250-37a7-4e22-b35a-64b53ae1e5ca', + 'cm:owner': { id: 'admin', displayName: 'Administrator' }, + 'cm:organizationId': '' + } +}; + +export class CommentMock extends BaseMock { + post201Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/74cd8a96-8a21-47e5-9b3b-a1b3e296787d/comments', { + content: 'This is a comment' + }) + .reply(201, { + entry: { + createdAt: '2017-04-11T09:31:21.452+0000', + createdBy: adminUser, + edited: false, + modifiedAt: '2017-04-11T09:31:21.452+0000', + canEdit: true, + modifiedBy: adminUser, + canDelete: true, + id: 'c294cf79-49c1-483e-ac86-39c8fe3cce8f', + content: 'This is a comment' + } + }); + } + + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/74cd8a96-8a21-47e5-9b3b-a1b3e296787d/comments') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + createdAt: '2017-04-11T09:31:21.658+0000', + createdBy: adminUser, + edited: false, + modifiedAt: '2017-04-11T09:31:21.658+0000', + canEdit: true, + modifiedBy: adminUser, + canDelete: true, + id: '539fc9b2-7d5b-4966-9e44-fcf433647f25', + content: 'This is another comment' + } + }, + { + entry: { + createdAt: '2017-04-11T09:31:21.452+0000', + createdBy: adminUser, + edited: false, + modifiedAt: '2017-04-11T09:31:21.452+0000', + canEdit: true, + modifiedBy: adminUser, + canDelete: true, + id: 'c294cf79-49c1-483e-ac86-39c8fe3cce8f', + content: 'This is a comment' + } + } + ] + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/custom-model.mock.ts b/lib/js-api/test/mockObjects/content-services/custom-model.mock.ts new file mode 100644 index 0000000000..bf77c147af --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/custom-model.mock.ts @@ -0,0 +1,69 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class CustomModelMock extends BaseMock { + get200AllCustomModel(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/private/alfresco/versions/1/cmm') + .reply(200, { + list: { + pagination: { + count: 0, + hasMoreItems: false, + totalItems: 0, + skipCount: 0, + maxItems: 100 + }, + entries: [] + } + }); + } + + create201CustomModel(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/private/alfresco/versions/1/cmm') + .reply(201, { + entry: { + author: 'Administrator', + name: 'testModel', + description: 'Test model description', + namespaceUri: 'https://www.alfresco.org/model/testNamespace/1.0', + namespacePrefix: 'test', + status: 'DRAFT' + } + }); + } + + activateCustomModel200(): void { + nock(this.host, { encodedQueryParams: true }) + .put('/alfresco/api/-default-/private/alfresco/versions/1/cmm/testModel', { status: 'ACTIVE' }) + .query({ select: 'status' }) + .reply(200, { + entry: { + author: 'Administrator', + name: 'testModel', + description: 'Test model description', + namespaceUri: 'https://www.alfresco.org/model/testNamespace/1.0', + namespacePrefix: 'test', + status: 'ACTIVE' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/discovery.mock.ts b/lib/js-api/test/mockObjects/content-services/discovery.mock.ts new file mode 100644 index 0000000000..2515da3b82 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/discovery.mock.ts @@ -0,0 +1,86 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class DiscoveryMock extends BaseMock { + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/discovery') + .reply(200, { + entry: { + repository: { + edition: 'Enterprise', + version: { + major: '5', + minor: '2', + patch: '1', + hotfix: '0', + schema: 10052, + label: 'r133188-b433', + display: '5.2.1.0 (r133188-b433) schema 10052' + }, + license: { + issuedAt: '2017-04-10T10:45:00.177+0000', + expiresAt: '2017-05-10T00:00:00.000+0000', + remainingDays: 16, + holder: 'Trial User', + mode: 'ENTERPRISE', + entitlements: { isClusterEnabled: false, isCryptodocEnabled: false } + }, + status: { + isReadOnly: false, + isAuditEnabled: true, + isQuickShareEnabled: true, + isThumbnailGenerationEnabled: true + }, + modules: [ + { + id: 'alfresco-share-services', + title: 'Alfresco Share Services AMP', + description: 'Module to be applied to alfresco.war, containing APIs for Alfresco Share', + version: '5.2.0', + installDate: '2016-11-28T18:59:22.555+0000', + installState: 'INSTALLED', + versionMin: '5.1', + versionMax: '999' + }, + { + id: 'alfresco-trashcan-cleaner', + title: 'alfresco-trashcan-cleaner project', + description: 'The Alfresco Trash Can Cleaner (Alfresco Module)', + version: '2.2', + installState: 'UNKNOWN', + versionMin: '0', + versionMax: '999' + }, + { + id: 'enablecors', + title: 'Enable Cors support', + description: 'Adds a web-fragment with the filter config for Cors support', + version: '1.0-SNAPSHOT', + installState: 'UNKNOWN', + versionMin: '0', + versionMax: '999' + } + ] + } + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/ecm-auth.mock.ts b/lib/js-api/test/mockObjects/content-services/ecm-auth.mock.ts new file mode 100644 index 0000000000..96313142f0 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/ecm-auth.mock.ts @@ -0,0 +1,108 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class EcmAuthMock extends BaseMock { + username: string; + password: string; + + constructor(host?: string, username?: string, password?: string) { + super(host); + this.username = username || 'admin'; + this.password = password || 'admin'; + } + + get201Response(forceTicket?: string): void { + const returnMockTicket = forceTicket || 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'; + + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/authentication/versions/1/tickets', { + userId: this.username, + password: this.password + }) + .reply(201, { entry: { id: returnMockTicket, userId: 'admin' } }); + } + + get200ValidTicket(forceTicket?: string): void { + const returnMockTicket = forceTicket || 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'; + + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/authentication/versions/1/tickets/-me-') + .reply(200, { entry: { id: returnMockTicket } }); + } + + get403Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/authentication/versions/1/tickets', { + userId: 'wrong', + password: 'name' + }) + .reply(403, { + error: { + errorKey: 'Login failed', + statusCode: 403, + briefSummary: '05150009 Login failed', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get400Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/authentication/versions/1/tickets', { + userId: null, + password: null + }) + .reply(400, { + error: { + errorKey: 'Invalid login details.', + statusCode: 400, + briefSummary: '05160045 Invalid login details.', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get401Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/authentication/versions/1/tickets', { + userId: 'wrong', + password: 'name' + }) + .reply(401, { + error: { + errorKey: 'framework.exception.ApiDefault', + statusCode: 401, + briefSummary: '05210059 Authentication failed for Web Script org/alfresco/api/ResourceWebScript.get', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get204ResponseLogout(): void { + nock(this.host, { encodedQueryParams: true }).delete('/alfresco/api/-default-/public/authentication/versions/1/tickets/-me-').reply(204, ''); + } + + get404ResponseLogout(): void { + nock(this.host, { encodedQueryParams: true }).delete('/alfresco/api/-default-/public/authentication/versions/1/tickets/-me-').reply(404, ''); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/find-nodes.mock.ts b/lib/js-api/test/mockObjects/content-services/find-nodes.mock.ts new file mode 100644 index 0000000000..8d6703e1a9 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/find-nodes.mock.ts @@ -0,0 +1,93 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class FindNodesMock extends BaseMock { + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/queries/nodes?term=test') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + createdAt: '2011-03-03T10:34:52.092+0000', + isFolder: false, + isFile: true, + createdByUser: { id: 'abeecher', displayName: 'Alice Beecher' }, + modifiedAt: '2011-03-03T10:34:52.092+0000', + modifiedByUser: { id: 'abeecher', displayName: 'Alice Beecher' }, + name: 'coins1.JPG', + id: '7bb9c846-fcc5-43b5-a893-39e46ebe94d4', + nodeType: 'cm:content', + content: { + mimeType: 'image/jpeg', + mimeTypeName: 'JPEG Image', + sizeInBytes: 501641, + encoding: 'UTF-8' + }, + parentId: '880a0f47-31b1-4101-b20b-4d325e54e8b1' + } + }, + { + entry: { + createdAt: '2011-03-03T10:34:52.092+0000', + isFolder: false, + isFile: true, + createdByUser: { id: 'abeecher', displayName: 'Alice Beecher' }, + modifiedAt: '2011-03-03T10:34:52.092+0000', + modifiedByUser: { id: 'abeecher', displayName: 'Alice Beecher' }, + name: 'coins2.JPG', + id: '7bb9c846-fcc5-43b5-a893-39e46ebe94d4', + nodeType: 'cm:content', + content: { + mimeType: 'image/jpeg', + mimeTypeName: 'JPEG Image', + sizeInBytes: 501641, + encoding: 'UTF-8' + }, + parentId: '880a0f47-31b1-4101-b20b-4d325e54e8b1' + } + } + ] + } + }); + } + + get401Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/queries/nodes?term=test') + .reply(401, { + error: { + errorKey: 'framework.exception.ApiDefault', + statusCode: 401, + briefSummary: '05210059 Authentication failed for Web Script org/alfresco/api/ResourceWebScript.get', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/groups.mock.ts b/lib/js-api/test/mockObjects/content-services/groups.mock.ts new file mode 100644 index 0000000000..43450caed1 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/groups.mock.ts @@ -0,0 +1,139 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class GroupsMock extends BaseMock { + get200GetGroups(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/groups') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: true, + totalItems: 279, + skipCount: 0, + maxItems: 2 + }, + entries: [ + { + entry: { + isRoot: true, + displayName: 'alfalfb', + id: 'GROUP_alfalfa' + } + }, + { + entry: { + isRoot: true, + displayName: 'Call CenterAA', + id: 'GROUP_CallCenterAA' + } + } + ] + } + }); + } + + getDeleteGroupSuccessfulResponse(groupName: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/alfresco/api/-default-/public/alfresco/versions/1/groups/' + groupName) + .query({ cascade: 'false' }) + .reply(200); + } + + getDeleteMemberForGroupSuccessfulResponse(groupName: string, memberName: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/alfresco/api/-default-/public/alfresco/versions/1/groups/' + groupName + '/members/' + memberName) + .reply(200); + } + + get200CreateGroupResponse(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/groups') + .reply(200, { + entry: { + isRoot: true, + displayName: 'SAMPLE', + id: 'GROUP_TEST' + } + }); + } + + get200GetSingleGroup(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_TEST') + .reply(200, { + entry: { + isRoot: true, + displayName: 'SAMPLE', + id: 'GROUP_TEST' + } + }); + } + + get200UpdateGroupResponse(): void { + nock(this.host, { encodedQueryParams: true }) + .put('/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_TEST') + .reply(200, { + entry: { + isRoot: true, + displayName: 'CHANGED', + id: 'GROUP_TEST' + } + }); + } + + get200GetGroupMemberships(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_TEST/members') + .reply(200, { + list: { + pagination: { + count: 1, + hasMoreItems: false, + totalItems: 1, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + displayName: 'SAMPLE', + id: 'GROUP_SUB_TEST', + memberType: 'GROUP' + } + } + ] + } + }); + } + + get200AddGroupMembershipResponse(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_TEST/members') + .reply(200, { + entry: { + displayName: 'SAMPLE', + id: 'GROUP_SUB_TEST', + memberType: 'GROUP' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/node.mock.ts b/lib/js-api/test/mockObjects/content-services/node.mock.ts new file mode 100644 index 0000000000..d4ba760cce --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/node.mock.ts @@ -0,0 +1,233 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class NodeMock extends BaseMock { + get200ResponseChildren(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/b4cff62a-664d-4d45-9302-98723eac1319/children') + .reply(200, { + list: { + pagination: { + count: 5, + hasMoreItems: false, + totalItems: 5, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + createdAt: '2011-02-15T20:19:00.007+0000', + isFolder: true, + isFile: false, + createdByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + modifiedAt: '2011-02-15T20:19:00.007+0000', + modifiedByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + name: 'dataLists', + id: '64f69e69-f61e-42a3-8697-95eea1f2bda2', + nodeType: 'cm:folder', + parentId: 'b4cff62a-664d-4d45-9302-98723eac1319' + } + }, + { + entry: { + createdAt: '2011-02-15T22:04:54.290+0000', + isFolder: true, + isFile: false, + createdByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + modifiedAt: '2011-02-15T22:04:54.290+0000', + modifiedByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + name: 'discussions', + id: '059c5bc7-2d38-4dc5-96b8-d09cd3c69b4c', + nodeType: 'cm:folder', + parentId: 'b4cff62a-664d-4d45-9302-98723eac1319' + } + }, + { + entry: { + createdAt: '2011-02-15T20:16:28.292+0000', + isFolder: true, + isFile: false, + createdByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + modifiedAt: '2016-06-27T14:31:10.007+0000', + modifiedByUser: { id: 'admin', displayName: 'Administrator' }, + name: 'documentLibrary', + id: '8f2105b4-daaf-4874-9e8a-2152569d109b', + nodeType: 'cm:folder', + parentId: 'b4cff62a-664d-4d45-9302-98723eac1319' + } + }, + { + entry: { + createdAt: '2011-02-15T20:18:59.808+0000', + isFolder: true, + isFile: false, + createdByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + modifiedAt: '2011-02-15T20:18:59.808+0000', + modifiedByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + name: 'links', + id: '0e24b99c-41f0-43e1-a55e-fb9f50d73820', + nodeType: 'cm:folder', + parentId: 'b4cff62a-664d-4d45-9302-98723eac1319' + } + }, + { + entry: { + createdAt: '2011-02-15T21:46:01.603+0000', + isFolder: true, + isFile: false, + createdByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + modifiedAt: '2011-02-15T21:46:01.603+0000', + modifiedByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + name: 'wiki', + id: 'cdefb3a9-8f55-4771-a9e3-06fa370250f6', + nodeType: 'cm:folder', + parentId: 'b4cff62a-664d-4d45-9302-98723eac1319' + } + } + ] + } + }); + } + + get200ResponseChildrenNonUTCTimes(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/b4cff62a-664d-4d45-9302-98723eac1320/children') + .reply(200, { + list: { + pagination: { + count: 5, + hasMoreItems: false, + totalItems: 5, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + createdAt: '2011-03-15T12:04:54.290-0500', + isFolder: true, + isFile: false, + createdByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + modifiedAt: '2011-03-15T12:04:54.290-0500', + modifiedByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + name: 'discussions', + id: '059c5bc7-2d38-4dc5-96b8-d09cd3c69b4c', + nodeType: 'cm:folder', + parentId: 'b4cff62a-664d-4d45-9302-98723eac1320' + } + } + ] + } + }); + } + + get404ChildrenNotExist(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/b4cff62a-664d-4d45-9302-98723eac1319/children') + .reply(404, { + error: { + errorKey: 'framework.exception.EntityNotFound', + statusCode: 404, + briefSummary: '05220073 The entity with id: 80a94ac4-3ec4-47ad-864e-5d939424c47c was not found', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get401CreationFolder(): void { + nock(this.host, { encodedQueryParams: true }).post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children').reply(401); + } + + get204SuccessfullyDeleted(): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/alfresco/api/-default-/public/alfresco/versions/1/nodes/80a94ac8-3ece-47ad-864e-5d939424c47c') + .reply(204); + } + + get403DeletePermissionDenied(): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/alfresco/api/-default-/public/alfresco/versions/1/nodes/80a94ac8-3ece-47ad-864e-5d939424c47c') + .reply(403); + } + + get404DeleteNotFound(): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/alfresco/api/-default-/public/alfresco/versions/1/nodes/80a94ac8-test-47ad-864e-5d939424c47c') + .reply(404, { + error: { + errorKey: 'framework.exception.EntityNotFound', + statusCode: 404, + briefSummary: '05230078 The entity with id: 80a94ac8-test-47ad-864e-5d939424c47c was not found', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get200ResponseChildrenFutureNewPossibleValue(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/b4cff62a-664d-4d45-9302-98723eac1319/children') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + createdAt: '2011-02-15T20:19:00.007+0000', + isFolder: true, + isFile: false, + createdByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + modifiedAt: '2011-02-15T20:19:00.007+0000', + modifiedByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + name: 'dataLists', + id: '64f69e69-f61e-42a3-8697-95eea1f2bda2', + nodeType: 'cm:folder', + parentId: 'b4cff62a-664d-4d45-9302-98723eac1319', + impossibleProperties: 'impossibleRightValue' + } + }, + { + entry: { + createdAt: '2011-02-15T22:04:54.290+0000', + isFolder: true, + isFile: false, + createdByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + modifiedAt: '2011-02-15T22:04:54.290+0000', + modifiedByUser: { id: 'mjackson', displayName: 'Mike Jackson' }, + name: 'discussions', + id: '059c5bc7-2d38-4dc5-96b8-d09cd3c69b4c', + nodeType: 'cm:folder', + parentId: 'b4cff62a-664d-4d45-9302-98723eac1319', + impossibleProperties: 'impossibleRightValue' + } + } + ] + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/people.mock.ts b/lib/js-api/test/mockObjects/content-services/people.mock.ts new file mode 100644 index 0000000000..ece5d5df73 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/people.mock.ts @@ -0,0 +1,115 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class PeopleMock extends BaseMock { + get201Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/people') + .reply(201, { + entry: { + firstName: 'chewbacca', + lastName: 'Chewbe', + emailNotificationsEnabled: true, + company: {}, + id: 'chewbe', + enabled: true, + email: 'chewbe@millenniumfalcon.com' + } + }); + } + + get200ResponsePersons(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/people') + .reply(200, { + list: { + pagination: { + count: 5, + hasMoreItems: true, + totalItems: 153, + skipCount: 0, + maxItems: 5 + }, + entries: [ + { + entry: { + firstName: 'anSNSlXA', + lastName: '3PhtPlBO', + jobTitle: 'N/A', + emailNotificationsEnabled: true, + company: {}, + id: '0jl2FBTc', + enabled: true, + email: 'owAwLISy' + } + }, + { + entry: { + firstName: '84N1jji3', + lastName: '748zEwJV', + jobTitle: 'N/A', + emailNotificationsEnabled: true, + company: {}, + id: '0kd3jA3b', + enabled: true, + email: 'm1ooPRIu' + } + }, + { + entry: { + firstName: 'cPuvOYnb', + lastName: 'GZK6IenG', + jobTitle: 'N/A', + emailNotificationsEnabled: true, + company: {}, + id: '1BJSWj5u', + enabled: true, + email: 'UtKzKjje' + } + }, + { + entry: { + firstName: '87vRSHzf', + lastName: 'OiLjkq9z', + jobTitle: 'N/A', + emailNotificationsEnabled: true, + company: {}, + id: '1pvBqbmT', + enabled: true, + email: '72GemSCB' + } + }, + { + entry: { + firstName: 'QTxD4AWn', + lastName: 'IHb5JiaR', + jobTitle: 'N/A', + emailNotificationsEnabled: true, + company: {}, + id: '2fOamhbL', + enabled: true, + email: 'hhhQHpmZ' + } + } + ] + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/rendition.mock.ts b/lib/js-api/test/mockObjects/content-services/rendition.mock.ts new file mode 100644 index 0000000000..3ed09121d8 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/rendition.mock.ts @@ -0,0 +1,99 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class RenditionMock extends BaseMock { + get200RenditionResponse(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/97a29e9c-1e4f-4d9d-bb02-1ec920dda045/renditions/pdf') + .reply(200, { + entry: { + id: 'pdf', + content: { mimeType: 'application/pdf', mimeTypeName: 'Adobe PDF Document' }, + status: 'NOT_CREATED' + } + }); + } + + createRendition200(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/97a29e9c-1e4f-4d9d-bb02-1ec920dda045/renditions', { id: 'pdf' }) + .reply(202, ''); + } + + get200RenditionList(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/97a29e9c-1e4f-4d9d-bb02-1ec920dda045/renditions') + .reply(200, { + list: { + pagination: { + count: 6, + hasMoreItems: false, + totalItems: 6, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + id: 'avatar', + content: { mimeType: 'image/png', mimeTypeName: 'PNG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'avatar32', + content: { mimeType: 'image/png', mimeTypeName: 'PNG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'doclib', + content: { mimeType: 'image/png', mimeTypeName: 'PNG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'imgpreview', + content: { mimeType: 'image/jpeg', mimeTypeName: 'JPEG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'medium', + content: { mimeType: 'image/jpeg', mimeTypeName: 'JPEG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'pdf', + content: { mimeType: 'application/pdf', mimeTypeName: 'Adobe PDF Document' }, + status: 'NOT_CREATED' + } + } + ] + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/search.mock.ts b/lib/js-api/test/mockObjects/content-services/search.mock.ts new file mode 100644 index 0000000000..7eb8649e24 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/search.mock.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class SearchMock extends BaseMock { + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/search/versions/1/search', { + query: { + query: 'select * from cmis:folder', + language: 'cmis' + } + }) + .reply(200, { + list: { + pagination: { count: 100, hasMoreItems: true, skipCount: 0, maxItems: 100 }, + entries: [ + { + entry: { + createdAt: '2017-04-10T10:52:30.868+0000', + isFolder: true, + search: { score: 1 }, + isFile: false, + createdByUser: { id: 'admin', displayName: 'Administrator' }, + modifiedAt: '2017-04-10T10:52:30.868+0000', + modifiedByUser: { id: 'admin', displayName: 'Administrator' }, + name: 'user', + id: '224e30f4-a7b3-4192-b6e6-dc27d95e26ef', + nodeType: 'cm:folder', + parentId: '83551834-75d6-4e07-a318-46d5d176738a' + } + } + ] + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/tag.mock.ts b/lib/js-api/test/mockObjects/content-services/tag.mock.ts new file mode 100644 index 0000000000..2f4e63216b --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/tag.mock.ts @@ -0,0 +1,99 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; +import { TagBody, TagEntry, TagPaging } from '../../../src/api/content-rest-api'; + +export class TagMock extends BaseMock { + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/tags') + .reply(200, this.getPaginatedListOfTags()); + } + + getTagsByNameFilteredByMatching200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/tags?where=(tag%20matches%20(%27*tag-test*%27))') + .reply(200, this.getPaginatedListOfTags()); + } + + getTagsByNamesFilterByExactTag200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/tags?where=(tag%3D%27tag-test-1%27)') + .reply(200, { + list: { + pagination: { + count: 1, + hasMoreItems: false, + skipCount: 0, + maxItems: 100 + }, + entries: [this.mockTagEntry()] + } + }); + } + + get401Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/tags') + .reply(401, { + error: { + errorKey: 'framework.exception.ApiDefault', + statusCode: 401, + briefSummary: '05210059 Authentication failed for Web Script org/alfresco/api/ResourceWebScript.get', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + createTags201Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/tags') + .reply(201, [this.mockTagEntry(), this.mockTagEntry('tag-test-2', 'd79bdbd0-9f55-45bb-9521-811e15bf48f6')]); + } + + get201ResponseForAssigningTagsToNode(body: TagBody[]): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/someNodeId/tags', JSON.stringify(body)) + .reply(201, body.length > 1 ? this.getPaginatedListOfTags() : this.mockTagEntry()); + } + + private getPaginatedListOfTags(): TagPaging { + return { + list: { + pagination: { + count: 2, + hasMoreItems: false, + skipCount: 0, + maxItems: 100 + }, + entries: [this.mockTagEntry(), this.mockTagEntry('tag-test-2', 'd79bdbd0-9f55-45bb-9521-811e15bf48f6')] + } + }; + } + + private mockTagEntry(tag = 'tag-test-1', id = '0d89aa82-f2b8-4a37-9a54-f4c5148174d6'): TagEntry { + return { + entry: { + tag, + id + } + }; + } +} diff --git a/lib/js-api/test/mockObjects/content-services/upload.mock.ts b/lib/js-api/test/mockObjects/content-services/upload.mock.ts new file mode 100644 index 0000000000..6b37225abd --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/upload.mock.ts @@ -0,0 +1,104 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class UploadMock extends BaseMock { + get201CreationFile(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children') + .reply(201, { + entry: { + isFile: true, + createdByUser: { id: 'admin', displayName: 'Administrator' }, + modifiedAt: '2016-07-08T16:08:10.218+0000', + nodeType: 'cm:content', + content: { + mimeType: 'text/plain', + mimeTypeName: 'Plain Text', + sizeInBytes: 28, + encoding: 'ISO-8859-2' + }, + parentId: '55290409-3c61-41e5-80f6-8354ed133ce0', + aspectNames: ['cm:versionable', 'cm:titled', 'cm:auditable', 'cm:author'], + createdAt: '2016-07-08T16:08:10.218+0000', + isFolder: false, + modifiedByUser: { id: 'admin', displayName: 'Administrator' }, + name: 'testFile.txt', + id: '2857abfd-0ac6-459d-a22d-ec78770570f3', + properties: { 'cm:versionLabel': '1.0', 'cm:versionType': 'MAJOR' } + } + }); + } + + get201CreationFileAutoRename(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children') + .query({ autoRename: 'true' }) + .reply(201, { + entry: { + isFile: true, + createdByUser: { id: 'admin', displayName: 'Administrator' }, + modifiedAt: '2016-07-08T17:04:34.684+0000', + nodeType: 'cm:content', + content: { + mimeType: 'text/plain', + mimeTypeName: 'Plain Text', + sizeInBytes: 28, + encoding: 'ISO-8859-2' + }, + parentId: '55290409-3c61-41e5-80f6-8354ed133ce0', + aspectNames: ['cm:versionable', 'cm:titled', 'cm:auditable', 'cm:author'], + createdAt: '2016-07-08T17:04:34.684+0000', + isFolder: false, + modifiedByUser: { id: 'admin', displayName: 'Administrator' }, + name: 'testFile-2.txt', + id: 'ae314293-27e8-4221-9a09-699f103db5f3', + properties: { 'cm:versionLabel': '1.0', 'cm:versionType': 'MAJOR' } + } + }); + } + + get409CreationFileNewNameClashes(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children') + .reply(409, { + error: { + errorKey: 'Duplicate child name not allowed: newFile', + statusCode: 409, + briefSummary: '06070090 Duplicate child name not allowed: newFile', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get401Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children') + .reply(401, { + error: { + errorKey: 'framework.exception.ApiDefault', + statusCode: 401, + briefSummary: '05210059 Authentication failed for Web Script org/alfresco/api/ResourceWebScript.get', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/version.mock.ts b/lib/js-api/test/mockObjects/content-services/version.mock.ts new file mode 100644 index 0000000000..4d227af9e5 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/version.mock.ts @@ -0,0 +1,122 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class VersionMock extends BaseMock { + post201Response(nodeId: string, versionId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions/' + versionId + '/revert') + .reply(201, { entry: { id: '3.0' } }); + } + + get200Response(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [{ entry: { id: '2.0' } }, { entry: { id: '1.0' } }] + } + }); + } + + get200ResponseVersionRenditions(nodeId: string, versionId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions/' + versionId + '/renditions') + .reply(200, { + list: { + pagination: { + count: 6, + hasMoreItems: false, + totalItems: 6, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + id: 'avatar', + content: { mimeType: 'image/png', mimeTypeName: 'PNG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'avatar32', + content: { mimeType: 'image/png', mimeTypeName: 'PNG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'doclib', + content: { mimeType: 'image/png', mimeTypeName: 'PNG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'imgpreview', + content: { mimeType: 'image/jpeg', mimeTypeName: 'JPEG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'medium', + content: { mimeType: 'image/jpeg', mimeTypeName: 'JPEG Image' }, + status: 'NOT_CREATED' + } + }, + { + entry: { + id: 'pdf', + content: { mimeType: 'application/pdf', mimeTypeName: 'Adobe PDF Document' }, + status: 'NOT_CREATED' + } + } + ] + } + }); + } + + get200VersionRendition(nodeId: string, versionId: string, renditionId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions/' + versionId + '/renditions/' + renditionId) + .reply(200, { + entry: { + id: 'pdf', + content: { mimeType: 'application/pdf', mimeTypeName: 'Adobe PDF Document' }, + status: 'NOT_CREATED' + } + }); + } + + create200VersionRendition(nodeId: string, versionId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions/' + versionId + '/renditions', { id: 'pdf' }) + .reply(202, ''); + } +} diff --git a/lib/js-api/test/mockObjects/content-services/webscript.mock.ts b/lib/js-api/test/mockObjects/content-services/webscript.mock.ts new file mode 100644 index 0000000000..398d8999e8 --- /dev/null +++ b/lib/js-api/test/mockObjects/content-services/webscript.mock.ts @@ -0,0 +1,84 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class WebScriptMock extends BaseMock { + contextRoot: string; + servicePath: string; + scriptPath: string; + scriptSlug: string; + + constructor(host?: string, contextRoot?: string, servicePath?: string, scriptPath?: string) { + super(host); + this.contextRoot = contextRoot || 'alfresco'; + this.servicePath = servicePath || 'service'; + this.scriptPath = scriptPath; + + this.scriptSlug = '/' + this.contextRoot + '/' + this.servicePath + '/' + this.scriptPath; + } + + get404Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get(this.scriptSlug) + .reply(404, { + error: { + errorKey: 'Unable to locate resource resource for :alfresco ', + statusCode: 404, + briefSummary: '06130000 Unable to locate resource resource for :alfresco ', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } + + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get(this.scriptSlug) + .reply(200, { + randomStructure: { + exampleInt: 1, + exampleString: 'string test' + } + }); + } + + get200ResponseHTMLFormat(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/service/sample/folder/Company%20Home') + .reply( + 200, + // eslint-disable-next-line max-len + '<html>\n <head>\n <title>/Company Home</title>\n </head>\n <body>\n Folder: /Company Home\n <br>\n <table>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/Data%20Dictionary">Data Dictionary</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/Guest%20Home">Guest Home</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/User%20Homes">User Homes</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/Shared">Shared</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/Imap%20Attachments">Imap Attachments</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/IMAP%20Home">IMAP Home</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/Sites">Sites</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/x">x</a>\n </tr>\n <tr>\n <td><td><a href="/alfresco/service/api/node/content/workspace/SpacesStore/2857abfd-0ac6-459d-a22d-ec78770570f3/testFile.txt">testFile.txt</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/newFolder">newFolder</a>\n </tr>\n <tr>\n <td>><td><a href="/alfresco/service/sample/folder/Company%20Home/newFolder-1">newFolder-1</a>\n </tr>\n <tr>\n <td><td><a href="/alfresco/service/api/node/content/workspace/SpacesStore/21ce66a9-6bc5-4c49-8ad3-43d3b824a9a3/testFile-1.txt">testFile-1.txt</a>\n </tr>\n <tr>\n <td><td><a href="/alfresco/service/api/node/content/workspace/SpacesStore/ae314293-27e8-4221-9a09-699f103db5f3/testFile-2.txt">testFile-2.txt</a>\n </tr>\n <tr>\n <td><td><a href="/alfresco/service/api/node/content/workspace/SpacesStore/935c1a72-647f-4c8f-aab6-e3b161978427/testFile-3.txt">testFile-3.txt</a>\n </tr>\n </table>\n </body>\n</html>\n\n' + ); // jshint ignore:line + } + + get401Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get(this.scriptSlug) + .reply(401, { + error: { + errorKey: 'framework.exception.ApiDefault', + statusCode: 401, + briefSummary: '05210059 Authentication failed for Web Script org/alfresco/api/ResourceWebScript.get', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/goverance-services/authority-clearance.mock.ts b/lib/js-api/test/mockObjects/goverance-services/authority-clearance.mock.ts new file mode 100644 index 0000000000..d92e5db422 --- /dev/null +++ b/lib/js-api/test/mockObjects/goverance-services/authority-clearance.mock.ts @@ -0,0 +1,139 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BaseMock } from '../base.mock'; +import nock from 'nock'; + +export class AuthorityClearanceMock extends BaseMock { + get200AuthorityClearanceForAuthority(authorityId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/gs/versions/1/cleared-authorities/' + authorityId + '/clearing-marks?skipCount=0&maxItems=100') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + id: 'securityGroupFruits', + displayLabel: 'Security Group FRUITS', + systemGroup: false, + type: 'USER_REQUIRES_ALL', + marks: [ + { + id: 'fruitMarkId1', + displayLabel: 'APPLES', + applied: true, + inherited: false + }, + { + id: 'fruitMarkId2', + displayLabel: 'BANANAS', + applied: false, + inherited: false + }, + { + id: 'fruitMarkId3', + displayLabel: 'MANGOES', + applied: false, + inherited: true + } + ] + } + }, + { + entry: { + id: 'securityGroupAnimals', + displayLabel: 'Security Group ANIMALS', + systemGroup: false, + type: 'USER_REQUIRES_ANY', + marks: [ + { + id: 'animalMarkId1', + displayLabel: 'LION', + applied: true, + inherited: false + }, + { + id: 'animalMarkId1', + displayLabel: 'TIGER', + applied: true, + inherited: false + }, + { + id: 'animalMarkId1', + displayLabel: 'ZEBRA', + applied: true, + inherited: false + } + ] + } + } + ] + } + }); + } + + post200AuthorityClearanceWithSingleItem(authorityId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/gs/versions/1/cleared-authorities/' + authorityId + '/clearing-marks') + .reply(200, { + entry: { + id: 'fruitMarkId1', + name: 'APPLES', + groupId: 'securityGroupFruits' + } + }); + } + + post200AuthorityClearanceWithList(authorityId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/gs/versions/1/cleared-authorities/' + authorityId + '/clearing-marks') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + id: 'fruitMarkId1', + name: 'APPLES', + groupId: 'securityGroupFruits' + } + }, + { + entry: { + id: 'fruitMarkId2', + name: 'BANANAS', + groupId: 'securityGroupFruits' + } + } + ] + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/goverance-services/gs-sites.mock.ts b/lib/js-api/test/mockObjects/goverance-services/gs-sites.mock.ts new file mode 100644 index 0000000000..892be0877a --- /dev/null +++ b/lib/js-api/test/mockObjects/goverance-services/gs-sites.mock.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class GsSitesApiMock extends BaseMock { + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/gs/versions/1/gs-sites/rm') + .reply(200, { + entry: { + role: 'SiteManager', + visibility: 'PUBLIC', + compliance: 'STANDARD', + guid: 'fd870d47-57a0-46f7-83c8-c523a4da13c4', + description: 'Records Management Description Test', + id: 'rm', + title: 'Records Management' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/goverance-services/node-security-marks.mock.ts b/lib/js-api/test/mockObjects/goverance-services/node-security-marks.mock.ts new file mode 100644 index 0000000000..e02305b795 --- /dev/null +++ b/lib/js-api/test/mockObjects/goverance-services/node-security-marks.mock.ts @@ -0,0 +1,85 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class NodeSecurityMarksApiMock extends BaseMock { + post200manageSecurityMarkOnNode(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/gs/versions/1/secured-nodes/' + nodeId + '/securing-marks') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + groupId: 'securityGroupId1', + name: 'SecurityMarkTest1', + id: 'Sh1G8vTQ' + } + }, + { + entry: { + groupId: 'securityGroupId2', + name: 'SecurityMarkTest2', + id: 'Sh1G8vTR' + } + } + ] + } + }); + } + + get200SecurityMarkOnNode(nodeId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/gs/versions/1/secured-nodes/' + nodeId + '/securing-marks') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + groupId: 'securityGroupId1', + name: 'SecurityMarkTest1', + id: 'Sh1G8vTQ' + } + }, + { + entry: { + groupId: 'securityGroupId2', + name: 'SecurityMarkTest2', + id: 'Sh1G8vTR' + } + } + ] + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/goverance-services/security-groups.mock.ts b/lib/js-api/test/mockObjects/goverance-services/security-groups.mock.ts new file mode 100644 index 0000000000..eb82c713fe --- /dev/null +++ b/lib/js-api/test/mockObjects/goverance-services/security-groups.mock.ts @@ -0,0 +1,95 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class SecurityGroupApiMock extends BaseMock { + createSecurityGroup200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/gs/versions/1/security-groups') + .reply(200, { + entry: { + groupName: 'Alfresco', + groupType: 'HIERARCHICAL', + id: 'a0a7b107-84ba-4c3d-b0b7-a8509e8c1c33' + } + }); + } + + getSecurityGroups200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/gs/versions/1/security-groups') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + groupName: 'Alfresco', + groupType: 'HIERARCHICAL', + id: 'a0a7b107-84ba-4c3d-b0b7-a8509e8c1c33' + } + }, + { + entry: { + groupName: 'Classification', + groupType: 'HIERARCHICAL', + id: 'classification' + } + } + ] + } + }); + } + + getSecurityGroupInfo200Response(securityGroupId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/gs/versions/1/security-groups/' + securityGroupId) + .reply(200, { + entry: { + groupName: 'Alfresco', + groupType: 'HIERARCHICAL', + id: 'a0a7b107-84ba-4c3d-b0b7-a8509e8c1c33' + } + }); + } + + updateSecurityGroup200Response(securityGroupId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put('/alfresco/api/-default-/public/gs/versions/1/security-groups/' + securityGroupId) + .reply(200, { + entry: { + groupName: 'Nasa', + groupType: 'HIERARCHICAL', + id: 'a0a7b107-84ba-4c3d-b0b7-a8509e8c1c33' + } + }); + } + + deleteSecurityGroup200Response(securityGroupId: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/alfresco/api/-default-/public/alfresco/versions/1/security-groups/' + securityGroupId) + .reply(200); + } +} diff --git a/lib/js-api/test/mockObjects/goverance-services/security-marks.mock.ts b/lib/js-api/test/mockObjects/goverance-services/security-marks.mock.ts new file mode 100644 index 0000000000..02a10b4a11 --- /dev/null +++ b/lib/js-api/test/mockObjects/goverance-services/security-marks.mock.ts @@ -0,0 +1,129 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class SecurityMarkApiMock extends BaseMock { + get200GetSecurityMark(securityGroupId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/gs/versions/1/security-groups/' + securityGroupId + '/security-marks') + .reply(200, { + list: { + pagination: { + count: 1, + hasMoreItems: false, + totalItems: 1, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + groupId: securityGroupId, + name: 'SecurityMarkTest', + id: 'Sh1G8vTQ' + } + } + ] + } + }); + } + + createSecurityMark200Response(securityGroupId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/gs/versions/1/security-groups/' + securityGroupId + '/security-marks') + .reply(200, { + entry: { + groupId: securityGroupId, + name: 'SecurityMarkTest', + id: 'Sh1G8vTQ' + } + }); + } + createSecurityMarks200Response(securityGroupId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/alfresco/api/-default-/public/gs/versions/1/security-groups/' + securityGroupId + '/security-marks') + .reply(200, { + list: { + pagination: { + count: 2, + hasMoreItems: false, + totalItems: 2, + skipCount: 0, + maxItems: 100 + }, + entries: [ + { + entry: { + groupId: securityGroupId, + name: 'SecurityMark3', + id: 'KsnOlXVM' + } + }, + { + entry: { + groupId: securityGroupId, + name: 'SecurityMark4', + id: 'wFYkG8CV' + } + } + ] + } + }); + } + get200GetSingleSecurityMark(securityGroupId: string, securityMarkId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/gs/versions/1/security-groups/' + securityGroupId + '/security-marks/' + securityMarkId) + .reply(200, { + entry: { + groupId: securityGroupId, + name: 'SecurityMarkTest', + id: securityMarkId + } + }); + } + put200UpdateSecurityMarkResponse(securityGroupId: string, securityMarkId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put('/alfresco/api/-default-/public/gs/versions/1/security-groups/' + securityGroupId + '/security-marks/' + securityMarkId) + .reply(200, { + entry: { + groupId: securityGroupId, + name: 'AlfrescoSecurityMark', + id: securityMarkId + } + }); + } + getDeleteSecurityMarkSuccessfulResponse(securityGroupId: string, securityMarkId: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/alfresco/api/-default-/public/gs/versions/1/security-groups/' + securityGroupId + '/security-marks/' + securityMarkId) + .reply(200); + } + get401Response(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/alfresco/api/-default-/public/gs/versions/1/security-groups/') + .reply(401, { + error: { + errorKey: 'framework.exception.ApiDefault', + statusCode: 401, + briefSummary: '05210059 Authentication failed for Web Script org/alfresco/api/ResourceWebScript.get', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/index.ts b/lib/js-api/test/mockObjects/index.ts new file mode 100644 index 0000000000..3dc4b92aa9 --- /dev/null +++ b/lib/js-api/test/mockObjects/index.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './content-services/categories.mock'; +export * from './content-services/comment.mock'; +export * from './content-services/ecm-auth.mock'; +export * from './content-services/custom-model.mock'; +export * from './content-services/discovery.mock'; +export * from './content-services/node.mock'; +export * from './content-services/people.mock'; +export * from './content-services/groups.mock'; +export * from './content-services/find-nodes.mock'; +export * from './content-services/rendition.mock'; +export * from './content-services/search.mock'; +export * from './content-services/tag.mock'; +export * from './content-services/upload.mock'; +export * from './content-services/version.mock'; +export * from './content-services/webscript.mock'; + +export * from './goverance-services/authority-clearance.mock'; +export * from './goverance-services/gs-sites.mock'; +export * from './goverance-services/node-security-marks.mock'; +export * from './goverance-services/security-groups.mock'; +export * from './goverance-services/security-marks.mock'; + +export * from './process-services/bpm-auth.mock'; +export * from './process-services/process.mock'; +export * from './process-services/process-instance-variables.mock'; +export * from './process-services/models.mock'; +export * from './process-services/model-json.mock'; +export * from './process-services/profile.mock'; +export * from './process-services/reports.mock'; +export * from './process-services/task-form.mock'; +export * from './process-services/tasks.mock'; +export * from './process-services/user-filters.mock'; + +export * from './oauth2/oauth.mock'; diff --git a/lib/js-api/test/mockObjects/oauth2/oauth.mock.ts b/lib/js-api/test/mockObjects/oauth2/oauth.mock.ts new file mode 100644 index 0000000000..5187349aae --- /dev/null +++ b/lib/js-api/test/mockObjects/oauth2/oauth.mock.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class OAuthMock extends BaseMock { + username: string; + password: string; + + constructor(host?: string, username?: string, password?: string) { + super(host); + this.username = username || 'admin'; + this.password = password || 'admin'; + } + + get200Response(mockToken?: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/auth/realms/springboot/protocol/openid-connect/token') + .reply(200, { + access_token: mockToken || 'test-token', + expires_in: 300, + refresh_expires_in: 1800, + refresh_token: + // eslint-disable-next-line max-len + 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI0cHczOUltNE54dXZEN0ZqZ3JOQ3Q2ZkpaVDctQ3JWTzRkX3BLaXJlSTF3In0.eyJqdGkiOiI2MzQxMDc1ZC1lOTY4LTRmZTctOTkwZS05MTQ3NTUwOGEzZWIiLCJleHAiOjE1Mjk2MDkxMDYsIm5iZiI6MCwiaWF0IjoxNTI5NjA3MzA2LCJpc3MiOiJodHRwOi8vYTVlMmY5M2RlMTBhZjExZThhMDU2MGExYmVhNWI3YzgtMjM2NzA5NDMzLnVzLWVhc3QtMS5lbGIuYW1hem9uYXdzLmNvbTozMDA4MS9hdXRoL3JlYWxtcy9zcHJpbmdib290IiwiYXVkIjoiYWN0aXZpdGkiLCJzdWIiOiJlMjRjZjM0Mi1mYzUwLTRjYjEtYTBjMC01N2RhZWRiODI3NDkiLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoiYWN0aXZpdGkiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiI5NDMzZTIwNi1kZjFhLTQ2YTMtYmU3ZS02NWIwNDVhMWMzNmIiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsiYWRtaW4iLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7InJlYWxtLW1hbmFnZW1lbnQiOnsicm9sZXMiOlsidmlldy1pZGVudGl0eS1wcm92aWRlcnMiLCJ2aWV3LXJlYWxtIiwibWFuYWdlLWlkZW50aXR5LXByb3ZpZGVycyIsImltcGVyc29uYXRpb24iLCJyZWFsbS1hZG1pbiIsImNyZWF0ZS1jbGllbnQiLCJtYW5hZ2UtdXNlcnMiLCJxdWVyeS1yZWFsbXMiLCJ2aWV3LWF1dGhvcml6YXRpb24iLCJxdWVyeS1jbGllbnRzIiwicXVlcnktdXNlcnMiLCJtYW5hZ2UtZXZlbnRzIiwibWFuYWdlLXJlYWxtIiwidmlldy1ldmVudHMiLCJ2aWV3LXVzZXJzIiwidmlldy1jbGllbnRzIiwibWFuYWdlLWF1dGhvcml6YXRpb24iLCJtYW5hZ2UtY2xpZW50cyIsInF1ZXJ5LWdyb3VwcyJdfSwiYnJva2VyIjp7InJvbGVzIjpbInJlYWQtdG9rZW4iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX19.mQ4Vi1yLG9KvcmmhHlgOowy8D30iaUsiO7--JTPY7Ol-R1eY4wvRn1cH5FllieXk8yltYGP23xXNtTC4M54guXGVtgRgo8AlRklFHL1BMlxpa0OPwcNmwthx1-P2n7c9XL1e8pt2uRhQJLxunr2TpLaQi0UpEmEyouXHfR7sxM1AzKAf3b9Nk7f7lrk__2BYlFsL3YcGlFDqDMgPfhNlDbR-rQGoxlOjt0YqS8ktYq4bneL5etpXnPh0oEt4B7FFK-WKKuOWR6rQ9791ACnn6puz6C_Ki261IkZ0a_Uu7tOA4Xi9xzoQKLgSTAlBeg4u86Wb5kjL5r2-3zTg-Dikew', + token_type: 'bearer', + 'not-before-policy': 0, + session_state: '9433e206-df1a-46a3-be7e-65b045a1c36b' + }); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/bpm-auth.mock.ts b/lib/js-api/test/mockObjects/process-services/bpm-auth.mock.ts new file mode 100644 index 0000000000..115c0b48fd --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/bpm-auth.mock.ts @@ -0,0 +1,68 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class BpmAuthMock extends BaseMock { + username: string; + password: string; + + constructor(host?: string, username?: string, password?: string) { + super(host); + this.username = username || 'admin'; + this.password = password || 'admin'; + } + + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post( + '/activiti-app/app/authentication', + 'j_username=' + this.username + '&j_password=' + this.password + '&_spring_security_remember_me=true&submit=Login' + ) + .reply(200); + } + + get200ResponseLogout(): void { + nock(this.host, { encodedQueryParams: true }).get('/activiti-app/app/logout', {}).reply(200); + } + + get401Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/activiti-app/app/authentication', 'j_username=wrong&j_password=name&_spring_security_remember_me=true&submit=Login') + .reply(401, { + error: { + message: 'This request requires HTTP authentication.', + statusCode: 401 + } + }); + } + + get403Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/activiti-app/app/authentication', 'j_username=wrong&j_password=name&_spring_security_remember_me=true&submit=Login') + .reply(403, { + error: { + errorKey: 'Login failed', + statusCode: 403, + briefSummary: '05150009 Login failed', + stackTrace: 'For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.', + descriptionURL: 'https://api-explorer.alfresco.com' + } + }); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/model-json.mock.ts b/lib/js-api/test/mockObjects/process-services/model-json.mock.ts new file mode 100644 index 0000000000..28e5ac6fd1 --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/model-json.mock.ts @@ -0,0 +1,155 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class ModelJsonBpmMock extends BaseMock { + get200EditorDisplayJsonClient(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/app/rest/models/1/model-json') + .reply(200, { + elements: [ + { + id: 'startEvent1', + name: null, + x: 100, + y: 163, + width: 30, + height: 30, + type: 'StartEvent', + properties: [] + }, + { + id: 'sid-8B04E151-6B46-4F48-B49E-F719057353AD', + name: null, + x: 175, + y: 138, + width: 100, + height: 80, + type: 'UserTask', + properties: [{ name: 'Assignee', value: '$INITIATOR' }] + }, + { + id: 'sid-8F6A225D-91AC-4FE3-8DDF-7DF034A37C44', + name: null, + x: 320, + y: 164, + width: 28, + height: 28, + type: 'EndEvent', + properties: [] + } + ], + flows: [ + { + id: 'sid-BC321EAF-BF83-4343-91C4-C0E7C4E10133', + type: 'sequenceFlow', + sourceRef: 'startEvent1', + targetRef: 'sid-8B04E151-6B46-4F48-B49E-F719057353AD', + waypoints: [ + { x: 130, y: 178 }, + { x: 175, y: 178 } + ], + properties: [] + }, + { + id: 'sid-CA38A1B7-1BFC-44C1-B20D-86748AE7AAA0', + type: 'sequenceFlow', + sourceRef: 'sid-8B04E151-6B46-4F48-B49E-F719057353AD', + targetRef: 'sid-8F6A225D-91AC-4FE3-8DDF-7DF034A37C44', + waypoints: [ + { x: 275, y: 178 }, + { x: 320, y: 178 } + ], + properties: [] + } + ], + diagramBeginX: 115, + diagramBeginY: 138, + diagramWidth: 348, + diagramHeight: 218 + }); + } + + get200HistoricEditorDisplayJsonClient(): void { + nock('https://127.0.0.1:9999', { encodedQueryParams: true }) + .get('/activiti-app/app/rest/models/1/history/1/model-json') + .reply(200, { + elements: [ + { + id: 'startEvent1', + name: null, + x: 100, + y: 163, + width: 30, + height: 30, + type: 'StartEvent', + properties: [] + }, + { + id: 'sid-8B04E151-6B46-4F48-B49E-F719057353AD', + name: null, + x: 175, + y: 138, + width: 100, + height: 80, + type: 'UserTask', + properties: [{ name: 'Assignee', value: '$INITIATOR' }] + }, + { + id: 'sid-8F6A225D-91AC-4FE3-8DDF-7DF034A37C44', + name: null, + x: 320, + y: 164, + width: 28, + height: 28, + type: 'EndEvent', + properties: [] + } + ], + flows: [ + { + id: 'sid-BC321EAF-BF83-4343-91C4-C0E7C4E10133', + type: 'sequenceFlow', + sourceRef: 'startEvent1', + targetRef: 'sid-8B04E151-6B46-4F48-B49E-F719057353AD', + waypoints: [ + { x: 130, y: 178 }, + { x: 175, y: 178 } + ], + properties: [] + }, + { + id: 'sid-CA38A1B7-1BFC-44C1-B20D-86748AE7AAA0', + type: 'sequenceFlow', + sourceRef: 'sid-8B04E151-6B46-4F48-B49E-F719057353AD', + targetRef: 'sid-8F6A225D-91AC-4FE3-8DDF-7DF034A37C44', + waypoints: [ + { x: 275, y: 178 }, + { x: 320, y: 178 } + ], + properties: [] + } + ], + diagramBeginX: 115, + diagramBeginY: 138, + diagramWidth: 348, + diagramHeight: 218 + }); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/models.mock.ts b/lib/js-api/test/mockObjects/process-services/models.mock.ts new file mode 100644 index 0000000000..c9f3bb9709 --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/models.mock.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class ModelsMock extends BaseMock { + get200getModels(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/models') + .query({ filter: 'myReusableForms', modelType: '2' }) + .reply(200, { + size: 1, + total: 1, + start: 0, + data: [ + { + id: 1, + name: 'Metadata', + description: '', + createdBy: 1, + createdByFullName: ' Administrator', + lastUpdatedBy: 1, + lastUpdatedByFullName: ' Administrator', + lastUpdated: '2016-08-05T17:39:22.750+0000', + latestVersion: true, + version: 2, + comment: null, + stencilSet: null, + referenceId: null, + modelType: 2, + favorite: null, + permission: 'write', + tenantId: 1 + } + ] + }); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/process-instance-variables.mock.ts b/lib/js-api/test/mockObjects/process-services/process-instance-variables.mock.ts new file mode 100644 index 0000000000..2a976c959e --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/process-instance-variables.mock.ts @@ -0,0 +1,110 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +const fakeVariable1 = { + name: 'variable1', + value: 'Value 123', + scope: 'global' +}; + +const fakeVariable2 = { + name: 'variable2', + value: 'Value 456', + scope: 'local' +}; + +const fakeVariablesList = [fakeVariable1, fakeVariable2]; + +export class ProcessInstanceVariablesMock extends BaseMock { + addListProcessInstanceVariables200Response(processInstanceId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables') + .reply(200, fakeVariablesList); + } + + addListProcessInstanceVariables500Response(processInstanceId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables') + .reply(500, { + messageKey: 'UNKNOWN', + message: 'Unknown error' + }); + } + + addPutProcessInstanceVariables200Response(processInstanceId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables') + .reply(200, fakeVariablesList); + } + + addPutProcessInstanceVariables500Response(processInstanceId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables') + .reply(500, { + messageKey: 'UNKNOWN', + message: 'Unknown error' + }); + } + + addGetProcessInstanceVariable200Response(processInstanceId: string, variableName: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables/' + variableName) + .reply(200, fakeVariable1); + } + + addGetProcessInstanceVariable500Response(processInstanceId: string, variableName: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables/' + variableName) + .reply(500, { + messageKey: 'UNKNOWN', + message: 'Unknown error' + }); + } + + addUpdateProcessInstanceVariable200Response(processInstanceId: string, variableName: string): void { + nock(this.host, { encodedQueryParams: true }) + .put('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables/' + variableName) + .reply(200, fakeVariable1); + } + + addUpdateProcessInstanceVariable500Response(processInstanceId: string, variableName: string): void { + nock(this.host, { encodedQueryParams: true }) + .put('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables/' + variableName) + .reply(500, { + messageKey: 'UNKNOWN', + message: 'Unknown error' + }); + } + + addDeleteProcessInstanceVariable200Response(processInstanceId: string, variableName: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables/' + variableName) + .reply(200); + } + + addDeleteProcessInstanceVariable500Response(processInstanceId: string, variableName: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/activiti-app/api/enterprise/process-instances/' + processInstanceId + '/variables/' + variableName) + .reply(500, { + messageKey: 'UNKNOWN', + message: 'Unknown error' + }); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/process.mock.ts b/lib/js-api/test/mockObjects/process-services/process.mock.ts new file mode 100644 index 0000000000..0112dcff9e --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/process.mock.ts @@ -0,0 +1,160 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class ProcessMock extends BaseMock { + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/activiti-app/api/enterprise/process-instances/query') + .reply(200, { + size: 2, + total: 2, + start: 0, + data: [ + { + id: '39', + name: 'Process Test Api - July 26th 2016', + businessKey: null, + processDefinitionId: 'ProcessTestApi:1:32', + tenantId: 'tenant_1', + started: '2016-07-26T15:31:00.414+0000', + ended: null, + startedBy: { + id: 1, + firstName: null, + lastName: 'Administrator', + email: 'admin@app.activiti.com' + }, + processDefinitionName: 'Process Test Api', + processDefinitionDescription: null, + processDefinitionKey: 'ProcessTestApi', + processDefinitionCategory: 'https://www.activiti.org/processdef', + processDefinitionVersion: 1, + processDefinitionDeploymentId: '29', + graphicalNotationDefined: true, + startFormDefined: false, + suspended: false, + variables: [] + }, + { + id: '33', + name: 'Process Test Api - July 26th 2016', + businessKey: null, + processDefinitionId: 'ProcessTestApi:1:32', + tenantId: 'tenant_1', + started: '2016-07-26T15:30:58.367+0000', + ended: null, + startedBy: { + id: 1, + firstName: null, + lastName: 'Administrator', + email: 'admin@app.activiti.com' + }, + processDefinitionName: 'Process Test Api', + processDefinitionDescription: null, + processDefinitionKey: 'ProcessTestApi', + processDefinitionCategory: 'https://www.activiti.org/processdef', + processDefinitionVersion: 1, + processDefinitionDeploymentId: '29', + graphicalNotationDefined: true, + startFormDefined: false, + suspended: false, + variables: [] + } + ] + }); + } + + get200getProcessDefinitionStartForm(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/process-definitions/testProcess%3A1%3A7504/start-form') + .reply(200, { + id: 2002, + processDefinitionId: 'testProcess:1:7504', + processDefinitionName: 'test process', + processDefinitionKey: 'testProcess', + tabs: [], + fields: [ + { + fieldType: 'DynamicTableRepresentation', + id: 'label', + name: 'Label', + type: 'dynamic-table', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + layout: { row: -1, column: -1, colspan: 2 }, + sizeX: 2, + sizeY: 2, + row: -1, + col: -1, + visibilityCondition: null, + columnDefinitions: [ + { + id: 'user', + name: 'User', + type: 'Dropdown', + value: null, + optionType: 'rest', + options: [{ id: null, name: 'Option 1' }], + restResponsePath: null, + restUrl: 'https://jsonplaceholder.typicode.com/users', + restIdProperty: 'id', + restLabelProperty: 'name', + amountCurrency: null, + amountEnableFractions: false, + required: true, + editable: true, + sortable: true, + visible: true, + endpoint: null, + requestHeaders: null + } + ] + } + ], + outcomes: [], + javascriptEvents: [], + className: '', + style: '', + customFieldTemplates: {}, + metadata: {}, + variables: [], + gridsterForm: false + }); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/profile.mock.ts b/lib/js-api/test/mockObjects/process-services/profile.mock.ts new file mode 100644 index 0000000000..f2b2121a18 --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/profile.mock.ts @@ -0,0 +1,103 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class ProfileMock extends BaseMock { + get200getProfile(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/profile') + .reply(200, { + id: 1, + firstName: null, + lastName: 'Administrator', + email: 'admin', + externalId: null, + company: null, + pictureId: null, + fullname: ' Administrator', + password: null, + type: 'enterprise', + status: 'active', + created: '2016-10-21T13:32:54.886+0000', + lastUpdate: '2016-10-23T22:16:48.252+0000', + tenantId: 1, + latestSyncTimeStamp: null, + groups: [ + { + id: 1, + name: 'analytics-users', + externalId: null, + status: 'active', + tenantId: 1, + type: 0, + parentGroupId: null, + lastSyncTimeStamp: null, + userCount: null, + users: null, + capabilities: null, + groups: null, + manager: null + }, + { + id: 2, + name: 'kickstart-users', + externalId: null, + status: 'active', + tenantId: 1, + type: 0, + parentGroupId: null, + lastSyncTimeStamp: null, + userCount: null, + users: null, + capabilities: null, + groups: null, + manager: null + }, + { + id: 3, + name: 'Superusers', + externalId: null, + status: 'active', + tenantId: 1, + type: 0, + parentGroupId: null, + lastSyncTimeStamp: null, + userCount: null, + users: null, + capabilities: null, + groups: null, + manager: null + } + ], + capabilities: null, + apps: [], + primaryGroup: null, + tenantPictureId: null, + tenantName: 'test' + }); + } + + get401getProfile(): void { + nock(this.host, { encodedQueryParams: true }).get('/activiti-app/api/enterprise/profile').reply(401); + } + + get200getProfilePicture(): void { + nock(this.host, { encodedQueryParams: true }).get('/activiti-app/api/enterprise/profile-picture').reply(200, 'BUFFERSIZE'); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/reports.mock.ts b/lib/js-api/test/mockObjects/process-services/reports.mock.ts new file mode 100644 index 0000000000..12b04fe5f7 --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/reports.mock.ts @@ -0,0 +1,212 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +const fakeReportList = [ + { id: 11011, name: 'Process definition heat map' }, + { id: 11012, name: 'Process definition overview' }, + { id: 11013, name: 'Process instances overview' }, + { id: 11014, name: 'Task overview' }, + { id: 11015, name: 'Task service level agreement' } +]; + +const fakeReportParams = { + id: 11013, + name: 'Process instances overview', + created: '2016-12-07T13:26:40.095+0000', + definition: + '{"parameters":[{"id":"processDefinitionId","name":null,"nameKey":"REPORTING.DEFAULT-REPORTS.PROCESS-INSTANCES-OVERVIEW.PROCESS-DEFINITION","type":"processDefinition","value":null,"dependsOn":null},' + + '{"id":"dateRange","name":null,"nameKey":"REPORTING.DEFAULT-REPORTS.PROCESS-INSTANCES-OVERVIEW.DATE-RANGE","type":"dateRange","value":null,"dependsOn":null},' + + '{"id":"slowProcessInstanceInteger","name":null,"nameKey":"REPORTING.DEFAULT-REPORTS.PROCESS-INSTANCES-OVERVIEW.SLOW-PROC-INST-NUMBER","type":"integer","value":10,"dependsOn":null},' + + '{"id":"status","name":null,"nameKey":"REPORTING.PROCESS-STATUS","type":"status","value":null,"dependsOn":null}' + + ']}' +}; + +const fakeChartReports = { + elements: [ + { + id: 'id10889073739455', + type: 'table', + rows: [ + ['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS', '10'], + ['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-INSTANCES', '63'], + ['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-ACTIVE-PROCESS-INSTANCES', '5'], + ['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-COMPLETED-PROCESS-INSTANCES', '52'] + ], + collapseable: false, + collapsed: false, + showRowIndex: false + }, + { + id: 'id10889073934509', + type: 'pieChart', + title: 'Total process instances overview', + titleKey: 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.PROC-INST-CHART-TITLE', + values: [ + { key: 'Activiti', y: 13, keyAndValue: ['Activiti', '13'] }, + { + key: 'Second Process', + y: 5, + keyAndValue: ['Second Process', '5'] + }, + { key: 'Process Custom Name', y: 3, keyAndValue: ['Process Custom Name', '3'] }, + { + key: 'Simple process', + y: 29, + keyAndValue: ['Simple process', '29'] + }, + { key: 'Third Process', y: 7, keyAndValue: ['Third Process', '7'] } + ] + }, + { + id: 'id10889074082883', + type: 'table', + title: 'Process definition details', + titleKey: 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE', + columnNames: ['Process definition', 'Total', 'Active', 'Completed'], + columnNameKeys: [ + 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-PROCESS', + 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-TOTAL', + 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-ACTIVE', + 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-COMPLETED' + ], + columnsCentered: [false, false, false, false], + rows: [ + ['Activiti', '13', '3', '10'], + ['Process Custom Name', '3', '0', '3'], + ['Second Process', '5', '1', '4'], + ['Simple process', '29', '1', '28'], + ['Third Process', '7', '0', '7'] + ], + collapseable: false, + collapsed: false, + showRowIndex: true + } + ] +}; + +const fakeProcessDefinitionsNoApp: any[] = [ + { + id: 'Process_sid-0FF10DA3-E2BD-4E6A-9013-6D66FC8A4716:1:30004', + name: 'Fake Process Name 1', + description: null, + key: 'Process_sid-0FF10DA3-E2BD-4E6A-9013-6D66FC8A4716', + category: 'https://www.activiti.org/processdef', + version: 1, + deploymentId: '30001', + tenantId: 'tenant_1', + metaDataValues: [], + hasStartForm: false + }, + { + id: 'SecondProcess:1:15027', + name: 'Fake Process Name 2', + description: 'fdsdf', + key: 'SecondProcess', + category: 'https://www.activiti.org/processdef', + version: 1, + deploymentId: '15024', + tenantId: 'tenant_1', + metaDataValues: [], + hasStartForm: false + }, + { + id: 'Simpleprocess:15:10004', + name: 'Fake Process Name 3', + description: null, + key: 'Simpleprocess', + category: 'https://www.activiti.org/processdef', + version: 15, + deploymentId: '10001', + tenantId: 'tenant_1', + metaDataValues: [], + hasStartForm: false + }, + { + id: 'fruitorderprocess:5:42530', + name: 'Fake Process Name 4', + description: null, + key: 'fruitorderprocess', + category: 'https://www.activiti.org/processdef', + version: 5, + deploymentId: '42527', + tenantId: 'tenant_1', + metaDataValues: [], + hasStartForm: false + } +]; + +export class ReportsMock extends BaseMock { + get200ResponseCreateDefaultReport(): void { + nock(this.host, { encodedQueryParams: true }).post('/activiti-app/app/rest/reporting/default-reports').reply(200); + } + + get200ResponseTasksByProcessDefinitionId(reportId: string, processDefinitionId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/app/rest/reporting/report-params/' + reportId + '/tasks') + .query({ processDefinitionId }) + .reply(200, ['Fake Task 1', 'Fake Task 2', 'Fake Task 3']); + } + + get200ResponseReportList(): void { + nock(this.host, { encodedQueryParams: true }).get('/activiti-app/app/rest/reporting/reports').reply(200, fakeReportList); + } + + get200ResponseReportParams(reportId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/app/rest/reporting/report-params/' + reportId) + .reply(200, fakeReportParams); + } + + get200ResponseReportsByParams(reportId: string, paramsQuery: { status: string }): void { + nock(this.host, { encodedQueryParams: true }) + .post('/activiti-app/app/rest/reporting/report-params/' + reportId, paramsQuery) + .reply(200, fakeChartReports); + } + + get200ResponseProcessDefinitions(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/app/rest/reporting/process-definitions') + .reply(200, fakeProcessDefinitionsNoApp); + } + + get200ResponseUpdateReport(reportId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put('/activiti-app/app/rest/reporting/reports/' + reportId) + .reply(200); + } + + get200ResponseExportReport(reportId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/activiti-app/app/rest/reporting/reports/' + reportId + '/export-to-csv') + .reply(200, 'CSV'); + } + + get200ResponseSaveReport(reportId: string): void { + nock(this.host, { encodedQueryParams: true }) + .post('/activiti-app/app/rest/reporting/reports/' + reportId) + .reply(200); + } + + get200ResponseDeleteReport(reportId: string): void { + nock(this.host, { encodedQueryParams: true }) + .delete('/activiti-app/app/rest/reporting/reports/' + reportId) + .reply(200); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/task-form.mock.ts b/lib/js-api/test/mockObjects/process-services/task-form.mock.ts new file mode 100644 index 0000000000..f4869e93ef --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/task-form.mock.ts @@ -0,0 +1,56 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class TaskFormMock extends BaseMock { + get200getTaskFormVariables(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/task-forms/5028/variables') + .reply( + 200, + [{ id: 'initiator', type: 'string', value: '1001' }], + [ + 'Server', + 'Apache-Coyote/1.1', + 'set-cookie', + 'ACTIVITI_REMEMBER_ME=NjdOdGwvcUtFTkVEczQyMGh4WFp5QT09OmpUL1UwdFVBTC94QTJMTFFUVFgvdFE9PQ', + 'X-Content-Type-Options', + 'nosniff', + 'X-XSS-Protection', + '1; mode=block', + 'Cache-Control', + 'no-cache, no-store, max-age=0, must-revalidate', + 'Pragma', + 'no-cache', + 'Expires', + '0', + 'X-Frame-Options', + 'SAMEORIGIN', + 'Content-Type', + 'application/json', + 'Transfer-Encoding', + 'chunked', + 'Date', + 'Tue, 01 Nov 2016 19:43:36 GMT', + 'Connection', + 'close' + ] + ); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/tasks.mock.ts b/lib/js-api/test/mockObjects/process-services/tasks.mock.ts new file mode 100644 index 0000000000..c8bc643ddf --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/tasks.mock.ts @@ -0,0 +1,1046 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +const formValues = [ + { id: '1', name: 'Leanne Graham' }, + { id: '2', name: 'Ervin Howell' }, + { + id: '3', + name: 'Clementine Bauch' + }, + { id: '4', name: 'Patricia Lebsack' }, + { id: '5', name: 'Chelsey Dietrich' }, + { + id: '6', + name: 'Mrs. Dennis Schulist' + }, + { id: '7', name: 'Kurtis Weissnat' }, + { id: '8', name: 'Nicholas Runolfsdottir V' }, + { + id: '9', + name: 'Glenna Reichert' + }, + { id: '10', name: 'Clementina DuBuque' } +]; + +export class TasksMock extends BaseMock { + get200Response(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/activiti-app/api/enterprise/tasks/query', {}) + .reply(200, { + size: 2, + total: 2, + start: 0, + data: [ + { + id: '38', + name: null, + description: null, + category: null, + assignee: { + id: 1, + firstName: null, + lastName: 'Administrator', + email: 'admin@app.activiti.com' + }, + created: '2016-07-26T15:30:58.368+0000', + dueDate: null, + endDate: null, + duration: null, + priority: 50, + parentTaskId: null, + parentTaskName: null, + processInstanceId: '33', + processInstanceName: null, + processDefinitionId: 'ProcessTestApi:1:32', + processDefinitionName: 'Process Test Api', + processDefinitionDescription: null, + processDefinitionKey: 'ProcessTestApi', + processDefinitionCategory: 'https://www.activiti.org/processdef', + processDefinitionVersion: 1, + processDefinitionDeploymentId: '29', + formKey: null, + processInstanceStartUserId: null, + initiatorCanCompleteTask: false, + adhocTaskCanBeReassigned: false, + taskDefinitionKey: 'sid-E6C102D3-F101-47AE-8D39-B7FD17F38FE9', + executionId: '33', + memberOfCandidateGroup: false, + memberOfCandidateUsers: false, + managerOfCandidateGroup: false + }, + { + id: '44', + name: null, + description: null, + category: null, + assignee: { + id: 1, + firstName: null, + lastName: 'Administrator', + email: 'admin@app.activiti.com' + }, + created: '2016-07-26T15:31:00.415+0000', + dueDate: null, + endDate: null, + duration: null, + priority: 50, + parentTaskId: null, + parentTaskName: null, + processInstanceId: '39', + processInstanceName: null, + processDefinitionId: 'ProcessTestApi:1:32', + processDefinitionName: 'Process Test Api', + processDefinitionDescription: null, + processDefinitionKey: 'ProcessTestApi', + processDefinitionCategory: 'https://www.activiti.org/processdef', + processDefinitionVersion: 1, + processDefinitionDeploymentId: '29', + formKey: null, + processInstanceStartUserId: null, + initiatorCanCompleteTask: false, + adhocTaskCanBeReassigned: false, + taskDefinitionKey: 'sid-E6C102D3-F101-47AE-8D39-B7FD17F38FE9', + executionId: '39', + memberOfCandidateGroup: false, + memberOfCandidateUsers: false, + managerOfCandidateGroup: false + } + ] + }); + } + + get200ResponseGetTask(taskId: string): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/tasks/' + taskId) + .reply(200, { + id: '10', + name: 'Upload Document', + description: null, + category: null, + assignee: { id: 1, firstName: null, lastName: 'Administrator', email: 'admin' }, + created: '2016-08-05T17:39:36.159+0000', + dueDate: null, + endDate: null, + duration: null, + priority: 50, + parentTaskId: null, + parentTaskName: null, + processInstanceId: '5', + processInstanceName: null, + processDefinitionId: 'Sales:1:4', + processDefinitionName: 'Sales', + processDefinitionDescription: null, + processDefinitionKey: 'Sales', + processDefinitionCategory: 'https://www.activiti.org/processdef', + processDefinitionVersion: 1, + processDefinitionDeploymentId: '1', + formKey: '1', + processInstanceStartUserId: '1', + initiatorCanCompleteTask: true, + adhocTaskCanBeReassigned: false, + taskDefinitionKey: 'sid-58C42FE9-EDAC-4F7B-B36B-F13DF0A8CE70', + executionId: '5', + involvedPeople: [], + memberOfCandidateGroup: false, + memberOfCandidateUsers: false, + managerOfCandidateGroup: false + }); + } + + get400TaskFilter(): void { + nock(this.host, { encodedQueryParams: true }).post('/activiti-app/api/enterprise/tasks/filter', {}).reply(400, { + message: 'A valid filterId or filter params must be provided', + messageKey: 'GENERAL.ERROR.BAD-REQUEST' + }); + } + + get200TaskFilter(): void { + nock(this.host, { encodedQueryParams: true }) + .post('/activiti-app/api/enterprise/tasks/filter', { appDefinitionId: 1 }) + .reply(200, { + size: 2, + total: 2, + start: 0, + data: [ + { + id: '7506', + name: 'Upload Document', + description: null, + category: null, + assignee: { id: 1, firstName: null, lastName: 'Administrator', email: 'admin' }, + created: '2016-08-12T15:37:50.963+0000', + dueDate: null, + endDate: null, + duration: null, + priority: 50, + parentTaskId: null, + parentTaskName: null, + processInstanceId: '7501', + processInstanceName: null, + processDefinitionId: 'Sales:1:4', + processDefinitionName: 'Sales', + processDefinitionDescription: null, + processDefinitionKey: 'Sales', + processDefinitionCategory: 'https://www.activiti.org/processdef', + processDefinitionVersion: 1, + processDefinitionDeploymentId: '1', + formKey: '1', + processInstanceStartUserId: null, + initiatorCanCompleteTask: false, + adhocTaskCanBeReassigned: false, + taskDefinitionKey: 'sid-58C42FE9-EDAC-4F7B-B36B-F13DF0A8CE70', + executionId: '7501', + memberOfCandidateGroup: false, + memberOfCandidateUsers: false, + managerOfCandidateGroup: false + }, + { + id: '5006', + name: 'Upload Document', + description: null, + category: null, + assignee: { id: 1, firstName: null, lastName: 'Administrator', email: 'admin' }, + created: '2016-08-10T09:39:36.837+0000', + dueDate: null, + endDate: null, + duration: null, + priority: 50, + parentTaskId: null, + parentTaskName: null, + processInstanceId: '5001', + processInstanceName: null, + processDefinitionId: 'Sales:1:4', + processDefinitionName: 'Sales', + processDefinitionDescription: null, + processDefinitionKey: 'Sales', + processDefinitionCategory: 'https://www.activiti.org/processdef', + processDefinitionVersion: 1, + processDefinitionDeploymentId: '1', + formKey: '1', + processInstanceStartUserId: null, + initiatorCanCompleteTask: false, + adhocTaskCanBeReassigned: false, + taskDefinitionKey: 'sid-58C42FE9-EDAC-4F7B-B36B-F13DF0A8CE70', + executionId: '5001', + memberOfCandidateGroup: false, + memberOfCandidateUsers: false, + managerOfCandidateGroup: false + } + ] + }); + } + + get404CompleteTask(taskId: string): void { + nock(this.host, { encodedQueryParams: true }) + .put('/activiti-app/api/enterprise/tasks/' + taskId + '/action/complete') + .reply(404, { + message: 'Task with id: ' + taskId + ' does not exist', + messageKey: 'GENERAL.ERROR.NOT-FOUND' + }); + } + + get200CreateTask(name: string): void { + nock(this.host, { encodedQueryParams: true }).post('/activiti-app/api/enterprise/tasks', { name }).reply(200, { + id: '10001', + name: 'test-name', + description: null, + category: null, + assignee: null, + created: '2016-08-22T09:31:40.492+0000', + dueDate: null, + endDate: null, + duration: null, + priority: 50, + parentTaskId: null, + parentTaskName: null, + processInstanceId: null, + processInstanceName: null, + processDefinitionId: null, + processDefinitionName: null, + processDefinitionDescription: null, + processDefinitionKey: null, + processDefinitionCategory: null, + processDefinitionVersion: 0, + processDefinitionDeploymentId: null, + formKey: null, + processInstanceStartUserId: null, + initiatorCanCompleteTask: false, + adhocTaskCanBeReassigned: false, + taskDefinitionKey: null, + executionId: null, + memberOfCandidateGroup: false, + memberOfCandidateUsers: false, + managerOfCandidateGroup: false + }); + } + + get200getTaskForm(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/task-forms/2518') + .reply(200, { + id: 1, + name: 'Metadata', + processDefinitionId: 'Sales:1:4', + processDefinitionName: 'Sales', + processDefinitionKey: 'Sales', + taskId: '2518', + taskName: 'Upload Document', + taskDefinitionKey: 'sid-58C42FE9-EDAC-4F7B-B36B-F13DF0A8CE70', + tabs: [], + fields: [ + { + fieldType: 'ContainerRepresentation', + id: '1470229884327', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + 1: [ + { + fieldType: 'RestFieldRepresentation', + id: 'contenttype', + name: 'Content Type', + type: 'dropdown', + value: 'Choose one...', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: '@Other', + name: '@Other' + }, + { id: 'Blog Post', name: 'Blog Post' }, + { + id: 'Customer case study', + name: 'Customer case study' + }, + { id: 'Event materials', name: 'Event materials' } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + } + ], + 2: [ + { + fieldType: 'RestFieldRepresentation', + id: 'usageinternalorexternal', + name: 'Usage ( Internal or External)', + type: 'dropdown', + value: 'Internal Use Only', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: 'Internal Use Only', + name: 'Internal Use Only' + }, + { id: 'External use permitted', name: 'External use permitted' } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + } + ] + } + }, + { + fieldType: 'ContainerRepresentation', + id: '1470229890873', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + 1: [ + { + fieldType: 'RestFieldRepresentation', + id: 'productname', + name: 'Product Name', + type: 'dropdown', + value: 'Choose one...', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: 'ECM- Alfresco One', + name: 'ECM- Alfresco One' + }, + { + id: 'ECM- Alfresco in the Cloud', + name: 'ECM- Alfresco in the Cloud' + }, + { + id: 'ECM- Alfresco Community Edition', + name: 'ECM- Alfresco Community Edition' + }, + { id: 'ECM- Modules- Alfresco Mobile', name: 'ECM- Modules- Alfresco Mobile' } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + } + ], + 2: [] + } + }, + { + fieldType: 'ContainerRepresentation', + id: '1470229895618', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 3, + fields: { + 1: [ + { + fieldType: 'RestFieldRepresentation', + id: 'language', + name: 'Language', + type: 'dropdown', + value: 'English', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: 'English', + name: 'English' + }, + { id: 'French', name: 'French' }, + { + id: 'Italian', + name: 'Italian' + }, + { id: 'German', name: 'German' }, + { id: 'Spanish', name: 'Spanish' } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 3 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + } + ], + 2: [ + { + fieldType: 'RestFieldRepresentation', + id: 'region', + name: 'Region', + type: 'dropdown', + value: 'ALL', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: 'ALL', + name: 'ALL' + }, + { id: 'AMER', name: 'AMER' }, + { id: 'EMEA', name: 'EMEA' }, + { + id: 'APAC', + name: 'APAC' + } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + } + ], + 3: [ + { + fieldType: 'RestFieldRepresentation', + id: 'country', + name: 'Country', + type: 'dropdown', + value: 'Choose one...', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: 'ALL', + name: 'ALL' + }, + { id: 'United Kingdom', name: 'United Kingdom' }, + { + id: 'France', + name: 'France' + }, + { id: 'Spain', name: 'Spain' }, + { id: 'Germany', name: 'Germany' } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + } + ] + } + }, + { + fieldType: 'ContainerRepresentation', + id: '1470229910390', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + 1: [ + { + fieldType: 'FormFieldRepresentation', + id: 'customername', + name: 'Customer Name', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + }, + { + fieldType: 'RestFieldRepresentation', + id: 'industry', + name: 'Industry', + type: 'dropdown', + value: 'Choose one...', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: '@Other', + name: '@Other' + }, + { id: 'Construction', name: 'Construction' }, + { + id: 'Education', + name: 'Education' + }, + { + id: 'Financial Services', + name: 'Financial Services' + }, + { + id: 'Public Administration & Government', + name: 'Public Administration & Government' + }, + { id: 'Healthcare', name: 'Healthcare' }, + { + id: 'Life Sciences', + name: 'Life Sciences' + }, + { id: 'Manufacturing', name: 'Manufacturing' } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + }, + { + fieldType: 'RestFieldRepresentation', + id: 'solution', + name: 'Solution', + type: 'dropdown', + value: 'Choose one...', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: 'Content Management', + name: 'Content Management' + }, + { + id: 'External Collaboration', + name: 'External Collaboration' + }, + { + id: 'Information Governance', + name: 'Information Governance' + }, + { id: 'Case Management', name: 'Case Management' }, + { + id: 'Process Management', + name: 'Process Management' + } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + } + ], + 2: [ + { + fieldType: 'FormFieldRepresentation', + id: 'partnername', + name: 'Partner Name', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + }, + { + fieldType: 'RestFieldRepresentation', + id: 'usecase', + name: 'Use case', + type: 'dropdown', + value: '@ None selected', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: true, + options: [ + { id: 'empty', name: 'Choose one...' }, + { + id: '@ None selected', + name: '@ None selected' + }, + { + id: 'HR- Employee Records', + name: 'HR- Employee Records' + }, + { + id: 'HR- Employee On-Boarding', + name: 'HR- Employee On-Boarding' + }, + { + id: 'HR- Disciplinary Process Management', + name: 'HR- Disciplinary Process Management' + } + ], + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + endpoint: null, + dataSource: null, + requestHeaders: null + }, + { + fieldType: 'FormFieldRepresentation', + id: 'competitor', + name: 'Competitor', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ] + } + } + ], + outcomes: [], + javascriptEvents: [], + className: '', + style: '', + customFieldTemplates: {}, + metadata: {}, + variables: [], + gridsterForm: false + }); + } + + get200getRestFieldValuesColumn(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/task-forms/1/form-values/label/user') + .reply(200, formValues); + } + + get200getRestFieldValues(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/task-forms/2/form-values/label') + .reply(200, formValues); + } +} diff --git a/lib/js-api/test/mockObjects/process-services/user-filters.mock.ts b/lib/js-api/test/mockObjects/process-services/user-filters.mock.ts new file mode 100644 index 0000000000..3d48533202 --- /dev/null +++ b/lib/js-api/test/mockObjects/process-services/user-filters.mock.ts @@ -0,0 +1,66 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import nock from 'nock'; +import { BaseMock } from '../base.mock'; + +export class UserFiltersMock extends BaseMock { + get200getUserTaskFilters(): void { + nock(this.host, { encodedQueryParams: true }) + .get('/activiti-app/api/enterprise/filters/tasks') + .query({ appId: '1' }) + .reply(200, { + size: 4, + total: 4, + start: 0, + data: [ + { + id: 2, + name: 'Involved Tasks', + appId: 1, + recent: true, + icon: 'glyphicon-align-left', + filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'involved' } + }, + { + id: 4, + name: 'My Tasks', + appId: 1, + recent: false, + icon: 'glyphicon-inbox', + filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'assignee' } + }, + { + id: 1, + name: 'Queued Tasks', + appId: 1, + recent: false, + icon: 'glyphicon-record', + filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'candidate' } + }, + { + id: 3, + name: 'Completed Tasks', + appId: 1, + recent: false, + icon: 'glyphicon-ok-sign', + filter: { sort: 'created-desc', name: '', state: 'completed', assignment: 'involved' } + } + ] + }); + } +} diff --git a/lib/js-api/test/oauth2Auth.spec.ts b/lib/js-api/test/oauth2Auth.spec.ts new file mode 100644 index 0000000000..3e7ac4c6ab --- /dev/null +++ b/lib/js-api/test/oauth2Auth.spec.ts @@ -0,0 +1,636 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, ContentApi, Oauth2Auth } from '../src'; +import { EcmAuthMock, OAuthMock } from './mockObjects'; +import jsdom from 'jsdom'; + +const { JSDOM } = jsdom; +const globalAny: any = global; + +describe('Oauth2 test', () => { + let alfrescoJsApi: AlfrescoApi; + let oauth2Mock: OAuthMock; + let authResponseMock: EcmAuthMock; + + beforeEach(() => { + const hostOauth2 = 'https://myOauthUrl:30081'; + const mockStorage = { + getItem: () => {}, + setItem: () => {} + }; + + oauth2Mock = new OAuthMock(hostOauth2); + authResponseMock = new EcmAuthMock(hostOauth2); + + alfrescoJsApi = new AlfrescoApi({ + hostEcm: 'myecm' + }); + + alfrescoJsApi.storage.setStorage(mockStorage); + }); + + describe('Discovery urls', () => { + const authType = 'OAUTH'; + const host = 'https://dummy/auth'; + const clientId = 'dummy'; + const scope = 'openid'; + const redirectUri = '/'; + + it('should have default urls', async () => { + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host, + clientId, + scope, + redirectUri + }, + authType + }, + alfrescoJsApi + ); + + assert.equal(oauth2Auth.discovery.loginUrl, host + Oauth2Auth.DEFAULT_AUTHORIZATION_URL); + assert.equal(oauth2Auth.discovery.tokenEndpoint, host + Oauth2Auth.DEFAULT_TOKEN_URL); + assert.equal(oauth2Auth.discovery.logoutUrl, host + Oauth2Auth.DEFAULT_LOGOUT_URL); + }); + + it('should be possible to override the default urls', async () => { + const authorizationUrl = '/custom-login'; + const logoutUrl = '/custom-logout'; + const tokenUrl = '/custom-token'; + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host, + authorizationUrl, + logoutUrl, + tokenUrl, + clientId, + scope, + redirectUri + }, + authType + }, + alfrescoJsApi + ); + + assert.equal(oauth2Auth.discovery.loginUrl, authorizationUrl); + assert.equal(oauth2Auth.discovery.tokenEndpoint, tokenUrl); + assert.equal(oauth2Auth.discovery.logoutUrl, logoutUrl); + }); + }); + + describe('With Authentication', () => { + it('should be possible have different user login in different instance of the oauth2Auth class', async () => { + const oauth2AuthInstanceOne = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + const oauth2AuthInstanceTwo = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + const mock = new OAuthMock('https://myOauthUrl:30081'); + mock.get200Response('superman-token'); + const loginInstanceOne = await oauth2AuthInstanceOne.login('superman', 'crypto'); + + mock.get200Response('barman-token'); + const loginInstanceTwo = await oauth2AuthInstanceTwo.login('barman', 'IamBarman'); + + assert.equal(loginInstanceOne.access_token, 'superman-token'); + assert.equal(loginInstanceTwo.access_token, 'barman-token'); + + oauth2AuthInstanceOne.logOut(); + oauth2AuthInstanceTwo.logOut(); + }); + + it('login should return the Token if is ok', (done) => { + oauth2Mock.get200Response(); + + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + oauth2Auth.login('admin', 'admin').then((data) => { + assert.equal(data.access_token, 'test-token'); + oauth2Auth.logOut(); + done(); + }); + }); + + it('should refresh token when the login not use the implicitFlow ', function (done) { + this.timeout(3000); + oauth2Mock.get200Response(); + + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout', + implicitFlow: false, + refreshTokenTimeout: 100 + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + let calls = 0; + oauth2Auth.refreshToken = () => { + calls++; + return Promise.resolve(); + }; + + setTimeout(() => { + assert.equal(calls > 2, true); + oauth2Auth.logOut(); + done(); + }, 600); + + oauth2Auth.login('admin', 'admin'); + }); + + it('should not hang the app also if teh logout is missing', function (done) { + this.timeout(3000); + oauth2Mock.get200Response(); + + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout', + implicitFlow: false, + refreshTokenTimeout: 100 + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + let calls = 0; + oauth2Auth.refreshToken = () => { + calls++; + return Promise.resolve(); + }; + + setTimeout(() => { + assert.equal(calls > 2, true); + done(); + }, 600); + + oauth2Auth.login('admin', 'admin'); + }); + + it('should emit a token_issued event if login is ok ', (done) => { + oauth2Mock.get200Response(); + + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + oauth2Auth.once('token_issued', () => { + oauth2Auth.logOut(); + done(); + }); + + oauth2Auth.login('admin', 'admin'); + }); + + it('should not emit a token_issued event if setToken is null ', (done) => { + oauth2Mock.get200Response(); + + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + let counterCallEvent = 0; + oauth2Auth.once('token_issued', () => { + counterCallEvent++; + }); + + oauth2Auth.setToken(null, null); + oauth2Auth.setToken('200', null); + oauth2Auth.setToken(null, null); + + assert.equal(counterCallEvent, 1); + + done(); + }); + + it('should emit a token_issued if provider is ECM', (done) => { + oauth2Mock.get200Response(); + authResponseMock.get200ValidTicket(); + + const oauth2Auth = new Oauth2Auth( + { + provider: 'ECM', + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + oauth2Auth.once('token_issued', () => { + oauth2Auth.logOut(); + done(); + }); + + oauth2Auth.login('admin', 'admin'); + }); + + it('should emit a token_issued if provider is ALL', (done) => { + oauth2Mock.get200Response(); + authResponseMock.get200ValidTicket(); + const oauth2Auth = new Oauth2Auth( + { + provider: 'ALL', + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + oauth2Auth.once('token_issued', () => { + oauth2Auth.logOut(); + done(); + }); + + oauth2Auth.login('admin', 'admin'); + }); + + it('should after token_issued event exchange the access_token for the alf_ticket', (done) => { + oauth2Mock.get200Response(); + authResponseMock.get200ValidTicket(); + + const alfrescoApi = new AlfrescoApi({ + hostEcm: 'https://myOauthUrl:30081', + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }); + + alfrescoApi.oauth2Auth.on('ticket_exchanged', () => { + assert.equal(alfrescoApi.config.ticketEcm, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + assert.equal(alfrescoApi.contentClient.config.ticketEcm, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + + const content = new ContentApi(alfrescoApi); + const URL = content.getContentUrl('FAKE-NODE-ID'); + assert.equal( + URL, + 'https://myOauthUrl:30081/alfresco/api/-default-/public/alfresco/versions/1/nodes/FAKE-NODE-ID/content?attachment=false&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + + alfrescoApi.oauth2Auth.logOut(); + done(); + }); + + alfrescoApi.login('admin', 'admin'); + }); + + it('should after token_issued event exchange the access_token for the alf_ticket with the compatibility layer', (done) => { + oauth2Mock.get200Response(); + authResponseMock.get200ValidTicket(); + + const alfrescoApi = new AlfrescoApi({ + hostEcm: 'https://myOauthUrl:30081', + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }); + + const contentApi = new ContentApi(alfrescoApi); + + alfrescoApi.oauth2Auth.on('ticket_exchanged', () => { + assert.equal(alfrescoApi.config.ticketEcm, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + assert.equal(alfrescoApi.contentClient.config.ticketEcm, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + + const URL = contentApi.getContentUrl('FAKE-NODE-ID'); + assert.equal( + URL, + 'https://myOauthUrl:30081/alfresco/api/-default-/public/alfresco/versions/1/nodes/FAKE-NODE-ID/content?attachment=false&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + alfrescoApi.oauth2Auth.logOut(); + + done(); + }); + + alfrescoApi.login('admin', 'admin'); + }); + + // TODO: very flaky test, fails on different machines if running slow, might relate to `this.timeout` + // eslint-disable-next-line ban/ban + xit('should extend content session after oauth token refresh', function (done) { + this.timeout(3000); + + oauth2Mock.get200Response(); + authResponseMock.get200ValidTicket(); + + const alfrescoApi = new AlfrescoApi({ + hostEcm: 'https://myOauthUrl:30081', + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }); + + let counterCallEvent = 0; + alfrescoApi.oauth2Auth.on('ticket_exchanged', () => { + assert.equal(alfrescoApi.config.ticketEcm, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + assert.equal(alfrescoApi.contentClient.config.ticketEcm, 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1'); + + const content = new ContentApi(alfrescoApi); + const URL = content.getContentUrl('FAKE-NODE-ID'); + assert.equal( + URL, + 'https://myOauthUrl:30081/alfresco/api/-default-/public/alfresco/versions/1/nodes/FAKE-NODE-ID/content?attachment=false&alf_ticket=TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1' + ); + + counterCallEvent++; + + if (counterCallEvent === 2) { + done(); + } + }); + + alfrescoApi.login('admin', 'admin'); + this.timeout(3000); + alfrescoApi.refreshToken(); + }); + + it('isLoggedIn should return true if the api is logged in', (done) => { + oauth2Mock.get200Response(); + + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + oauth2Auth.login('admin', 'admin').then(() => { + assert.equal(oauth2Auth.isLoggedIn(), true); + oauth2Auth.logOut(); + done(); + }); + }); + + it('login password should be removed after login', (done) => { + oauth2Mock.get200Response(); + + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + oauth2Auth.login('admin', 'admin').then(() => { + assert.notEqual(oauth2Auth.authentications.basicAuth.password, 'admin'); + oauth2Auth.logOut(); + done(); + }); + }); + + describe('With mocked DOM', () => { + beforeEach(() => { + const dom = new JSDOM('', { url: 'https://localhost' }); + globalAny.window = dom.window; + globalAny.document = dom.window.document; + }); + + it('a failed hash check calls the logout', () => { + const oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + + oauth2Auth.createIframe(); + + const iframe = <HTMLIFrameElement>document.getElementById('silent_refresh_token_iframe'); + iframe.contentWindow.location.hash = 'invalid'; + + let logoutCalled = false; + oauth2Auth.logOut = () => { + logoutCalled = true; + return Promise.resolve(); + }; + + // invalid hash location leads to a reject which leads to a logout + oauth2Auth.iFrameHashListener(); + setTimeout(() => { + assert.equal(logoutCalled, true); + }, 500); + }); + + afterEach(() => { + globalAny.window = undefined; + }); + }); + + describe('public urls', () => { + let oauth2Auth: Oauth2Auth; + + beforeEach(() => { + oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + scope: 'openid', + secret: '', + redirectUri: '/', + redirectUriLogout: '/logout' + }, + authType: 'OAUTH' + }, + alfrescoJsApi + ); + }); + + it('should return true if PathMatcher.match returns true for matching url', () => { + globalAny.window = { location: { href: 'public-url' } }; + oauth2Auth.config.oauth2.publicUrls = ['public-url']; + oauth2Auth.pathMatcher = { + match: () => true + }; + + assert.equal(oauth2Auth.isPublicUrl(), true); + }); + + it('should return false if PathMatcher.match returns false for matching url', () => { + globalAny.window = { location: { href: 'some-public-url' } }; + oauth2Auth.config.oauth2.publicUrls = ['public-url']; + oauth2Auth.pathMatcher = { + match: () => false + }; + + assert.equal(oauth2Auth.isPublicUrl(), false); + }); + + it('should return false if publicUrls property is not defined', () => { + assert.equal(oauth2Auth.isPublicUrl(), false); + }); + + it('should return false if public urls is not set as an array list', () => { + globalAny.window = { location: { href: 'public-url-string' } }; + oauth2Auth.config.oauth2.publicUrls = null; + assert.equal(oauth2Auth.isPublicUrl(), false); + }); + + it('should not call `implicitLogin`', async () => { + globalAny.window = { location: { href: 'public-url' } }; + oauth2Auth.config.oauth2.silentLogin = true; + oauth2Auth.config.oauth2.publicUrls = ['public-url']; + + oauth2Auth.pathMatcher = { + match: () => true + }; + + let implicitLoginCalled = false; + oauth2Auth.implicitLogin = () => { + implicitLoginCalled = true; + }; + + await oauth2Auth.checkFragment(); + assert.equal(implicitLoginCalled, false); + }); + }); + }); +}); diff --git a/lib/js-api/test/oauth2AuthImplicitFlow.spec.ts b/lib/js-api/test/oauth2AuthImplicitFlow.spec.ts new file mode 100644 index 0000000000..93962b3573 --- /dev/null +++ b/lib/js-api/test/oauth2AuthImplicitFlow.spec.ts @@ -0,0 +1,188 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, Oauth2Auth } from '../src'; + +declare let window: any; +const globalAny: any = global; + +describe('Oauth2 Implicit flow test', () => { + let oauth2Auth: Oauth2Auth; + let alfrescoJsApi: AlfrescoApi; + + beforeEach(() => { + alfrescoJsApi = new AlfrescoApi({ + hostEcm: '' + }); + }); + + it('should throw an error if redirectUri is not present', (done) => { + try { + oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + secret: '', + scope: 'openid', + implicitFlow: true, + redirectUri: undefined + } + }, + alfrescoJsApi + ); + } catch (error) { + assert.equal(error.message, 'Missing redirectUri required parameter'); + done(); + } + }); + + it('should redirect to login if access token is not valid', (done) => { + window = globalAny.window = { location: {} }; + globalAny.document = { + getElementById: () => '' + }; + + oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + secret: '', + scope: 'openid', + implicitFlow: true, + redirectUri: 'redirectUri' + } + }, + alfrescoJsApi + ); + + oauth2Auth.on('implicit_redirect', () => { + assert.equal(window.location.href.includes('https://myOauthUrl:30081/auth/realms/springboot/protocol/openid-connect/auth?'), true); + done(); + }); + + oauth2Auth.implicitLogin(); + }); + + it('should not loop over redirection when redirectUri contains hash and token is not valid ', (done) => { + window = globalAny.window = { location: {} }; + globalAny.document = { + getElementById: () => '' + }; + oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + secret: '', + scope: 'openid', + implicitFlow: true, + redirectUri: '#/redirectUri' + } + }, + alfrescoJsApi + ); + + let setItemCalled = false; + alfrescoJsApi.storage.setItem = () => (setItemCalled = true); + + oauth2Auth.on('implicit_redirect', () => { + assert.equal(window.location.href.includes('https://myOauthUrl:30081/auth/realms/springboot/protocol/openid-connect/auth?'), true); + assert.equal(setItemCalled, true); + done(); + }); + + oauth2Auth.implicitLogin(); + }); + + it('should not redirect to login if access token is valid', (done) => { + window = globalAny.window = { location: {} }; + globalAny.document = { + getElementById: () => '' + }; + oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + secret: '', + scope: 'openid', + implicitFlow: true, + redirectUri: 'redirectUri' + } + }, + alfrescoJsApi + ); + + oauth2Auth.isValidAccessToken = () => true; + oauth2Auth.isValidToken = () => true; + + oauth2Auth.on('token_issued', () => { + assert.equal(window.location.url, undefined); + done(); + }); + + oauth2Auth.setToken('new_token', 'new_refresh_token'); + + oauth2Auth.implicitLogin(); + }); + + it('should set the loginFragment to redirect after the login if it is present', (done) => { + window = globalAny.window = {}; + globalAny.document = { + getElementById: () => '' + }; + window.location = <Location>{ hash: 'asfasfasfa' }; + + Object.defineProperty(window.location, 'hash', { + writable: true, + value: '#/redirect-path&session_state=eqfqwfqwf' + }); + + Object.defineProperty(window.location, 'href', { + writable: true, + value: 'https://stoca/#/redirect-path&session_state=eqfqwfqwf' + }); + + oauth2Auth = new Oauth2Auth( + { + oauth2: { + host: 'https://myOauthUrl:30081/auth/realms/springboot', + clientId: 'activiti', + secret: '', + scope: 'openid', + implicitFlow: true, + redirectUri: 'redirectUri' + } + }, + alfrescoJsApi + ); + + let lastValues: [string, any]; + alfrescoJsApi.storage.setItem = (key, value) => (lastValues = [key, value]); + + oauth2Auth.on('implicit_redirect', () => { + assert.equal(window.location.href.includes('https://myOauthUrl:30081/auth/realms/springboot/protocol/openid-connect/auth?'), true); + assert.deepEqual(lastValues, ['loginFragment', '/redirect-path&session_state=eqfqwfqwf']); + done(); + }); + + oauth2Auth.implicitLogin(); + }); +}); diff --git a/lib/js-api/test/path-matcher.spec.ts b/lib/js-api/test/path-matcher.spec.ts new file mode 100644 index 0000000000..15796bc2f3 --- /dev/null +++ b/lib/js-api/test/path-matcher.spec.ts @@ -0,0 +1,101 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { PathMatcher } from '../src/utils/path-matcher'; + +describe('PathMatcher', () => { + const pathPatcher = new PathMatcher(); + + describe('match', () => { + it('should return true if path is exactly the same like pattern', () => { + assert.equal(pathPatcher.match('public-url', 'public-url'), true); + }); + + it('should return false if path is not equal to pattern', () => { + assert.equal(pathPatcher.match('some-public-url', 'public-url'), false); + }); + + it('should return true if absolute path is equal to absolute path', () => { + assert.equal(pathPatcher.match('https://some-public-url', 'https://some-public-url'), true); + }); + + it('should return true if path matches pattern containing double and single *', () => { + assert.equal(pathPatcher.match('https://some-public-url/123/path', '**/some-public-url/*/path'), true); + }); + + it('should return true if path matches to pattern after replacing ** with multiple parts at the beginning', () => { + assert.equal(pathPatcher.match('https://test/other-test/some-public-url/path', '**/some-public-url/path'), true); + }); + + it('should return true if path matches to pattern after replacing ** with multiple parts at the beginning', () => { + assert.equal(pathPatcher.match('https://test/other-test/some-public-url/path', '**/some-public-url/path'), true); + }); + + it('should return true if path matches to pattern after replacing ** with multiple parts at the end', () => { + assert.equal(pathPatcher.match('https://some-public-url/path/test/other-test', 'https://some-public-url/path/**'), true); + }); + + it('should return true if path matches to pattern after replacing ** with none parts at the end', () => { + assert.equal(pathPatcher.match('https://some-public-url/path/', 'https://some-public-url/path/**'), true); + }); + + it('should return false if path does not match to pattern after replacing ** with none parts at the end and cuts last /', () => { + assert.equal(pathPatcher.match('https://some-public-url/path', 'https://some-public-url/path/**'), false); + }); + + it('should return true if path matches to pattern after replacing ** with multiple parts in the middle', () => { + assert.equal(pathPatcher.match('https://some-public-url/test/other-test/path', 'https://some-public-url/**/path'), true); + }); + + it('should return true if path matches to pattern after replacing ** with none parts in the middle', () => { + assert.equal(pathPatcher.match('https://some-public-url/path', 'https://some-public-url/**/path'), true); + }); + + it('should return false if path does not match to pattern with **', () => { + assert.equal(pathPatcher.match('https://some-public-url/', 'https://some-public-url/**/path'), false); + }); + + it('should return false if path has more than one part as replacement for * in the middle of pattern', () => { + assert.equal(pathPatcher.match('https://some-public-url/123/test/path', 'https://some-public-url/*/path'), false); + }); + + it('should return false if path has zero parts as replacement for * in the middle of pattern', () => { + assert.equal(pathPatcher.match('https://some-public-url/path', 'https://some-public-url/*/path'), false); + }); + + it('should return true if path matches to pattern containing * at the end', () => { + assert.equal(pathPatcher.match('https://some-public-url/path/test', 'https://some-public-url/path/*'), true); + }); + + it('should return false if path matches to pattern containing * at the end and cuts last /', () => { + assert.equal(pathPatcher.match('https://some-public-url/path', 'https://some-public-url/path/*'), false); + }); + + it('should return false if path has more than one part as replacement for * at the end of pattern', () => { + assert.equal(pathPatcher.match('https://some-public-url/path/test/other-test', 'https://some-public-url/path/*'), false); + }); + + it('should return false if path has zero parts as replacement for * at the end of pattern', () => { + assert.equal(pathPatcher.match('https://some-public-url/path/test/other-test', 'https://some-public-url/path/*'), false); + }); + + it('should return false if path starts with https:// and * is at the beginning of pattern', () => { + assert.equal(pathPatcher.match('https://some-public-url/path/test', '*/some-public-url/path'), false); + }); + }); +}); diff --git a/lib/js-api/test/peopleApi.spec.ts b/lib/js-api/test/peopleApi.spec.ts new file mode 100644 index 0000000000..80c5718bf6 --- /dev/null +++ b/lib/js-api/test/peopleApi.spec.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AlfrescoApi, PeopleApi, PersonBodyCreate } from '../src'; +import { PeopleMock } from './mockObjects'; + +describe('PeopleApi', () => { + let peopleMock: PeopleMock; + let peopleApi: PeopleApi; + + beforeEach(() => { + const hostEcm = 'https://127.0.0.1:8080'; + + const alfrescoApi = new AlfrescoApi({ + hostEcm + }); + + peopleMock = new PeopleMock(hostEcm); + peopleApi = new PeopleApi(alfrescoApi); + }); + + it('should add a person', (done) => { + peopleMock.get201Response(); + + const personBodyCreate: PersonBodyCreate = { + id: 'chewbe', + email: 'chewbe@millenniumfalcon.com', + lastName: 'Chewbe', + firstName: 'chewbacca', + password: 'Rrrrrrrghghghghgh' + }; + + peopleApi.createPerson(personBodyCreate).then(() => { + done(); + }); + }); +}); diff --git a/lib/js-api/test/process-services/modelApi.spec.ts b/lib/js-api/test/process-services/modelApi.spec.ts new file mode 100644 index 0000000000..51ac886d4c --- /dev/null +++ b/lib/js-api/test/process-services/modelApi.spec.ts @@ -0,0 +1,56 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, ModelsApi } from '../../src'; +import { BpmAuthMock, ModelsMock } from '../mockObjects'; + +describe('Activiti Models Api', () => { + let authResponseBpmMock: BpmAuthMock; + let modelsMock: ModelsMock; + let modelsApi: ModelsApi; + + beforeEach(async () => { + const hostBpm = 'https://127.0.0.1:9999'; + + authResponseBpmMock = new BpmAuthMock(hostBpm); + authResponseBpmMock.get200Response(); + + modelsMock = new ModelsMock(hostBpm); + + const alfrescoJsApi = new AlfrescoApi({ + hostBpm, + provider: 'BPM' + }); + + modelsApi = new ModelsApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + it('get activiti model', async () => { + modelsMock.get200getModels(); + + const opts = { + filter: 'myReusableForms', + modelType: 2 + }; + + const data = await modelsApi.getModels(opts); + assert.equal(data.data[0].name, 'Metadata'); + }); +}); diff --git a/lib/js-api/test/process-services/modelJsonBpmnApi.spec.ts b/lib/js-api/test/process-services/modelJsonBpmnApi.spec.ts new file mode 100644 index 0000000000..c8658d0dab --- /dev/null +++ b/lib/js-api/test/process-services/modelJsonBpmnApi.spec.ts @@ -0,0 +1,56 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, ModelJsonBpmnApi } from '../../src'; +import { BpmAuthMock, ModelJsonBpmMock } from '../mockObjects'; + +describe('Activiti Model JsonBpmn Api', () => { + let authResponseBpmMock: BpmAuthMock; + let modelJsonBpmMock: ModelJsonBpmMock; + let modelJsonBpmnApi: ModelJsonBpmnApi; + + beforeEach(async () => { + const hostBpm = 'https://127.0.0.1:9999'; + + authResponseBpmMock = new BpmAuthMock(hostBpm); + authResponseBpmMock.get200Response(); + + modelJsonBpmMock = new ModelJsonBpmMock(hostBpm); + + const alfrescoJsApi = new AlfrescoApi({ + hostBpm, + provider: 'BPM' + }); + + modelJsonBpmnApi = new ModelJsonBpmnApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + it('get Model JsonBpmn', async () => { + modelJsonBpmMock.get200EditorDisplayJsonClient(); + const data = await modelJsonBpmnApi.getEditorDisplayJsonClient(1); + assert.notEqual(data, null); + }); + + it('get Model JsonBpmn history', async () => { + modelJsonBpmMock.get200HistoricEditorDisplayJsonClient(); + const data = await modelJsonBpmnApi.getHistoricEditorDisplayJsonClient(1, 1); + assert.notEqual(data, null); + }); +}); diff --git a/lib/js-api/test/process-services/processApi.spec.ts b/lib/js-api/test/process-services/processApi.spec.ts new file mode 100644 index 0000000000..58564ab189 --- /dev/null +++ b/lib/js-api/test/process-services/processApi.spec.ts @@ -0,0 +1,84 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { BpmAuthMock, ProcessMock } from '../mockObjects'; +import { AlfrescoApi, ProcessDefinitionsApi, ProcessInstanceQueryRepresentation, ProcessInstancesApi } from '../../src'; + +describe('Activiti Process Api', () => { + let authResponseBpmMock: BpmAuthMock; + let processMock: ProcessMock; + let alfrescoJsApi: AlfrescoApi; + let processInstancesApi: ProcessInstancesApi; + let processDefinitionsApi: ProcessDefinitionsApi; + + beforeEach(async () => { + const BPM_HOST = 'https://127.0.0.1:9999'; + + authResponseBpmMock = new BpmAuthMock(BPM_HOST); + processMock = new ProcessMock(BPM_HOST); + + authResponseBpmMock.get200Response(); + + alfrescoJsApi = new AlfrescoApi({ + hostBpm: BPM_HOST, + provider: 'BPM' + }); + + processInstancesApi = new ProcessInstancesApi(alfrescoJsApi); + processDefinitionsApi = new ProcessDefinitionsApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + it('get activiti Process list filtered', (done) => { + processMock.get200Response(); + + const requestNode: ProcessInstanceQueryRepresentation = { + page: 0, + sort: 'created-desc', + state: 'completed' + }; + + processInstancesApi.getProcessInstances(requestNode).then((data) => { + assert.equal(data.data[0].name, 'Process Test Api - July 26th 2016'); + assert.equal(data.data[1].name, 'Process Test Api - July 26th 2016'); + assert.equal(data.size, 2); + done(); + }); + }); + + it('get activiti Process list', (done) => { + processMock.get200Response(); + + processInstancesApi.getProcessInstances({}).then((data) => { + assert.equal(data.data[0].name, 'Process Test Api - July 26th 2016'); + assert.equal(data.data[1].name, 'Process Test Api - July 26th 2016'); + done(); + }); + }); + + it('get process definition startForm', (done) => { + processMock.get200getProcessDefinitionStartForm(); + const processDefinitionId = 'testProcess:1:7504'; + + processDefinitionsApi.getProcessDefinitionStartForm(processDefinitionId).then((data) => { + assert.equal(data.processDefinitionId, 'testProcess:1:7504'); + done(); + }); + }); +}); diff --git a/lib/js-api/test/process-services/processInstanceVariablesApi.spec.ts b/lib/js-api/test/process-services/processInstanceVariablesApi.spec.ts new file mode 100644 index 0000000000..d89c1ef44e --- /dev/null +++ b/lib/js-api/test/process-services/processInstanceVariablesApi.spec.ts @@ -0,0 +1,174 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { BpmAuthMock, ProcessInstanceVariablesMock } from '../mockObjects'; +import { ProcessInstanceVariablesApi, AlfrescoApi } from '../../src'; + +describe('Activiti Process Instance Variables Api', () => { + let authResponseBpmMock: BpmAuthMock; + let variablesMock: ProcessInstanceVariablesMock; + let alfrescoJsApi: AlfrescoApi; + let processInstanceVariablesApi: ProcessInstanceVariablesApi; + + const NOOP = () => { + /* empty */ + }; + + beforeEach(async () => { + const BPM_HOST = 'https://127.0.0.1:9999'; + + authResponseBpmMock = new BpmAuthMock(BPM_HOST); + variablesMock = new ProcessInstanceVariablesMock(BPM_HOST); + + authResponseBpmMock.get200Response(); + + alfrescoJsApi = new AlfrescoApi({ + hostBpm: BPM_HOST, + provider: 'BPM' + }); + + processInstanceVariablesApi = new ProcessInstanceVariablesApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + describe('get variables', () => { + it('should return all variables for a process instance', (done) => { + const processInstanceId = '111'; + variablesMock.addListProcessInstanceVariables200Response(processInstanceId); + + processInstanceVariablesApi.getProcessInstanceVariables(processInstanceId).then((data) => { + assert.equal(data.length, 2); + done(); + }); + }); + + it('should emit an error when API returns an error response', (done) => { + const processInstanceId = '111'; + variablesMock.addListProcessInstanceVariables500Response(processInstanceId); + + processInstanceVariablesApi.getProcessInstanceVariables(processInstanceId).then(NOOP, (error) => { + assert.equal(error.status, 500); + assert.equal(error.message, '{"messageKey":"UNKNOWN","message":"Unknown error"}'); + done(); + }); + }); + }); + + describe('create or update variables', () => { + it('should return all variables for a process instance', (done) => { + const processInstanceId = '111'; + variablesMock.addPutProcessInstanceVariables200Response(processInstanceId); + + processInstanceVariablesApi.createOrUpdateProcessInstanceVariables(processInstanceId, []).then((data) => { + assert.equal(data.length, 2); + done(); + }); + }); + + it('should emit an error when API returns an error response', (done) => { + const processInstanceId = '111'; + variablesMock.addPutProcessInstanceVariables500Response(processInstanceId); + + processInstanceVariablesApi.createOrUpdateProcessInstanceVariables(processInstanceId, []).then(NOOP, (error) => { + assert.equal(error.status, 500); + assert.equal(error.message, '{"messageKey":"UNKNOWN","message":"Unknown error"}'); + done(); + }); + }); + }); + + describe('get variable', () => { + it('should call API to get variable', (done) => { + const processInstanceId = '111'; + const variableName = 'var1'; + variablesMock.addGetProcessInstanceVariable200Response(processInstanceId, variableName); + + processInstanceVariablesApi.getProcessInstanceVariable(processInstanceId, variableName).then( + (data) => { + assert.equal(data.name, 'variable1'); + assert.equal(data.value, 'Value 123'); + done(); + }, + () => { + done(); + } + ); + }); + + it('should emit an error when API returns an error response', (done) => { + const processInstanceId = '111'; + const variableName = 'var1'; + variablesMock.addGetProcessInstanceVariable500Response(processInstanceId, variableName); + + processInstanceVariablesApi.getProcessInstanceVariable(processInstanceId, variableName).then(NOOP, (error) => { + assert.equal(error.status, 500); + assert.equal(error.message, '{"messageKey":"UNKNOWN","message":"Unknown error"}'); + done(); + }); + }); + }); + + describe('update variable', () => { + it('should call API to update variable', (done) => { + const processInstanceId = '111'; + const variableName = 'var1'; + variablesMock.addUpdateProcessInstanceVariable200Response(processInstanceId, variableName); + + processInstanceVariablesApi.updateProcessInstanceVariable(processInstanceId, variableName, {}).then(() => { + done(); + }); + }); + + it('should emit an error when API returns an error response', (done) => { + const processInstanceId = '111'; + const variableName = 'var1'; + variablesMock.addUpdateProcessInstanceVariable500Response(processInstanceId, variableName); + + processInstanceVariablesApi.updateProcessInstanceVariable(processInstanceId, variableName, {}).then(NOOP, (error) => { + assert.equal(error.status, 500); + assert.equal(error.message, '{"messageKey":"UNKNOWN","message":"Unknown error"}'); + done(); + }); + }); + }); + + describe('delete variable', () => { + it('should call API to delete variables', (done) => { + const processInstanceId = '111'; + const variableName = 'var1'; + variablesMock.addDeleteProcessInstanceVariable200Response(processInstanceId, variableName); + + processInstanceVariablesApi.deleteProcessInstanceVariable(processInstanceId, variableName).then(() => { + done(); + }); + }); + + it('should emit an error when API returns an error response', (done) => { + const processInstanceId = '111'; + const variableName = 'var1'; + variablesMock.addDeleteProcessInstanceVariable500Response(processInstanceId, variableName); + + processInstanceVariablesApi.deleteProcessInstanceVariable(processInstanceId, variableName).then(NOOP, (error) => { + assert.equal(error.status, 500); + assert.equal(error.message, '{"messageKey":"UNKNOWN","message":"Unknown error"}'); + done(); + }); + }); + }); +}); diff --git a/lib/js-api/test/process-services/profileApi.spec.ts b/lib/js-api/test/process-services/profileApi.spec.ts new file mode 100644 index 0000000000..d3823e6b4d --- /dev/null +++ b/lib/js-api/test/process-services/profileApi.spec.ts @@ -0,0 +1,62 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, UserProfileApi } from '../../src'; +import { BpmAuthMock, ProfileMock } from '../mockObjects'; + +describe('Activiti Profile Api', () => { + let profileApi: UserProfileApi; + + let profileMock: ProfileMock; + let authResponseBpmMock: BpmAuthMock; + + beforeEach(async () => { + const BPM_HOST = 'https://127.0.0.1:9999'; + + authResponseBpmMock = new BpmAuthMock(BPM_HOST); + profileMock = new ProfileMock(BPM_HOST); + + authResponseBpmMock.get200Response(); + + const alfrescoApi = new AlfrescoApi({ + hostBpm: BPM_HOST, + provider: 'BPM' + }); + + profileApi = new UserProfileApi(alfrescoApi); + + await alfrescoApi.login('admin', 'admin'); + }); + + it('get Profile Picture', async () => { + profileMock.get200getProfilePicture(); + await profileApi.getProfilePicture(); + }); + + it('get Profile url Picture', () => { + assert.equal(profileApi.getProfilePictureUrl(), 'https://127.0.0.1:9999/activiti-app/app/rest/admin/profile-picture'); + }); + + it('get Profile', async () => { + profileMock.get200getProfile(); + const data = await profileApi.getProfile(); + assert.equal(data.lastName, 'Administrator'); + assert.equal(data.groups[0].name, 'analytics-users'); + assert.equal(data.tenantName, 'test'); + }); +}); diff --git a/lib/js-api/test/process-services/reportApi.spec.ts b/lib/js-api/test/process-services/reportApi.spec.ts new file mode 100644 index 0000000000..e044625f30 --- /dev/null +++ b/lib/js-api/test/process-services/reportApi.spec.ts @@ -0,0 +1,203 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { BpmAuthMock, ReportsMock } from '../mockObjects'; +import { ReportApi, AlfrescoApi } from '../../src'; + +describe('Activiti Report Api', () => { + let authResponseBpmMock: BpmAuthMock; + let reportsMock: ReportsMock; + let alfrescoJsApi: AlfrescoApi; + let reportApi: ReportApi; + + beforeEach(async () => { + const BPM_HOST = 'https://127.0.0.1:9999'; + + authResponseBpmMock = new BpmAuthMock(BPM_HOST); + reportsMock = new ReportsMock(BPM_HOST); + + authResponseBpmMock.get200Response(); + + alfrescoJsApi = new AlfrescoApi({ + hostBpm: BPM_HOST, + provider: 'BPM' + }); + + reportApi = new ReportApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + it('should create the default reports', async () => { + reportsMock.get200ResponseCreateDefaultReport(); + await reportApi.createDefaultReports(); + }); + + it('should return the tasks referring to the process id', async () => { + const reportId = '11015'; + const processDefinitionId = 'Process_sid-0FF10DA3-E2BD-4E6A-9013-6D66FC8A4716:1:30004'; + + reportsMock.get200ResponseTasksByProcessDefinitionId(reportId, processDefinitionId); + + const data = await reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId); + assert.equal(data.length, 3); + assert.equal(data[0], 'Fake Task 1'); + assert.equal(data[1], 'Fake Task 2'); + assert.equal(data[2], 'Fake Task 3'); + }); + + it('should return the chart reports', async () => { + const reportId = '11015'; + const paramsQuery = { status: 'All' }; + + reportsMock.get200ResponseReportsByParams(reportId, paramsQuery); + + const data = await reportApi.getReportsByParams(reportId, paramsQuery); + assert.equal(data.elements.length, 3); + assert.equal(data.elements[0].type, 'table'); + + assert.equal(data.elements[1].type, 'pieChart'); + assert.equal(data.elements[1].titleKey, 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.PROC-INST-CHART-TITLE'); + + assert.equal(data.elements[2].type, 'table'); + assert.equal(data.elements[2].titleKey, 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE'); + }); + + it('should return the process definitions when the appId is not provided', async () => { + reportsMock.get200ResponseProcessDefinitions(); + + const res = await reportApi.getProcessDefinitions(); + + assert.equal(res.length, 4); + assert.equal(res[0].id, 'Process_sid-0FF10DA3-E2BD-4E6A-9013-6D66FC8A4716:1:30004'); + assert.equal(res[0].name, 'Fake Process Name 1'); + + assert.equal(res[1].id, 'SecondProcess:1:15027'); + assert.equal(res[1].name, 'Fake Process Name 2'); + + assert.equal(res[2].id, 'Simpleprocess:15:10004'); + assert.equal(res[2].name, 'Fake Process Name 3'); + + assert.equal(res[3].id, 'fruitorderprocess:5:42530'); + assert.equal(res[3].name, 'Fake Process Name 4'); + }); + + it('should return the report list', async () => { + reportsMock.get200ResponseReportList(); + + const res = await reportApi.getReportList(); + + assert.equal(res.length, 5); + + assert.equal(res[0].id, 11011); + assert.equal(res[0].name, 'Process definition heat map'); + + assert.equal(res[1].id, 11012); + assert.equal(res[1].name, 'Process definition overview'); + + assert.equal(res[2].id, 11013); + assert.equal(res[2].name, 'Process instances overview'); + + assert.equal(res[3].id, 11014); + assert.equal(res[3].name, 'Task overview'); + + assert.equal(res[4].id, 11015); + assert.equal(res[4].name, 'Task service level agreement'); + }); + + it('should return the report parameters', async () => { + const reportId = '11013'; // String | reportId + reportsMock.get200ResponseReportParams(reportId); + + const res = await reportApi.getReportParams(reportId); + const paramsDefinition = JSON.parse(res.definition); + + assert.equal(res.id, 11013); + assert.equal(res.name, 'Process instances overview'); + assert.equal(paramsDefinition.parameters.length, 4); + + assert.equal(paramsDefinition.parameters[0].id, 'processDefinitionId'); + assert.equal(paramsDefinition.parameters[0].nameKey, 'REPORTING.DEFAULT-REPORTS.PROCESS-INSTANCES-OVERVIEW.PROCESS-DEFINITION'); + assert.equal(paramsDefinition.parameters[0].type, 'processDefinition'); + + assert.equal(paramsDefinition.parameters[1].id, 'dateRange'); + assert.equal(paramsDefinition.parameters[1].nameKey, 'REPORTING.DEFAULT-REPORTS.PROCESS-INSTANCES-OVERVIEW.DATE-RANGE'); + assert.equal(paramsDefinition.parameters[1].type, 'dateRange'); + + assert.equal(paramsDefinition.parameters[2].id, 'slowProcessInstanceInteger'); + assert.equal(paramsDefinition.parameters[2].nameKey, 'REPORTING.DEFAULT-REPORTS.PROCESS-INSTANCES-OVERVIEW.SLOW-PROC-INST-NUMBER'); + assert.equal(paramsDefinition.parameters[2].type, 'integer'); + + assert.equal(paramsDefinition.parameters[3].id, 'status'); + assert.equal(paramsDefinition.parameters[3].nameKey, 'REPORTING.PROCESS-STATUS'); + assert.equal(paramsDefinition.parameters[3].type, 'status'); + }); + + it('should update the report', async () => { + const reportId = '11015'; + const name = 'New Fake Name'; + reportsMock.get200ResponseUpdateReport(reportId); + + await reportApi.updateReport(reportId, name); + }); + + it('should export the report', async () => { + const reportId = '11015'; // String | reportId + const queryParams = { + processDefinitionId: 'TEST:99:999', + dateRange: { + startDate: '2017-01-01T00:00:00.000Z', + endDate: '2017-01-24T23:59:59.999Z', + rangeId: 'currentYear' + }, + slowProcessInstanceInteger: 10, + status: 'All', + reportName: 'FAKE_REPORT_NAME' + }; + reportsMock.get200ResponseExportReport(reportId); + + const response = await reportApi.exportToCsv(reportId, queryParams); + assert.notEqual(response, null); + assert.notEqual(response, undefined); + }); + + it('should save the report', async () => { + const reportId = '11015'; // String | reportId + const queryParams = { + processDefinitionId: 'TEST:99:999', + dateRange: { + startDate: '2017-01-01T00:00:00.000Z', + endDate: '2017-01-24T23:59:59.999Z', + rangeId: 'currentYear' + }, + slowProcessInstanceInteger: 10, + status: 'All', + reportName: 'FAKE_REPORT_NAME' + }; + reportsMock.get200ResponseSaveReport(reportId); + + await reportApi.saveReport(reportId, queryParams); + }); + + it('should delete a report', async () => { + const reportId = '11015'; + reportsMock.get200ResponseDeleteReport(reportId); + + await reportApi.deleteReport(reportId); + }); +}); diff --git a/lib/js-api/test/process-services/taskApi.spec.ts b/lib/js-api/test/process-services/taskApi.spec.ts new file mode 100644 index 0000000000..e5b1130762 --- /dev/null +++ b/lib/js-api/test/process-services/taskApi.spec.ts @@ -0,0 +1,169 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { + AlfrescoApi, + TaskFilterRequestRepresentation, + TaskRepresentation, + TaskFormsApi, + TaskActionsApi, + TasksApi, + TaskQueryRepresentation +} from '../../src'; +import { BpmAuthMock, TasksMock } from '../mockObjects'; + +describe('Activiti Task Api', () => { + let authResponseBpmMock: BpmAuthMock; + let tasksMock: TasksMock; + let alfrescoJsApi: AlfrescoApi; + let tasksApi: TasksApi; + let taskFormsApi: TaskFormsApi; + let taskActionsApi: TaskActionsApi; + + const NOOP = () => { + /* empty */ + }; + + beforeEach(async () => { + const BPM_HOST = 'https://127.0.0.1:9999'; + + authResponseBpmMock = new BpmAuthMock(BPM_HOST); + tasksMock = new TasksMock(BPM_HOST); + + authResponseBpmMock.get200Response(); + + alfrescoJsApi = new AlfrescoApi({ + hostBpm: BPM_HOST, + provider: 'BPM' + }); + + tasksApi = new TasksApi(alfrescoJsApi); + taskFormsApi = new TaskFormsApi(alfrescoJsApi); + taskActionsApi = new TaskActionsApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + it('get Task list', async () => { + tasksMock.get200Response(); + + const requestNode = new TaskQueryRepresentation(); + const data = await tasksApi.listTasks(requestNode); + + assert.equal(data.data[0].processDefinitionName, 'Process Test Api'); + assert.equal(data.data[1].processDefinitionName, 'Process Test Api'); + assert.equal(data.size, 2); + }); + + it('get Task', async () => { + tasksMock.get200ResponseGetTask('10'); + + const data = await tasksApi.getTask('10'); + assert.equal(data.name, 'Upload Document'); + }); + + it('bad filter Tasks', (done) => { + tasksMock.get400TaskFilter(); + + const requestNode = new TaskFilterRequestRepresentation(); + + tasksApi.filterTasks(requestNode).then(NOOP, () => { + done(); + }); + }); + + it('filter Tasks', async () => { + tasksMock.get200TaskFilter(); + + const requestNode = new TaskFilterRequestRepresentation(); + requestNode.appDefinitionId = 1; + + const data = await tasksApi.filterTasks(requestNode); + assert.equal(data.size, 2); + assert.equal(data.data[0].id, '7506'); + }); + + it('complete Task not found', (done) => { + const taskId = '200'; + tasksMock.get404CompleteTask(taskId); + + taskActionsApi.completeTask(taskId).then(NOOP, () => { + done(); + }); + }); + + it('complete Task ', async () => { + const taskId = '5006'; + + tasksMock.put200GenericResponse('/activiti-app/api/enterprise/tasks/5006/action/complete'); + + await taskActionsApi.completeTask(taskId); + }); + + it('Create a Task', async () => { + const taskName = 'test-name'; + + tasksMock.get200CreateTask(taskName); + + const taskRepresentation = new TaskRepresentation(); + taskRepresentation.name = taskName; + + await tasksApi.createNewTask(taskRepresentation); + }); + + it('Get task form', async () => { + tasksMock.get200getTaskForm(); + + const taskId = '2518'; + const data = await taskFormsApi.getTaskForm(taskId); + + assert.equal(data.name, 'Metadata'); + assert.equal(data.fields[0].name, 'Label'); + assert.equal(data.fields[0].fieldType, 'ContainerRepresentation'); + }); + + it('Get getRestFieldValuesColumn ', async () => { + tasksMock.get200getTaskForm(); + + const taskId = '2518'; + const data = await taskFormsApi.getTaskForm(taskId); + + assert.equal(data.name, 'Metadata'); + assert.equal(data.fields[0].name, 'Label'); + assert.equal(data.fields[0].fieldType, 'ContainerRepresentation'); + }); + + it('get form field values that are populated through a REST backend', async () => { + tasksMock.get200getRestFieldValuesColumn(); + + const taskId = '1'; + const field = 'label'; + const column = 'user'; + + await taskFormsApi.getRestFieldColumnValues(taskId, field, column); + }); + + it('get form field values that are populated through a REST backend Specific case to retrieve information on a specific column', async () => { + tasksMock.get200getRestFieldValues(); + + const taskId = '2'; + const field = 'label'; + + await taskFormsApi.getRestFieldValues(taskId, field); + }); +}); diff --git a/lib/js-api/test/process-services/taskFormApi.spec.ts b/lib/js-api/test/process-services/taskFormApi.spec.ts new file mode 100644 index 0000000000..654ea991f1 --- /dev/null +++ b/lib/js-api/test/process-services/taskFormApi.spec.ts @@ -0,0 +1,65 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { TaskFormsApi, AlfrescoApi } from '../../src'; +import { BpmAuthMock, TaskFormMock } from '../mockObjects'; + +describe('Activiti Task Api', () => { + let authResponseBpmMock: BpmAuthMock; + let taskFormMock: TaskFormMock; + let alfrescoJsApi: AlfrescoApi; + let taskFormsApi: TaskFormsApi; + + beforeEach(async () => { + const BPM_HOST = 'https://127.0.0.1:9999'; + + authResponseBpmMock = new BpmAuthMock(BPM_HOST); + taskFormMock = new TaskFormMock(BPM_HOST); + + authResponseBpmMock.get200Response(); + + alfrescoJsApi = new AlfrescoApi({ + hostBpm: BPM_HOST, + provider: 'BPM' + }); + + taskFormsApi = new TaskFormsApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + it('get Task Form variables list', async () => { + taskFormMock.get200getTaskFormVariables(); + + const taskId = '5028'; + const data = await taskFormsApi.getTaskFormVariables(taskId); + + assert.equal(data[0].id, 'initiator'); + }); + + it('Check cookie settings', async () => { + taskFormMock.get200getTaskFormVariables(); + + const taskId = '5028'; + await taskFormsApi.getTaskFormVariables(taskId); + assert.equal( + (taskFormsApi.apiClient as any).authentications.cookie, + 'ACTIVITI_REMEMBER_ME=NjdOdGwvcUtFTkVEczQyMGh4WFp5QT09OmpUL1UwdFVBTC94QTJMTFFUVFgvdFE9PQ' + ); + }); +}); diff --git a/lib/js-api/test/process-services/userFiltersApi.spec.ts b/lib/js-api/test/process-services/userFiltersApi.spec.ts new file mode 100644 index 0000000000..e8ac4d6871 --- /dev/null +++ b/lib/js-api/test/process-services/userFiltersApi.spec.ts @@ -0,0 +1,54 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, UserFiltersApi } from '../../src'; +import { BpmAuthMock, UserFiltersMock } from '../mockObjects'; + +describe('Activiti User Filter Api', () => { + const hostBpm = 'https://127.0.0.1:9999'; + let authResponseBpmMock: BpmAuthMock; + let filtersMock: UserFiltersMock; + let userFiltersApi: UserFiltersApi; + + beforeEach(async () => { + authResponseBpmMock = new BpmAuthMock(hostBpm); + filtersMock = new UserFiltersMock(hostBpm); + + authResponseBpmMock.get200Response(); + + const alfrescoJsApi = new AlfrescoApi({ + hostBpm, + provider: 'BPM' + }); + + userFiltersApi = new UserFiltersApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + it('get filter user', async () => { + filtersMock.get200getUserTaskFilters(); + + const opts = { + appId: 1 // Integer | appId + }; + + const data = await userFiltersApi.getUserTaskFilters(opts); + assert.equal(data.data[0].name, 'Involved Tasks'); + }); +}); diff --git a/lib/js-api/test/searchApi.spec.spec.ts b/lib/js-api/test/searchApi.spec.spec.ts new file mode 100644 index 0000000000..2a92494f03 --- /dev/null +++ b/lib/js-api/test/searchApi.spec.spec.ts @@ -0,0 +1,61 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { AlfrescoApi, SearchApi } from '../src'; +import { EcmAuthMock, SearchMock } from './mockObjects'; + +describe('Search', () => { + let authResponseMock: EcmAuthMock; + let searchMock: SearchMock; + let searchApi: SearchApi; + + beforeEach((done) => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + authResponseMock.get201Response(); + + searchMock = new SearchMock(hostEcm); + + const alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + alfrescoJsApi.login('admin', 'admin').then(() => { + done(); + }); + + searchApi = new SearchApi(alfrescoJsApi); + }); + + it('should search works', (done) => { + searchMock.get200Response(); + + searchApi + .search({ + query: { + query: 'select * from cmis:folder', + language: 'cmis' + } + }) + .then((data) => { + assert.equal(data.list.entries[0].entry.name, 'user'); + done(); + }); + }); +}); diff --git a/lib/js-api/test/superagentHttpClient.spec.ts b/lib/js-api/test/superagentHttpClient.spec.ts new file mode 100644 index 0000000000..ff4c4fdeb3 --- /dev/null +++ b/lib/js-api/test/superagentHttpClient.spec.ts @@ -0,0 +1,90 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { SuperagentHttpClient } from '../src/superagentHttpClient'; +import { Response } from 'superagent'; + +describe('SuperagentHttpClient', () => { + describe('#buildRequest', () => { + const client = new SuperagentHttpClient(); + + it('should create a request with response type blob', () => { + const queryParams = {}; + const headerParams = {}; + const formParams = {}; + + const contentTypes = 'application/json'; + const accepts = 'application/json'; + const responseType = 'blob'; + const url = '/fake-api/enterprise/process-instances/'; + const httpMethod = 'GET'; + const securityOptions = { + isBpmRequest: false, + enableCsrf: false, + withCredentials: false, + authentications: { + basicAuth: { + ticket: '' + }, + type: 'basic' + }, + defaultHeaders: {} + }; + + const response: any = client['buildRequest']( + httpMethod, + url, + queryParams, + headerParams, + formParams, + null, + contentTypes, + accepts, + responseType, + null, + null, + securityOptions + ); + + assert.equal(response.url, '/fake-api/enterprise/process-instances/'); + assert.equal(response.header.Accept, 'application/json'); + assert.equal(response.header['Content-Type'], 'application/json'); + assert.equal(response._responseType, 'blob'); + }); + }); + + describe('#deserialize', () => { + it('should the deserializer return an array of object when the response is an array', () => { + const data = { + body: [ + { + id: '1', + name: 'test1' + }, + { + id: '2', + name: 'test2' + } + ] + } as Response; + const result = SuperagentHttpClient['deserialize'](data); + const isArray = Array.isArray(result); + assert.equal(isArray, true); + }); + }); +}); diff --git a/lib/js-api/test/tsconfig.json b/lib/js-api/test/tsconfig.json new file mode 100644 index 0000000000..673d8a99ca --- /dev/null +++ b/lib/js-api/test/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "moduleResolution": "node", + "target": "ES2015", + "esModuleInterop": true, + "isolatedModules": true, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "types": ["mocha"] + } +} diff --git a/lib/js-api/test/upload.spec.ts b/lib/js-api/test/upload.spec.ts new file mode 100644 index 0000000000..11f5992b0a --- /dev/null +++ b/lib/js-api/test/upload.spec.ts @@ -0,0 +1,327 @@ +/*! + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import assert from 'assert'; +import { EcmAuthMock, UploadMock } from './mockObjects'; +import fs from 'fs'; +import { UploadApi, AlfrescoApi, NodeEntry } from '../src'; + +// eslint-disable-next-line ban/ban +xdescribe('Upload', () => { + let authResponseMock: EcmAuthMock; + let uploadMock: UploadMock; + let alfrescoJsApi: AlfrescoApi; + let uploadApi: UploadApi; + + beforeEach(async () => { + const hostEcm = 'https://127.0.0.1:8080'; + + authResponseMock = new EcmAuthMock(hostEcm); + uploadMock = new UploadMock(hostEcm); + + authResponseMock.get201Response(); + alfrescoJsApi = new AlfrescoApi({ + hostEcm + }); + + uploadApi = new UploadApi(alfrescoJsApi); + + await alfrescoJsApi.login('admin', 'admin'); + }); + + describe('Upload File', () => { + it('upload file should return 200 if is all ok', (done) => { + uploadMock.get201CreationFile(); + + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + + uploadApi.uploadFile(file).then((data: NodeEntry) => { + assert.equal(data.entry.isFile, true); + assert.equal(data.entry.name, 'testFile.txt'); + done(); + }); + }); + + it('upload file should get 409 if new name clashes with an existing file in the current parent folder', (done) => { + uploadMock.get409CreationFileNewNameClashes(); + + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + + uploadApi.uploadFile(file).then( + () => {}, + (error: any) => { + assert.equal(error.status, 409); + done(); + } + ); + }); + + it('upload file should get 200 and rename if the new name clashes with an existing file in the current parent folder and autorename is true', (done) => { + uploadMock.get201CreationFileAutoRename(); + + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + + uploadApi.uploadFile(file, null, null, null, { autoRename: true }).then((data: NodeEntry) => { + assert.equal(data.entry.isFile, true); + assert.equal(data.entry.name, 'testFile-2.txt'); + done(); + }); + }); + + it('Abort should stop the file file upload', (done) => { + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + + const promise: any = uploadApi.uploadFile(file, null, null, null, { autoRename: true }); + promise.once('abort', () => { + done(); + }); + + promise.abort(); + }); + }); + + describe('Events', () => { + it('Upload should fire done event at the end of an upload', (done) => { + uploadMock.get201CreationFile(); + + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + + const uploadPromise: any = uploadApi.uploadFile(file); + + uploadPromise.catch(() => {}); + uploadPromise.on('success', () => { + done(); + }); + }); + + it('Upload should fire error event if something go wrong', (done) => { + uploadMock.get409CreationFileNewNameClashes(); + + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + + const uploadPromise: any = uploadApi.uploadFile(file); + uploadPromise.catch(() => {}); + uploadPromise.on('error', () => { + done(); + }); + }); + + it('Upload should fire unauthorized event if get 401', (done) => { + uploadMock.get401Response(); + + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + + const uploadPromise: any = uploadApi.uploadFile(file); + + uploadPromise.catch(() => {}); + uploadPromise.on('unauthorized', () => { + done(); + }); + }); + + it('Upload should fire progress event during the upload', (done) => { + uploadMock.get201CreationFile(); + + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + const uploadPromise: any = uploadApi.uploadFile(file); + + uploadPromise.once('progress', () => done()); + }); + + it('Multiple Upload should fire progress events on the right promise during the upload', (done) => { + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + const fileTwo = fs.createReadStream('./test/mockObjects/assets/testFile2.txt'); + + let progressOneOk = false; + let progressTwoOk = false; + + const promiseProgressOne = new Promise((resolve) => { + uploadMock.get201CreationFile(); + + const promise: any = uploadApi.uploadFile(file); + promise.once('success', () => { + progressOneOk = true; + resolve('Resolving'); + }); + }); + + const promiseProgressTwo = new Promise((resolve) => { + uploadMock.get201CreationFile(); + + const promise: any = uploadApi.uploadFile(fileTwo); + promise.once('success', () => { + progressTwoOk = true; + resolve('Resolving'); + }); + }); + + Promise.all([promiseProgressOne, promiseProgressTwo]).then(() => { + assert.equal(progressOneOk, true); + assert.equal(progressTwoOk, true); + done(); + }); + }); + + it('Multiple Upload should fire error events on the right promise during the upload', (done) => { + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + const fileTwo = fs.createReadStream('./test/mockObjects/assets/testFile2.txt'); + + let errorOneOk = false; + let errorTwoOk = false; + + const promiseErrorOne = new Promise((resolve) => { + uploadMock.get201CreationFile(); + + const uploadPromise: any = uploadApi.uploadFile(file); + uploadPromise.catch(() => {}); + uploadPromise.once('success', () => { + errorOneOk = true; + resolve('Resolving'); + }); + }); + + const promiseErrorTwo = new Promise((resolve) => { + uploadMock.get201CreationFile(); + + const uploadPromise: any = uploadApi.uploadFile(fileTwo); + uploadPromise.catch(() => {}); + uploadPromise.once('success', () => { + errorTwoOk = true; + resolve('Resolving'); + }); + }); + + Promise.all([promiseErrorOne, promiseErrorTwo]).then(() => { + assert.equal(errorOneOk, true); + assert.equal(errorTwoOk, true); + done(); + }); + }); + + it('Multiple Upload should fire success events on the right promise during the upload', (done) => { + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + const fileTwo = fs.createReadStream('./test/mockObjects/assets/testFile2.txt'); + + let successOneOk = false; + let successTwoOk = false; + + const promiseSuccessOne = new Promise((resolve) => { + uploadMock.get201CreationFile(); + + const uploadPromiseOne: any = uploadApi.uploadFile(file); + uploadPromiseOne.catch(() => {}); + uploadPromiseOne.once('success', () => { + successOneOk = true; + resolve('Resolving'); + }); + }); + + const promiseSuccessTwo = new Promise((resolve) => { + uploadMock.get201CreationFile(); + + const uploadPromiseTwo: any = uploadApi.uploadFile(fileTwo); + uploadPromiseTwo.catch(() => {}); + uploadPromiseTwo.once('success', () => { + successTwoOk = true; + resolve('Resolving'); + }); + }); + + Promise.all([promiseSuccessOne, promiseSuccessTwo]).then(() => { + assert.equal(successOneOk, true); + assert.equal(successTwoOk, true); + done(); + }); + }); + + it('Multiple Upload should resolve the correct promise', (done) => { + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + const fileTwo = fs.createReadStream('./test/mockObjects/assets/testFile2.txt'); + + let resolveOneOk = false; + let resolveTwoOk = false; + + uploadMock.get201CreationFile(); + + const p1 = uploadApi.uploadFile(file).then(() => { + resolveOneOk = true; + }); + + uploadMock.get201CreationFile(); + + const p2 = uploadApi.uploadFile(fileTwo).then(() => { + resolveTwoOk = true; + }); + + Promise.all([p1, p2]).then(() => { + assert.equal(resolveOneOk, true); + assert.equal(resolveTwoOk, true); + done(); + }); + }); + + it('Multiple Upload should reject the correct promise', (done) => { + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + const fileTwo = fs.createReadStream('./test/mockObjects/assets/testFile2.txt'); + + let rejectOneOk = false; + let rejectTwoOk = false; + + uploadMock.get409CreationFileNewNameClashes(); + + const p1 = uploadApi.uploadFile(file).then(null, () => { + rejectOneOk = true; + }); + + uploadMock.get409CreationFileNewNameClashes(); + + const p2 = uploadApi.uploadFile(fileTwo).then(null, () => { + rejectTwoOk = true; + }); + + Promise.all([p1, p2]).then(() => { + assert.equal(rejectOneOk, true); + assert.equal(rejectTwoOk, true); + done(); + }); + }); + + it('Is possible use chain events', (done) => { + const file = fs.createReadStream('./test/mockObjects/assets/testFile.txt'); + + uploadMock.get401Response(); + + let promiseProgressOne = {}; + let promiseProgressTwo = {}; + + const uploadPromise: any = uploadApi.uploadFile(file); + uploadPromise.catch(() => {}); + + uploadPromise + .once('error', () => { + promiseProgressOne = Promise.resolve('Resolving'); + }) + .once('unauthorized', () => { + promiseProgressTwo = Promise.resolve('Resolving'); + }); + + Promise.all([promiseProgressOne, promiseProgressTwo]).then(() => { + done(); + }); + }); + }); +}); diff --git a/lib/process-services-cloud/tsconfig.lib.json b/lib/process-services-cloud/tsconfig.lib.json index 45fbb848e3..e01e4d4667 100644 --- a/lib/process-services-cloud/tsconfig.lib.json +++ b/lib/process-services-cloud/tsconfig.lib.json @@ -11,7 +11,9 @@ "@alfresco/adf-core": ["../../../dist/libs/core"], "@alfresco/adf-core/*": ["../../../dist/libs/core/*"], "@alfresco/adf-content-services": ["../../../dist/libs/content-services"], - "@alfresco/adf-content-services/*": ["../../../dist/libs/content-services/*"] + "@alfresco/adf-content-services/*": ["../../../dist/libs/content-services/*"], + "@alfresco/js-api": ["../../../dist/libs/js-api"], + "@alfresco/js-api/*": ["../../../dist/libs/js-api/*"] } } } diff --git a/lib/process-services/tsconfig.lib.json b/lib/process-services/tsconfig.lib.json index d06f87e9a1..58ed92a794 100644 --- a/lib/process-services/tsconfig.lib.json +++ b/lib/process-services/tsconfig.lib.json @@ -10,7 +10,9 @@ "@alfresco/adf-core": ["../../../dist/libs/core"], "@alfresco/adf-core/*": ["../../../dist/libs/core/*"], "@alfresco/adf-content-services": ["../../../dist/libs/content-services"], - "@alfresco/adf-content-services/*": ["../../../dist/libs/content-services/*"] + "@alfresco/adf-content-services/*": ["../../../dist/libs/content-services/*"], + "@alfresco/js-api": ["../../../dist/libs/js-api"], + "@alfresco/js-api/*": ["../../../dist/libs/js-api/*"] } } } diff --git a/lib/testing/src/lib/protractor/process-services/actions/user-filters.util.ts b/lib/testing/src/lib/protractor/process-services/actions/user-filters.util.ts index 8a20c4b949..b3f8e06327 100644 --- a/lib/testing/src/lib/protractor/process-services/actions/user-filters.util.ts +++ b/lib/testing/src/lib/protractor/process-services/actions/user-filters.util.ts @@ -17,10 +17,9 @@ import { Logger } from '../../core/utils/logger'; import { ApiService } from '../../../shared/api/api.service'; -import { UserFiltersApi, UserFilterOrderRepresentation, UserTaskFilterRepresentation, ResultListDataRepresentationUserProcessInstanceFilterRepresentation } from '@alfresco/js-api'; +import { UserFiltersApi, UserTaskFilterRepresentation, ResultListDataRepresentationUserProcessInstanceFilterRepresentation } from '@alfresco/js-api'; export class UserFiltersUtil { - apiService: ApiService; userFiltersApi: UserFiltersApi; @@ -29,10 +28,23 @@ export class UserFiltersUtil { this.userFiltersApi = new UserFiltersApi(apiService.getInstance()); } - async createATaskFilter(newTaskFilterName: string, sortType?: string, stateType?: string, assignmentType?: string, iconName?: string, appId?: number): Promise<any> { + async createATaskFilter( + newTaskFilterName: string, + sortType?: string, + stateType?: string, + assignmentType?: string, + iconName?: string, + appId?: number + ): Promise<any> { try { - return this.userFiltersApi.createUserTaskFilter(new UserTaskFilterRepresentation( - {appId, name: newTaskFilterName, icon: iconName, filter: {sort: sortType, state: stateType, assignment: assignmentType}})); + return this.userFiltersApi.createUserTaskFilter( + new UserTaskFilterRepresentation({ + appId, + name: newTaskFilterName, + icon: iconName, + filter: { sort: sortType, state: stateType, assignment: assignmentType } + }) + ); } catch (error) { Logger.error('Create Task Filter - Service error, Response: ', error); } @@ -48,7 +60,7 @@ export class UserFiltersUtil { async orderUserTaskFilters(filtersIdOrder: number[], appId?: number): Promise<any> { try { - return this.userFiltersApi.orderUserTaskFilters(new UserFilterOrderRepresentation({appId, order: filtersIdOrder})); + return this.userFiltersApi.orderUserTaskFilters({ appId, order: filtersIdOrder }); } catch (error) { Logger.error('Re-order the list of user task filters - Service error, Response: ', error); } @@ -56,7 +68,7 @@ export class UserFiltersUtil { async getUserTaskFilters(appId?: number): Promise<any> { try { - return this.userFiltersApi.getUserTaskFilters({appId}); + return this.userFiltersApi.getUserTaskFilters({ appId }); } catch (error) { Logger.error('List task filters - Service error, Response: ', error); } @@ -67,14 +79,14 @@ export class UserFiltersUtil { return this.userFiltersApi.getUserProcessInstanceFilters({ appId }); } catch (error) { Logger.error('List process filters - Service error, Response: ', error); - return new ResultListDataRepresentationUserProcessInstanceFilterRepresentation(); + return null; } } async getUserTaskFilterByName(taskFilterName: string, appId?: number): Promise<any> { try { - const taskFiltersList = this.userFiltersApi.getUserTaskFilters({appId}); - const chosenTaskFilter = (await taskFiltersList).data.find( (taskFilter) => taskFilter.name === taskFilterName); + const taskFiltersList = this.userFiltersApi.getUserTaskFilters({ appId }); + const chosenTaskFilter = (await taskFiltersList).data.find((taskFilter) => taskFilter.name === taskFilterName); return chosenTaskFilter; } catch (error) { Logger.error('Get user task filters by name - Service error, Response: ', error); @@ -89,10 +101,25 @@ export class UserFiltersUtil { } } - async updateUserTaskFilter(filterId: number, updatedTaskFilterName?: string, updatedSortType?: string, updatedStateType?: string, updatedAssignmentType?: string, updatedIconName?: string, appId?: number): Promise<any> { + async updateUserTaskFilter( + filterId: number, + updatedTaskFilterName?: string, + updatedSortType?: string, + updatedStateType?: string, + updatedAssignmentType?: string, + updatedIconName?: string, + appId?: number + ): Promise<any> { try { - return this.userFiltersApi.updateUserTaskFilter(filterId, new UserTaskFilterRepresentation( - {appId, name: updatedTaskFilterName, icon: updatedIconName, filter: {sort: updatedSortType, state: updatedStateType, assignment: updatedAssignmentType}})); + return this.userFiltersApi.updateUserTaskFilter( + filterId, + new UserTaskFilterRepresentation({ + appId, + name: updatedTaskFilterName, + icon: updatedIconName, + filter: { sort: updatedSortType, state: updatedStateType, assignment: updatedAssignmentType } + }) + ); } catch (error) { Logger.error('Update a task filter - Service error, Response: ', error); } diff --git a/package-lock.json b/package-lock.json index 6f6a7fcd3e..b62cd22e3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@alfresco/js-api": "7.2.0", + "@alfresco/js-api": ">=7.2.0", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.2", "@angular/common": "14.1.3", @@ -80,7 +80,9 @@ "@types/event-emitter": "^0.3.3", "@types/jasmine": "4.0.3", "@types/jasminewd2": "~2.0.2", + "@types/jsdom": "^21.1.5", "@types/minimatch": "^3.0.3", + "@types/mocha": "^10.0.4", "@types/node": "18.0.0", "@types/pdfjs-dist": "^2.10.378", "@types/selenium-webdriver": "^4.0.11", @@ -111,6 +113,7 @@ "jasmine-reporters": "^2.5.2", "jasmine-spec-reporter": "7.0.0", "js-yaml": "^4.0.0", + "jsdom": "^22.1.0", "karma": "^6.4.1", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", @@ -122,8 +125,10 @@ "lint-staged": "^13.2.0", "lite-server": "^2.6.1", "mini-css-extract-plugin": "^2.7.6", + "mocha": "^10.2.0", "moment": "^2.29.4", "ng-packagr": "14.0.3", + "nock": "^13.3.8", "nx": "14.4.2", "postcss": "^8.4.31", "postcss-sass": "^0.5.0", @@ -137,7 +142,7 @@ "selenium-webdriver": "4.1.0", "stylelint": "^14.15.0", "stylelint-config-standard-scss": "^3.0.0", - "ts-node": "^10.4.0", + "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.1", "typescript": "4.7.4", "webdriver-manager": "12.1.9", @@ -21128,6 +21133,41 @@ "@types/jasmine": "*" } }, + "node_modules/@types/jsdom": { + "version": "21.1.5", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.5.tgz", + "integrity": "sha512-sBK/3YjS3uuPj+HzZyhB4GGTnFmk0mdyQfhzZ/sqs9ciyG41QJdZZdwcPa6OfW97OTNTwl5tBAsfEOm/dui9pQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "node_modules/@types/jsdom/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/@types/jsdom/node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/@types/json-schema": { "version": "7.0.11", "license": "MIT" @@ -21162,6 +21202,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/mocha": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.4.tgz", + "integrity": "sha512-xKU7bUjiFTIttpWaIZ9qvgg+22O1nmbA+HRxdlR+u6TWsGfmFdXrheJoK4fFxrHNVIOBDvDNKZG+LYBpMHpX3w==", + "dev": true + }, "node_modules/@types/node": { "version": "18.0.0", "license": "MIT" @@ -21324,6 +21370,12 @@ "version": "1.0.8", "license": "MIT" }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true + }, "node_modules/@types/uglify-js": { "version": "3.17.1", "license": "MIT", @@ -23951,6 +24003,12 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, "node_modules/browser-sync": { "version": "2.29.1", "dev": true, @@ -24816,17 +24874,18 @@ } }, "node_modules/chai": { - "version": "4.3.7", + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", + "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", "dev": true, - "license": "MIT", "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.0.8" }, "engines": { "node": ">=4" @@ -24905,9 +24964,13 @@ } }, "node_modules/check-error": { - "version": "1.0.2", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, - "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } @@ -26866,23 +26929,17 @@ "dev": true }, "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", "dev": true, "dependencies": { - "cssom": "~0.3.6" + "rrweb-cssom": "^0.6.0" }, "engines": { - "node": ">=8" + "node": ">=14" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - }, "node_modules/csstype": { "version": "3.1.2", "dev": true, @@ -26933,52 +26990,51 @@ } }, "node_modules/data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", "dev": true, "dependencies": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/data-urls/node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", "dev": true, "dependencies": { - "punycode": "^2.1.1" + "punycode": "^2.3.0" }, "engines": { - "node": ">=8" + "node": ">=14" } }, "node_modules/data-urls/node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true, "engines": { - "node": ">=10.4" + "node": ">=12" } }, "node_modules/data-urls/node_modules/whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", + "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", "dev": true, "dependencies": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/date-fns": { @@ -27920,24 +27976,24 @@ "license": "BSD-2-Clause" }, "node_modules/domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, "dependencies": { - "webidl-conversions": "^5.0.0" + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/domexception/node_modules/webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/domhandler": { @@ -30725,9 +30781,10 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, - "license": "MIT", "engines": { "node": "*" } @@ -33855,6 +33912,15 @@ "@sinonjs/commons": "^1.7.0" } }, + "node_modules/jest-environment-jsdom/node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/jest-environment-jsdom/node_modules/@types/yargs": { "version": "16.0.7", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.7.tgz", @@ -33907,6 +33973,59 @@ "node": ">=7.0.0" } }, + "node_modules/jest-environment-jsdom/node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-jsdom/node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + }, + "node_modules/jest-environment-jsdom/node_modules/data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-environment-jsdom/node_modules/domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "dependencies": { + "webidl-conversions": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-jsdom/node_modules/domexception/node_modules/webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/jest-environment-jsdom/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -33916,6 +34035,32 @@ "node": ">=8" } }, + "node_modules/jest-environment-jsdom/node_modules/html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^1.0.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-environment-jsdom/node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/jest-environment-jsdom/node_modules/jest-message-util": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", @@ -33966,6 +34111,58 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, + "node_modules/jest-environment-jsdom/node_modules/jsdom": { + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "dev": true, + "dependencies": { + "abab": "^2.0.5", + "acorn": "^8.2.4", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.3.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.1", + "domexception": "^2.0.1", + "escodegen": "^2.0.0", + "form-data": "^3.0.0", + "html-encoding-sniffer": "^2.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.5.0", + "ws": "^7.4.6", + "xml-name-validator": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jest-environment-jsdom/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, "node_modules/jest-environment-jsdom/node_modules/pretty-format": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", @@ -33998,6 +34195,18 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true }, + "node_modules/jest-environment-jsdom/node_modules/saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jest-environment-jsdom/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -34010,6 +34219,119 @@ "node": ">=8" } }, + "node_modules/jest-environment-jsdom/node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jest-environment-jsdom/node_modules/tr46": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-jsdom/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "dependencies": { + "xml-name-validator": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-environment-jsdom/node_modules/webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true, + "engines": { + "node": ">=10.4" + } + }, + "node_modules/jest-environment-jsdom/node_modules/whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "dependencies": { + "iconv-lite": "0.4.24" + } + }, + "node_modules/jest-environment-jsdom/node_modules/whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "node_modules/jest-environment-jsdom/node_modules/whatwg-url": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", + "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "dev": true, + "dependencies": { + "lodash": "^4.7.0", + "tr46": "^2.1.0", + "webidl-conversions": "^6.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-environment-jsdom/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/jest-environment-jsdom/node_modules/xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, "node_modules/jest-environment-node": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-28.1.3.tgz", @@ -35979,41 +36301,37 @@ } }, "node_modules/jsdom": { - "version": "16.7.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", - "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", + "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", "dev": true, "dependencies": { - "abab": "^2.0.5", - "acorn": "^8.2.4", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", - "cssstyle": "^2.3.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.1", - "domexception": "^2.0.1", - "escodegen": "^2.0.0", - "form-data": "^3.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", + "abab": "^2.0.6", + "cssstyle": "^3.0.0", + "data-urls": "^4.0.0", + "decimal.js": "^10.4.3", + "domexception": "^4.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", + "nwsapi": "^2.2.4", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.6.0", + "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.5.0", - "ws": "^7.4.6", - "xml-name-validator": "^3.0.0" + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.1", + "ws": "^8.13.0", + "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=16" }, "peerDependencies": { "canvas": "^2.5.0" @@ -36024,46 +36342,43 @@ } } }, - "node_modules/jsdom/node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "node_modules/jsdom/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, "engines": { - "node": ">= 6" - } - }, - "node_modules/jsdom/node_modules/html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", - "dev": true, - "dependencies": { - "whatwg-encoding": "^1.0.5" + "node": ">=0.12" }, - "engines": { - "node": ">=10" + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/jsdom/node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "node_modules/jsdom/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" }, "engines": { "node": ">= 6" } }, "node_modules/jsdom/node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } }, "node_modules/jsdom/node_modules/tough-cookie": { "version": "4.1.3", @@ -36081,15 +36396,15 @@ } }, "node_modules/jsdom/node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", "dev": true, "dependencies": { - "punycode": "^2.1.1" + "punycode": "^2.3.0" }, "engines": { - "node": ">=8" + "node": ">=14" } }, "node_modules/jsdom/node_modules/universalify": { @@ -36102,56 +36417,25 @@ } }, "node_modules/jsdom/node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true, "engines": { - "node": ">=10.4" - } - }, - "node_modules/jsdom/node_modules/whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "dependencies": { - "iconv-lite": "0.4.24" + "node": ">=12" } }, "node_modules/jsdom/node_modules/whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", + "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", "dev": true, "dependencies": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=10" - } - }, - "node_modules/jsdom/node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", - "dev": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "node": ">=14" } }, "node_modules/jsesc": { @@ -38295,6 +38579,278 @@ "node": ">=10" } }, + "node_modules/mocha": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "dev": true, + "dependencies": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/mocha/node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/mocha/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/mocha/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/mocha/node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/mocha/node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", @@ -38714,6 +39270,20 @@ "tslib": "^2.0.3" } }, + "node_modules/nock": { + "version": "13.3.8", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.3.8.tgz", + "integrity": "sha512-96yVFal0c/W1lG7mmfRe7eO+hovrhJYd2obzzOZ90f6fjpeU/XNvd9cYHZKZAQJumDfhXgoTpkpJ9pvMj+hqHw==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "json-stringify-safe": "^5.0.1", + "propagate": "^2.0.0" + }, + "engines": { + "node": ">= 10.13" + } + }, "node_modules/node-abort-controller": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", @@ -41974,6 +42544,15 @@ "react-is": "^16.13.1" } }, + "node_modules/propagate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/property-information": { "version": "5.6.0", "license": "MIT", @@ -43912,6 +44491,12 @@ } } }, + "node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true + }, "node_modules/rsvp": { "version": "4.8.5", "dev": true, @@ -44514,15 +45099,15 @@ "license": "ISC" }, "node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, "dependencies": { "xmlchars": "^2.2.0" }, "engines": { - "node": ">=10" + "node": ">=v12.22.7" } }, "node_modules/scheduler": { @@ -47251,8 +47836,9 @@ }, "node_modules/ts-node": { "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, - "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -48241,15 +48827,15 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", "dev": true, "dependencies": { - "xml-name-validator": "^3.0.0" + "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/walker": { @@ -49216,10 +49802,13 @@ } }, "node_modules/whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "engines": { + "node": ">=12" + } }, "node_modules/whatwg-url": { "version": "5.0.0", @@ -49333,6 +49922,12 @@ "microevent.ts": "~0.1.1" } }, + "node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, "node_modules/wrap-ansi": { "version": "7.0.0", "license": "MIT", @@ -49462,10 +50057,13 @@ } }, "node_modules/xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } }, "node_modules/xml2js": { "version": "0.4.23", @@ -49489,8 +50087,9 @@ }, "node_modules/xmlchars": { "version": "2.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true }, "node_modules/xmlhttprequest-ssl": { "version": "2.0.0", @@ -49558,6 +50157,54 @@ "node": ">=12" } }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs-unparser/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/yn": { "version": "3.1.1", "dev": true, diff --git a/package.json b/package.json index c0a2c50b36..876a31e57a 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,9 @@ "@types/event-emitter": "^0.3.3", "@types/jasmine": "4.0.3", "@types/jasminewd2": "~2.0.2", + "@types/jsdom": "^21.1.5", "@types/minimatch": "^3.0.3", + "@types/mocha": "^10.0.4", "@types/node": "18.0.0", "@types/pdfjs-dist": "^2.10.378", "@types/selenium-webdriver": "^4.0.11", @@ -155,6 +157,7 @@ "jasmine-reporters": "^2.5.2", "jasmine-spec-reporter": "7.0.0", "js-yaml": "^4.0.0", + "jsdom": "^22.1.0", "karma": "^6.4.1", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", @@ -166,8 +169,10 @@ "lint-staged": "^13.2.0", "lite-server": "^2.6.1", "mini-css-extract-plugin": "^2.7.6", + "mocha": "^10.2.0", "moment": "^2.29.4", "ng-packagr": "14.0.3", + "nock": "^13.3.8", "nx": "14.4.2", "postcss": "^8.4.31", "postcss-sass": "^0.5.0", @@ -181,7 +186,7 @@ "selenium-webdriver": "4.1.0", "stylelint": "^14.15.0", "stylelint-config-standard-scss": "^3.0.0", - "ts-node": "^10.4.0", + "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.1", "typescript": "4.7.4", "webdriver-manager": "12.1.9", diff --git a/scripts/github/build/npm-check-bundles.sh b/scripts/github/build/npm-check-bundles.sh index fa3fbc3518..e844a9d65c 100755 --- a/scripts/github/build/npm-check-bundles.sh +++ b/scripts/github/build/npm-check-bundles.sh @@ -11,7 +11,8 @@ eval projects=( "adf-core" "adf-testing" "adf-process-services" "adf-process-services-cloud" - "eslint-plugin-eslint-angular" ) + "eslint-plugin-eslint-angular" + "js-api" ) show_help() { echo "Usage: npm-check-bundles.sh" diff --git a/scripts/github/update/check-pr-already-exist.js b/scripts/github/update/check-pr-already-exist.js deleted file mode 100755 index 771fac1bde..0000000000 --- a/scripts/github/update/check-pr-already-exist.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = async ({github, context, version}) => { - - const BRANCH_TO_CREATE = 'upstream-dependencies'; - - const { data: prs } = await github.rest.pulls.list({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open', - head: `${context.repo.owner}:${BRANCH_TO_CREATE}`, - base: 'develop' - }); - - if (prs?.length > 0) { - const title = prs[0].title; - const result = title.match(version); - return result?.length > 0 ? true : false; - } - return false; - -} - \ No newline at end of file diff --git a/scripts/github/update/latest-version-of.js b/scripts/github/update/latest-version-of.js deleted file mode 100755 index 8bee55df86..0000000000 --- a/scripts/github/update/latest-version-of.js +++ /dev/null @@ -1,46 +0,0 @@ -module.exports = async ({github, context, dependencyName, tagVersion = 'alpha' }) => { - - console.log('owner', context.repo.owner) - const organization = 'alfresco'; - const dependencyFullName = `@${organization}/${dependencyName}`; - - console.log('Looking versions for: ', dependencyFullName); - - const pjson = require('../../../package.json'); - const currentDependency = pjson?.dependencies[dependencyFullName]; - console.log('current from package.json:', currentDependency); - - const { data: availablePakages } = await github.rest.packages.getAllPackageVersionsForPackageOwnedByOrg({ - package_type: 'npm', - package_name: dependencyName, - org: organization - }); - - let latestPkgToUpdate = undefined; - if (tagVersion !== 'latest') { - console.log('alpha: taking most recent') - - const filteredAlphaPkgs = availablePakages.filter( (item) => item.name.match('^[0-9]*.[0-9]*.[0-9]*.-[0-9]*$')); - latestPkgToUpdate = filteredAlphaPkgs[0]; - } else { - console.log('release: taking most recent') - const filteredReleasePkgs = availablePakages.filter( (item) => item.name.match('^[0-9]*.[0-9]*.[0-9]*$')); - latestPkgToUpdate = filteredReleasePkgs[0]; - } - - if (latestPkgToUpdate === undefined) { - console.log(`Something went wrong. Not able to find any version.`); - return { hasVersionNew: 'false' }; - } else { - console.log(`latest tag:${tagVersion} from NPM: `, latestPkgToUpdate.name); - - if (currentDependency === latestPkgToUpdate?.name) { - console.log(`There is no new version published for ${dependencyFullName}.`); - return { hasVersionNew: 'false' }; - } else { - return { hasVersionNew: 'true', latestVersion: latestPkgToUpdate?.name }; - } - } - -} - \ No newline at end of file diff --git a/scripts/update-version.sh b/scripts/update-version.sh index ac533c8b16..cb3accf42f 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -18,7 +18,8 @@ eval projects=( "cli" "insights" "testing" "extensions" - "eslint-angular" ) + "eslint-angular" + "js-api" ) cd `dirname $0` diff --git a/tsconfig.e2e.json b/tsconfig.e2e.json index d59f0651c1..004f8b7bd3 100644 --- a/tsconfig.e2e.json +++ b/tsconfig.e2e.json @@ -12,7 +12,8 @@ "node" ], "paths": { - "@alfresco/js-api": ["../node_modules/@alfresco/js-api"], + "@alfresco/js-api": ["../lib/js-api/src"], + "@alfresco/js-api/*": ["../lib/js-api/src/*"], "@alfresco/adf-extensions": ["../lib/extensions"], "@alfresco/adf-extensions/*": ["../lib/extensions/*"], "@alfresco/adf-content-services": ["../lib/content-services"], diff --git a/tsconfig.json b/tsconfig.json index fc7444b506..b3a835d5a1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -34,7 +34,7 @@ "@alfresco/adf-process-services": ["lib/process-services/src/public-api.ts"], "@alfresco/adf-process-services-cloud": ["lib/process-services-cloud/src/public-api.ts"], "@alfresco/adf-testing": ["lib/testing/src/public-api.ts"], - "@alfresco/js-api": ["node_modules/@alfresco/js-api"] + "@alfresco/js-api": ["lib/js-api/src/index.ts"] } }, "exclude": ["lib/config", "integration", "scripts", "assets", "tools", "node_modules"],