@salesforce/lds-adapters-industries-sustainability-reference-data 1.213.0 → 1.213.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, deepFreeze, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -41,6 +41,24 @@ function untrustedIsObject(untrusted) {
|
|
|
41
41
|
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
42
|
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
43
|
}
|
|
44
|
+
function generateParamConfigMetadata(name, required, coerceFn) {
|
|
45
|
+
return {
|
|
46
|
+
name,
|
|
47
|
+
required,
|
|
48
|
+
coerceFn,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
52
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
53
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
54
|
+
return {
|
|
55
|
+
displayName,
|
|
56
|
+
parameters: {
|
|
57
|
+
required,
|
|
58
|
+
optional,
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
44
62
|
const keyPrefix = 'sustainability-reference-data';
|
|
45
63
|
|
|
46
64
|
const { isArray: ArrayIsArray } = Array;
|
|
@@ -106,26 +124,8 @@ const ingest = function SCReferenceDataOutputRepresentationIngest(input, path, l
|
|
|
106
124
|
}
|
|
107
125
|
}
|
|
108
126
|
const key = keyBuilderFromType(luvio, input);
|
|
109
|
-
const existingRecord = store.readEntry(key);
|
|
110
127
|
const ttlToUse = TTL;
|
|
111
|
-
|
|
112
|
-
fullPath: key,
|
|
113
|
-
parent: path.parent,
|
|
114
|
-
propertyName: path.propertyName,
|
|
115
|
-
ttl: ttlToUse
|
|
116
|
-
});
|
|
117
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
118
|
-
luvio.storePublish(key, incomingRecord);
|
|
119
|
-
}
|
|
120
|
-
{
|
|
121
|
-
const storeMetadataParams = {
|
|
122
|
-
ttl: ttlToUse,
|
|
123
|
-
namespace: "sustainability-reference-data",
|
|
124
|
-
version: VERSION,
|
|
125
|
-
representationName: RepresentationType,
|
|
126
|
-
};
|
|
127
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
128
|
-
}
|
|
128
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "sustainability-reference-data", VERSION, RepresentationType, equals);
|
|
129
129
|
return createLink(key);
|
|
130
130
|
};
|
|
131
131
|
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -175,13 +175,12 @@ function createResourceRequest(config) {
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
};
|
|
178
|
+
const adapterName = 'uploadReferenceData';
|
|
179
|
+
const uploadReferenceData_ConfigPropertyMetadata = [
|
|
180
|
+
generateParamConfigMetadata('category', true),
|
|
181
|
+
generateParamConfigMetadata('recordTypeId', false),
|
|
182
|
+
];
|
|
183
|
+
const uploadReferenceData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, uploadReferenceData_ConfigPropertyMetadata);
|
|
185
184
|
function createResourceParams(config) {
|
|
186
185
|
const resourceParams = {
|
|
187
186
|
urlParams: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot } from '@luvio/engine';
|
|
1
|
+
import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot, AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata } from '@luvio/engine';
|
|
2
2
|
export declare const ObjectPrototypeHasOwnProperty: (v: PropertyKey) => boolean;
|
|
3
3
|
declare const ObjectKeys: {
|
|
4
4
|
(o: object): string[];
|
|
@@ -57,4 +57,6 @@ export declare const snapshotRefreshOptions: {
|
|
|
57
57
|
export declare function stableJSONStringify(node: any): string | undefined;
|
|
58
58
|
export declare function getFetchResponseStatusText(status: number): string;
|
|
59
59
|
export declare function isUnfulfilledSnapshot<T, U>(snapshot: $64$luvio_engine_Snapshot<T, U>): snapshot is $64$luvio_engine_UnfulfilledSnapshot<T, U>;
|
|
60
|
+
export declare function generateParamConfigMetadata(name: string, required: boolean, coerceFn?: (v: unknown) => unknown): $64$luvio_engine_AdapterConfigMetadata;
|
|
61
|
+
export declare function buildAdapterValidationConfig(displayName: string, paramsMeta: $64$luvio_engine_AdapterConfigMetadata[]): AdapterValidationConfig;
|
|
60
62
|
export declare const keyPrefix = "sustainability-reference-data";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
|
|
2
|
+
import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
|
|
2
3
|
import { ResourceRequestConfig as resources_postConnectSustainabilityReferenceDataUploadByCategory_ResourceRequestConfig } from '../resources/postConnectSustainabilityReferenceDataUploadByCategory';
|
|
3
|
-
import { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
|
|
4
4
|
import { SCReferenceDataOutputRepresentation as types_SCReferenceDataOutputRepresentation_SCReferenceDataOutputRepresentation } from '../types/SCReferenceDataOutputRepresentation';
|
|
5
5
|
export declare const adapterName = "uploadReferenceData";
|
|
6
|
+
export declare const uploadReferenceData_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
|
|
6
7
|
export declare const uploadReferenceData_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
|
|
7
8
|
export interface UploadReferenceDataConfig {
|
|
8
9
|
category: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-adapters-industries-sustainability-reference-data",
|
|
3
|
-
"version": "1.213.
|
|
3
|
+
"version": "1.213.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "Sustainability Reference Data",
|
|
6
6
|
"main": "dist/es/es2018/industries-sustainability-reference-data.js",
|
package/sfdc/index.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
/* proxy-compat-disable */
|
|
15
15
|
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
16
|
-
import { serializeStructuredKey, deepFreeze, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
|
|
16
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
|
|
17
17
|
|
|
18
18
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
19
19
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -50,6 +50,24 @@ function untrustedIsObject(untrusted) {
|
|
|
50
50
|
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
51
51
|
return configPropertyNames.parameters.required.every(req => req in config);
|
|
52
52
|
}
|
|
53
|
+
function generateParamConfigMetadata(name, required, coerceFn) {
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
required,
|
|
57
|
+
coerceFn,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
61
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
62
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
63
|
+
return {
|
|
64
|
+
displayName,
|
|
65
|
+
parameters: {
|
|
66
|
+
required,
|
|
67
|
+
optional,
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
53
71
|
const keyPrefix = 'sustainability-reference-data';
|
|
54
72
|
|
|
55
73
|
const { isArray: ArrayIsArray } = Array;
|
|
@@ -115,26 +133,8 @@ const ingest = function SCReferenceDataOutputRepresentationIngest(input, path, l
|
|
|
115
133
|
}
|
|
116
134
|
}
|
|
117
135
|
const key = keyBuilderFromType(luvio, input);
|
|
118
|
-
const existingRecord = store.readEntry(key);
|
|
119
136
|
const ttlToUse = TTL;
|
|
120
|
-
|
|
121
|
-
fullPath: key,
|
|
122
|
-
parent: path.parent,
|
|
123
|
-
propertyName: path.propertyName,
|
|
124
|
-
ttl: ttlToUse
|
|
125
|
-
});
|
|
126
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
127
|
-
luvio.storePublish(key, incomingRecord);
|
|
128
|
-
}
|
|
129
|
-
{
|
|
130
|
-
const storeMetadataParams = {
|
|
131
|
-
ttl: ttlToUse,
|
|
132
|
-
namespace: "sustainability-reference-data",
|
|
133
|
-
version: VERSION,
|
|
134
|
-
representationName: RepresentationType,
|
|
135
|
-
};
|
|
136
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
137
|
-
}
|
|
137
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "sustainability-reference-data", VERSION, RepresentationType, equals);
|
|
138
138
|
return createLink(key);
|
|
139
139
|
};
|
|
140
140
|
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -184,13 +184,12 @@ function createResourceRequest(config) {
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
};
|
|
187
|
+
const adapterName = 'uploadReferenceData';
|
|
188
|
+
const uploadReferenceData_ConfigPropertyMetadata = [
|
|
189
|
+
generateParamConfigMetadata('category', true),
|
|
190
|
+
generateParamConfigMetadata('recordTypeId', false),
|
|
191
|
+
];
|
|
192
|
+
const uploadReferenceData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, uploadReferenceData_ConfigPropertyMetadata);
|
|
194
193
|
function createResourceParams(config) {
|
|
195
194
|
const resourceParams = {
|
|
196
195
|
urlParams: {
|
|
@@ -270,4 +269,4 @@ withDefaultLuvio((luvio) => {
|
|
|
270
269
|
});
|
|
271
270
|
|
|
272
271
|
export { uploadReferenceData };
|
|
273
|
-
// version: 1.213.
|
|
272
|
+
// version: 1.213.1-79de10fe1
|