-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 90636fd
Showing
43 changed files
with
1,645 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"extends": "eslint:recommended", | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"jest": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2017 | ||
}, | ||
"globals": { | ||
"SELECT": true, | ||
"INSERT": true, | ||
"UPDATE": true, | ||
"DELETE": true, | ||
"CREATE": true, | ||
"DROP": true, | ||
"cds": true | ||
}, | ||
"rules": { | ||
"no-console": "off", | ||
"require-atomic-updates": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# CAP consumer-app-gwsample | ||
_out | ||
*.db | ||
connection.properties | ||
default-*.json | ||
gen/ | ||
node_modules/ | ||
package-lock.json | ||
target/ | ||
|
||
# Web IDE, App Studio | ||
.che/ | ||
.gen/ | ||
|
||
# MTA | ||
*_mta_build_tmp | ||
*.mtar | ||
mta_archives/ | ||
|
||
# Other | ||
.DS_Store | ||
*.orig | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// used in launch.json to refer to an installed cds via an absolute path | ||
|
||
const cds = require('@sap/cds'); | ||
cds.exec(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "cds run", | ||
"type": "node", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/.vscode/cds", | ||
"args": [ "run", "--with-mocks", "--in-memory?" ], | ||
"skipFiles": [ "<node_internals>/**" ], | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"console": "internalConsole", | ||
"autoAttachChildProcesses": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"files.exclude": { | ||
"**/.gitignore": true, | ||
"**/.git": true, | ||
"**/.vscode": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "shell", | ||
"label": "cds watch", | ||
"command": ["cds", "watch"], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "cds run", | ||
"command": ["cds", "run", "--with-mocks", "--in-memory?"], | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Getting Started | ||
|
||
Welcome to your new project. | ||
|
||
It contains these folders and files, following our recommended project layout: | ||
|
||
File / Folder | Purpose | ||
---------|---------- | ||
`app/` | content for UI frontends go here | ||
`db/` | your domain models and data go here | ||
`srv/` | your service models and code go here | ||
`package.json` | project metadata and configuration | ||
`readme.md` | this getting started guide | ||
|
||
|
||
## Next Steps... | ||
|
||
- Open a new terminal and run `cds watch` | ||
- ( in VSCode simply choose _**Terminal** > Run Task > cds watch_ ) | ||
- Start adding content, e.g. a [db/schema.cds](db/schema.cds), ... | ||
|
||
|
||
## Learn more... | ||
|
||
Learn more at https://cap.cloud.sap/docs/get-started/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ID,NAME | ||
42,Douglas Adams | ||
101,Emily Brontë | ||
107,Charlote Brontë | ||
150,Edgar Allen Poe | ||
170,Richard Carpenter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ID,TITLE,AUTHOR_ID,STOCK | ||
421,The Hitch Hiker's Guide To The Galaxy,42,1000 | ||
427,"Life, The Universe And Everything",42,95 | ||
201,Wuthering Heights,101,12 | ||
207,Jane Eyre,107,11 | ||
251,The Raven,150,333 | ||
252,Eleonora,150,555 | ||
271,Catweazle,170,22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ID,BOOK_ID,QUANTITY,BUSINESSPARTNER | ||
7e2f2640-6866-4dcf-8f4d-3027aa831cad,421,15,1003764 | ||
64e718c9-ff99-47f1-8ca3-950c850777d4,271,9,1003765 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using my.bookshop as my from './schema'; | ||
|
||
extend my.Orders with { | ||
businessPartner : String(10); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace my.bookshop; | ||
|
||
using cuid from '@sap/cds/common'; | ||
|
||
entity Books { | ||
key ID : Integer; | ||
title : String; | ||
stock : Integer; | ||
author : Association to Authors; | ||
} | ||
|
||
entity Authors { | ||
key ID : Integer; | ||
name : String; | ||
books : Association to many Books on books.author = $self; | ||
} | ||
|
||
entity Orders : cuid { | ||
book : Association to Books; | ||
quantity : Integer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "consumer-app-gwsample", | ||
"version": "1.0.0", | ||
"description": "A simple CAP project.", | ||
"repository": "<Add your repository here>", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@sap/cds": "^3", | ||
"express": "^4" | ||
}, | ||
"scripts": { | ||
"start": "npx cds run", | ||
"generate-odata-client": "npx generate-odata-client --inputDir srv/service-specifications --outputDir srv/odata-client --forceOverwrite" | ||
}, | ||
"devDependencies": { | ||
"@sap/cloud-sdk-generator": "^1.16.0", | ||
"sqlite3": "^4.1.1" | ||
}, | ||
"cds": { | ||
"requires": { | ||
"db": { | ||
"kind": "sqlite", | ||
"model": [ | ||
"db/", | ||
"srv/", | ||
"app/" | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"version": { | ||
"csn": "1.0" | ||
}, | ||
"definitions": { | ||
"ZEPM_BP_SRV.EPMBusinessPartner": { | ||
"kind": "entity", | ||
"@cds.persistence.skip": true, | ||
"elements": { | ||
"BpId": { | ||
"key": true, | ||
"type": "cds.String", | ||
"length": 10 | ||
}, | ||
"BpRole": { | ||
"type": "cds.String", | ||
"length": 3 | ||
}, | ||
"EmailAddress": { | ||
"type": "cds.String", | ||
"length": 255 | ||
}, | ||
"PhoneNumber": { | ||
"type": "cds.String", | ||
"length": 30 | ||
}, | ||
"FaxNumber": { | ||
"type": "cds.String", | ||
"length": 30 | ||
}, | ||
"WebAddress": { | ||
"type": "cds.String", | ||
"length": 255 | ||
}, | ||
"CompanyName": { | ||
"type": "cds.String", | ||
"length": 80 | ||
}, | ||
"LegalForm": { | ||
"type": "cds.String", | ||
"length": 10 | ||
}, | ||
"CurrencyCode": { | ||
"type": "cds.String", | ||
"length": 5 | ||
}, | ||
"City": { | ||
"type": "cds.String", | ||
"length": 40 | ||
}, | ||
"PostalCode": { | ||
"type": "cds.String", | ||
"length": 10 | ||
}, | ||
"Street": { | ||
"type": "cds.String", | ||
"length": 60 | ||
}, | ||
"Building": { | ||
"type": "cds.String", | ||
"length": 10 | ||
}, | ||
"Country": { | ||
"type": "cds.String", | ||
"length": 3 | ||
}, | ||
"AddressType": { | ||
"type": "cds.String", | ||
"length": 2 | ||
}, | ||
"AddressValStartDate": { | ||
"type": "cds.Timestamp" | ||
}, | ||
"AddressValEndDate": { | ||
"type": "cds.Timestamp" | ||
}, | ||
"CreatedBy": { | ||
"type": "cds.String", | ||
"length": 10 | ||
}, | ||
"CreatedAt": { | ||
"type": "cds.Timestamp" | ||
}, | ||
"ChangedBy": { | ||
"type": "cds.String", | ||
"length": 10 | ||
}, | ||
"ChangedAt": { | ||
"type": "cds.Timestamp" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// get-epmbp.js | ||
|
||
const { EpmBusinessPartnerSet } = require('../odata-client/zepm-bp-service'); | ||
|
||
function getEpmBusinessPartners() { | ||
return EpmBusinessPartnerSet.requestBuilder() | ||
.getAll() | ||
.top(20) // look at the top 10 bp's only | ||
.select(EpmBusinessPartnerSet.BP_ID, EpmBusinessPartnerSet.COMPANY_NAME) | ||
.execute({ | ||
url: 'http://localhost:3000/v2' | ||
}); | ||
} | ||
|
||
module.exports.getEpmBusinessPartners = getEpmBusinessPartners; | ||
getEpmBusinessPartners().then((epmbp) => { | ||
console.log(epmbp); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@sap:registry=https://npm.sap.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*! | ||
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
*/ | ||
import { CreateRequestBuilder, DeleteRequestBuilder, GetAllRequestBuilder, GetByKeyRequestBuilder, ODataBatchChangeSet, ODataBatchRequestBuilder, UpdateRequestBuilder } from '@sap/cloud-sdk-core'; | ||
import { EpmBusinessPartnerSet } from './index'; | ||
/** | ||
* Batch builder for operations supported on the Zepm Bp Service. | ||
* @param requests The requests of the batch | ||
* @returns A request builder for batch. | ||
*/ | ||
export declare function batch(...requests: Array<ReadZepmBpServiceRequestBuilder | ODataBatchChangeSet<WriteZepmBpServiceRequestBuilder>>): ODataBatchRequestBuilder; | ||
/** | ||
* Change set constructor consists of write operations supported on the Zepm Bp Service. | ||
* @param requests The requests of the change set | ||
* @returns A change set for batch. | ||
*/ | ||
export declare function changeset(...requests: WriteZepmBpServiceRequestBuilder[]): ODataBatchChangeSet<WriteZepmBpServiceRequestBuilder>; | ||
export declare const defaultZepmBpServicePath = "/sap/opu/odata/sap/ZEPM_BP_SRV"; | ||
export declare type ReadZepmBpServiceRequestBuilder = GetAllRequestBuilder<EpmBusinessPartnerSet> | GetByKeyRequestBuilder<EpmBusinessPartnerSet>; | ||
export declare type WriteZepmBpServiceRequestBuilder = CreateRequestBuilder<EpmBusinessPartnerSet> | UpdateRequestBuilder<EpmBusinessPartnerSet> | DeleteRequestBuilder<EpmBusinessPartnerSet>; | ||
//# sourceMappingURL=BatchRequest.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.