Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dps integration #280

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions db/data/com.sap.dps-Namespaces.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NamespaceID;Description
cap.sflight;CAP SFlight
7 changes: 7 additions & 0 deletions db/data/com.sap.dps-Providers.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ProviderID;NamespaceID;Description;ServiceURL
Airport;cap.sflight;List of Airports;/cdi-airport
Airline;cap.sflight;List of Airlines;/cdi-airline
Flight;cap.sflight;List of Flights;/cdi-flight
FlightConnection;cap.sflight;List of FlightConnections;/cdi-flight-connection
Countries;cap.sflight;List of Countries;/cdi-countries
Currencies;cap.sflight;List of Currencies;/cdi-currencies
32 changes: 32 additions & 0 deletions db/dps-integration.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace com.sap.dps;

entity Namespaces {
key NamespaceID : String;
Description : String;

Providers : Association to many Providers on Providers.Namespace = $self;
}

entity Providers {
key ProviderID : String;
key NamespaceID : String;
Description : String;
ServiceURL : String;

Namespace : Association to one Namespaces on Namespace.NamespaceID = NamespaceID;
Subscriptions : Association to many Subscriptions on Subscriptions.NamespaceID = NamespaceID
and Subscriptions.ProviderID = ProviderID;
}

entity Subscriptions {
key SubscriptionID : String;
key NamespaceID : String;
key ProviderID : String;
Filter : String;
Selection : String;
Description : String;
CurrentDeltaLink : String;
PreviousDeltaLink : String;
ExternalID : String;
EntitySetName : String;
}
256 changes: 129 additions & 127 deletions mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ modules:
path: gen/srv
requires:
- name: sflight-db
- name: sflight-uaa
# - name: sflight-uaa
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter, destinations)
properties:
Expand All @@ -39,73 +39,75 @@ modules:
buildpack: nodejs_buildpack
requires:
- name: sflight-db
- name: sflight-uaa
# - name: sflight-uaa
build-parameters:
ignore: ["node_modules/"]

# ------------------ APPLICATION CONTENT ---------------------
- name: sflight-appcontent
# ------------------------------------------------------------
type: com.sap.application.content
path: app
requires:
- name: sflight-destination-service
- name: sflight-html5-repo-host
parameters:
content-target: true
build-parameters:
build-result: resources
requires:
- name: sflight-app-travel-processor
artifacts:
- travel-processor.zip
target-path: resources/

# ------------- APPLICATION: TRAVEL PROCESSOR ----------------
- name: sflight-app-travel-processor
# ------------------------------------------------------------
type: html5
path: app/travel_processor
build-parameters:
build-result: dist
builder: custom
commands:
- npm install
- npm run build
supported-platforms: []

# ------------------ DESTINATION CONTENT ---------------------
- name: sflight-destinationcontent
# ------------------------------------------------------------
type: com.sap.application.content
build-parameters:
no-source: true
requires:
- name: sflight-uaa
parameters:
service-key:
name: sflight-uaa-key
- name: sflight-html5-repo-host
parameters:
service-key:
name: sflight-html5-repo-host-key
- name: sflight-destination-service
parameters:
content-target: true
parameters:
content:
instance:
existing_destinations_policy: update
destinations:
- Name: sflight-html5-repository
ServiceInstanceName: sflight-html5-repo-host
ServiceKeyName: sflight-html5-repo-host-key
sap.cloud.service: sap.fe.cap.sflight
- Name: sflight-uaa
Authentication: OAuth2UserTokenExchange
ServiceInstanceName: sflight-uaa
ServiceKeyName: sflight-uaa-key
sap.cloud.service: sap.fe.cap.sflight
# # ------------------ APPLICATION CONTENT ---------------------
# - name: sflight-appcontent
# # ------------------------------------------------------------
# type: com.sap.application.content
# path: app
# requires:
# - name: sflight-destination-service
# - name: sflight-html5-repo-host
# parameters:
# content-target: true
# build-parameters:
# build-result: resources
# requires:
# - name: sflight-app-travel-processor
# artifacts:
# - travel-processor.zip
# target-path: resources/
#
# # ------------- APPLICATION: TRAVEL PROCESSOR ----------------
# - name: sflight-app-travel-processor
# # ------------------------------------------------------------
# type: html5
# path: app/travel_processor
# build-parameters:
# build-result: dist
# builder: custom
# commands:
# - npm install
# - npm run build
# supported-platforms: []
#
# # ------------------ DESTINATION CONTENT ---------------------
# - name: sflight-destinationcontent
# # ------------------------------------------------------------
# type: com.sap.application.content
# build-parameters:
# no-source: true
# requires:
# - name: sflight-uaa
# parameters:
# service-key:
# name: sflight-uaa-key
# - name: sflight-html5-repo-host
# parameters:
# service-key:
# name: sflight-html5-repo-host-key
# - name: sflight-destination-service
# parameters:
# content-target: true
# parameters:
# content:
# instance:
# existing_destinations_policy: update
# destinations:
# - Name: sflight-html5-repository
# ServiceInstanceName: sflight-html5-repo-host
# ServiceKeyName: sflight-html5-repo-host-key
# sap.cloud.service: sap.fe.cap.sflight
# - Name: sflight-uaa
# Authentication: OAuth2UserTokenExchange
# ServiceInstanceName: sflight-uaa
# ServiceKeyName: sflight-uaa-key
# sap.cloud.service: sap.fe.cap.sflight

