@salesforce/lds-adapters-platform-mobilepublisher 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 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,275 @@
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, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys, create: ObjectCreate } = 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(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 generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ resourceType,
56
+ typeCheckShape,
57
+ isArrayShape,
58
+ coerceFn,
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 = 'MobilePublisher';
73
+
74
+ const { isArray: ArrayIsArray } = Array;
75
+ const { stringify: JSONStringify } = JSON;
76
+ function createLink(ref) {
77
+ return {
78
+ __ref: serializeStructuredKey(ref),
79
+ };
80
+ }
81
+
82
+ const TTL = 100;
83
+ const VERSION = "9ea1c4910ff2c7f0401deb55b7799bb6";
84
+ function validate(obj, path = 'MobilePublisherContainerOneTimeLoginUrlOutputRepresentation') {
85
+ const v_error = (() => {
86
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
87
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
88
+ }
89
+ const obj_oneTimeLoginUrl = obj.oneTimeLoginUrl;
90
+ const path_oneTimeLoginUrl = path + '.oneTimeLoginUrl';
91
+ if (typeof obj_oneTimeLoginUrl !== 'string') {
92
+ return new TypeError('Expected "string" but received "' + typeof obj_oneTimeLoginUrl + '" (at "' + path_oneTimeLoginUrl + '")');
93
+ }
94
+ })();
95
+ return v_error === undefined ? null : v_error;
96
+ }
97
+ const RepresentationType = 'MobilePublisherContainerOneTimeLoginUrlOutputRepresentation';
98
+ function normalize(input, existing, path, luvio, store, timestamp) {
99
+ return input;
100
+ }
101
+ const select$1 = function MobilePublisherContainerOneTimeLoginUrlOutputRepresentationSelect() {
102
+ return {
103
+ kind: 'Fragment',
104
+ version: VERSION,
105
+ private: [],
106
+ opaque: true
107
+ };
108
+ };
109
+ function equals(existing, incoming) {
110
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
111
+ return false;
112
+ }
113
+ return true;
114
+ }
115
+ const ingest = function MobilePublisherContainerOneTimeLoginUrlOutputRepresentationIngest(input, path, luvio, store, timestamp) {
116
+ if (process.env.NODE_ENV !== 'production') {
117
+ const validateError = validate(input);
118
+ if (validateError !== null) {
119
+ throw validateError;
120
+ }
121
+ }
122
+ const key = path.fullPath;
123
+ const ttlToUse = TTL;
124
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "MobilePublisher", VERSION, RepresentationType, equals);
125
+ return createLink(key);
126
+ };
127
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
128
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
129
+ const rootKey = fullPathFactory();
130
+ rootKeySet.set(rootKey, {
131
+ namespace: keyPrefix,
132
+ representationName: RepresentationType,
133
+ mergeable: false
134
+ });
135
+ }
136
+
137
+ function select(luvio, params) {
138
+ return select$1();
139
+ }
140
+ function keyBuilder$1(luvio, params) {
141
+ return keyPrefix + '::MobilePublisherContainerOneTimeLoginUrlOutputRepresentation:(' + 'consumerKey:' + params.queryParams.consumerKey + ')';
142
+ }
143
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
144
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
145
+ }
146
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
147
+ const { body } = response;
148
+ const key = keyBuilder$1(luvio, resourceParams);
149
+ luvio.storeIngest(key, ingest, body);
150
+ const snapshot = luvio.storeLookup({
151
+ recordId: key,
152
+ node: select(),
153
+ variables: {},
154
+ }, snapshotRefresh);
155
+ if (process.env.NODE_ENV !== 'production') {
156
+ if (snapshot.state !== 'Fulfilled') {
157
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
158
+ }
159
+ }
160
+ deepFreeze(snapshot.data);
161
+ return snapshot;
162
+ }
163
+ function ingestError(luvio, params, error, snapshotRefresh) {
164
+ const key = keyBuilder$1(luvio, params);
165
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
166
+ const storeMetadataParams = {
167
+ ttl: TTL,
168
+ namespace: keyPrefix,
169
+ version: VERSION,
170
+ representationName: RepresentationType
171
+ };
172
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
173
+ return errorSnapshot;
174
+ }
175
+ function createResourceRequest(config) {
176
+ const headers = {};
177
+ return {
178
+ baseUri: '/services/data/v66.0',
179
+ basePath: '/connect/mobilepublisher/container/onetimeloginurl',
180
+ method: 'get',
181
+ body: null,
182
+ urlParams: {},
183
+ queryParams: config.queryParams,
184
+ headers,
185
+ priority: 'normal',
186
+ };
187
+ }
188
+
189
+ const adapterName = 'getMobilePublisherContainerOneTimeLoginUrl';
190
+ const getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata = [
191
+ generateParamConfigMetadata('consumerKey', false, 1 /* QueryParameter */, 0 /* String */),
192
+ ];
193
+ const getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata);
194
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata);
195
+ function keyBuilder(luvio, config) {
196
+ const resourceParams = createResourceParams(config);
197
+ return keyBuilder$1(luvio, resourceParams);
198
+ }
199
+ function typeCheckConfig(untrustedConfig) {
200
+ const config = {};
201
+ typeCheckConfig$1(untrustedConfig, config, getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata);
202
+ return config;
203
+ }
204
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
205
+ if (!untrustedIsObject(untrustedConfig)) {
206
+ return null;
207
+ }
208
+ if (process.env.NODE_ENV !== 'production') {
209
+ validateConfig(untrustedConfig, configPropertyNames);
210
+ }
211
+ const config = typeCheckConfig(untrustedConfig);
212
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
213
+ return null;
214
+ }
215
+ return config;
216
+ }
217
+ function adapterFragment(luvio, config) {
218
+ createResourceParams(config);
219
+ return select();
220
+ }
221
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
222
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
223
+ config,
224
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
225
+ });
226
+ return luvio.storeBroadcast().then(() => snapshot);
227
+ }
228
+ function onFetchResponseError(luvio, config, resourceParams, response) {
229
+ const snapshot = ingestError(luvio, resourceParams, response, {
230
+ config,
231
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
232
+ });
233
+ return luvio.storeBroadcast().then(() => snapshot);
234
+ }
235
+ function buildNetworkSnapshot(luvio, config, options) {
236
+ const resourceParams = createResourceParams(config);
237
+ const request = createResourceRequest(resourceParams);
238
+ return luvio.dispatchResourceRequest(request, options)
239
+ .then((response) => {
240
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
241
+ const cache = new StoreKeyMap();
242
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
243
+ return cache;
244
+ });
245
+ }, (response) => {
246
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
247
+ });
248
+ }
249
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
250
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
251
+ }
252
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
253
+ const { luvio, config } = context;
254
+ const selector = {
255
+ recordId: keyBuilder(luvio, config),
256
+ node: adapterFragment(luvio, config),
257
+ variables: {},
258
+ };
259
+ const cacheSnapshot = storeLookup(selector, {
260
+ config,
261
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
262
+ });
263
+ return cacheSnapshot;
264
+ }
265
+ const getMobilePublisherContainerOneTimeLoginUrlAdapterFactory = (luvio) => function MobilePublisher__getMobilePublisherContainerOneTimeLoginUrl(untrustedConfig, requestContext) {
266
+ const config = validateAdapterConfig(untrustedConfig, getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyNames);
267
+ // Invalid or incomplete config
268
+ if (config === null) {
269
+ return null;
270
+ }
271
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
272
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
273
+ };
274
+
275
+ export { getMobilePublisherContainerOneTimeLoginUrlAdapterFactory };
@@ -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 = "MobilePublisher";
@@ -0,0 +1,27 @@
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_getConnectMobilepublisherContainerOnetimeloginurl_ResourceRequestConfig } from '../resources/getConnectMobilepublisherContainerOnetimeloginurl';
4
+ import { MobilePublisherContainerOneTimeLoginUrlOutputRepresentation as types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation } from '../types/MobilePublisherContainerOneTimeLoginUrlOutputRepresentation';
5
+ export declare const adapterName = "getMobilePublisherContainerOneTimeLoginUrl";
6
+ export declare const getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
+ export declare const getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
+ export interface GetMobilePublisherContainerOneTimeLoginUrlConfig {
9
+ consumerKey?: string;
10
+ }
11
+ export declare const createResourceParams: (config: GetMobilePublisherContainerOneTimeLoginUrlConfig) => resources_getConnectMobilepublisherContainerOnetimeloginurl_ResourceRequestConfig;
12
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: GetMobilePublisherContainerOneTimeLoginUrlConfig): string;
13
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: GetMobilePublisherContainerOneTimeLoginUrlConfig): $64$luvio_engine_NormalizedKeyMetadata;
14
+ export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<GetMobilePublisherContainerOneTimeLoginUrlConfig>): adapter$45$utils_Untrusted<GetMobilePublisherContainerOneTimeLoginUrlConfig>;
15
+ export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): GetMobilePublisherContainerOneTimeLoginUrlConfig | null;
16
+ export declare function adapterFragment(luvio: $64$luvio_engine_Luvio, config: GetMobilePublisherContainerOneTimeLoginUrlConfig): $64$luvio_engine_Fragment;
17
+ export declare function buildCachedSnapshot(luvio: $64$luvio_engine_Luvio, config: GetMobilePublisherContainerOneTimeLoginUrlConfig): $64$luvio_engine_Snapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, any>;
18
+ export declare function onFetchResponseSuccess(luvio: $64$luvio_engine_Luvio, config: GetMobilePublisherContainerOneTimeLoginUrlConfig, resourceParams: resources_getConnectMobilepublisherContainerOnetimeloginurl_ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation>): Promise<import("@luvio/engine").FulfilledSnapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, any>>;
19
+ export declare function onFetchResponseError(luvio: $64$luvio_engine_Luvio, config: GetMobilePublisherContainerOneTimeLoginUrlConfig, resourceParams: resources_getConnectMobilepublisherContainerOnetimeloginurl_ResourceRequestConfig, response: $64$luvio_engine_ErrorResponse): Promise<import("@luvio/engine").ErrorSnapshot>;
20
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: GetMobilePublisherContainerOneTimeLoginUrlConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<$64$luvio_engine_Snapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, any>>;
21
+ export type BuildSnapshotContext = {
22
+ luvio: $64$luvio_engine_Luvio;
23
+ config: GetMobilePublisherContainerOneTimeLoginUrlConfig;
24
+ };
25
+ export declare function buildNetworkSnapshotCachePolicy(context: BuildSnapshotContext, coercedAdapterRequestContext: $64$luvio_engine_CoercedAdapterRequestContext): Promise<$64$luvio_engine_Snapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, any>>;
26
+ export declare function buildCachedSnapshotCachePolicy(context: BuildSnapshotContext, storeLookup: $64$luvio_engine_StoreLookup<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation>): $64$luvio_engine_Snapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, any>;
27
+ export declare const getMobilePublisherContainerOneTimeLoginUrlAdapterFactory: $64$luvio_engine_AdapterFactory<GetMobilePublisherContainerOneTimeLoginUrlConfig, types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation>;
@@ -0,0 +1 @@
1
+ export { getMobilePublisherContainerOneTimeLoginUrlAdapterFactory } from '../adapters/getMobilePublisherContainerOneTimeLoginUrl';
@@ -0,0 +1,3 @@
1
+ declare let getMobilePublisherContainerOneTimeLoginUrl: any;
2
+ declare let getMobilePublisherContainerOneTimeLoginUrl_imperative: any;
3
+ export { getMobilePublisherContainerOneTimeLoginUrl, getMobilePublisherContainerOneTimeLoginUrl_imperative, };
@@ -0,0 +1,15 @@
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 { MobilePublisherContainerOneTimeLoginUrlOutputRepresentation as types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation } from '../types/MobilePublisherContainerOneTimeLoginUrlOutputRepresentation';
3
+ export interface ResourceRequestConfig {
4
+ queryParams: {
5
+ consumerKey?: string;
6
+ };
7
+ }
8
+ export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
9
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): string;
10
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_NormalizedKeyMetadata;
11
+ export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation): void;
12
+ export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation>, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, any>;
13
+ export declare function ingestError(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig, error: $64$luvio_engine_ErrorResponse, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation_MobilePublisherContainerOneTimeLoginUrlOutputRepresentation>): $64$luvio_engine_ErrorSnapshot;
14
+ export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
15
+ export default createResourceRequest;
@@ -0,0 +1,29 @@
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 TTL = 100;
3
+ export declare const VERSION = "9ea1c4910ff2c7f0401deb55b7799bb6";
4
+ export declare function validate(obj: any, path?: string): TypeError | null;
5
+ export declare const RepresentationType: string;
6
+ export declare function normalize(input: MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, existing: MobilePublisherContainerOneTimeLoginUrlOutputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): MobilePublisherContainerOneTimeLoginUrlOutputRepresentationNormalized;
7
+ export declare const select: () => $64$luvio_engine_BaseFragment;
8
+ export declare function equals(existing: MobilePublisherContainerOneTimeLoginUrlOutputRepresentationNormalized, incoming: MobilePublisherContainerOneTimeLoginUrlOutputRepresentationNormalized): 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: MobilePublisherContainerOneTimeLoginUrlOutputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
11
+ /**
12
+ * Details of Response
13
+ *
14
+ * Keys:
15
+ * (none)
16
+ */
17
+ export interface MobilePublisherContainerOneTimeLoginUrlOutputRepresentationNormalized {
18
+ /** One Time Login Url */
19
+ oneTimeLoginUrl: string;
20
+ }
21
+ /**
22
+ * Details of Response
23
+ *
24
+ * Keys:
25
+ * (none)
26
+ */
27
+ export interface MobilePublisherContainerOneTimeLoginUrlOutputRepresentation {
28
+ oneTimeLoginUrl: string;
29
+ }
@@ -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-platform-mobilepublisher",
3
+ "version": "0.1.0-dev1",
4
+ "description": "Mobile Publisher API Family",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "main": "dist/es/es2018/platform-mobilepublisher.js",
7
+ "module": "dist/es/es2018/platform-mobilepublisher.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/platform-mobilepublisher.js",
18
+ "require": "./dist/es/es2018/platform-mobilepublisher.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": "platformMobilepublisherApi"
29
+ },
30
+ "contributors": [
31
+ "jeff.lai@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-platform-mobilepublisher",
39
+ "release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-platform-mobilepublisher",
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
+ }
@@ -0,0 +1 @@
1
+ export * from '../dist/es/es2018/types/src/generated/artifacts/sfdc';
package/sfdc/index.js ADDED
@@ -0,0 +1,313 @@
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, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys, create: ObjectCreate } = 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(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 generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ resourceType,
66
+ typeCheckShape,
67
+ isArrayShape,
68
+ coerceFn,
69
+ };
70
+ }
71
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
72
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
73
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
74
+ return {
75
+ displayName,
76
+ parameters: {
77
+ required,
78
+ optional,
79
+ }
80
+ };
81
+ }
82
+ const keyPrefix = 'MobilePublisher';
83
+
84
+ const { isArray: ArrayIsArray } = Array;
85
+ const { stringify: JSONStringify } = JSON;
86
+ function createLink(ref) {
87
+ return {
88
+ __ref: serializeStructuredKey(ref),
89
+ };
90
+ }
91
+
92
+ const TTL = 100;
93
+ const VERSION = "9ea1c4910ff2c7f0401deb55b7799bb6";
94
+ function validate(obj, path = 'MobilePublisherContainerOneTimeLoginUrlOutputRepresentation') {
95
+ const v_error = (() => {
96
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
97
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
98
+ }
99
+ const obj_oneTimeLoginUrl = obj.oneTimeLoginUrl;
100
+ const path_oneTimeLoginUrl = path + '.oneTimeLoginUrl';
101
+ if (typeof obj_oneTimeLoginUrl !== 'string') {
102
+ return new TypeError('Expected "string" but received "' + typeof obj_oneTimeLoginUrl + '" (at "' + path_oneTimeLoginUrl + '")');
103
+ }
104
+ })();
105
+ return v_error === undefined ? null : v_error;
106
+ }
107
+ const RepresentationType = 'MobilePublisherContainerOneTimeLoginUrlOutputRepresentation';
108
+ function normalize(input, existing, path, luvio, store, timestamp) {
109
+ return input;
110
+ }
111
+ const select$1 = function MobilePublisherContainerOneTimeLoginUrlOutputRepresentationSelect() {
112
+ return {
113
+ kind: 'Fragment',
114
+ version: VERSION,
115
+ private: [],
116
+ opaque: true
117
+ };
118
+ };
119
+ function equals(existing, incoming) {
120
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
121
+ return false;
122
+ }
123
+ return true;
124
+ }
125
+ const ingest = function MobilePublisherContainerOneTimeLoginUrlOutputRepresentationIngest(input, path, luvio, store, timestamp) {
126
+ if (process.env.NODE_ENV !== 'production') {
127
+ const validateError = validate(input);
128
+ if (validateError !== null) {
129
+ throw validateError;
130
+ }
131
+ }
132
+ const key = path.fullPath;
133
+ const ttlToUse = TTL;
134
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "MobilePublisher", VERSION, RepresentationType, equals);
135
+ return createLink(key);
136
+ };
137
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
138
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
139
+ const rootKey = fullPathFactory();
140
+ rootKeySet.set(rootKey, {
141
+ namespace: keyPrefix,
142
+ representationName: RepresentationType,
143
+ mergeable: false
144
+ });
145
+ }
146
+
147
+ function select(luvio, params) {
148
+ return select$1();
149
+ }
150
+ function keyBuilder$1(luvio, params) {
151
+ return keyPrefix + '::MobilePublisherContainerOneTimeLoginUrlOutputRepresentation:(' + 'consumerKey:' + params.queryParams.consumerKey + ')';
152
+ }
153
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
154
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
155
+ }
156
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
157
+ const { body } = response;
158
+ const key = keyBuilder$1(luvio, resourceParams);
159
+ luvio.storeIngest(key, ingest, body);
160
+ const snapshot = luvio.storeLookup({
161
+ recordId: key,
162
+ node: select(),
163
+ variables: {},
164
+ }, snapshotRefresh);
165
+ if (process.env.NODE_ENV !== 'production') {
166
+ if (snapshot.state !== 'Fulfilled') {
167
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
168
+ }
169
+ }
170
+ deepFreeze(snapshot.data);
171
+ return snapshot;
172
+ }
173
+ function ingestError(luvio, params, error, snapshotRefresh) {
174
+ const key = keyBuilder$1(luvio, params);
175
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
176
+ const storeMetadataParams = {
177
+ ttl: TTL,
178
+ namespace: keyPrefix,
179
+ version: VERSION,
180
+ representationName: RepresentationType
181
+ };
182
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
183
+ return errorSnapshot;
184
+ }
185
+ function createResourceRequest(config) {
186
+ const headers = {};
187
+ return {
188
+ baseUri: '/services/data/v66.0',
189
+ basePath: '/connect/mobilepublisher/container/onetimeloginurl',
190
+ method: 'get',
191
+ body: null,
192
+ urlParams: {},
193
+ queryParams: config.queryParams,
194
+ headers,
195
+ priority: 'normal',
196
+ };
197
+ }
198
+
199
+ const adapterName = 'getMobilePublisherContainerOneTimeLoginUrl';
200
+ const getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata = [
201
+ generateParamConfigMetadata('consumerKey', false, 1 /* QueryParameter */, 0 /* String */),
202
+ ];
203
+ const getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata);
204
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata);
205
+ function keyBuilder(luvio, config) {
206
+ const resourceParams = createResourceParams(config);
207
+ return keyBuilder$1(luvio, resourceParams);
208
+ }
209
+ function typeCheckConfig(untrustedConfig) {
210
+ const config = {};
211
+ typeCheckConfig$1(untrustedConfig, config, getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyMetadata);
212
+ return config;
213
+ }
214
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
215
+ if (!untrustedIsObject(untrustedConfig)) {
216
+ return null;
217
+ }
218
+ if (process.env.NODE_ENV !== 'production') {
219
+ validateConfig(untrustedConfig, configPropertyNames);
220
+ }
221
+ const config = typeCheckConfig(untrustedConfig);
222
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
223
+ return null;
224
+ }
225
+ return config;
226
+ }
227
+ function adapterFragment(luvio, config) {
228
+ createResourceParams(config);
229
+ return select();
230
+ }
231
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
232
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
233
+ config,
234
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
235
+ });
236
+ return luvio.storeBroadcast().then(() => snapshot);
237
+ }
238
+ function onFetchResponseError(luvio, config, resourceParams, response) {
239
+ const snapshot = ingestError(luvio, resourceParams, response, {
240
+ config,
241
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
242
+ });
243
+ return luvio.storeBroadcast().then(() => snapshot);
244
+ }
245
+ function buildNetworkSnapshot(luvio, config, options) {
246
+ const resourceParams = createResourceParams(config);
247
+ const request = createResourceRequest(resourceParams);
248
+ return luvio.dispatchResourceRequest(request, options)
249
+ .then((response) => {
250
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
251
+ const cache = new StoreKeyMap();
252
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
253
+ return cache;
254
+ });
255
+ }, (response) => {
256
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
257
+ });
258
+ }
259
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
260
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
261
+ }
262
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
263
+ const { luvio, config } = context;
264
+ const selector = {
265
+ recordId: keyBuilder(luvio, config),
266
+ node: adapterFragment(luvio, config),
267
+ variables: {},
268
+ };
269
+ const cacheSnapshot = storeLookup(selector, {
270
+ config,
271
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
272
+ });
273
+ return cacheSnapshot;
274
+ }
275
+ const getMobilePublisherContainerOneTimeLoginUrlAdapterFactory = (luvio) => function MobilePublisher__getMobilePublisherContainerOneTimeLoginUrl(untrustedConfig, requestContext) {
276
+ const config = validateAdapterConfig(untrustedConfig, getMobilePublisherContainerOneTimeLoginUrl_ConfigPropertyNames);
277
+ // Invalid or incomplete config
278
+ if (config === null) {
279
+ return null;
280
+ }
281
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
282
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
283
+ };
284
+
285
+ let getMobilePublisherContainerOneTimeLoginUrl;
286
+ // Imperative GET Adapters
287
+ let getMobilePublisherContainerOneTimeLoginUrl_imperative;
288
+ // Adapter Metadata
289
+ const getMobilePublisherContainerOneTimeLoginUrlMetadata = {
290
+ apiFamily: 'MobilePublisher',
291
+ name: 'getMobilePublisherContainerOneTimeLoginUrl',
292
+ ttl: 100,
293
+ };
294
+ // Notify Update Available
295
+ function bindExportsTo(luvio) {
296
+ // LDS Adapters
297
+ const getMobilePublisherContainerOneTimeLoginUrl_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getMobilePublisherContainerOneTimeLoginUrl', getMobilePublisherContainerOneTimeLoginUrlAdapterFactory), getMobilePublisherContainerOneTimeLoginUrlMetadata);
298
+ return {
299
+ getMobilePublisherContainerOneTimeLoginUrl: createWireAdapterConstructor(luvio, getMobilePublisherContainerOneTimeLoginUrl_ldsAdapter, getMobilePublisherContainerOneTimeLoginUrlMetadata),
300
+ // Imperative GET Adapters
301
+ getMobilePublisherContainerOneTimeLoginUrl_imperative: createImperativeAdapter(luvio, getMobilePublisherContainerOneTimeLoginUrl_ldsAdapter, getMobilePublisherContainerOneTimeLoginUrlMetadata),
302
+ // Notify Update Availables
303
+ };
304
+ }
305
+ withDefaultLuvio((luvio) => {
306
+ ({
307
+ getMobilePublisherContainerOneTimeLoginUrl,
308
+ getMobilePublisherContainerOneTimeLoginUrl_imperative,
309
+ } = bindExportsTo(luvio));
310
+ });
311
+
312
+ export { getMobilePublisherContainerOneTimeLoginUrl, getMobilePublisherContainerOneTimeLoginUrl_imperative };
313
+ // version: 0.1.0-dev1-c978a7b010
@@ -0,0 +1,153 @@
1
+ #%RAML 1.0
2
+ securedBy:
3
+ - OAuth2
4
+ title: Salesforce Connect API
5
+ version: '65.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
+ # the types commented out below should not be exposed as as wire adapterss
29
+ # ErrorInputRepresentation:
30
+ # description: The input representation for Error
31
+ # type: object
32
+ # properties:
33
+ # errorCode:
34
+ # description: Error code is required
35
+ # type: string
36
+ # errorMsg:
37
+ # description: Error Message is required
38
+ # type: string
39
+ MobilePublisherContainerOneTimeLoginUrlOutputRepresentation:
40
+ description: Details of Response
41
+ type: object
42
+ properties:
43
+ oneTimeLoginUrl:
44
+ description: One Time Login Url
45
+ type: string
46
+ # MobilePublisherInputRepresentation:
47
+ # description: The input representation for Mobile Publisher Update Metadata
48
+ # type: object
49
+ # properties:
50
+ # errors:
51
+ # description: Error is optional
52
+ # type: array
53
+ # items:
54
+ # type: object
55
+ # metadataId:
56
+ # description: MetadataId is required
57
+ # type: string
58
+ # status:
59
+ # description: status is required
60
+ # type: string
61
+ # MobilePublisherOutputRepresentation:
62
+ # description: Details of Response
63
+ # type: object
64
+ # properties: {}
65
+ # MobilePublisherServiceAccountAuthRepresentation:
66
+ # description: Mobile Publisher Service Account Auth
67
+ # type: object
68
+ # properties:
69
+ # auth_provider_x509_cert_url:
70
+ # description: Auth Provider X509 Cert Url
71
+ # type: string
72
+ # auth_uri:
73
+ # description: Auth Uri
74
+ # type: string
75
+ # client_email:
76
+ # description: Client Email
77
+ # type: string
78
+ # client_id:
79
+ # description: Client Id
80
+ # type: string
81
+ # client_x509_cert_url:
82
+ # description: Client X509 Cert Url
83
+ # type: string
84
+ # private_key:
85
+ # description: Private Key
86
+ # type: string
87
+ # private_key_id:
88
+ # description: Private Key Id
89
+ # type: string
90
+ # project_id:
91
+ # description: Project Id
92
+ # type: string
93
+ # token_uri:
94
+ # description: Token Uri
95
+ # type: string
96
+ # type:
97
+ # description: Type
98
+ # type: string
99
+ # MobilePublisherStoreCredentialsOutputRepresentation:
100
+ # description: Details of Response
101
+ # type: object
102
+ # properties:
103
+ # serviceAccountAuth:
104
+ # description: Service Account Auth Data
105
+ # type: MobilePublisherServiceAccountAuthRepresentation
106
+ # storeIdentifier:
107
+ # description: Store Identifier
108
+ # type: string
109
+ /connect/mobilepublisher:
110
+ # the end points commented out below should not be exposed as as wire adapters
111
+ # /buildstatus:
112
+ # post:
113
+ # displayName: postMobilePublisher
114
+ # description: Update the mobile publisher metadata status, error
115
+ # responses:
116
+ # '200':
117
+ # description: Success
118
+ # body:
119
+ # application/json:
120
+ # type: MobilePublisherOutputRepresentation
121
+ # body:
122
+ # application/json:
123
+ # type: MobilePublisherInputRepresentation
124
+ # TODO hand-rolled W-9271732 (removed required: false)
125
+ # (oas-body-name): MobilePublisherInputRepresentation
126
+ /container/onetimeloginurl:
127
+ get:
128
+ displayName: getMobilePublisherContainerOneTimeLoginUrl
129
+ description: Retrieve Mobile Publisher Container One Time Login Url
130
+ responses:
131
+ '200':
132
+ description: Success
133
+ body:
134
+ application/json:
135
+ type: MobilePublisherContainerOneTimeLoginUrlOutputRepresentation
136
+ queryParameters:
137
+ consumerKey:
138
+ type: string
139
+ required: false
140
+ # /storecredentials:
141
+ # get:
142
+ # displayName: getMobilePublisherStoreCredentials
143
+ # description: Retrieve Mobile Publisher Store Credentials
144
+ # responses:
145
+ # '200':
146
+ # description: Success
147
+ # body:
148
+ # application/json:
149
+ # type: MobilePublisherStoreCredentialsOutputRepresentation
150
+ # queryParameters:
151
+ # metadataId:
152
+ # type: string
153
+ # required: false
@@ -0,0 +1,18 @@
1
+ #%RAML 1.0 Overlay
2
+ extends: ./api.raml
3
+
4
+ uses:
5
+ luvio: luvio://annotations.raml
6
+
7
+ (luvio.keyPrefix): 'MobilePublisher'
8
+
9
+ types:
10
+ MobilePublisherContainerOneTimeLoginUrlOutputRepresentation:
11
+ # using the ttl value 100 to prevent the response from being cached, this login url result should not be cached because the login url is only valid for 60 seconds and each user will need to get a different login url generated
12
+ (luvio.ttl): 100
13
+ (luvio.opaque): true
14
+
15
+ /connect/mobilepublisher/container/onetimeloginurl:
16
+ get:
17
+ (luvio.adapter):
18
+ name: getMobilePublisherContainerOneTimeLoginUrl