diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..639d13a --- /dev/null +++ b/.eslintrc @@ -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" + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a95ad1 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.vscode/cds.js b/.vscode/cds.js new file mode 100644 index 0000000..a9e6d6f --- /dev/null +++ b/.vscode/cds.js @@ -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(); diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f4c8896 --- /dev/null +++ b/.vscode/launch.json @@ -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": [ "/**" ], + "internalConsoleOptions": "openOnSessionStart", + "console": "internalConsole", + "autoAttachChildProcesses": true + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9fefa08 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "files.exclude": { + "**/.gitignore": true, + "**/.git": true, + "**/.vscode": true + } +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..c8762fa --- /dev/null +++ b/.vscode/tasks.json @@ -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": [] + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..be0b6d2 --- /dev/null +++ b/README.md @@ -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/ diff --git a/db/csv/my.bookshop-Authors.csv b/db/csv/my.bookshop-Authors.csv new file mode 100644 index 0000000..4116e36 --- /dev/null +++ b/db/csv/my.bookshop-Authors.csv @@ -0,0 +1,6 @@ +ID,NAME +42,Douglas Adams +101,Emily Brontë +107,Charlote Brontë +150,Edgar Allen Poe +170,Richard Carpenter \ No newline at end of file diff --git a/db/csv/my.bookshop-Books.csv b/db/csv/my.bookshop-Books.csv new file mode 100644 index 0000000..ad9ba5d --- /dev/null +++ b/db/csv/my.bookshop-Books.csv @@ -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 \ No newline at end of file diff --git a/db/csv/my.bookshop-Orders.csv b/db/csv/my.bookshop-Orders.csv new file mode 100644 index 0000000..ba759d0 --- /dev/null +++ b/db/csv/my.bookshop-Orders.csv @@ -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 \ No newline at end of file diff --git a/db/extended.cds b/db/extended.cds new file mode 100644 index 0000000..d6bb10b --- /dev/null +++ b/db/extended.cds @@ -0,0 +1,5 @@ +using my.bookshop as my from './schema'; + +extend my.Orders with { + businessPartner : String(10); +} \ No newline at end of file diff --git a/db/schema.cds b/db/schema.cds new file mode 100644 index 0000000..53fca25 --- /dev/null +++ b/db/schema.cds @@ -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; +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..a5247db --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "consumer-app-gwsample", + "version": "1.0.0", + "description": "A simple CAP project.", + "repository": "", + "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/" + ] + } + } + } +} diff --git a/srv/external/csn/ZEPM_BP_SRV.json b/srv/external/csn/ZEPM_BP_SRV.json new file mode 100644 index 0000000..846b60f --- /dev/null +++ b/srv/external/csn/ZEPM_BP_SRV.json @@ -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" + } + } + } + } +} \ No newline at end of file diff --git a/srv/get-epmbp.js b/srv/get-epmbp.js new file mode 100644 index 0000000..f03f52e --- /dev/null +++ b/srv/get-epmbp.js @@ -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); +}); \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/.npmrc b/srv/odata-client/zepm-bp-service/.npmrc new file mode 100644 index 0000000..6041b7e --- /dev/null +++ b/srv/odata-client/zepm-bp-service/.npmrc @@ -0,0 +1 @@ +@sap:registry=https://npm.sap.com \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/BatchRequest.d.ts b/srv/odata-client/zepm-bp-service/BatchRequest.d.ts new file mode 100644 index 0000000..d5826e8 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/BatchRequest.d.ts @@ -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>): 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; +export declare const defaultZepmBpServicePath = "/sap/opu/odata/sap/ZEPM_BP_SRV"; +export declare type ReadZepmBpServiceRequestBuilder = GetAllRequestBuilder | GetByKeyRequestBuilder; +export declare type WriteZepmBpServiceRequestBuilder = CreateRequestBuilder | UpdateRequestBuilder | DeleteRequestBuilder; +//# sourceMappingURL=BatchRequest.d.ts.map \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/BatchRequest.d.ts.map b/srv/odata-client/zepm-bp-service/BatchRequest.d.ts.map new file mode 100644 index 0000000..00dcd99 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/BatchRequest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BatchRequest.d.ts","sourceRoot":"","sources":["BatchRequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpM,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,+BAA+B,GAAG,mBAAmB,CAAC,gCAAgC,CAAC,CAAC,GAAG,wBAAwB,CAE3J;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,QAAQ,EAAE,gCAAgC,EAAE,GAAG,mBAAmB,CAAC,gCAAgC,CAAC,CAEhI;AAED,eAAO,MAAM,wBAAwB,mCAAmC,CAAC;AAEzE,oBAAY,+BAA+B,GAAG,oBAAoB,CAAC,qBAAqB,CAAC,GAAG,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;AAC1I,oBAAY,gCAAgC,GAAG,oBAAoB,CAAC,qBAAqB,CAAC,GAAG,oBAAoB,CAAC,qBAAqB,CAAC,GAAG,oBAAoB,CAAC,qBAAqB,CAAC,CAAC"} \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/BatchRequest.js b/srv/odata-client/zepm-bp-service/BatchRequest.js new file mode 100644 index 0000000..a0a5c91 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/BatchRequest.js @@ -0,0 +1,36 @@ +"use strict"; +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var cloud_sdk_core_1 = require("@sap/cloud-sdk-core"); +var index_1 = require("./index"); +/** + * Batch builder for operations supported on the Zepm Bp Service. + * @param requests The requests of the batch + * @returns A request builder for batch. + */ +function batch() { + var requests = []; + for (var _i = 0; _i < arguments.length; _i++) { + requests[_i] = arguments[_i]; + } + return new cloud_sdk_core_1.ODataBatchRequestBuilder(exports.defaultZepmBpServicePath, requests, map); +} +exports.batch = batch; +/** + * 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. + */ +function changeset() { + var requests = []; + for (var _i = 0; _i < arguments.length; _i++) { + requests[_i] = arguments[_i]; + } + return new cloud_sdk_core_1.ODataBatchChangeSet(requests); +} +exports.changeset = changeset; +exports.defaultZepmBpServicePath = '/sap/opu/odata/sap/ZEPM_BP_SRV'; +var map = { 'EPMBusinessPartner': index_1.EpmBusinessPartnerSet }; +//# sourceMappingURL=BatchRequest.js.map \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/BatchRequest.js.map b/srv/odata-client/zepm-bp-service/BatchRequest.js.map new file mode 100644 index 0000000..c3f9106 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/BatchRequest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BatchRequest.js","sourceRoot":"","sources":["BatchRequest.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAEH,sDAAoM;AACpM,iCAAgD;AAEhD;;;;GAIG;AACH,SAAgB,KAAK;IAAC,kBAA2G;SAA3G,UAA2G,EAA3G,qBAA2G,EAA3G,IAA2G;QAA3G,6BAA2G;;IAC/H,OAAO,IAAI,yCAAwB,CAAC,gCAAwB,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC/E,CAAC;AAFD,sBAEC;AAED;;;;GAIG;AACH,SAAgB,SAAS;IAAC,kBAA+C;SAA/C,UAA+C,EAA/C,qBAA+C,EAA/C,IAA+C;QAA/C,6BAA+C;;IACvE,OAAO,IAAI,oCAAmB,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC;AAFD,8BAEC;AAEY,QAAA,wBAAwB,GAAG,gCAAgC,CAAC;AACzE,IAAM,GAAG,GAAG,EAAE,oBAAoB,EAAE,6BAAqB,EAAE,CAAC"} \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/BatchRequest.ts b/srv/odata-client/zepm-bp-service/BatchRequest.ts new file mode 100644 index 0000000..1e3de08 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/BatchRequest.ts @@ -0,0 +1,29 @@ +/*! + * 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 function batch(...requests: Array>): ODataBatchRequestBuilder { + return new ODataBatchRequestBuilder(defaultZepmBpServicePath, requests, map); +} + +/** + * 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 function changeset(...requests: WriteZepmBpServiceRequestBuilder[]): ODataBatchChangeSet { + return new ODataBatchChangeSet(requests); +} + +export const defaultZepmBpServicePath = '/sap/opu/odata/sap/ZEPM_BP_SRV'; +const map = { 'EPMBusinessPartner': EpmBusinessPartnerSet }; +export type ReadZepmBpServiceRequestBuilder = GetAllRequestBuilder | GetByKeyRequestBuilder; +export type WriteZepmBpServiceRequestBuilder = CreateRequestBuilder | UpdateRequestBuilder | DeleteRequestBuilder; diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.d.ts b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.d.ts new file mode 100644 index 0000000..cc18f9f --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.d.ts @@ -0,0 +1,320 @@ +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ +import { EpmBusinessPartnerSetRequestBuilder } from './EpmBusinessPartnerSetRequestBuilder'; +import { Moment } from 'moment'; +import { AllFields, CustomField, DateField, Entity, EntityBuilderType, Selectable, StringField } from '@sap/cloud-sdk-core'; +/** + * This class represents the entity "EPMBusinessPartnerSet" of service "ZEPM_BP_SRV". + */ +export declare class EpmBusinessPartnerSet extends Entity implements EpmBusinessPartnerSetType { + /** + * Technical entity name for EpmBusinessPartnerSet. + */ + static _entityName: string; + /** + * @deprecated Since v1.0.1 Use [[_defaultServicePath]] instead. + * Technical service name for EpmBusinessPartnerSet. + */ + static _serviceName: string; + /** + * Default url path for the according service. + */ + static _defaultServicePath: string; + /** + * Business Partner ID. + * Maximum length: 10. + */ + bpId: string; + /** + * Bus. Part. Role. + * Maximum length: 3. + */ + bpRole: string; + /** + * Email. + * Maximum length: 255. + */ + emailAddress: string; + /** + * Phone. + * Maximum length: 30. + */ + phoneNumber: string; + /** + * Phone. + * Maximum length: 30. + */ + faxNumber: string; + /** + * Description. + * Maximum length: 255. + */ + webAddress: string; + /** + * Company. + * Maximum length: 80. + */ + companyName: string; + /** + * Legal Form. + * Maximum length: 10. + */ + legalForm: string; + /** + * Currency Code. + * Maximum length: 5. + */ + currencyCode: string; + /** + * City. + * Maximum length: 40. + */ + city: string; + /** + * Postal Code. + * Maximum length: 10. + */ + postalCode: string; + /** + * Street. + * Maximum length: 60. + */ + street: string; + /** + * Building. + * Maximum length: 10. + */ + building: string; + /** + * Country. + * Maximum length: 3. + */ + country: string; + /** + * Address Type. + * Maximum length: 2. + */ + addressType: string; + /** + * Time Stamp. + */ + addressValStartDate: Moment; + /** + * Time Stamp. + */ + addressValEndDate: Moment; + /** + * Ident. + * Maximum length: 10. + */ + createdBy: string; + /** + * Time Stamp. + */ + createdAt: Moment; + /** + * Ident. + * Maximum length: 10. + */ + changedBy: string; + /** + * Time Stamp. + */ + changedAt: Moment; + /** + * Returns an entity builder to construct instances `EpmBusinessPartnerSet`. + * @returns A builder that constructs instances of entity type `EpmBusinessPartnerSet`. + */ + static builder(): EntityBuilderType; + /** + * Returns a request builder to construct requests for operations on the `EpmBusinessPartnerSet` entity type. + * @returns A `EpmBusinessPartnerSet` request builder. + */ + static requestBuilder(): EpmBusinessPartnerSetRequestBuilder; + /** + * Returns a selectable object that allows the selection of custom field in a get request for the entity `EpmBusinessPartnerSet`. + * @param fieldName Name of the custom field to select + * @returns A builder that constructs instances of entity type `EpmBusinessPartnerSet`. + */ + static customField(fieldName: string): CustomField; + /** + * Overwrites the default toJSON method so that all instance variables as well as all custom fields of the entity are returned. + * @returns An object containing all instance variables + custom fields. + */ + toJSON(): { + [key: string]: any; + }; +} +export interface EpmBusinessPartnerSetType { + bpId: string; + bpRole: string; + emailAddress: string; + phoneNumber: string; + faxNumber: string; + webAddress: string; + companyName: string; + legalForm: string; + currencyCode: string; + city: string; + postalCode: string; + street: string; + building: string; + country: string; + addressType: string; + addressValStartDate: Moment; + addressValEndDate: Moment; + createdBy: string; + createdAt: Moment; + changedBy: string; + changedAt: Moment; +} +export interface EpmBusinessPartnerSetTypeForceMandatory { + bpId: string; + bpRole: string; + emailAddress: string; + phoneNumber: string; + faxNumber: string; + webAddress: string; + companyName: string; + legalForm: string; + currencyCode: string; + city: string; + postalCode: string; + street: string; + building: string; + country: string; + addressType: string; + addressValStartDate: Moment; + addressValEndDate: Moment; + createdBy: string; + createdAt: Moment; + changedBy: string; + changedAt: Moment; +} +export declare namespace EpmBusinessPartnerSet { + /** + * Static representation of the [[bpId]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const BP_ID: StringField; + /** + * Static representation of the [[bpRole]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const BP_ROLE: StringField; + /** + * Static representation of the [[emailAddress]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const EMAIL_ADDRESS: StringField; + /** + * Static representation of the [[phoneNumber]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const PHONE_NUMBER: StringField; + /** + * Static representation of the [[faxNumber]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const FAX_NUMBER: StringField; + /** + * Static representation of the [[webAddress]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const WEB_ADDRESS: StringField; + /** + * Static representation of the [[companyName]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const COMPANY_NAME: StringField; + /** + * Static representation of the [[legalForm]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const LEGAL_FORM: StringField; + /** + * Static representation of the [[currencyCode]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const CURRENCY_CODE: StringField; + /** + * Static representation of the [[city]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const CITY: StringField; + /** + * Static representation of the [[postalCode]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const POSTAL_CODE: StringField; + /** + * Static representation of the [[street]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const STREET: StringField; + /** + * Static representation of the [[building]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const BUILDING: StringField; + /** + * Static representation of the [[country]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const COUNTRY: StringField; + /** + * Static representation of the [[addressType]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const ADDRESS_TYPE: StringField; + /** + * Static representation of the [[addressValStartDate]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const ADDRESS_VAL_START_DATE: DateField; + /** + * Static representation of the [[addressValEndDate]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const ADDRESS_VAL_END_DATE: DateField; + /** + * Static representation of the [[createdBy]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const CREATED_BY: StringField; + /** + * Static representation of the [[createdAt]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const CREATED_AT: DateField; + /** + * Static representation of the [[changedBy]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const CHANGED_BY: StringField; + /** + * Static representation of the [[changedAt]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + const CHANGED_AT: DateField; + /** + * All fields of the EpmBusinessPartnerSet entity. + */ + const _allFields: Array | DateField>; + /** + * All fields selector. + */ + const ALL_FIELDS: AllFields; + /** + * All key fields of the EpmBusinessPartnerSet entity. + */ + const _keyFields: Array>; + /** + * Mapping of all key field names to the respective static field property EpmBusinessPartnerSet. + */ + const _keys: { + [keys: string]: Selectable; + }; +} +//# sourceMappingURL=EpmBusinessPartnerSet.d.ts.map \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.d.ts.map b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.d.ts.map new file mode 100644 index 0000000..69bc839 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EpmBusinessPartnerSet.d.ts","sourceRoot":"","sources":["EpmBusinessPartnerSet.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE5H;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,MAAO,YAAW,yBAAyB;IACpF;;OAEG;IACH,MAAM,CAAC,WAAW,SAA2B;IAC7C;;;OAGG;IACH,MAAM,CAAC,YAAY,SAAiB;IACpC;;OAEG;IACH,MAAM,CAAC,mBAAmB,SAAoC;IAC9D;;;OAGG;IACH,IAAI,EAAG,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,EAAG,MAAM,CAAC;IAChB;;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S,CAAC,qBAAqB,CAA6E,CAAC;IAChJ;;;OAGG;IACI,MAAM,UAAU,EAAE,WAAW,CAAC,qBAAqB,CAAqE,CAAC;IAChI;;;OAGG;IACI,MAAM,UAAU,EAAE,SAAS,CAAC,qBAAqB,CAAqE,CAAC;IAC9H;;;OAGG;IACI,MAAM,UAAU,EAAE,WAAW,CAAC,qBAAqB,CAAqE,CAAC;IAChI;;;OAGG;IACI,MAAM,UAAU,EAAE,SAAS,CAAC,qBAAqB,CAAqE,CAAC;IAC9H;;OAEG;IACI,MAAM,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAsBnG,CAAC;IACF;;OAEG;IACI,MAAM,UAAU,EAAE,SAAS,CAAC,qBAAqB,CAA6C,CAAC;IACtG;;OAEG;IACI,MAAM,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAiC,CAAC;IAClG;;OAEG;IACI,MAAM,KAAK,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAA;KAGjE,CAAC;CACR"} \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.js b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.js new file mode 100644 index 0000000..5077318 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.js @@ -0,0 +1,234 @@ +"use strict"; +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var EpmBusinessPartnerSetRequestBuilder_1 = require("./EpmBusinessPartnerSetRequestBuilder"); +var cloud_sdk_core_1 = require("@sap/cloud-sdk-core"); +/** + * This class represents the entity "EPMBusinessPartnerSet" of service "ZEPM_BP_SRV". + */ +var EpmBusinessPartnerSet = /** @class */ (function (_super) { + __extends(EpmBusinessPartnerSet, _super); + function EpmBusinessPartnerSet() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Returns an entity builder to construct instances `EpmBusinessPartnerSet`. + * @returns A builder that constructs instances of entity type `EpmBusinessPartnerSet`. + */ + EpmBusinessPartnerSet.builder = function () { + return cloud_sdk_core_1.Entity.entityBuilder(EpmBusinessPartnerSet); + }; + /** + * Returns a request builder to construct requests for operations on the `EpmBusinessPartnerSet` entity type. + * @returns A `EpmBusinessPartnerSet` request builder. + */ + EpmBusinessPartnerSet.requestBuilder = function () { + return new EpmBusinessPartnerSetRequestBuilder_1.EpmBusinessPartnerSetRequestBuilder(); + }; + /** + * Returns a selectable object that allows the selection of custom field in a get request for the entity `EpmBusinessPartnerSet`. + * @param fieldName Name of the custom field to select + * @returns A builder that constructs instances of entity type `EpmBusinessPartnerSet`. + */ + EpmBusinessPartnerSet.customField = function (fieldName) { + return cloud_sdk_core_1.Entity.customFieldSelector(fieldName, EpmBusinessPartnerSet); + }; + /** + * Overwrites the default toJSON method so that all instance variables as well as all custom fields of the entity are returned. + * @returns An object containing all instance variables + custom fields. + */ + EpmBusinessPartnerSet.prototype.toJSON = function () { + return __assign({}, this, this._customFields); + }; + /** + * Technical entity name for EpmBusinessPartnerSet. + */ + EpmBusinessPartnerSet._entityName = 'EPMBusinessPartnerSet'; + /** + * @deprecated Since v1.0.1 Use [[_defaultServicePath]] instead. + * Technical service name for EpmBusinessPartnerSet. + */ + EpmBusinessPartnerSet._serviceName = 'ZEPM_BP_SRV'; + /** + * Default url path for the according service. + */ + EpmBusinessPartnerSet._defaultServicePath = '/sap/opu/odata/sap/ZEPM_BP_SRV'; + return EpmBusinessPartnerSet; +}(cloud_sdk_core_1.Entity)); +exports.EpmBusinessPartnerSet = EpmBusinessPartnerSet; +(function (EpmBusinessPartnerSet) { + /** + * Static representation of the [[bpId]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.BP_ID = new cloud_sdk_core_1.StringField('BpId', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[bpRole]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.BP_ROLE = new cloud_sdk_core_1.StringField('BpRole', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[emailAddress]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.EMAIL_ADDRESS = new cloud_sdk_core_1.StringField('EmailAddress', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[phoneNumber]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.PHONE_NUMBER = new cloud_sdk_core_1.StringField('PhoneNumber', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[faxNumber]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.FAX_NUMBER = new cloud_sdk_core_1.StringField('FaxNumber', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[webAddress]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.WEB_ADDRESS = new cloud_sdk_core_1.StringField('WebAddress', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[companyName]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.COMPANY_NAME = new cloud_sdk_core_1.StringField('CompanyName', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[legalForm]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.LEGAL_FORM = new cloud_sdk_core_1.StringField('LegalForm', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[currencyCode]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.CURRENCY_CODE = new cloud_sdk_core_1.StringField('CurrencyCode', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[city]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.CITY = new cloud_sdk_core_1.StringField('City', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[postalCode]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.POSTAL_CODE = new cloud_sdk_core_1.StringField('PostalCode', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[street]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.STREET = new cloud_sdk_core_1.StringField('Street', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[building]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.BUILDING = new cloud_sdk_core_1.StringField('Building', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[country]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.COUNTRY = new cloud_sdk_core_1.StringField('Country', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[addressType]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.ADDRESS_TYPE = new cloud_sdk_core_1.StringField('AddressType', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[addressValStartDate]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.ADDRESS_VAL_START_DATE = new cloud_sdk_core_1.DateField('AddressValStartDate', EpmBusinessPartnerSet, 'Edm.DateTime'); + /** + * Static representation of the [[addressValEndDate]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.ADDRESS_VAL_END_DATE = new cloud_sdk_core_1.DateField('AddressValEndDate', EpmBusinessPartnerSet, 'Edm.DateTime'); + /** + * Static representation of the [[createdBy]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.CREATED_BY = new cloud_sdk_core_1.StringField('CreatedBy', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[createdAt]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.CREATED_AT = new cloud_sdk_core_1.DateField('CreatedAt', EpmBusinessPartnerSet, 'Edm.DateTime'); + /** + * Static representation of the [[changedBy]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.CHANGED_BY = new cloud_sdk_core_1.StringField('ChangedBy', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[changedAt]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + EpmBusinessPartnerSet.CHANGED_AT = new cloud_sdk_core_1.DateField('ChangedAt', EpmBusinessPartnerSet, 'Edm.DateTime'); + /** + * All fields of the EpmBusinessPartnerSet entity. + */ + EpmBusinessPartnerSet._allFields = [ + EpmBusinessPartnerSet.BP_ID, + EpmBusinessPartnerSet.BP_ROLE, + EpmBusinessPartnerSet.EMAIL_ADDRESS, + EpmBusinessPartnerSet.PHONE_NUMBER, + EpmBusinessPartnerSet.FAX_NUMBER, + EpmBusinessPartnerSet.WEB_ADDRESS, + EpmBusinessPartnerSet.COMPANY_NAME, + EpmBusinessPartnerSet.LEGAL_FORM, + EpmBusinessPartnerSet.CURRENCY_CODE, + EpmBusinessPartnerSet.CITY, + EpmBusinessPartnerSet.POSTAL_CODE, + EpmBusinessPartnerSet.STREET, + EpmBusinessPartnerSet.BUILDING, + EpmBusinessPartnerSet.COUNTRY, + EpmBusinessPartnerSet.ADDRESS_TYPE, + EpmBusinessPartnerSet.ADDRESS_VAL_START_DATE, + EpmBusinessPartnerSet.ADDRESS_VAL_END_DATE, + EpmBusinessPartnerSet.CREATED_BY, + EpmBusinessPartnerSet.CREATED_AT, + EpmBusinessPartnerSet.CHANGED_BY, + EpmBusinessPartnerSet.CHANGED_AT + ]; + /** + * All fields selector. + */ + EpmBusinessPartnerSet.ALL_FIELDS = new cloud_sdk_core_1.AllFields('*', EpmBusinessPartnerSet); + /** + * All key fields of the EpmBusinessPartnerSet entity. + */ + EpmBusinessPartnerSet._keyFields = [EpmBusinessPartnerSet.BP_ID]; + /** + * Mapping of all key field names to the respective static field property EpmBusinessPartnerSet. + */ + EpmBusinessPartnerSet._keys = EpmBusinessPartnerSet._keyFields.reduce(function (acc, field) { + acc[field._fieldName] = field; + return acc; + }, {}); +})(EpmBusinessPartnerSet = exports.EpmBusinessPartnerSet || (exports.EpmBusinessPartnerSet = {})); +exports.EpmBusinessPartnerSet = EpmBusinessPartnerSet; +//# sourceMappingURL=EpmBusinessPartnerSet.js.map \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.js.map b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.js.map new file mode 100644 index 0000000..be0c3de --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.js.map @@ -0,0 +1 @@ +{"version":3,"file":"EpmBusinessPartnerSet.js","sourceRoot":"","sources":["EpmBusinessPartnerSet.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;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AK,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;QAC9B,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,EAnJgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAmJrC;AAzVY,sDAAqB"} \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.ts b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.ts new file mode 100644 index 0000000..fd7fe77 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSet.ts @@ -0,0 +1,357 @@ +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ + +import { EpmBusinessPartnerSetRequestBuilder } from './EpmBusinessPartnerSetRequestBuilder'; +import { Moment } from 'moment'; +import { AllFields, CustomField, DateField, Entity, EntityBuilderType, Selectable, StringField } from '@sap/cloud-sdk-core'; + +/** + * This class represents the entity "EPMBusinessPartnerSet" of service "ZEPM_BP_SRV". + */ +export class EpmBusinessPartnerSet extends Entity implements EpmBusinessPartnerSetType { + /** + * Technical entity name for EpmBusinessPartnerSet. + */ + static _entityName = 'EPMBusinessPartnerSet'; + /** + * @deprecated Since v1.0.1 Use [[_defaultServicePath]] instead. + * Technical service name for EpmBusinessPartnerSet. + */ + static _serviceName = 'ZEPM_BP_SRV'; + /** + * Default url path for the according service. + */ + static _defaultServicePath = '/sap/opu/odata/sap/ZEPM_BP_SRV'; + /** + * Business Partner ID. + * Maximum length: 10. + */ + bpId!: string; + /** + * Bus. Part. Role. + * Maximum length: 3. + */ + bpRole!: string; + /** + * Email. + * Maximum length: 255. + */ + emailAddress!: string; + /** + * Phone. + * Maximum length: 30. + */ + phoneNumber!: string; + /** + * Phone. + * Maximum length: 30. + */ + faxNumber!: string; + /** + * Description. + * Maximum length: 255. + */ + webAddress!: string; + /** + * Company. + * Maximum length: 80. + */ + companyName!: string; + /** + * Legal Form. + * Maximum length: 10. + */ + legalForm!: string; + /** + * Currency Code. + * Maximum length: 5. + */ + currencyCode!: string; + /** + * City. + * Maximum length: 40. + */ + city!: string; + /** + * Postal Code. + * Maximum length: 10. + */ + postalCode!: string; + /** + * Street. + * Maximum length: 60. + */ + street!: string; + /** + * Building. + * Maximum length: 10. + */ + building!: string; + /** + * Country. + * Maximum length: 3. + */ + country!: string; + /** + * Address Type. + * Maximum length: 2. + */ + addressType!: string; + /** + * Time Stamp. + */ + addressValStartDate!: Moment; + /** + * Time Stamp. + */ + addressValEndDate!: Moment; + /** + * Ident. + * Maximum length: 10. + */ + createdBy!: string; + /** + * Time Stamp. + */ + createdAt!: Moment; + /** + * Ident. + * Maximum length: 10. + */ + changedBy!: string; + /** + * Time Stamp. + */ + changedAt!: Moment; + + /** + * Returns an entity builder to construct instances `EpmBusinessPartnerSet`. + * @returns A builder that constructs instances of entity type `EpmBusinessPartnerSet`. + */ + static builder(): EntityBuilderType { + return Entity.entityBuilder(EpmBusinessPartnerSet); + } + + /** + * Returns a request builder to construct requests for operations on the `EpmBusinessPartnerSet` entity type. + * @returns A `EpmBusinessPartnerSet` request builder. + */ + static requestBuilder(): EpmBusinessPartnerSetRequestBuilder { + return new EpmBusinessPartnerSetRequestBuilder(); + } + + /** + * Returns a selectable object that allows the selection of custom field in a get request for the entity `EpmBusinessPartnerSet`. + * @param fieldName Name of the custom field to select + * @returns A builder that constructs instances of entity type `EpmBusinessPartnerSet`. + */ + static customField(fieldName: string): CustomField { + return Entity.customFieldSelector(fieldName, EpmBusinessPartnerSet); + } + + /** + * Overwrites the default toJSON method so that all instance variables as well as all custom fields of the entity are returned. + * @returns An object containing all instance variables + custom fields. + */ + toJSON(): { [key: string]: any } { + return { ...this, ...this._customFields }; + } +} + +export interface EpmBusinessPartnerSetType { + bpId: string; + bpRole: string; + emailAddress: string; + phoneNumber: string; + faxNumber: string; + webAddress: string; + companyName: string; + legalForm: string; + currencyCode: string; + city: string; + postalCode: string; + street: string; + building: string; + country: string; + addressType: string; + addressValStartDate: Moment; + addressValEndDate: Moment; + createdBy: string; + createdAt: Moment; + changedBy: string; + changedAt: Moment; +} + +export interface EpmBusinessPartnerSetTypeForceMandatory { + bpId: string; + bpRole: string; + emailAddress: string; + phoneNumber: string; + faxNumber: string; + webAddress: string; + companyName: string; + legalForm: string; + currencyCode: string; + city: string; + postalCode: string; + street: string; + building: string; + country: string; + addressType: string; + addressValStartDate: Moment; + addressValEndDate: Moment; + createdBy: string; + createdAt: Moment; + changedBy: string; + changedAt: Moment; +} + +export namespace EpmBusinessPartnerSet { + /** + * Static representation of the [[bpId]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const BP_ID: StringField = new StringField('BpId', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[bpRole]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const BP_ROLE: StringField = new StringField('BpRole', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[emailAddress]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const EMAIL_ADDRESS: StringField = new StringField('EmailAddress', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[phoneNumber]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const PHONE_NUMBER: StringField = new StringField('PhoneNumber', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[faxNumber]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const FAX_NUMBER: StringField = new StringField('FaxNumber', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[webAddress]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const WEB_ADDRESS: StringField = new StringField('WebAddress', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[companyName]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const COMPANY_NAME: StringField = new StringField('CompanyName', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[legalForm]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const LEGAL_FORM: StringField = new StringField('LegalForm', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[currencyCode]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const CURRENCY_CODE: StringField = new StringField('CurrencyCode', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[city]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const CITY: StringField = new StringField('City', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[postalCode]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const POSTAL_CODE: StringField = new StringField('PostalCode', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[street]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const STREET: StringField = new StringField('Street', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[building]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const BUILDING: StringField = new StringField('Building', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[country]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const COUNTRY: StringField = new StringField('Country', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[addressType]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const ADDRESS_TYPE: StringField = new StringField('AddressType', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[addressValStartDate]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const ADDRESS_VAL_START_DATE: DateField = new DateField('AddressValStartDate', EpmBusinessPartnerSet, 'Edm.DateTime'); + /** + * Static representation of the [[addressValEndDate]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const ADDRESS_VAL_END_DATE: DateField = new DateField('AddressValEndDate', EpmBusinessPartnerSet, 'Edm.DateTime'); + /** + * Static representation of the [[createdBy]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const CREATED_BY: StringField = new StringField('CreatedBy', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[createdAt]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const CREATED_AT: DateField = new DateField('CreatedAt', EpmBusinessPartnerSet, 'Edm.DateTime'); + /** + * Static representation of the [[changedBy]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const CHANGED_BY: StringField = new StringField('ChangedBy', EpmBusinessPartnerSet, 'Edm.String'); + /** + * Static representation of the [[changedAt]] property for query construction. + * Use to reference this property in query operations such as 'select' in the fluent request API. + */ + export const CHANGED_AT: DateField = new DateField('ChangedAt', EpmBusinessPartnerSet, 'Edm.DateTime'); + /** + * All fields of the EpmBusinessPartnerSet entity. + */ + export const _allFields: Array | DateField> = [ + EpmBusinessPartnerSet.BP_ID, + EpmBusinessPartnerSet.BP_ROLE, + EpmBusinessPartnerSet.EMAIL_ADDRESS, + EpmBusinessPartnerSet.PHONE_NUMBER, + EpmBusinessPartnerSet.FAX_NUMBER, + EpmBusinessPartnerSet.WEB_ADDRESS, + EpmBusinessPartnerSet.COMPANY_NAME, + EpmBusinessPartnerSet.LEGAL_FORM, + EpmBusinessPartnerSet.CURRENCY_CODE, + EpmBusinessPartnerSet.CITY, + EpmBusinessPartnerSet.POSTAL_CODE, + EpmBusinessPartnerSet.STREET, + EpmBusinessPartnerSet.BUILDING, + EpmBusinessPartnerSet.COUNTRY, + EpmBusinessPartnerSet.ADDRESS_TYPE, + EpmBusinessPartnerSet.ADDRESS_VAL_START_DATE, + EpmBusinessPartnerSet.ADDRESS_VAL_END_DATE, + EpmBusinessPartnerSet.CREATED_BY, + EpmBusinessPartnerSet.CREATED_AT, + EpmBusinessPartnerSet.CHANGED_BY, + EpmBusinessPartnerSet.CHANGED_AT + ]; + /** + * All fields selector. + */ + export const ALL_FIELDS: AllFields = new AllFields('*', EpmBusinessPartnerSet); + /** + * All key fields of the EpmBusinessPartnerSet entity. + */ + export const _keyFields: Array> = [EpmBusinessPartnerSet.BP_ID]; + /** + * Mapping of all key field names to the respective static field property EpmBusinessPartnerSet. + */ + export const _keys: { [keys: string]: Selectable } = EpmBusinessPartnerSet._keyFields.reduce((acc: { [keys: string]: Selectable }, field: Selectable) => { + acc[field._fieldName] = field; + return acc; + }, {}); +} diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.d.ts b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.d.ts new file mode 100644 index 0000000..a4432b3 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.d.ts @@ -0,0 +1,22 @@ +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ +import { RequestBuilder, GetAllRequestBuilder, GetByKeyRequestBuilder } from '@sap/cloud-sdk-core'; +import { EpmBusinessPartnerSet } from './EpmBusinessPartnerSet'; +/** + * Request builder class for operations supported on the [[EpmBusinessPartnerSet]] entity. + */ +export declare class EpmBusinessPartnerSetRequestBuilder extends RequestBuilder { + /** + * Returns a request builder for retrieving one `EpmBusinessPartnerSet` entity based on its keys. + * @param bpId Key property. See [[EpmBusinessPartnerSet.bpId]]. + * @returns A request builder for creating requests to retrieve one `EpmBusinessPartnerSet` entity based on its keys. + */ + getByKey(bpId: string): GetByKeyRequestBuilder; + /** + * Returns a request builder for querying all `EpmBusinessPartnerSet` entities. + * @returns A request builder for creating requests to retrieve all `EpmBusinessPartnerSet` entities. + */ + getAll(): GetAllRequestBuilder; +} +//# sourceMappingURL=EpmBusinessPartnerSetRequestBuilder.d.ts.map \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.d.ts.map b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.d.ts.map new file mode 100644 index 0000000..ef42aaf --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EpmBusinessPartnerSetRequestBuilder.d.ts","sourceRoot":"","sources":["EpmBusinessPartnerSetRequestBuilder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;GAEG;AACH,qBAAa,mCAAoC,SAAQ,cAAc,CAAC,qBAAqB,CAAC;IAC5F;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,CAAC,qBAAqB,CAAC;IAIrE;;;OAGG;IACH,MAAM,IAAI,oBAAoB,CAAC,qBAAqB,CAAC;CAGtD"} \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.js b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.js new file mode 100644 index 0000000..9e2e587 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.js @@ -0,0 +1,47 @@ +"use strict"; +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var cloud_sdk_core_1 = require("@sap/cloud-sdk-core"); +var EpmBusinessPartnerSet_1 = require("./EpmBusinessPartnerSet"); +/** + * Request builder class for operations supported on the [[EpmBusinessPartnerSet]] entity. + */ +var EpmBusinessPartnerSetRequestBuilder = /** @class */ (function (_super) { + __extends(EpmBusinessPartnerSetRequestBuilder, _super); + function EpmBusinessPartnerSetRequestBuilder() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Returns a request builder for retrieving one `EpmBusinessPartnerSet` entity based on its keys. + * @param bpId Key property. See [[EpmBusinessPartnerSet.bpId]]. + * @returns A request builder for creating requests to retrieve one `EpmBusinessPartnerSet` entity based on its keys. + */ + EpmBusinessPartnerSetRequestBuilder.prototype.getByKey = function (bpId) { + return new cloud_sdk_core_1.GetByKeyRequestBuilder(EpmBusinessPartnerSet_1.EpmBusinessPartnerSet, { BpId: bpId }); + }; + /** + * Returns a request builder for querying all `EpmBusinessPartnerSet` entities. + * @returns A request builder for creating requests to retrieve all `EpmBusinessPartnerSet` entities. + */ + EpmBusinessPartnerSetRequestBuilder.prototype.getAll = function () { + return new cloud_sdk_core_1.GetAllRequestBuilder(EpmBusinessPartnerSet_1.EpmBusinessPartnerSet); + }; + return EpmBusinessPartnerSetRequestBuilder; +}(cloud_sdk_core_1.RequestBuilder)); +exports.EpmBusinessPartnerSetRequestBuilder = EpmBusinessPartnerSetRequestBuilder; +//# sourceMappingURL=EpmBusinessPartnerSetRequestBuilder.js.map \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.js.map b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.js.map new file mode 100644 index 0000000..ad339dd --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"EpmBusinessPartnerSetRequestBuilder.js","sourceRoot":"","sources":["EpmBusinessPartnerSetRequestBuilder.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;AAEH,sDAAmG;AACnG,iEAAgE;AAEhE;;GAEG;AACH;IAAyD,uDAAqC;IAA9F;;IAiBA,CAAC;IAhBC;;;;OAIG;IACH,sDAAQ,GAAR,UAAS,IAAY;QACnB,OAAO,IAAI,uCAAsB,CAAC,6CAAqB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACH,oDAAM,GAAN;QACE,OAAO,IAAI,qCAAoB,CAAC,6CAAqB,CAAC,CAAC;IACzD,CAAC;IACH,0CAAC;AAAD,CAAC,AAjBD,CAAyD,+BAAc,GAiBtE;AAjBY,kFAAmC"} \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.ts b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.ts new file mode 100644 index 0000000..8835843 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/EpmBusinessPartnerSetRequestBuilder.ts @@ -0,0 +1,28 @@ +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ + +import { RequestBuilder, GetAllRequestBuilder, GetByKeyRequestBuilder } from '@sap/cloud-sdk-core'; +import { EpmBusinessPartnerSet } from './EpmBusinessPartnerSet'; + +/** + * Request builder class for operations supported on the [[EpmBusinessPartnerSet]] entity. + */ +export class EpmBusinessPartnerSetRequestBuilder extends RequestBuilder { + /** + * Returns a request builder for retrieving one `EpmBusinessPartnerSet` entity based on its keys. + * @param bpId Key property. See [[EpmBusinessPartnerSet.bpId]]. + * @returns A request builder for creating requests to retrieve one `EpmBusinessPartnerSet` entity based on its keys. + */ + getByKey(bpId: string): GetByKeyRequestBuilder { + return new GetByKeyRequestBuilder(EpmBusinessPartnerSet, { BpId: bpId }); + } + + /** + * Returns a request builder for querying all `EpmBusinessPartnerSet` entities. + * @returns A request builder for creating requests to retrieve all `EpmBusinessPartnerSet` entities. + */ + getAll(): GetAllRequestBuilder { + return new GetAllRequestBuilder(EpmBusinessPartnerSet); + } +} diff --git a/srv/odata-client/zepm-bp-service/index.d.ts b/srv/odata-client/zepm-bp-service/index.d.ts new file mode 100644 index 0000000..bc685f4 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/index.d.ts @@ -0,0 +1,7 @@ +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ +export * from './EpmBusinessPartnerSet'; +export * from './EpmBusinessPartnerSetRequestBuilder'; +export * from './BatchRequest'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/index.d.ts.map b/srv/odata-client/zepm-bp-service/index.d.ts.map new file mode 100644 index 0000000..479e4fe --- /dev/null +++ b/srv/odata-client/zepm-bp-service/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC"} \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/index.js b/srv/odata-client/zepm-bp-service/index.js new file mode 100644 index 0000000..bbecf85 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/index.js @@ -0,0 +1,12 @@ +"use strict"; +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("./EpmBusinessPartnerSet")); +__export(require("./EpmBusinessPartnerSetRequestBuilder")); +__export(require("./BatchRequest")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/index.js.map b/srv/odata-client/zepm-bp-service/index.js.map new file mode 100644 index 0000000..beb90b0 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAEH,6CAAwC;AACxC,2DAAsD;AACtD,oCAA+B"} \ No newline at end of file diff --git a/srv/odata-client/zepm-bp-service/index.ts b/srv/odata-client/zepm-bp-service/index.ts new file mode 100644 index 0000000..08fb067 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/index.ts @@ -0,0 +1,7 @@ +/*! + * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. + */ + +export * from './EpmBusinessPartnerSet'; +export * from './EpmBusinessPartnerSetRequestBuilder'; +export * from './BatchRequest'; diff --git a/srv/odata-client/zepm-bp-service/package.json b/srv/odata-client/zepm-bp-service/package.json new file mode 100644 index 0000000..4d6e135 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/package.json @@ -0,0 +1,37 @@ +{ + "name": "zepm-bp-service", + "version": "1.16.0", + "description": "SAP Cloud SDK for JavaScript: Virtual Data Model (VDM) for service zepm-bp-service", + "homepage": "https://www.sap.com/cloud-sdk", + "main": "./index.js", + "types": "./index.d.ts", + "publishConfig": { + "access": "public" + }, + "files": [ + "**/*.js", + "**/*.js.map", + "**/*.d.ts", + "**/d.ts.map", + "**/*-csn.json" + ], + "repository": { + "type": "git", + "url": "" + }, + "scripts": { + "compile": "npx tsc", + "doc": "npx typedoc" + }, + "dependencies": { + "@sap/cloud-sdk-core": "^1.16.0" + }, + "peerDependencies": { + "@sap/cloud-sdk-core": "^1.16.0" + }, + "devDependencies": { + "@types/node": "^11.13.5", + "typedoc": "^0.15.0", + "typescript": "3.5.3" + } +} diff --git a/srv/odata-client/zepm-bp-service/tsconfig.json b/srv/odata-client/zepm-bp-service/tsconfig.json new file mode 100644 index 0000000..a92daf2 --- /dev/null +++ b/srv/odata-client/zepm-bp-service/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "target": "es5", + "module": "commonjs", + "lib": [ + "esnext" + ], + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "diagnostics": true, + "moduleResolution": "node", + "esModuleInterop": true, + "inlineSources": false, + "strict": true + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "dist/**/*", + "test/**/*", + "**/*.spec.ts", + "node_modules/**/*" + ] +} diff --git a/srv/odata-client/zepm-bp-service/typedoc.json b/srv/odata-client/zepm-bp-service/typedoc.json new file mode 100644 index 0000000..6d7e30d --- /dev/null +++ b/srv/odata-client/zepm-bp-service/typedoc.json @@ -0,0 +1,7 @@ +{ + "out": "documentation", + "exclude": [ + "node_modules/", + "dist/" + ] +} diff --git a/srv/service-specifications/ZEPM_BP_SRV.edmx.xml b/srv/service-specifications/ZEPM_BP_SRV.edmx.xml new file mode 100644 index 0000000..8d84d5a --- /dev/null +++ b/srv/service-specifications/ZEPM_BP_SRV.edmx.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/srv/service-specifications/service-mapping.json b/srv/service-specifications/service-mapping.json new file mode 100644 index 0000000..816ae84 --- /dev/null +++ b/srv/service-specifications/service-mapping.json @@ -0,0 +1,7 @@ +{ + "ZEPM_BP_SRV": { + "directoryName": "zepm-bp-service", + "servicePath": "/sap/opu/odata/sap/ZEPM_BP_SRV", + "npmPackageName": "zepm-bp-service" + } +} diff --git a/srv/service.cds b/srv/service.cds new file mode 100644 index 0000000..860058b --- /dev/null +++ b/srv/service.cds @@ -0,0 +1,25 @@ +using my.bookshop as my from '../db/extended'; +using ZEPM_BP_SRV as EPM_BP_API from './external/csn/ZEPM_BP_SRV.json'; + + + +service CatalogService { + entity Books as projection on my.Books; + entity Authors as projection on my.Authors; + + entity Orders as select from my.Orders mixin { + EPMBusinessPartner: Association to EPMBusinessPartners + on EPMBusinessPartner.bpId = businessPartner + } into { + *, + EPMBusinessPartner + }; + + @cds.persistence.skip + entity EPMBusinessPartners as projection on EPM_BP_API.EPMBusinessPartner { + key BpId as bpId, + CompanyName as companyName, + City as city, + Street as street + }; +}; \ No newline at end of file diff --git a/srv/service.js b/srv/service.js new file mode 100644 index 0000000..450ed0b --- /dev/null +++ b/srv/service.js @@ -0,0 +1,58 @@ +const { EpmBusinessPartnerSet } = require('odata-client/zepm-bp-service') +const { FilterList } = require('@sap/cloud-sdk-core') +const destination = { + url: 'http://localhost:3000/v2' +} + +const createFilter = xs => { + const andFilters = xs.map(x => new FilterList([ + EpmBusinessPartnerSet.BP_ID.equals(x.businessPartner), + ])) + return new FilterList(undefined, andFilters).flatten() +} + +function SELECT (columns) { + return { from(a){ + const b = {} + for (let p in a) if (p in columns) b[p] = a[p] + return b + }} +} + +module.exports = srv => { + + srv.before('READ', 'Orders', async (req) => { + + const { SELECT } = req.query + SELECT.columns = SELECT.columns.filter(c => !(c.expand && c.ref[0] === 'EPMBusinessPartner')) + + }) + + srv.after('READ', 'Orders', async (results, req) => { + + const { EPMBusinessPartners } = srv.entities + + const $expand = req._.odataReq.getQueryOptions() && req._.odataReq.getQueryOptions().$expand || '' + const result = results[0] || {} + + const entityRE = new RegExp(/([a-zA-Z]+)(?=(\(|$))/g) + + if ($expand){ + if($expand.match(entityRE).includes('EPMBusinessPartner')) { + if('businessPartner' in result) { + + const epmbps = await EpmBusinessPartnerSet + .requestBuilder() + .getAll() + .filter(createFilter(results)) + .execute(destination) + + results.forEach(order => order.EPMBusinessPartner = SELECT (EPMBusinessPartners.elements) .from (epmbps.find( + EpmBusinessPartnerSet => order.businessPartner === EpmBusinessPartnerSet.bpId + ))) + } + } + } + + }) +} \ No newline at end of file