Skip to content

Commit

Permalink
Merge pull request #2 from cap-js/main
Browse files Browse the repository at this point in the history
Main to develop code changes
  • Loading branch information
yashmeet29 authored Mar 5, 2024
2 parents e3d4cbb + 18e0e7d commit b557f1d
Show file tree
Hide file tree
Showing 9 changed files with 256 additions and 0 deletions.
1 change: 1 addition & 0 deletions .cdsrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": [ "prettier", "plugin:node/recommended"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"no-unused-vars": "warn",
"no-console": "off",
"func-names": "off",
"no-plusplus": "off",
"no-process-exit": "off",
"class-methods-use-this": "off"
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
gen
3 changes: 3 additions & 0 deletions cds-plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* Entry point for the plugin
*/
13 changes: 13 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const config = {
verbose: true,
testTimeout: 100000,
testMatch: ['**/test/*.test.js'],
collectCoverageFrom: [
'**/lib/*',
'**/srv/*',
'**/cds-plugin.js'
],
coverageReporters: ['lcov', 'text', 'text-summary'],
};

module.exports = config;
17 changes: 17 additions & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated manifest.yml based on template version 0.1.0
# appName = document-management
# language=nodejs
# multitenancy=false
---
applications:
# -----------------------------------------------------------------------------------
# Backend Service
# -----------------------------------------------------------------------------------
- name: document-management-srv
random-route: true # for development only
path: gen/srv
memory: 256M
buildpack: nodejs_buildpack
services:
- sdm-di

26 changes: 26 additions & 0 deletions mta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
_schema-version: '3.1'
ID: cap-js.document-management
version: 1.0.0
description: "CAP plugin for effortless integration of CAP applications with SAP
Document Management Service."
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npx cds build --production
modules:
- name: document-management-srv
type: nodejs
path: gen/srv
parameters:
buildpack: nodejs_buildpack
build-parameters:
builder: npm
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
requires: []
34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@cap-js/document-management",
"version": "1.0.0",
"description": "CAP plugin for effortless integration of CAP applications with SAP Document Management Service.",
"main": "cds-plugin.js",
"files": [
"lib",
"srv"
],
"keywords": [
"sap",
"cap",
"dms",
"sdm",
"plugin"
],
"dependencies": {
"@sap/cds": "^7",
"@sap/cds-lsp": "^7.6.1",
"@sap/xssec": "^3.6.1",
"dotenv": "^16.3.1",
"express": "^4"
},
"devDependencies": {
"@cap-js/sqlite": "^1",
"@sap/cds-dk": "^7",
"eslint": "^8.57.0",
"jest": "^29.7.0"
},
"scripts": {
"start": "cds-serve",
"test": "jest --coverage --config jest.config.js"
}
}
135 changes: 135 additions & 0 deletions srv/sdm-service.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
service SDMService {
@cds.persistence.skip
entity CmisObject {
key objectId : String;
baseTypeId : String;
versionSeriesId : String;
versionSeriesCheckedOutId : String;
objectTypeId : String;
name : String;
isMajorVersion : Boolean;
description : String;
contentStreamMimeType : String;
contentStreamId : String;
contentStreamLength : Integer;
contentStreamFileName : String;
isLatestMajorVersion : Boolean;
isPrivateWorkingCopy : Boolean;
isLatestVersion : Boolean;
isImmutable : Boolean;
path : String;
parentId : String;
checkinComment : String;
versionLabel : String;
isVersionSeriesCheckedOut : String;
createdBy : String;
creationDate : String;
lastModifiedBy : String;
lastModificationDate : String;
versionSeriesCheckedOutBy : String;
changeToken : String;
}

@cds.persistence.skip
entity CmisExtensionType {
key extTypeId : String;
baseTypeId : String;
lastModifiedBy : String;
createdBy : String;
lastModificationDate : String;
creationDate : String;
localName : String;
localNamespace : String;
queryName : String;
displayName : String;
parentId : String;
description : String;
creatable : Boolean;
fileable : Boolean;
queryable : Boolean;
controllablePolicy : String;
controllableACL : String;
fulltextIndexed : Boolean;
includedInSupertypeQuery : Boolean;
}

@cds.persistence.skip
entity CmisTypeProperty {
key id : String;
extTypeId : String;
lastModifiedBy : String;
createdBy : String;
lastModificationDate : String;
creationDate : String;
localName : String;
localNamespace : String;
queryName : String;
displayName : String;
propertyType : String;
description : String;
cardinality : String;
updatability : String;
inherited : Boolean;
required : Boolean;
queryable : Boolean;
orderable : Boolean;
openChoice : Boolean;
defaultValue : String;
maxLength : Integer;
precision : String;
minValue : Integer;
maxValue : Integer;
resolution : Integer;
choices : String;
}

@cds.persistence.skip
entity CmisTypeObject {
key id : String;
objectId : String;
extTypeId : String;
lastModifiedBy : String;
createdBy : String;
lastModificationDate : String;
creationDate : String;
}

@cds.persistence.skip
entity CmisTypePropertyData {
key id : String;
objectId : String;
typeObjectMappingId : String;
lastModifiedBy : String;
createdBy : String;
lastModificationDate : String;
creationDate : String;
typePropertyId : String;
propertyValue : String;
}

@cds.persistence.skip
entity CmisRepository {
repositoryId : String;
repositoryName : String;
repositoryDescription : String;
vendorName : String;
productName : String;
productVersion : String;
rootFolderId : String;
latestChangeLogToken : String;
cmisVersionSupported : Boolean;
changesIncomplete : Boolean;
changesOnType : String;
principalIdAnonymous : String;
principalIdAnyone : String;
repositoryUrl : String;
rootFolderUrl : String;
cmisRepositoryId : String;
repositoryCategory : String;
externalId : String;
connectionType : String;
extendedFeatures : String;
aclCapabilities : String;
capabilities : String;
}
}

0 comments on commit b557f1d

Please sign in to comment.