1.1.3 • Published 15 days ago

flexso-sfsf-config v1.1.3

Weekly downloads
2
License
ISC
Repository
github
Last release
15 days ago

NodeJS Library to read the configuration for a Successfactors extension build by SAP.

installation

npm install flexso-sfsf-config

Use the library

  import FlexsoSFSFConfig from "flexso-sfsf-config";
  const sfsfconfig = new FlexsoSfSFConfig ("DESTINATION_NAME", "APP_NAME", async (config) => {
	    // deze functie  wordt na elke read van niet gecachte config gedaan.
	    // als er iets mis is met het config object raisen we een error.
	    // vb PROPERTY1 bestaat niet
	    if(!config.values.PROPERTY1) {
		    throw({
			    code: "500"
			    error: "PROPERTY1 is not configured"
		    })
		}

		// de return waarde is terug het config object, dat laat ons toe om ook default waarden te zetten per app
		// is de return waarde null, dan wordt het config object van de input parameter gerbruikt
		if( !config.values.PROPERTY2 ) {
			config.PROPERT2 = "VALUE_PROPERTY_2";
		}
		return config;
	});

// Voorbeeld van gebruilk:
app.get("/Matrix", async (req, res) => {
	const tenantName = req.authInfo ? req.authInfo.subdomain : "";
	// read all geeft de huidige configuratievalues terug van alle properties voor de huidige app.
	const config = sfsfconfig.readAll( tenantName );
	/*
		config = {
			values: {
				PROPERTY1: "VALUE_PROPERTY_1",
				PROPERTY2: "VALUE_PROPERTY_2",
				…
			},
			objects: {
				PROPERTY3: [SFSFConfigurationItemChild, SFSFConfigurationItemChild],
				PROPERTY4: [SFSFConfigurationItemChild],
				…
			}
		}
	*/

}) ;
  
1.1.3

15 days ago

1.1.2

15 days ago

1.1.1

21 days ago

1.1.0

22 days ago

1.0.25

5 months ago

1.0.24

5 months ago

1.0.23

5 months ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.12

2 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago

0.0.2

3 years ago

0.0.1

4 years ago

0.0.0

4 years ago