@salesforce/lds-adapters-industries-field-service 1.280.0

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,265 @@
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, StoreKeyMap, createResourceParams as createResourceParams$1, typeCheckConfig as typeCheckConfig$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
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
45
+ return {
46
+ name,
47
+ required,
48
+ resourceType,
49
+ typeCheckShape,
50
+ isArrayShape,
51
+ coerceFn,
52
+ };
53
+ }
54
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
55
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
56
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
57
+ return {
58
+ displayName,
59
+ parameters: {
60
+ required,
61
+ optional,
62
+ }
63
+ };
64
+ }
65
+ const keyPrefix = 'field-service';
66
+
67
+ const { isArray: ArrayIsArray } = Array;
68
+ function createLink(ref) {
69
+ return {
70
+ __ref: serializeStructuredKey(ref),
71
+ };
72
+ }
73
+
74
+ const TTL = 300;
75
+ const VERSION = "4709f5219c6244678df647885fe34233";
76
+ function validate(obj, path = 'ProductServiceCampaignItemsFromListRepresentation') {
77
+ const v_error = (() => {
78
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
79
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
80
+ }
81
+ const obj_errorCode = obj.errorCode;
82
+ const path_errorCode = path + '.errorCode';
83
+ if (typeof obj_errorCode !== 'string') {
84
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
85
+ }
86
+ const obj_errorMessage = obj.errorMessage;
87
+ const path_errorMessage = path + '.errorMessage';
88
+ if (typeof obj_errorMessage !== 'string') {
89
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
90
+ }
91
+ const obj_isSuccess = obj.isSuccess;
92
+ const path_isSuccess = path + '.isSuccess';
93
+ if (typeof obj_isSuccess !== 'boolean') {
94
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
95
+ }
96
+ })();
97
+ return v_error === undefined ? null : v_error;
98
+ }
99
+ const RepresentationType = 'ProductServiceCampaignItemsFromListRepresentation';
100
+ function keyBuilder(luvio, config) {
101
+ return keyPrefix + '::' + RepresentationType + ':' + config.errorCode + ':' + config.errorMessage + ':' + config.isSuccess;
102
+ }
103
+ function keyBuilderFromType(luvio, object) {
104
+ const keyParams = {
105
+ errorCode: object.errorCode,
106
+ errorMessage: object.errorMessage,
107
+ isSuccess: object.isSuccess
108
+ };
109
+ return keyBuilder(luvio, keyParams);
110
+ }
111
+ function normalize(input, existing, path, luvio, store, timestamp) {
112
+ return input;
113
+ }
114
+ const select$1 = function ProductServiceCampaignItemsFromListRepresentationSelect() {
115
+ return {
116
+ kind: 'Fragment',
117
+ version: VERSION,
118
+ private: [],
119
+ selections: [
120
+ {
121
+ name: 'errorCode',
122
+ kind: 'Scalar'
123
+ },
124
+ {
125
+ name: 'errorMessage',
126
+ kind: 'Scalar'
127
+ },
128
+ {
129
+ name: 'isSuccess',
130
+ kind: 'Scalar'
131
+ }
132
+ ]
133
+ };
134
+ };
135
+ function equals(existing, incoming) {
136
+ const existing_isSuccess = existing.isSuccess;
137
+ const incoming_isSuccess = incoming.isSuccess;
138
+ if (!(existing_isSuccess === incoming_isSuccess)) {
139
+ return false;
140
+ }
141
+ const existing_errorCode = existing.errorCode;
142
+ const incoming_errorCode = incoming.errorCode;
143
+ if (!(existing_errorCode === incoming_errorCode)) {
144
+ return false;
145
+ }
146
+ const existing_errorMessage = existing.errorMessage;
147
+ const incoming_errorMessage = incoming.errorMessage;
148
+ if (!(existing_errorMessage === incoming_errorMessage)) {
149
+ return false;
150
+ }
151
+ return true;
152
+ }
153
+ const ingest = function ProductServiceCampaignItemsFromListRepresentationIngest(input, path, luvio, store, timestamp) {
154
+ if (process.env.NODE_ENV !== 'production') {
155
+ const validateError = validate(input);
156
+ if (validateError !== null) {
157
+ throw validateError;
158
+ }
159
+ }
160
+ const key = keyBuilderFromType(luvio, input);
161
+ const ttlToUse = TTL;
162
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "field-service", VERSION, RepresentationType, equals);
163
+ return createLink(key);
164
+ };
165
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
166
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
167
+ const rootKey = keyBuilderFromType(luvio, input);
168
+ rootKeySet.set(rootKey, {
169
+ namespace: keyPrefix,
170
+ representationName: RepresentationType,
171
+ mergeable: false
172
+ });
173
+ }
174
+
175
+ function select(luvio, params) {
176
+ return select$1();
177
+ }
178
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
179
+ getTypeCacheKeys(storeKeyMap, luvio, response);
180
+ }
181
+ function ingestSuccess(luvio, resourceParams, response) {
182
+ const { body } = response;
183
+ const key = keyBuilderFromType(luvio, body);
184
+ luvio.storeIngest(key, ingest, body);
185
+ const snapshot = luvio.storeLookup({
186
+ recordId: key,
187
+ node: select(),
188
+ variables: {},
189
+ });
190
+ if (process.env.NODE_ENV !== 'production') {
191
+ if (snapshot.state !== 'Fulfilled') {
192
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
193
+ }
194
+ }
195
+ deepFreeze(snapshot.data);
196
+ return snapshot;
197
+ }
198
+ function createResourceRequest(config) {
199
+ const headers = {};
200
+ return {
201
+ baseUri: '/services/data/v61.0',
202
+ basePath: '/connect/industries-field-service/product-service-campaign/items-from-list',
203
+ method: 'post',
204
+ body: config.body,
205
+ urlParams: {},
206
+ queryParams: {},
207
+ headers,
208
+ priority: 'normal',
209
+ };
210
+ }
211
+
212
+ const adapterName = 'createProductServiceCampaign';
213
+ const createProductServiceCampaign_ConfigPropertyMetadata = [
214
+ generateParamConfigMetadata('actionableListId', true, 2 /* Body */, 0 /* String */),
215
+ ];
216
+ const createProductServiceCampaign_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createProductServiceCampaign_ConfigPropertyMetadata);
217
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(createProductServiceCampaign_ConfigPropertyMetadata);
218
+ function typeCheckConfig(untrustedConfig) {
219
+ const config = {};
220
+ typeCheckConfig$1(untrustedConfig, config, createProductServiceCampaign_ConfigPropertyMetadata);
221
+ return config;
222
+ }
223
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
224
+ if (!untrustedIsObject(untrustedConfig)) {
225
+ return null;
226
+ }
227
+ if (process.env.NODE_ENV !== 'production') {
228
+ validateConfig(untrustedConfig, configPropertyNames);
229
+ }
230
+ const config = typeCheckConfig(untrustedConfig);
231
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
232
+ return null;
233
+ }
234
+ return config;
235
+ }
236
+ function buildNetworkSnapshot(luvio, config, options) {
237
+ const resourceParams = createResourceParams(config);
238
+ const request = createResourceRequest(resourceParams);
239
+ return luvio.dispatchResourceRequest(request, options)
240
+ .then((response) => {
241
+ return luvio.handleSuccessResponse(() => {
242
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
243
+ return luvio.storeBroadcast().then(() => snapshot);
244
+ }, () => {
245
+ const cache = new StoreKeyMap();
246
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
247
+ return cache;
248
+ });
249
+ }, (response) => {
250
+ deepFreeze(response);
251
+ throw response;
252
+ });
253
+ }
254
+ const createProductServiceCampaignAdapterFactory = (luvio) => {
255
+ return function createProductServiceCampaign(untrustedConfig) {
256
+ const config = validateAdapterConfig(untrustedConfig, createProductServiceCampaign_ConfigPropertyNames);
257
+ // Invalid or incomplete config
258
+ if (config === null) {
259
+ throw new Error('Invalid config for "createProductServiceCampaign"');
260
+ }
261
+ return buildNetworkSnapshot(luvio, config);
262
+ };
263
+ };
264
+
265
+ export { createProductServiceCampaignAdapterFactory };
@@ -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 = "field-service";
@@ -0,0 +1,15 @@
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
3
+ import { ResourceRequestConfig as resources_postConnectIndustriesFieldServiceProductServiceCampaignItemsFromList_ResourceRequestConfig } from '../resources/postConnectIndustriesFieldServiceProductServiceCampaignItemsFromList';
4
+ import { ProductServiceCampaignItemsFromListRepresentation as types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation } from '../types/ProductServiceCampaignItemsFromListRepresentation';
5
+ export declare const adapterName = "createProductServiceCampaign";
6
+ export declare const createProductServiceCampaign_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
+ export declare const createProductServiceCampaign_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
+ export interface CreateProductServiceCampaignConfig {
9
+ actionableListId: string;
10
+ }
11
+ export declare const createResourceParams: (config: CreateProductServiceCampaignConfig) => resources_postConnectIndustriesFieldServiceProductServiceCampaignItemsFromList_ResourceRequestConfig;
12
+ export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<CreateProductServiceCampaignConfig>): adapter$45$utils_Untrusted<CreateProductServiceCampaignConfig>;
13
+ export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): CreateProductServiceCampaignConfig | null;
14
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: CreateProductServiceCampaignConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<import("@luvio/engine").FulfilledSnapshot<types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation, any>>;
15
+ export declare const createProductServiceCampaignAdapterFactory: $64$luvio_engine_AdapterFactory<CreateProductServiceCampaignConfig, types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation>;
@@ -0,0 +1 @@
1
+ export { createProductServiceCampaignAdapterFactory } from '../adapters/createProductServiceCampaign';
@@ -0,0 +1,2 @@
1
+ declare let createProductServiceCampaign: any;
2
+ export { createProductServiceCampaign };
@@ -0,0 +1,12 @@
1
+ import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, FetchResponse as $64$luvio_engine_FetchResponse, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
2
+ import { ProductServiceCampaignItemsFromListRepresentation as types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation } from '../types/ProductServiceCampaignItemsFromListRepresentation';
3
+ export interface ResourceRequestConfig {
4
+ body: {
5
+ actionableListId: string;
6
+ };
7
+ }
8
+ export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
9
+ export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation): void;
10
+ export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_ProductServiceCampaignItemsFromListRepresentation_ProductServiceCampaignItemsFromListRepresentation, any>;
11
+ export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
12
+ export default createResourceRequest;
@@ -0,0 +1,38 @@
1
+ import { KeyMetadata as $64$luvio_engine_KeyMetadata, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Luvio as $64$luvio_engine_Luvio, IngestPath as $64$luvio_engine_IngestPath, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
2
+ export declare const TTL = 300;
3
+ export declare const VERSION = "2d988d51293112860e27be9c879a36c1";
4
+ export declare function validate(obj: any, path?: string): TypeError | null;
5
+ export declare const RepresentationType: string;
6
+ export interface KeyParams extends $64$luvio_engine_KeyMetadata {
7
+ id: string;
8
+ }
9
+ export type ProductServiceCampaignItemsFromListInputRepresentationNormalizedKeyMetadata = KeyParams & $64$luvio_engine_NormalizedKeyMetadata;
10
+ export type PartialProductServiceCampaignItemsFromListInputRepresentationNormalizedKeyMetadata = Partial<KeyParams> & $64$luvio_engine_NormalizedKeyMetadata;
11
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: KeyParams): string;
12
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: KeyParams): ProductServiceCampaignItemsFromListInputRepresentationNormalizedKeyMetadata;
13
+ export declare function keyBuilderFromType(luvio: $64$luvio_engine_Luvio, object: ProductServiceCampaignItemsFromListInputRepresentation): string;
14
+ export declare function keyBuilderFromType_StructuredKey(luvio: $64$luvio_engine_Luvio, object: ProductServiceCampaignItemsFromListInputRepresentation): $64$luvio_engine_NormalizedKeyMetadata;
15
+ export declare function normalize(input: ProductServiceCampaignItemsFromListInputRepresentation, existing: ProductServiceCampaignItemsFromListInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductServiceCampaignItemsFromListInputRepresentationNormalized;
16
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
17
+ export declare function equals(existing: ProductServiceCampaignItemsFromListInputRepresentationNormalized, incoming: ProductServiceCampaignItemsFromListInputRepresentationNormalized): boolean;
18
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
19
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: ProductServiceCampaignItemsFromListInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
20
+ /**
21
+ * Input representation to create product service campaign items for each actionable list member in an actionable list.
22
+ *
23
+ * Keys:
24
+ * id (string): actionableListId
25
+ */
26
+ export interface ProductServiceCampaignItemsFromListInputRepresentationNormalized {
27
+ /** The ID of the Actionable List record. */
28
+ actionableListId: string;
29
+ }
30
+ /**
31
+ * Input representation to create product service campaign items for each actionable list member in an actionable list.
32
+ *
33
+ * Keys:
34
+ * id (string): actionableListId
35
+ */
36
+ export interface ProductServiceCampaignItemsFromListInputRepresentation {
37
+ actionableListId: string;
38
+ }
@@ -0,0 +1,50 @@
1
+ import { KeyMetadata as $64$luvio_engine_KeyMetadata, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Luvio as $64$luvio_engine_Luvio, IngestPath as $64$luvio_engine_IngestPath, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
2
+ export declare const TTL = 300;
3
+ export declare const VERSION = "4709f5219c6244678df647885fe34233";
4
+ export declare function validate(obj: any, path?: string): TypeError | null;
5
+ export declare const RepresentationType: string;
6
+ export interface KeyParams extends $64$luvio_engine_KeyMetadata {
7
+ errorCode: string;
8
+ errorMessage: string;
9
+ isSuccess: boolean;
10
+ }
11
+ export type ProductServiceCampaignItemsFromListRepresentationNormalizedKeyMetadata = KeyParams & $64$luvio_engine_NormalizedKeyMetadata;
12
+ export type PartialProductServiceCampaignItemsFromListRepresentationNormalizedKeyMetadata = Partial<KeyParams> & $64$luvio_engine_NormalizedKeyMetadata;
13
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: KeyParams): string;
14
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: KeyParams): ProductServiceCampaignItemsFromListRepresentationNormalizedKeyMetadata;
15
+ export declare function keyBuilderFromType(luvio: $64$luvio_engine_Luvio, object: ProductServiceCampaignItemsFromListRepresentation): string;
16
+ export declare function keyBuilderFromType_StructuredKey(luvio: $64$luvio_engine_Luvio, object: ProductServiceCampaignItemsFromListRepresentation): $64$luvio_engine_NormalizedKeyMetadata;
17
+ export declare function normalize(input: ProductServiceCampaignItemsFromListRepresentation, existing: ProductServiceCampaignItemsFromListRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductServiceCampaignItemsFromListRepresentationNormalized;
18
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
19
+ export declare function equals(existing: ProductServiceCampaignItemsFromListRepresentationNormalized, incoming: ProductServiceCampaignItemsFromListRepresentationNormalized): boolean;
20
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
21
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: ProductServiceCampaignItemsFromListRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
22
+ /**
23
+ * Output representation of the error response for the product service campaign items creation request.
24
+ *
25
+ * Keys:
26
+ * errorCode (string): errorCode
27
+ * errorMessage (string): errorMessage
28
+ * isSuccess (boolean): isSuccess
29
+ */
30
+ export interface ProductServiceCampaignItemsFromListRepresentationNormalized {
31
+ /** The code of the error due to which the request failed. */
32
+ errorCode: string;
33
+ /** The details of the error if the operation was unsuccessful. */
34
+ errorMessage: string;
35
+ /** Specifies if the operation was successful (true) or not (false) */
36
+ isSuccess: boolean;
37
+ }
38
+ /**
39
+ * Output representation of the error response for the product service campaign items creation request.
40
+ *
41
+ * Keys:
42
+ * errorCode (string): errorCode
43
+ * errorMessage (string): errorMessage
44
+ * isSuccess (boolean): isSuccess
45
+ */
46
+ export interface ProductServiceCampaignItemsFromListRepresentation {
47
+ errorCode: string;
48
+ errorMessage: string;
49
+ isSuccess: boolean;
50
+ }
@@ -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-industries-field-service",
3
+ "version": "1.280.0",
4
+ "description": "Set of APIs for Industries field service",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "main": "dist/es/es2018/industries-field-service.js",
7
+ "module": "dist/es/es2018/industries-field-service.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/industries-field-service.js",
18
+ "require": "./dist/es/es2018/industries-field-service.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": "industriesFieldServiceApi"
29
+ },
30
+ "contributors": [
31
+ "salapati@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-industries-field-service",
39
+ "release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-industries-field-service",
40
+ "test:unit": "jest"
41
+ },
42
+ "dependencies": {
43
+ "@salesforce/lds-bindings": "^1.280.0"
44
+ },
45
+ "devDependencies": {
46
+ "@salesforce/lds-compiler-plugins": "^1.280.0"
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,293 @@
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 { withDefaultLuvio } from 'force/ldsEngine';
16
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$1, typeCheckConfig as typeCheckConfig$1 } from 'force/luvioEngine';
17
+
18
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
19
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
20
+ const { isArray: ArrayIsArray$1 } = Array;
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
+ function validateConfig(config, adapter, oneOf) {
29
+ const { displayName } = adapter;
30
+ const { required, optional, unsupported } = adapter.parameters;
31
+ if (config === undefined ||
32
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
33
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
34
+ }
35
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
36
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
37
+ }
38
+ if (unsupported !== undefined &&
39
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
40
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
41
+ }
42
+ const supported = required.concat(optional);
43
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
44
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
45
+ }
46
+ }
47
+ function untrustedIsObject(untrusted) {
48
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
49
+ }
50
+ function areRequiredParametersPresent(config, configPropertyNames) {
51
+ return configPropertyNames.parameters.required.every(req => req in config);
52
+ }
53
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
54
+ return {
55
+ name,
56
+ required,
57
+ resourceType,
58
+ typeCheckShape,
59
+ isArrayShape,
60
+ coerceFn,
61
+ };
62
+ }
63
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
64
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
65
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
66
+ return {
67
+ displayName,
68
+ parameters: {
69
+ required,
70
+ optional,
71
+ }
72
+ };
73
+ }
74
+ const keyPrefix = 'field-service';
75
+
76
+ const { isArray: ArrayIsArray } = Array;
77
+ function createLink(ref) {
78
+ return {
79
+ __ref: serializeStructuredKey(ref),
80
+ };
81
+ }
82
+
83
+ const TTL = 300;
84
+ const VERSION = "4709f5219c6244678df647885fe34233";
85
+ function validate(obj, path = 'ProductServiceCampaignItemsFromListRepresentation') {
86
+ const v_error = (() => {
87
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
88
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
89
+ }
90
+ const obj_errorCode = obj.errorCode;
91
+ const path_errorCode = path + '.errorCode';
92
+ if (typeof obj_errorCode !== 'string') {
93
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
94
+ }
95
+ const obj_errorMessage = obj.errorMessage;
96
+ const path_errorMessage = path + '.errorMessage';
97
+ if (typeof obj_errorMessage !== 'string') {
98
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
99
+ }
100
+ const obj_isSuccess = obj.isSuccess;
101
+ const path_isSuccess = path + '.isSuccess';
102
+ if (typeof obj_isSuccess !== 'boolean') {
103
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
104
+ }
105
+ })();
106
+ return v_error === undefined ? null : v_error;
107
+ }
108
+ const RepresentationType = 'ProductServiceCampaignItemsFromListRepresentation';
109
+ function keyBuilder(luvio, config) {
110
+ return keyPrefix + '::' + RepresentationType + ':' + config.errorCode + ':' + config.errorMessage + ':' + config.isSuccess;
111
+ }
112
+ function keyBuilderFromType(luvio, object) {
113
+ const keyParams = {
114
+ errorCode: object.errorCode,
115
+ errorMessage: object.errorMessage,
116
+ isSuccess: object.isSuccess
117
+ };
118
+ return keyBuilder(luvio, keyParams);
119
+ }
120
+ function normalize(input, existing, path, luvio, store, timestamp) {
121
+ return input;
122
+ }
123
+ const select$1 = function ProductServiceCampaignItemsFromListRepresentationSelect() {
124
+ return {
125
+ kind: 'Fragment',
126
+ version: VERSION,
127
+ private: [],
128
+ selections: [
129
+ {
130
+ name: 'errorCode',
131
+ kind: 'Scalar'
132
+ },
133
+ {
134
+ name: 'errorMessage',
135
+ kind: 'Scalar'
136
+ },
137
+ {
138
+ name: 'isSuccess',
139
+ kind: 'Scalar'
140
+ }
141
+ ]
142
+ };
143
+ };
144
+ function equals(existing, incoming) {
145
+ const existing_isSuccess = existing.isSuccess;
146
+ const incoming_isSuccess = incoming.isSuccess;
147
+ if (!(existing_isSuccess === incoming_isSuccess)) {
148
+ return false;
149
+ }
150
+ const existing_errorCode = existing.errorCode;
151
+ const incoming_errorCode = incoming.errorCode;
152
+ if (!(existing_errorCode === incoming_errorCode)) {
153
+ return false;
154
+ }
155
+ const existing_errorMessage = existing.errorMessage;
156
+ const incoming_errorMessage = incoming.errorMessage;
157
+ if (!(existing_errorMessage === incoming_errorMessage)) {
158
+ return false;
159
+ }
160
+ return true;
161
+ }
162
+ const ingest = function ProductServiceCampaignItemsFromListRepresentationIngest(input, path, luvio, store, timestamp) {
163
+ if (process.env.NODE_ENV !== 'production') {
164
+ const validateError = validate(input);
165
+ if (validateError !== null) {
166
+ throw validateError;
167
+ }
168
+ }
169
+ const key = keyBuilderFromType(luvio, input);
170
+ const ttlToUse = TTL;
171
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "field-service", VERSION, RepresentationType, equals);
172
+ return createLink(key);
173
+ };
174
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
175
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
176
+ const rootKey = keyBuilderFromType(luvio, input);
177
+ rootKeySet.set(rootKey, {
178
+ namespace: keyPrefix,
179
+ representationName: RepresentationType,
180
+ mergeable: false
181
+ });
182
+ }
183
+
184
+ function select(luvio, params) {
185
+ return select$1();
186
+ }
187
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
188
+ getTypeCacheKeys(storeKeyMap, luvio, response);
189
+ }
190
+ function ingestSuccess(luvio, resourceParams, response) {
191
+ const { body } = response;
192
+ const key = keyBuilderFromType(luvio, body);
193
+ luvio.storeIngest(key, ingest, body);
194
+ const snapshot = luvio.storeLookup({
195
+ recordId: key,
196
+ node: select(),
197
+ variables: {},
198
+ });
199
+ if (process.env.NODE_ENV !== 'production') {
200
+ if (snapshot.state !== 'Fulfilled') {
201
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
202
+ }
203
+ }
204
+ deepFreeze(snapshot.data);
205
+ return snapshot;
206
+ }
207
+ function createResourceRequest(config) {
208
+ const headers = {};
209
+ return {
210
+ baseUri: '/services/data/v61.0',
211
+ basePath: '/connect/industries-field-service/product-service-campaign/items-from-list',
212
+ method: 'post',
213
+ body: config.body,
214
+ urlParams: {},
215
+ queryParams: {},
216
+ headers,
217
+ priority: 'normal',
218
+ };
219
+ }
220
+
221
+ const adapterName = 'createProductServiceCampaign';
222
+ const createProductServiceCampaign_ConfigPropertyMetadata = [
223
+ generateParamConfigMetadata('actionableListId', true, 2 /* Body */, 0 /* String */),
224
+ ];
225
+ const createProductServiceCampaign_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createProductServiceCampaign_ConfigPropertyMetadata);
226
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(createProductServiceCampaign_ConfigPropertyMetadata);
227
+ function typeCheckConfig(untrustedConfig) {
228
+ const config = {};
229
+ typeCheckConfig$1(untrustedConfig, config, createProductServiceCampaign_ConfigPropertyMetadata);
230
+ return config;
231
+ }
232
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
233
+ if (!untrustedIsObject(untrustedConfig)) {
234
+ return null;
235
+ }
236
+ if (process.env.NODE_ENV !== 'production') {
237
+ validateConfig(untrustedConfig, configPropertyNames);
238
+ }
239
+ const config = typeCheckConfig(untrustedConfig);
240
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
241
+ return null;
242
+ }
243
+ return config;
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(() => {
251
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
252
+ return luvio.storeBroadcast().then(() => snapshot);
253
+ }, () => {
254
+ const cache = new StoreKeyMap();
255
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
256
+ return cache;
257
+ });
258
+ }, (response) => {
259
+ deepFreeze(response);
260
+ throw response;
261
+ });
262
+ }
263
+ const createProductServiceCampaignAdapterFactory = (luvio) => {
264
+ return function createProductServiceCampaign(untrustedConfig) {
265
+ const config = validateAdapterConfig(untrustedConfig, createProductServiceCampaign_ConfigPropertyNames);
266
+ // Invalid or incomplete config
267
+ if (config === null) {
268
+ throw new Error('Invalid config for "createProductServiceCampaign"');
269
+ }
270
+ return buildNetworkSnapshot(luvio, config);
271
+ };
272
+ };
273
+
274
+ let createProductServiceCampaign;
275
+ // Notify Update Available
276
+ function bindExportsTo(luvio) {
277
+ // LDS Adapters
278
+ function unwrapSnapshotData(factory) {
279
+ const adapter = factory(luvio);
280
+ return (config) => adapter(config).then((snapshot) => snapshot.data);
281
+ }
282
+ return {
283
+ createProductServiceCampaign: unwrapSnapshotData(createProductServiceCampaignAdapterFactory),
284
+ // Imperative GET Adapters
285
+ // Notify Update Availables
286
+ };
287
+ }
288
+ withDefaultLuvio((luvio) => {
289
+ ({ createProductServiceCampaign } = bindExportsTo(luvio));
290
+ });
291
+
292
+ export { createProductServiceCampaign };
293
+ // version: 1.280.0-09f980816
@@ -0,0 +1,63 @@
1
+ #%RAML 1.0
2
+ securedBy:
3
+ - OAuth2
4
+ title: Salesforce Connect API
5
+ version: '61.0'
6
+ mediaType: application/json
7
+ protocols:
8
+ - https
9
+ baseUri: /services/data/v61.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
+ ProductServiceCampaignItemsFromListInputRepresentation:
29
+ description: Input representation to create product service campaign items for
30
+ each actionable list member in an actionable list.
31
+ type: object
32
+ properties:
33
+ actionableListId:
34
+ description: The ID of the Actionable List record.
35
+ type: string
36
+ ProductServiceCampaignItemsFromListRepresentation:
37
+ description: Output representation of the error response for the product service
38
+ campaign items creation request.
39
+ type: object
40
+ properties:
41
+ errorCode:
42
+ description: The code of the error due to which the request failed.
43
+ type: string
44
+ errorMessage:
45
+ description: The details of the error if the operation was unsuccessful.
46
+ type: string
47
+ isSuccess:
48
+ description: Specifies if the operation was successful (true) or not (false)
49
+ type: boolean
50
+ /connect/industries-field-service/product-service-campaign/items-from-list:
51
+ post:
52
+ displayName: postCreateProductServiceCampaignItems
53
+ description: Creates Product Service Campaign Items for the Given Actionable List
54
+ responses:
55
+ '200':
56
+ description: Success
57
+ body:
58
+ application/json:
59
+ type: ProductServiceCampaignItemsFromListRepresentation
60
+ body:
61
+ application/json:
62
+ type: ProductServiceCampaignItemsFromListInputRepresentation
63
+ (oas-body-name): createPSCIInput
@@ -0,0 +1,24 @@
1
+ #%RAML 1.0 Overlay
2
+ extends: ./api.raml
3
+
4
+ uses:
5
+ luvio: luvio://annotations.raml
6
+
7
+ (luvio.keyPrefix): 'field-service'
8
+
9
+ types:
10
+ ProductServiceCampaignItemsFromListInputRepresentation:
11
+ (luvio.ttl): 300
12
+ (luvio.key):
13
+ id: actionableListId
14
+ ProductServiceCampaignItemsFromListRepresentation:
15
+ (luvio.ttl): 300
16
+ (luvio.key):
17
+ errorCode: errorCode
18
+ errorMessage: errorMessage
19
+ isSuccess: isSuccess
20
+
21
+ /connect/industries-field-service/product-service-campaign/items-from-list:
22
+ post:
23
+ (luvio.adapter):
24
+ name: createProductServiceCampaign