1.1.3 • Published 1 year ago

flexso-sfsf-config v1.1.3

Weekly downloads
2
License
ISC
Repository
github
Last release
1 year 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

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.12

3 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago

0.0.2

4 years ago

0.0.1

5 years ago

0.0.0

5 years ago