resources:
# ------------------------------------------------------------
Expand All @@ -118,68 +120,68 @@ resources:
properties:
hdi-service-name: ${service-name}

# ------------------------------------------------------------
- name: sflight-uaa
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service: xsuaa
service-plan: application
path: ./app/travel_processor/xs-security.json
config:
xsappname: sflight-${space}
tenant-mode: dedicated
role-collections:
- name: 'sflight-reviewer-${space}'
description: Review travels
role-template-references:
- $XSAPPNAME.reviewer
- name: 'sflight-processor-${space}'
description: Process travels
role-template-references:
- $XSAPPNAME.processor
- name: 'sflight-admin-${space}'
description: Manage travels
role-template-references:
- $XSAPPNAME.admin

# ------------------------------------------------------------
- name: sflight-html5-repo-runtime
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-runtime

# ------------------------------------------------------------
- name: sflight-html5-repo-host
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-host

# ------------------------------------------------------------
- name: sflight-destination-service
# ------------------------------------------------------------
type: org.cloudfoundry.managed-service
requires:
- name: srv-api
parameters:
service: destination
service-plan: lite
config:
version: 1.0.0
HTML5Runtime_enabled: true
init_data:
instance:
existing_destinations_policy: update
destinations:
- Name: sflight-srv
URL: ~{srv-api/srv-url}
Authentication: NoAuthentication
Type: HTTP
ProxyType: Internet
HTML5.ForwardAuthToken: true
HTML5.DynamicDestination: true
# # ------------------------------------------------------------
# - name: sflight-uaa
# # ------------------------------------------------------------
# type: org.cloudfoundry.managed-service
# parameters:
# service: xsuaa
# service-plan: application
# path: ./app/travel_processor/xs-security.json
# config:
# xsappname: sflight-${space}
# tenant-mode: dedicated
# role-collections:
# - name: 'sflight-reviewer-${space}'
# description: Review travels
# role-template-references:
# - $XSAPPNAME.reviewer
# - name: 'sflight-processor-${space}'
# description: Process travels
# role-template-references:
# - $XSAPPNAME.processor
# - name: 'sflight-admin-${space}'
# description: Manage travels
# role-template-references:
# - $XSAPPNAME.admin
#
# # ------------------------------------------------------------
# - name: sflight-html5-repo-runtime
# # ------------------------------------------------------------
# type: org.cloudfoundry.managed-service
# parameters:
# service: html5-apps-repo
# service-plan: app-runtime
#
# # ------------------------------------------------------------
# - name: sflight-html5-repo-host
# # ------------------------------------------------------------
# type: org.cloudfoundry.managed-service
# parameters:
# service: html5-apps-repo
# service-plan: app-host
#
# # ------------------------------------------------------------
# - name: sflight-destination-service
# # ------------------------------------------------------------
# type: org.cloudfoundry.managed-service
# requires:
# - name: srv-api
# parameters:
# service: destination
# service-plan: lite
# config:
# version: 1.0.0
# HTML5Runtime_enabled: true
# init_data:
# instance:
# existing_destinations_policy: update
# destinations:
# - Name: sflight-srv
# URL: ~{srv-api/srv-url}
# Authentication: NoAuthentication
# Type: HTTP
# ProxyType: Internet
# HTML5.ForwardAuthToken: true
# HTML5.DynamicDestination: true

Loading