@sitecore/byoc
Advanced tools
Comparing version 0.2.9-alpha.2 to 0.2.9
@@ -5,3 +5,3 @@ { | ||
"description": "Bring-Your-Own-Components runtime to register and retrieve react components", | ||
"version": "0.2.9-alpha.2", | ||
"version": "0.2.9", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -211,3 +211,6 @@ # Sitecore BYOC components | ||
// Promise overrides data fetching logic, original request is not made | ||
const dataResolverPromise: DataResolver = | ||
const dataResolverPromise: DataResolver = (settings) => | ||
Promise.resolve({ | ||
hello: 'world' | ||
}) | ||
``` | ||
@@ -223,21 +226,15 @@ | ||
// Register datasource to be displayed in the UI | ||
registerDatasource( | ||
() => | ||
Promise.resolve({ | ||
hello: 'world' | ||
}), | ||
{ | ||
id: 'datasource-id', | ||
name: 'Datasource based on schema', | ||
mode: 'register', | ||
title: 'title', | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
name: { type: 'string', description: 'First and Last name' }, | ||
age: { type: 'number' } | ||
} | ||
registerDatasource(dataResolver, { | ||
id: 'datasource-id', | ||
name: 'Datasource based on schema', | ||
mode: 'register', | ||
title: 'title', | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
name: { type: 'string', description: 'First and Last name' }, | ||
age: { type: 'number' } | ||
} | ||
} | ||
) | ||
}) | ||
``` | ||
@@ -253,12 +250,10 @@ | ||
// Intercept datasource requests by its id to add Authorization header | ||
registerDatasource( | ||
() => ({ | ||
...settings, | ||
header: { | ||
...settings.header, | ||
Authorization: 'Bearer token' | ||
} | ||
}), | ||
{ id: 'existing-datasource-id' } | ||
) | ||
registerDatasource(() => ({ | ||
...settings, | ||
header: { | ||
...settings.header, | ||
Authorization: 'Bearer token' | ||
} | ||
}), { id: 'existing-datasource-id' }) | ||
``` | ||
@@ -265,0 +260,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
467774
63
2712
305