@salesforce/lds-adapters-cdp-data-transform-experience 0.1.0-dev1
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.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/cdp-data-transform-experience.js +317 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getDataTransformsExperienceConfiguration.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotDataTransformsExperienceConfigurations.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/types/DataTransformExperienceAppSettingsRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/DataTransformExperienceConfigurationRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +354 -0
- package/src/raml/api.raml +78 -0
- package/src/raml/luvio.raml +20 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Terms of Use
|
|
2
|
+
|
|
3
|
+
Copyright 2022 Salesforce, Inc. All rights reserved.
|
|
4
|
+
|
|
5
|
+
These Terms of Use govern the download, installation, and/or use of this
|
|
6
|
+
software provided by Salesforce, Inc. ("Salesforce") (the "Software"), were
|
|
7
|
+
last updated on April 15, 2022, and constitute a legally binding
|
|
8
|
+
agreement between you and Salesforce. If you do not agree to these Terms of
|
|
9
|
+
Use, do not install or use the Software.
|
|
10
|
+
|
|
11
|
+
Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free
|
|
12
|
+
copyright license to reproduce, prepare derivative works of, publicly
|
|
13
|
+
display, publicly perform, sublicense, and distribute the Software and
|
|
14
|
+
derivative works subject to these Terms. These Terms shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
Subject to the limited rights expressly granted hereunder, Salesforce
|
|
18
|
+
reserves all rights, title, and interest in and to all intellectual
|
|
19
|
+
property subsisting in the Software. No rights are granted to you hereunder
|
|
20
|
+
other than as expressly set forth herein. Users residing in countries on
|
|
21
|
+
the United States Office of Foreign Assets Control sanction list, or which
|
|
22
|
+
are otherwise subject to a US export embargo, may not use the Software.
|
|
23
|
+
|
|
24
|
+
Implementation of the Software may require development work, for which you
|
|
25
|
+
are responsible. The Software may contain bugs, errors and
|
|
26
|
+
incompatibilities and is made available on an AS IS basis without support,
|
|
27
|
+
updates, or service level commitments.
|
|
28
|
+
|
|
29
|
+
Salesforce reserves the right at any time to modify, suspend, or
|
|
30
|
+
discontinue, the Software (or any part thereof) with or without notice. You
|
|
31
|
+
agree that Salesforce shall not be liable to you or to any third party for
|
|
32
|
+
any modification, suspension, or discontinuance.
|
|
33
|
+
|
|
34
|
+
You agree to defend Salesforce against any claim, demand, suit or
|
|
35
|
+
proceeding made or brought against Salesforce by a third party arising out
|
|
36
|
+
of or accruing from (a) your use of the Software, and (b) any application
|
|
37
|
+
you develop with the Software that infringes any copyright, trademark,
|
|
38
|
+
trade secret, trade dress, patent, or other intellectual property right of
|
|
39
|
+
any person or defames any person or violates their rights of publicity or
|
|
40
|
+
privacy (each a "Claim Against Salesforce"), and will indemnify Salesforce
|
|
41
|
+
from any damages, attorney fees, and costs finally awarded against
|
|
42
|
+
Salesforce as a result of, or for any amounts paid by Salesforce under a
|
|
43
|
+
settlement approved by you in writing of, a Claim Against Salesforce,
|
|
44
|
+
provided Salesforce (x) promptly gives you written notice of the Claim
|
|
45
|
+
Against Salesforce, (y) gives you sole control of the defense and
|
|
46
|
+
settlement of the Claim Against Salesforce (except that you may not settle
|
|
47
|
+
any Claim Against Salesforce unless it unconditionally releases Salesforce
|
|
48
|
+
of all liability), and (z) gives you all reasonable assistance, at your
|
|
49
|
+
expense.
|
|
50
|
+
|
|
51
|
+
WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT
|
|
52
|
+
SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
53
|
+
IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES,
|
|
54
|
+
INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
|
|
55
|
+
PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA,
|
|
56
|
+
OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN
|
|
57
|
+
CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU
|
|
58
|
+
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
59
|
+
|
|
60
|
+
These Terms of Use shall be governed exclusively by the internal laws of
|
|
61
|
+
the State of California, without regard to its conflicts of laws
|
|
62
|
+
rules. Each party hereby consents to the exclusive jurisdiction of the
|
|
63
|
+
state and federal courts located in San Francisco County, California to
|
|
64
|
+
adjudicate any dispute arising out of or relating to these Terms of Use and
|
|
65
|
+
the download, installation, and/or use of the Software. Except as expressly
|
|
66
|
+
stated herein, these Terms of Use constitute the entire agreement between
|
|
67
|
+
the parties, and supersede all prior and contemporaneous agreements,
|
|
68
|
+
proposals, or representations, written or oral, concerning their subject
|
|
69
|
+
matter. No modification, amendment, or waiver of any provision of these
|
|
70
|
+
Terms of Use shall be effective unless it is by an update to these Terms of
|
|
71
|
+
Use that Salesforce makes available, or is in writing and signed by the
|
|
72
|
+
party against whom the modification, amendment, or waiver is to be
|
|
73
|
+
asserted.
|
|
74
|
+
|
|
75
|
+
Data Privacy: Salesforce may collect, process, and store device,
|
|
76
|
+
system, and other information related to your use of the Software. This
|
|
77
|
+
information includes, but is not limited to, IP address, user metrics, and
|
|
78
|
+
other data ("Usage Data"). Salesforce may use Usage Data for analytics,
|
|
79
|
+
product development, and marketing purposes. You acknowledge that files
|
|
80
|
+
generated in conjunction with the Software may contain sensitive or
|
|
81
|
+
confidential data, and you are solely responsible for anonymizing and
|
|
82
|
+
protecting such data.
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
|
|
8
|
+
|
|
9
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
11
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
12
|
+
/**
|
|
13
|
+
* Validates an adapter config is well-formed.
|
|
14
|
+
* @param config The config to validate.
|
|
15
|
+
* @param adapter The adapter validation configuration.
|
|
16
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
17
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
18
|
+
*/
|
|
19
|
+
function validateConfig(config, adapter, oneOf) {
|
|
20
|
+
const { displayName } = adapter;
|
|
21
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
22
|
+
if (config === undefined ||
|
|
23
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
24
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
27
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
if (unsupported !== undefined &&
|
|
30
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
31
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
const supported = required.concat(optional);
|
|
34
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function untrustedIsObject(untrusted) {
|
|
39
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
40
|
+
}
|
|
41
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
|
+
}
|
|
44
|
+
const snapshotRefreshOptions = {
|
|
45
|
+
overrides: {
|
|
46
|
+
headers: {
|
|
47
|
+
'Cache-Control': 'no-cache',
|
|
48
|
+
},
|
|
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
|
+
}
|
|
62
|
+
const keyPrefix = 'cdp-data-transform-experience';
|
|
63
|
+
|
|
64
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
65
|
+
const { isArray: ArrayIsArray } = Array;
|
|
66
|
+
const { stringify: JSONStringify } = JSON;
|
|
67
|
+
function createLink(ref) {
|
|
68
|
+
return {
|
|
69
|
+
__ref: serializeStructuredKey(ref),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function validate$1(obj, path = 'DataTransformExperienceAppSettingsRepresentation') {
|
|
74
|
+
const v_error = (() => {
|
|
75
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
76
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
77
|
+
}
|
|
78
|
+
const obj_formattersLocale = obj.formattersLocale;
|
|
79
|
+
const path_formattersLocale = path + '.formattersLocale';
|
|
80
|
+
if (typeof obj_formattersLocale !== 'string') {
|
|
81
|
+
return new TypeError('Expected "string" but received "' + typeof obj_formattersLocale + '" (at "' + path_formattersLocale + '")');
|
|
82
|
+
}
|
|
83
|
+
const obj_isFileRecoveryEnabled = obj.isFileRecoveryEnabled;
|
|
84
|
+
const path_isFileRecoveryEnabled = path + '.isFileRecoveryEnabled';
|
|
85
|
+
if (typeof obj_isFileRecoveryEnabled !== 'boolean') {
|
|
86
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isFileRecoveryEnabled + '" (at "' + path_isFileRecoveryEnabled + '")');
|
|
87
|
+
}
|
|
88
|
+
const obj_isRecommendationsEnabled = obj.isRecommendationsEnabled;
|
|
89
|
+
const path_isRecommendationsEnabled = path + '.isRecommendationsEnabled';
|
|
90
|
+
if (typeof obj_isRecommendationsEnabled !== 'boolean') {
|
|
91
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRecommendationsEnabled + '" (at "' + path_isRecommendationsEnabled + '")');
|
|
92
|
+
}
|
|
93
|
+
const obj_isTelemetryEnabled = obj.isTelemetryEnabled;
|
|
94
|
+
const path_isTelemetryEnabled = path + '.isTelemetryEnabled';
|
|
95
|
+
if (typeof obj_isTelemetryEnabled !== 'boolean') {
|
|
96
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isTelemetryEnabled + '" (at "' + path_isTelemetryEnabled + '")');
|
|
97
|
+
}
|
|
98
|
+
const obj_maxConcurrentSessionPerUser = obj.maxConcurrentSessionPerUser;
|
|
99
|
+
const path_maxConcurrentSessionPerUser = path + '.maxConcurrentSessionPerUser';
|
|
100
|
+
if (typeof obj_maxConcurrentSessionPerUser !== 'number') {
|
|
101
|
+
return new TypeError('Expected "number" but received "' + typeof obj_maxConcurrentSessionPerUser + '" (at "' + path_maxConcurrentSessionPerUser + '")');
|
|
102
|
+
}
|
|
103
|
+
const obj_samplingMaxRowLimit = obj.samplingMaxRowLimit;
|
|
104
|
+
const path_samplingMaxRowLimit = path + '.samplingMaxRowLimit';
|
|
105
|
+
if (typeof obj_samplingMaxRowLimit !== 'number') {
|
|
106
|
+
return new TypeError('Expected "number" but received "' + typeof obj_samplingMaxRowLimit + '" (at "' + path_samplingMaxRowLimit + '")');
|
|
107
|
+
}
|
|
108
|
+
const obj_textLocale = obj.textLocale;
|
|
109
|
+
const path_textLocale = path + '.textLocale';
|
|
110
|
+
if (typeof obj_textLocale !== 'string') {
|
|
111
|
+
return new TypeError('Expected "string" but received "' + typeof obj_textLocale + '" (at "' + path_textLocale + '")');
|
|
112
|
+
}
|
|
113
|
+
})();
|
|
114
|
+
return v_error === undefined ? null : v_error;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const VERSION = "bf126a11521eabfe4b45a2bcfa7f91a4";
|
|
118
|
+
function validate(obj, path = 'DataTransformExperienceConfigurationRepresentation') {
|
|
119
|
+
const v_error = (() => {
|
|
120
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
121
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
122
|
+
}
|
|
123
|
+
const obj_appSettings = obj.appSettings;
|
|
124
|
+
const path_appSettings = path + '.appSettings';
|
|
125
|
+
const referencepath_appSettingsValidationError = validate$1(obj_appSettings, path_appSettings);
|
|
126
|
+
if (referencepath_appSettingsValidationError !== null) {
|
|
127
|
+
let message = 'Object doesn\'t match DataTransformExperienceAppSettingsRepresentation (at "' + path_appSettings + '")\n';
|
|
128
|
+
message += referencepath_appSettingsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
129
|
+
return new TypeError(message);
|
|
130
|
+
}
|
|
131
|
+
const obj_featureFlags = obj.featureFlags;
|
|
132
|
+
const path_featureFlags = path + '.featureFlags';
|
|
133
|
+
if (typeof obj_featureFlags !== 'object' || ArrayIsArray(obj_featureFlags) || obj_featureFlags === null) {
|
|
134
|
+
return new TypeError('Expected "object" but received "' + typeof obj_featureFlags + '" (at "' + path_featureFlags + '")');
|
|
135
|
+
}
|
|
136
|
+
const obj_featureFlags_keys = ObjectKeys(obj_featureFlags);
|
|
137
|
+
for (let i = 0; i < obj_featureFlags_keys.length; i++) {
|
|
138
|
+
const key = obj_featureFlags_keys[i];
|
|
139
|
+
const obj_featureFlags_prop = obj_featureFlags[key];
|
|
140
|
+
const path_featureFlags_prop = path_featureFlags + '["' + key + '"]';
|
|
141
|
+
if (typeof obj_featureFlags_prop !== 'boolean') {
|
|
142
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_featureFlags_prop + '" (at "' + path_featureFlags_prop + '")');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
})();
|
|
146
|
+
return v_error === undefined ? null : v_error;
|
|
147
|
+
}
|
|
148
|
+
const RepresentationType = 'DataTransformExperienceConfigurationRepresentation';
|
|
149
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
150
|
+
return input;
|
|
151
|
+
}
|
|
152
|
+
const select$1 = function DataTransformExperienceConfigurationRepresentationSelect() {
|
|
153
|
+
return {
|
|
154
|
+
kind: 'Fragment',
|
|
155
|
+
version: VERSION,
|
|
156
|
+
private: [],
|
|
157
|
+
opaque: true
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
function equals(existing, incoming) {
|
|
161
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
const ingest = function DataTransformExperienceConfigurationRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
167
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
168
|
+
const validateError = validate(input);
|
|
169
|
+
if (validateError !== null) {
|
|
170
|
+
throw validateError;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const key = path.fullPath;
|
|
174
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
|
|
175
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "cdp-data-transform-experience", VERSION, RepresentationType, equals);
|
|
176
|
+
return createLink(key);
|
|
177
|
+
};
|
|
178
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
179
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
180
|
+
const rootKey = fullPathFactory();
|
|
181
|
+
rootKeySet.set(rootKey, {
|
|
182
|
+
namespace: keyPrefix,
|
|
183
|
+
representationName: RepresentationType,
|
|
184
|
+
mergeable: false
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function select(luvio, params) {
|
|
189
|
+
return select$1();
|
|
190
|
+
}
|
|
191
|
+
function keyBuilder$1(luvio, params) {
|
|
192
|
+
return keyPrefix + '::DataTransformExperienceConfigurationRepresentation:(' + ')';
|
|
193
|
+
}
|
|
194
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
195
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1());
|
|
196
|
+
}
|
|
197
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
198
|
+
const { body } = response;
|
|
199
|
+
const key = keyBuilder$1();
|
|
200
|
+
luvio.storeIngest(key, ingest, body);
|
|
201
|
+
const snapshot = luvio.storeLookup({
|
|
202
|
+
recordId: key,
|
|
203
|
+
node: select(),
|
|
204
|
+
variables: {},
|
|
205
|
+
}, snapshotRefresh);
|
|
206
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
207
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
208
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
deepFreeze(snapshot.data);
|
|
212
|
+
return snapshot;
|
|
213
|
+
}
|
|
214
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
215
|
+
const key = keyBuilder$1();
|
|
216
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
217
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
218
|
+
return errorSnapshot;
|
|
219
|
+
}
|
|
220
|
+
function createResourceRequest(config) {
|
|
221
|
+
const headers = {};
|
|
222
|
+
return {
|
|
223
|
+
baseUri: '/services/data/v66.0',
|
|
224
|
+
basePath: '/ssot/data-transforms-experience/configurations',
|
|
225
|
+
method: 'get',
|
|
226
|
+
body: null,
|
|
227
|
+
urlParams: {},
|
|
228
|
+
queryParams: {},
|
|
229
|
+
headers,
|
|
230
|
+
priority: 'normal',
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const adapterName = 'getDataTransformsExperienceConfiguration';
|
|
235
|
+
const getDataTransformsExperienceConfiguration_ConfigPropertyMetadata = [];
|
|
236
|
+
const getDataTransformsExperienceConfiguration_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getDataTransformsExperienceConfiguration_ConfigPropertyMetadata);
|
|
237
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$1(getDataTransformsExperienceConfiguration_ConfigPropertyMetadata);
|
|
238
|
+
function keyBuilder(luvio, config) {
|
|
239
|
+
createResourceParams(config);
|
|
240
|
+
return keyBuilder$1();
|
|
241
|
+
}
|
|
242
|
+
function typeCheckConfig(untrustedConfig) {
|
|
243
|
+
const config = {};
|
|
244
|
+
return config;
|
|
245
|
+
}
|
|
246
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
247
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
251
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
252
|
+
}
|
|
253
|
+
const config = typeCheckConfig();
|
|
254
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
return config;
|
|
258
|
+
}
|
|
259
|
+
function adapterFragment(luvio, config) {
|
|
260
|
+
createResourceParams(config);
|
|
261
|
+
return select();
|
|
262
|
+
}
|
|
263
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
264
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
265
|
+
config,
|
|
266
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
267
|
+
});
|
|
268
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
269
|
+
}
|
|
270
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
271
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
272
|
+
config,
|
|
273
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
274
|
+
});
|
|
275
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
276
|
+
}
|
|
277
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
278
|
+
const resourceParams = createResourceParams(config);
|
|
279
|
+
const request = createResourceRequest();
|
|
280
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
281
|
+
.then((response) => {
|
|
282
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
283
|
+
const cache = new StoreKeyMap();
|
|
284
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
285
|
+
return cache;
|
|
286
|
+
});
|
|
287
|
+
}, (response) => {
|
|
288
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
292
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
293
|
+
}
|
|
294
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
295
|
+
const { luvio, config } = context;
|
|
296
|
+
const selector = {
|
|
297
|
+
recordId: keyBuilder(luvio, config),
|
|
298
|
+
node: adapterFragment(luvio, config),
|
|
299
|
+
variables: {},
|
|
300
|
+
};
|
|
301
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
302
|
+
config,
|
|
303
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
304
|
+
});
|
|
305
|
+
return cacheSnapshot;
|
|
306
|
+
}
|
|
307
|
+
const getDataTransformsExperienceConfigurationAdapterFactory = (luvio) => function cdpDataTransformExperience__getDataTransformsExperienceConfiguration(untrustedConfig, requestContext) {
|
|
308
|
+
const config = validateAdapterConfig(untrustedConfig, getDataTransformsExperienceConfiguration_ConfigPropertyNames);
|
|
309
|
+
// Invalid or incomplete config
|
|
310
|
+
if (config === null) {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
314
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export { getDataTransformsExperienceConfigurationAdapterFactory };
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
export declare const ObjectPrototypeHasOwnProperty: (v: PropertyKey) => boolean;
|
|
3
|
+
declare const ObjectKeys: {
|
|
4
|
+
(o: object): string[];
|
|
5
|
+
(o: {}): string[];
|
|
6
|
+
}, ObjectCreate: {
|
|
7
|
+
(o: object | null): any;
|
|
8
|
+
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
9
|
+
};
|
|
10
|
+
export { ObjectCreate, ObjectKeys };
|
|
11
|
+
export declare const ArrayIsArray: (arg: any) => arg is any[];
|
|
12
|
+
export declare const ArrayPrototypePush: (...items: any[]) => number;
|
|
13
|
+
export interface AdapterValidationConfig {
|
|
14
|
+
displayName: string;
|
|
15
|
+
parameters: {
|
|
16
|
+
required: string[];
|
|
17
|
+
optional: string[];
|
|
18
|
+
unsupported?: string[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validates an adapter config is well-formed.
|
|
23
|
+
* @param config The config to validate.
|
|
24
|
+
* @param adapter The adapter validation configuration.
|
|
25
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
26
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateConfig<T>(config: Untrusted<T>, adapter: AdapterValidationConfig, oneOf?: string[]): void;
|
|
29
|
+
export declare function untrustedIsObject<Base>(untrusted: unknown): untrusted is Untrusted<Base>;
|
|
30
|
+
export type UncoercedConfiguration<Base, Options extends {
|
|
31
|
+
[key in keyof Base]?: any;
|
|
32
|
+
}> = {
|
|
33
|
+
[Key in keyof Base]?: Base[Key] | Options[Key];
|
|
34
|
+
};
|
|
35
|
+
export type Untrusted<Base> = Partial<Base>;
|
|
36
|
+
export declare function areRequiredParametersPresent<T>(config: any, configPropertyNames: AdapterValidationConfig): config is T;
|
|
37
|
+
export declare function refreshable<C, D, R>(adapter: $64$luvio_engine_Adapter<C, D>, resolve: (config: unknown) => Promise<$64$luvio_engine_Snapshot<R>>): $64$luvio_engine_Adapter<C, D>;
|
|
38
|
+
export declare const SNAPSHOT_STATE_FULFILLED = "Fulfilled";
|
|
39
|
+
export declare const SNAPSHOT_STATE_UNFULFILLED = "Unfulfilled";
|
|
40
|
+
export declare const snapshotRefreshOptions: {
|
|
41
|
+
overrides: {
|
|
42
|
+
headers: {
|
|
43
|
+
'Cache-Control': string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* A deterministic JSON stringify implementation. Heavily adapted from https://github.com/epoberezkin/fast-json-stable-stringify.
|
|
49
|
+
* This is needed because insertion order for JSON.stringify(object) affects output:
|
|
50
|
+
* JSON.stringify({a: 1, b: 2})
|
|
51
|
+
* "{"a":1,"b":2}"
|
|
52
|
+
* JSON.stringify({b: 2, a: 1})
|
|
53
|
+
* "{"b":2,"a":1}"
|
|
54
|
+
* @param data Data to be JSON-stringified.
|
|
55
|
+
* @returns JSON.stringified value with consistent ordering of keys.
|
|
56
|
+
*/
|
|
57
|
+
export declare function stableJSONStringify(node: any): string | undefined;
|
|
58
|
+
export declare function getFetchResponseStatusText(status: number): string;
|
|
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, resourceType: $64$luvio_engine_AdapterConfigMetadata['resourceType'], typeCheckShape: $64$luvio_engine_AdapterConfigMetadata['typeCheckShape'], isArrayShape?: boolean, coerceFn?: (v: unknown) => unknown): $64$luvio_engine_AdapterConfigMetadata;
|
|
61
|
+
export declare function buildAdapterValidationConfig(displayName: string, paramsMeta: $64$luvio_engine_AdapterConfigMetadata[]): AdapterValidationConfig;
|
|
62
|
+
export declare const keyPrefix = "cdp-data-transform-experience";
|
package/dist/es/es2018/types/src/generated/adapters/getDataTransformsExperienceConfiguration.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, 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';
|
|
3
|
+
import { ResourceRequestConfig as resources_getSsotDataTransformsExperienceConfigurations_ResourceRequestConfig } from '../resources/getSsotDataTransformsExperienceConfigurations';
|
|
4
|
+
import { DataTransformExperienceConfigurationRepresentation as types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation } from '../types/DataTransformExperienceConfigurationRepresentation';
|
|
5
|
+
export declare const adapterName = "getDataTransformsExperienceConfiguration";
|
|
6
|
+
export declare const getDataTransformsExperienceConfiguration_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
|
|
7
|
+
export declare const getDataTransformsExperienceConfiguration_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
|
|
8
|
+
export interface GetDataTransformsExperienceConfigurationConfig {
|
|
9
|
+
}
|
|
10
|
+
export declare const createResourceParams: (config: GetDataTransformsExperienceConfigurationConfig) => resources_getSsotDataTransformsExperienceConfigurations_ResourceRequestConfig;
|
|
11
|
+
export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: GetDataTransformsExperienceConfigurationConfig): string;
|
|
12
|
+
export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: GetDataTransformsExperienceConfigurationConfig): $64$luvio_engine_NormalizedKeyMetadata;
|
|
13
|
+
export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<GetDataTransformsExperienceConfigurationConfig>): adapter$45$utils_Untrusted<GetDataTransformsExperienceConfigurationConfig>;
|
|
14
|
+
export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): GetDataTransformsExperienceConfigurationConfig | null;
|
|
15
|
+
export declare function adapterFragment(luvio: $64$luvio_engine_Luvio, config: GetDataTransformsExperienceConfigurationConfig): $64$luvio_engine_Fragment;
|
|
16
|
+
export declare function buildCachedSnapshot(luvio: $64$luvio_engine_Luvio, config: GetDataTransformsExperienceConfigurationConfig): $64$luvio_engine_Snapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, any>;
|
|
17
|
+
export declare function onFetchResponseSuccess(luvio: $64$luvio_engine_Luvio, config: GetDataTransformsExperienceConfigurationConfig, resourceParams: resources_getSsotDataTransformsExperienceConfigurations_ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation>): Promise<import("@luvio/engine").FulfilledSnapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, any>>;
|
|
18
|
+
export declare function onFetchResponseError(luvio: $64$luvio_engine_Luvio, config: GetDataTransformsExperienceConfigurationConfig, resourceParams: resources_getSsotDataTransformsExperienceConfigurations_ResourceRequestConfig, response: $64$luvio_engine_ErrorResponse): Promise<import("@luvio/engine").ErrorSnapshot>;
|
|
19
|
+
export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: GetDataTransformsExperienceConfigurationConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<$64$luvio_engine_Snapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, any>>;
|
|
20
|
+
export type BuildSnapshotContext = {
|
|
21
|
+
luvio: $64$luvio_engine_Luvio;
|
|
22
|
+
config: GetDataTransformsExperienceConfigurationConfig;
|
|
23
|
+
};
|
|
24
|
+
export declare function buildNetworkSnapshotCachePolicy(context: BuildSnapshotContext, coercedAdapterRequestContext: $64$luvio_engine_CoercedAdapterRequestContext): Promise<$64$luvio_engine_Snapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, any>>;
|
|
25
|
+
export declare function buildCachedSnapshotCachePolicy(context: BuildSnapshotContext, storeLookup: $64$luvio_engine_StoreLookup<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation>): $64$luvio_engine_Snapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, any>;
|
|
26
|
+
export declare const getDataTransformsExperienceConfigurationAdapterFactory: $64$luvio_engine_AdapterFactory<GetDataTransformsExperienceConfigurationConfig, types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDataTransformsExperienceConfigurationAdapterFactory } from '../adapters/getDataTransformsExperienceConfiguration';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, FetchResponse as $64$luvio_engine_FetchResponse, SnapshotRefresh as $64$luvio_engine_SnapshotRefresh, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ErrorResponse as $64$luvio_engine_ErrorResponse, ErrorSnapshot as $64$luvio_engine_ErrorSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
|
|
2
|
+
import { DataTransformExperienceConfigurationRepresentation as types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation } from '../types/DataTransformExperienceConfigurationRepresentation';
|
|
3
|
+
export interface ResourceRequestConfig {
|
|
4
|
+
}
|
|
5
|
+
export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
|
|
6
|
+
export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): string;
|
|
7
|
+
export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_NormalizedKeyMetadata;
|
|
8
|
+
export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation): void;
|
|
9
|
+
export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation>, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation, any>;
|
|
10
|
+
export declare function ingestError(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig, error: $64$luvio_engine_ErrorResponse, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_DataTransformExperienceConfigurationRepresentation_DataTransformExperienceConfigurationRepresentation>): $64$luvio_engine_ErrorSnapshot;
|
|
11
|
+
export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
|
|
12
|
+
export default createResourceRequest;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, BaseFragment as $64$luvio_engine_BaseFragment, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const VERSION = "ecb2d34d045debe3aecab9ff60551f17";
|
|
3
|
+
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
4
|
+
export declare const RepresentationType: string;
|
|
5
|
+
export declare function normalize(input: DataTransformExperienceAppSettingsRepresentation, existing: DataTransformExperienceAppSettingsRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): DataTransformExperienceAppSettingsRepresentationNormalized;
|
|
6
|
+
export declare const select: () => $64$luvio_engine_BaseFragment;
|
|
7
|
+
export declare function equals(existing: DataTransformExperienceAppSettingsRepresentationNormalized, incoming: DataTransformExperienceAppSettingsRepresentationNormalized): boolean;
|
|
8
|
+
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
9
|
+
export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: DataTransformExperienceAppSettingsRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
10
|
+
/**
|
|
11
|
+
* User App settings for Data Transform Experience
|
|
12
|
+
*
|
|
13
|
+
* Keys:
|
|
14
|
+
* (none)
|
|
15
|
+
*/
|
|
16
|
+
export interface DataTransformExperienceAppSettingsRepresentationNormalized {
|
|
17
|
+
/** Locale for formatters */
|
|
18
|
+
formattersLocale: string;
|
|
19
|
+
/** Field mappings */
|
|
20
|
+
isFileRecoveryEnabled: boolean;
|
|
21
|
+
/** Whether to show recommendations to user */
|
|
22
|
+
isRecommendationsEnabled: boolean;
|
|
23
|
+
/** Whether telemetry is enabled */
|
|
24
|
+
isTelemetryEnabled: boolean;
|
|
25
|
+
/** Maximum number of concurrent sessions that the user can have */
|
|
26
|
+
maxConcurrentSessionPerUser: number;
|
|
27
|
+
/** Maximum number of rows that can be sampled */
|
|
28
|
+
samplingMaxRowLimit: number;
|
|
29
|
+
/** Locale for text */
|
|
30
|
+
textLocale: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* User App settings for Data Transform Experience
|
|
34
|
+
*
|
|
35
|
+
* Keys:
|
|
36
|
+
* (none)
|
|
37
|
+
*/
|
|
38
|
+
export interface DataTransformExperienceAppSettingsRepresentation {
|
|
39
|
+
formattersLocale: string;
|
|
40
|
+
isFileRecoveryEnabled: boolean;
|
|
41
|
+
isRecommendationsEnabled: boolean;
|
|
42
|
+
isTelemetryEnabled: boolean;
|
|
43
|
+
maxConcurrentSessionPerUser: number;
|
|
44
|
+
samplingMaxRowLimit: number;
|
|
45
|
+
textLocale: string;
|
|
46
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DataTransformExperienceAppSettingsRepresentation as DataTransformExperienceAppSettingsRepresentation_DataTransformExperienceAppSettingsRepresentation } from './DataTransformExperienceAppSettingsRepresentation';
|
|
2
|
+
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, BaseFragment as $64$luvio_engine_BaseFragment, ResourceIngest as $64$luvio_engine_ResourceIngest, StoreLink as $64$luvio_engine_StoreLink, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
3
|
+
export declare const VERSION = "bf126a11521eabfe4b45a2bcfa7f91a4";
|
|
4
|
+
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
5
|
+
export declare const RepresentationType: string;
|
|
6
|
+
export declare function normalize(input: DataTransformExperienceConfigurationRepresentation, existing: DataTransformExperienceConfigurationRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): DataTransformExperienceConfigurationRepresentationNormalized;
|
|
7
|
+
export declare const select: () => $64$luvio_engine_BaseFragment;
|
|
8
|
+
export declare function equals(existing: DataTransformExperienceConfigurationRepresentationNormalized, incoming: DataTransformExperienceConfigurationRepresentationNormalized): boolean;
|
|
9
|
+
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
|
+
export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: DataTransformExperienceConfigurationRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
11
|
+
/**
|
|
12
|
+
* Data Transform Experience configuration
|
|
13
|
+
*
|
|
14
|
+
* Keys:
|
|
15
|
+
* (none)
|
|
16
|
+
*/
|
|
17
|
+
export interface DataTransformExperienceConfigurationRepresentationNormalized {
|
|
18
|
+
/** User app settings */
|
|
19
|
+
appSettings: $64$luvio_engine_StoreLink;
|
|
20
|
+
/** The feature flags for Data Transforms editing UI */
|
|
21
|
+
featureFlags: {
|
|
22
|
+
[key: string]: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Data Transform Experience configuration
|
|
27
|
+
*
|
|
28
|
+
* Keys:
|
|
29
|
+
* (none)
|
|
30
|
+
*/
|
|
31
|
+
export interface DataTransformExperienceConfigurationRepresentation {
|
|
32
|
+
appSettings: DataTransformExperienceAppSettingsRepresentation_DataTransformExperienceAppSettingsRepresentation;
|
|
33
|
+
featureFlags: {
|
|
34
|
+
[key: string]: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const ObjectKeys: {
|
|
3
|
+
(o: object): string[];
|
|
4
|
+
(o: {}): string[];
|
|
5
|
+
}, ObjectCreate: {
|
|
6
|
+
(o: object | null): any;
|
|
7
|
+
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
8
|
+
}, ObjectAssign: {
|
|
9
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
10
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
11
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
12
|
+
(target: object, ...sources: any[]): any;
|
|
13
|
+
};
|
|
14
|
+
export declare const ArrayIsArray: (arg: any) => arg is any[];
|
|
15
|
+
export declare const JSONStringify: {
|
|
16
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
17
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
18
|
+
};
|
|
19
|
+
type AllowedPrimitives = boolean | string | number | Date | null;
|
|
20
|
+
type Value<T> = T extends AllowedPrimitives ? T : RecursivePartial<T>;
|
|
21
|
+
export type RecursivePartial<T> = null | {
|
|
22
|
+
[P in keyof T]?: T[P] extends Array<infer U> ? Array<Value<U>> | null : Value<T[P]> | null;
|
|
23
|
+
};
|
|
24
|
+
export declare function equalsArray<U, V extends U[]>(a: V, b: V, equalsItem: (itemA: U, itemB: U) => boolean | void): boolean;
|
|
25
|
+
export declare function equalsObject<U, V extends {
|
|
26
|
+
[key: string]: U;
|
|
27
|
+
}>(a: V, b: V, equalsProp: (propA: U, propB: U) => boolean | void): boolean;
|
|
28
|
+
export declare function createLink(ref: string | $64$luvio_engine_NormalizedKeyMetadata): {
|
|
29
|
+
__ref: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function assignMetadataLink(entry: any, metadataKey: string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
32
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@salesforce/lds-adapters-cdp-data-transform-experience",
|
|
3
|
+
"version": "0.1.0-dev1",
|
|
4
|
+
"description": "Data Transforms related API calls",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
|
+
"main": "dist/es/es2018/cdp-data-transform-experience.js",
|
|
7
|
+
"module": "dist/es/es2018/cdp-data-transform-experience.js",
|
|
8
|
+
"types": "dist/es/es2018/types/src/generated/artifacts/main.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"sfdc",
|
|
12
|
+
"src/raml/*"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/es/es2018/types/src/generated/artifacts/main.d.ts",
|
|
17
|
+
"import": "./dist/es/es2018/cdp-data-transform-experience.js",
|
|
18
|
+
"require": "./dist/es/es2018/cdp-data-transform-experience.js"
|
|
19
|
+
},
|
|
20
|
+
"./sfdc": {
|
|
21
|
+
"types": "./sfdc/index.d.ts",
|
|
22
|
+
"import": "./sfdc/index.js",
|
|
23
|
+
"default": "./sfdc/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"sfdc": {
|
|
27
|
+
"namespace": "lightning",
|
|
28
|
+
"module": "cdpDataTransformExperienceApi"
|
|
29
|
+
},
|
|
30
|
+
"contributors": [
|
|
31
|
+
"ho.lee@salesforce.com"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "yarn build:services",
|
|
35
|
+
"build:raml": "luvio generate src/raml/luvio.raml src/generated -p '../lds-compiler-plugins'",
|
|
36
|
+
"build:services": "rollup --bundleConfigAsCjs --config rollup.config.js",
|
|
37
|
+
"clean": "rm -rf dist sfdc src/generated",
|
|
38
|
+
"release:core": "../../scripts/release/core.js --adapter=lds-adapters-cdp-data-transform-experience",
|
|
39
|
+
"release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-cdp-data-transform-experience",
|
|
40
|
+
"test:unit": "jest"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@salesforce/lds-bindings": "^0.1.0-dev1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@salesforce/lds-compiler-plugins": "^0.1.0-dev1"
|
|
47
|
+
},
|
|
48
|
+
"nx": {
|
|
49
|
+
"targets": {
|
|
50
|
+
"build": {
|
|
51
|
+
"outputs": [
|
|
52
|
+
"{projectRoot}/dist",
|
|
53
|
+
"{projectRoot}/sfdc"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"build:raml": {
|
|
57
|
+
"outputs": [
|
|
58
|
+
"{projectRoot}/src/generated"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"volta": {
|
|
64
|
+
"extends": "../../package.json"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/sfdc/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/es/es2018/types/src/generated/artifacts/sfdc';
|
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
21
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
|
+
/**
|
|
23
|
+
* Validates an adapter config is well-formed.
|
|
24
|
+
* @param config The config to validate.
|
|
25
|
+
* @param adapter The adapter validation configuration.
|
|
26
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
27
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
28
|
+
*/
|
|
29
|
+
function validateConfig(config, adapter, oneOf) {
|
|
30
|
+
const { displayName } = adapter;
|
|
31
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
32
|
+
if (config === undefined ||
|
|
33
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
34
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
37
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (unsupported !== undefined &&
|
|
40
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
41
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const supported = required.concat(optional);
|
|
44
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
45
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function untrustedIsObject(untrusted) {
|
|
49
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
50
|
+
}
|
|
51
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
52
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
53
|
+
}
|
|
54
|
+
const snapshotRefreshOptions = {
|
|
55
|
+
overrides: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Cache-Control': 'no-cache',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
62
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
63
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
64
|
+
return {
|
|
65
|
+
displayName,
|
|
66
|
+
parameters: {
|
|
67
|
+
required,
|
|
68
|
+
optional,
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const keyPrefix = 'cdp-data-transform-experience';
|
|
73
|
+
|
|
74
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
75
|
+
const { isArray: ArrayIsArray } = Array;
|
|
76
|
+
const { stringify: JSONStringify } = JSON;
|
|
77
|
+
function createLink(ref) {
|
|
78
|
+
return {
|
|
79
|
+
__ref: serializeStructuredKey(ref),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function validate$1(obj, path = 'DataTransformExperienceAppSettingsRepresentation') {
|
|
84
|
+
const v_error = (() => {
|
|
85
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
86
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
87
|
+
}
|
|
88
|
+
const obj_formattersLocale = obj.formattersLocale;
|
|
89
|
+
const path_formattersLocale = path + '.formattersLocale';
|
|
90
|
+
if (typeof obj_formattersLocale !== 'string') {
|
|
91
|
+
return new TypeError('Expected "string" but received "' + typeof obj_formattersLocale + '" (at "' + path_formattersLocale + '")');
|
|
92
|
+
}
|
|
93
|
+
const obj_isFileRecoveryEnabled = obj.isFileRecoveryEnabled;
|
|
94
|
+
const path_isFileRecoveryEnabled = path + '.isFileRecoveryEnabled';
|
|
95
|
+
if (typeof obj_isFileRecoveryEnabled !== 'boolean') {
|
|
96
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isFileRecoveryEnabled + '" (at "' + path_isFileRecoveryEnabled + '")');
|
|
97
|
+
}
|
|
98
|
+
const obj_isRecommendationsEnabled = obj.isRecommendationsEnabled;
|
|
99
|
+
const path_isRecommendationsEnabled = path + '.isRecommendationsEnabled';
|
|
100
|
+
if (typeof obj_isRecommendationsEnabled !== 'boolean') {
|
|
101
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRecommendationsEnabled + '" (at "' + path_isRecommendationsEnabled + '")');
|
|
102
|
+
}
|
|
103
|
+
const obj_isTelemetryEnabled = obj.isTelemetryEnabled;
|
|
104
|
+
const path_isTelemetryEnabled = path + '.isTelemetryEnabled';
|
|
105
|
+
if (typeof obj_isTelemetryEnabled !== 'boolean') {
|
|
106
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isTelemetryEnabled + '" (at "' + path_isTelemetryEnabled + '")');
|
|
107
|
+
}
|
|
108
|
+
const obj_maxConcurrentSessionPerUser = obj.maxConcurrentSessionPerUser;
|
|
109
|
+
const path_maxConcurrentSessionPerUser = path + '.maxConcurrentSessionPerUser';
|
|
110
|
+
if (typeof obj_maxConcurrentSessionPerUser !== 'number') {
|
|
111
|
+
return new TypeError('Expected "number" but received "' + typeof obj_maxConcurrentSessionPerUser + '" (at "' + path_maxConcurrentSessionPerUser + '")');
|
|
112
|
+
}
|
|
113
|
+
const obj_samplingMaxRowLimit = obj.samplingMaxRowLimit;
|
|
114
|
+
const path_samplingMaxRowLimit = path + '.samplingMaxRowLimit';
|
|
115
|
+
if (typeof obj_samplingMaxRowLimit !== 'number') {
|
|
116
|
+
return new TypeError('Expected "number" but received "' + typeof obj_samplingMaxRowLimit + '" (at "' + path_samplingMaxRowLimit + '")');
|
|
117
|
+
}
|
|
118
|
+
const obj_textLocale = obj.textLocale;
|
|
119
|
+
const path_textLocale = path + '.textLocale';
|
|
120
|
+
if (typeof obj_textLocale !== 'string') {
|
|
121
|
+
return new TypeError('Expected "string" but received "' + typeof obj_textLocale + '" (at "' + path_textLocale + '")');
|
|
122
|
+
}
|
|
123
|
+
})();
|
|
124
|
+
return v_error === undefined ? null : v_error;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const VERSION = "bf126a11521eabfe4b45a2bcfa7f91a4";
|
|
128
|
+
function validate(obj, path = 'DataTransformExperienceConfigurationRepresentation') {
|
|
129
|
+
const v_error = (() => {
|
|
130
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
131
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
132
|
+
}
|
|
133
|
+
const obj_appSettings = obj.appSettings;
|
|
134
|
+
const path_appSettings = path + '.appSettings';
|
|
135
|
+
const referencepath_appSettingsValidationError = validate$1(obj_appSettings, path_appSettings);
|
|
136
|
+
if (referencepath_appSettingsValidationError !== null) {
|
|
137
|
+
let message = 'Object doesn\'t match DataTransformExperienceAppSettingsRepresentation (at "' + path_appSettings + '")\n';
|
|
138
|
+
message += referencepath_appSettingsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
139
|
+
return new TypeError(message);
|
|
140
|
+
}
|
|
141
|
+
const obj_featureFlags = obj.featureFlags;
|
|
142
|
+
const path_featureFlags = path + '.featureFlags';
|
|
143
|
+
if (typeof obj_featureFlags !== 'object' || ArrayIsArray(obj_featureFlags) || obj_featureFlags === null) {
|
|
144
|
+
return new TypeError('Expected "object" but received "' + typeof obj_featureFlags + '" (at "' + path_featureFlags + '")');
|
|
145
|
+
}
|
|
146
|
+
const obj_featureFlags_keys = ObjectKeys(obj_featureFlags);
|
|
147
|
+
for (let i = 0; i < obj_featureFlags_keys.length; i++) {
|
|
148
|
+
const key = obj_featureFlags_keys[i];
|
|
149
|
+
const obj_featureFlags_prop = obj_featureFlags[key];
|
|
150
|
+
const path_featureFlags_prop = path_featureFlags + '["' + key + '"]';
|
|
151
|
+
if (typeof obj_featureFlags_prop !== 'boolean') {
|
|
152
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_featureFlags_prop + '" (at "' + path_featureFlags_prop + '")');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
})();
|
|
156
|
+
return v_error === undefined ? null : v_error;
|
|
157
|
+
}
|
|
158
|
+
const RepresentationType = 'DataTransformExperienceConfigurationRepresentation';
|
|
159
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
160
|
+
return input;
|
|
161
|
+
}
|
|
162
|
+
const select$1 = function DataTransformExperienceConfigurationRepresentationSelect() {
|
|
163
|
+
return {
|
|
164
|
+
kind: 'Fragment',
|
|
165
|
+
version: VERSION,
|
|
166
|
+
private: [],
|
|
167
|
+
opaque: true
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
function equals(existing, incoming) {
|
|
171
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
const ingest = function DataTransformExperienceConfigurationRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
177
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
178
|
+
const validateError = validate(input);
|
|
179
|
+
if (validateError !== null) {
|
|
180
|
+
throw validateError;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const key = path.fullPath;
|
|
184
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
|
|
185
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "cdp-data-transform-experience", VERSION, RepresentationType, equals);
|
|
186
|
+
return createLink(key);
|
|
187
|
+
};
|
|
188
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
189
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
190
|
+
const rootKey = fullPathFactory();
|
|
191
|
+
rootKeySet.set(rootKey, {
|
|
192
|
+
namespace: keyPrefix,
|
|
193
|
+
representationName: RepresentationType,
|
|
194
|
+
mergeable: false
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function select(luvio, params) {
|
|
199
|
+
return select$1();
|
|
200
|
+
}
|
|
201
|
+
function keyBuilder$1(luvio, params) {
|
|
202
|
+
return keyPrefix + '::DataTransformExperienceConfigurationRepresentation:(' + ')';
|
|
203
|
+
}
|
|
204
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
205
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1());
|
|
206
|
+
}
|
|
207
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
208
|
+
const { body } = response;
|
|
209
|
+
const key = keyBuilder$1();
|
|
210
|
+
luvio.storeIngest(key, ingest, body);
|
|
211
|
+
const snapshot = luvio.storeLookup({
|
|
212
|
+
recordId: key,
|
|
213
|
+
node: select(),
|
|
214
|
+
variables: {},
|
|
215
|
+
}, snapshotRefresh);
|
|
216
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
217
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
218
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
deepFreeze(snapshot.data);
|
|
222
|
+
return snapshot;
|
|
223
|
+
}
|
|
224
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
225
|
+
const key = keyBuilder$1();
|
|
226
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
227
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
228
|
+
return errorSnapshot;
|
|
229
|
+
}
|
|
230
|
+
function createResourceRequest(config) {
|
|
231
|
+
const headers = {};
|
|
232
|
+
return {
|
|
233
|
+
baseUri: '/services/data/v66.0',
|
|
234
|
+
basePath: '/ssot/data-transforms-experience/configurations',
|
|
235
|
+
method: 'get',
|
|
236
|
+
body: null,
|
|
237
|
+
urlParams: {},
|
|
238
|
+
queryParams: {},
|
|
239
|
+
headers,
|
|
240
|
+
priority: 'normal',
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const adapterName = 'getDataTransformsExperienceConfiguration';
|
|
245
|
+
const getDataTransformsExperienceConfiguration_ConfigPropertyMetadata = [];
|
|
246
|
+
const getDataTransformsExperienceConfiguration_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getDataTransformsExperienceConfiguration_ConfigPropertyMetadata);
|
|
247
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$1(getDataTransformsExperienceConfiguration_ConfigPropertyMetadata);
|
|
248
|
+
function keyBuilder(luvio, config) {
|
|
249
|
+
createResourceParams(config);
|
|
250
|
+
return keyBuilder$1();
|
|
251
|
+
}
|
|
252
|
+
function typeCheckConfig(untrustedConfig) {
|
|
253
|
+
const config = {};
|
|
254
|
+
return config;
|
|
255
|
+
}
|
|
256
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
257
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
261
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
262
|
+
}
|
|
263
|
+
const config = typeCheckConfig();
|
|
264
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
return config;
|
|
268
|
+
}
|
|
269
|
+
function adapterFragment(luvio, config) {
|
|
270
|
+
createResourceParams(config);
|
|
271
|
+
return select();
|
|
272
|
+
}
|
|
273
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
274
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
275
|
+
config,
|
|
276
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
277
|
+
});
|
|
278
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
279
|
+
}
|
|
280
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
281
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
282
|
+
config,
|
|
283
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
284
|
+
});
|
|
285
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
286
|
+
}
|
|
287
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
288
|
+
const resourceParams = createResourceParams(config);
|
|
289
|
+
const request = createResourceRequest();
|
|
290
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
291
|
+
.then((response) => {
|
|
292
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
293
|
+
const cache = new StoreKeyMap();
|
|
294
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
295
|
+
return cache;
|
|
296
|
+
});
|
|
297
|
+
}, (response) => {
|
|
298
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
302
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
303
|
+
}
|
|
304
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
305
|
+
const { luvio, config } = context;
|
|
306
|
+
const selector = {
|
|
307
|
+
recordId: keyBuilder(luvio, config),
|
|
308
|
+
node: adapterFragment(luvio, config),
|
|
309
|
+
variables: {},
|
|
310
|
+
};
|
|
311
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
312
|
+
config,
|
|
313
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
314
|
+
});
|
|
315
|
+
return cacheSnapshot;
|
|
316
|
+
}
|
|
317
|
+
const getDataTransformsExperienceConfigurationAdapterFactory = (luvio) => function cdpDataTransformExperience__getDataTransformsExperienceConfiguration(untrustedConfig, requestContext) {
|
|
318
|
+
const config = validateAdapterConfig(untrustedConfig, getDataTransformsExperienceConfiguration_ConfigPropertyNames);
|
|
319
|
+
// Invalid or incomplete config
|
|
320
|
+
if (config === null) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
324
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
let getDataTransformsExperienceConfiguration;
|
|
328
|
+
// Imperative GET Adapters
|
|
329
|
+
let getDataTransformsExperienceConfiguration_imperative;
|
|
330
|
+
// Adapter Metadata
|
|
331
|
+
const getDataTransformsExperienceConfigurationMetadata = {
|
|
332
|
+
apiFamily: 'cdpdata-transform-experience',
|
|
333
|
+
name: 'getDataTransformsExperienceConfiguration',
|
|
334
|
+
};
|
|
335
|
+
// Notify Update Available
|
|
336
|
+
function bindExportsTo(luvio) {
|
|
337
|
+
// LDS Adapters
|
|
338
|
+
const getDataTransformsExperienceConfiguration_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDataTransformsExperienceConfiguration', getDataTransformsExperienceConfigurationAdapterFactory), getDataTransformsExperienceConfigurationMetadata);
|
|
339
|
+
return {
|
|
340
|
+
getDataTransformsExperienceConfiguration: createWireAdapterConstructor(luvio, getDataTransformsExperienceConfiguration_ldsAdapter, getDataTransformsExperienceConfigurationMetadata),
|
|
341
|
+
// Imperative GET Adapters
|
|
342
|
+
getDataTransformsExperienceConfiguration_imperative: createImperativeAdapter(luvio, getDataTransformsExperienceConfiguration_ldsAdapter, getDataTransformsExperienceConfigurationMetadata),
|
|
343
|
+
// Notify Update Availables
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
withDefaultLuvio((luvio) => {
|
|
347
|
+
({
|
|
348
|
+
getDataTransformsExperienceConfiguration,
|
|
349
|
+
getDataTransformsExperienceConfiguration_imperative,
|
|
350
|
+
} = bindExportsTo(luvio));
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
export { getDataTransformsExperienceConfiguration, getDataTransformsExperienceConfiguration_imperative };
|
|
354
|
+
// version: 0.1.0-dev1-c978a7b010
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#%RAML 1.0
|
|
2
|
+
securedBy:
|
|
3
|
+
- OAuth2
|
|
4
|
+
title: Salesforce Connect API
|
|
5
|
+
version: '62.0'
|
|
6
|
+
mediaType: application/json
|
|
7
|
+
protocols:
|
|
8
|
+
- https
|
|
9
|
+
baseUri: /services/data/v66.0
|
|
10
|
+
securitySchemes:
|
|
11
|
+
OAuth2:
|
|
12
|
+
type: OAuth 2.0
|
|
13
|
+
settings:
|
|
14
|
+
authorizationUri: https://example.com/oauth/authorize
|
|
15
|
+
accessTokenUri: ''
|
|
16
|
+
authorizationGrants:
|
|
17
|
+
- implicit
|
|
18
|
+
annotationTypes:
|
|
19
|
+
oas-readOnly:
|
|
20
|
+
type: boolean
|
|
21
|
+
allowedTargets: TypeDeclaration
|
|
22
|
+
oas-collectionFormat:
|
|
23
|
+
type: string
|
|
24
|
+
oas-body-name:
|
|
25
|
+
type: string
|
|
26
|
+
allowedTargets: TypeDeclaration
|
|
27
|
+
types:
|
|
28
|
+
DataTransformExperienceAppSettingsRepresentation:
|
|
29
|
+
description: User App settings for Data Transform Experience
|
|
30
|
+
type: object
|
|
31
|
+
properties:
|
|
32
|
+
formattersLocale:
|
|
33
|
+
description: Locale for formatters
|
|
34
|
+
type: string
|
|
35
|
+
isFileRecoveryEnabled:
|
|
36
|
+
description: Field mappings
|
|
37
|
+
type: boolean
|
|
38
|
+
isRecommendationsEnabled:
|
|
39
|
+
description: Whether to show recommendations to user
|
|
40
|
+
type: boolean
|
|
41
|
+
isTelemetryEnabled:
|
|
42
|
+
description: Whether telemetry is enabled
|
|
43
|
+
type: boolean
|
|
44
|
+
maxConcurrentSessionPerUser:
|
|
45
|
+
description: Maximum number of concurrent sessions that the user can have
|
|
46
|
+
type: number # TODO Hand-rolled W-16441134
|
|
47
|
+
samplingMaxRowLimit:
|
|
48
|
+
description: Maximum number of rows that can be sampled
|
|
49
|
+
type: number # TODO Hand-rolled W-16441134
|
|
50
|
+
textLocale:
|
|
51
|
+
description: Locale for text
|
|
52
|
+
type: string
|
|
53
|
+
DataTransformExperienceConfigurationRepresentation:
|
|
54
|
+
description: Data Transform Experience configuration
|
|
55
|
+
type: object
|
|
56
|
+
properties:
|
|
57
|
+
appSettings:
|
|
58
|
+
description: User app settings
|
|
59
|
+
type: DataTransformExperienceAppSettingsRepresentation
|
|
60
|
+
featureFlags:
|
|
61
|
+
description: The feature flags for Data Transforms editing UI
|
|
62
|
+
type: object
|
|
63
|
+
properties:
|
|
64
|
+
//:
|
|
65
|
+
type: boolean
|
|
66
|
+
|
|
67
|
+
/ssot/data-transforms-experience:
|
|
68
|
+
/configurations:
|
|
69
|
+
get:
|
|
70
|
+
displayName: getDataTransformsExperienceConfiguration
|
|
71
|
+
description: Get data transform experience configurations needed for bootstrapping
|
|
72
|
+
the UI
|
|
73
|
+
responses:
|
|
74
|
+
'200':
|
|
75
|
+
description: Success
|
|
76
|
+
body:
|
|
77
|
+
application/json:
|
|
78
|
+
type: DataTransformExperienceConfigurationRepresentation
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#%RAML 1.0 Overlay
|
|
2
|
+
extends: ./api.raml
|
|
3
|
+
|
|
4
|
+
uses:
|
|
5
|
+
luvio: luvio://annotations.raml
|
|
6
|
+
|
|
7
|
+
(luvio.keyPrefix): 'cdp-data-transform-experience'
|
|
8
|
+
(luvio.ttl): 360000
|
|
9
|
+
|
|
10
|
+
types:
|
|
11
|
+
DataTransformExperienceAppSettingsRepresentation:
|
|
12
|
+
(luvio.opaque): true
|
|
13
|
+
DataTransformExperienceConfigurationRepresentation:
|
|
14
|
+
(luvio.opaque): true
|
|
15
|
+
|
|
16
|
+
/ssot/data-transforms-experience:
|
|
17
|
+
/configurations:
|
|
18
|
+
get:
|
|
19
|
+
(luvio.adapter):
|
|
20
|
+
name: getDataTransformsExperienceConfiguration
|