@salesforce/lds-adapters-revenue-place-order 1.252.0 → 1.253.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.
@@ -72,11 +72,65 @@ function createLink(ref) {
72
72
  };
73
73
  }
74
74
 
75
+ function validate$3(obj, path = 'ConfiguratorOptionsInputRepresentation') {
76
+ const v_error = (() => {
77
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
78
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
79
+ }
80
+ if (obj.addDefaultConfiguration !== undefined) {
81
+ const obj_addDefaultConfiguration = obj.addDefaultConfiguration;
82
+ const path_addDefaultConfiguration = path + '.addDefaultConfiguration';
83
+ if (typeof obj_addDefaultConfiguration !== 'boolean') {
84
+ return new TypeError('Expected "boolean" but received "' + typeof obj_addDefaultConfiguration + '" (at "' + path_addDefaultConfiguration + '")');
85
+ }
86
+ }
87
+ if (obj.executeConfigurationRules !== undefined) {
88
+ const obj_executeConfigurationRules = obj.executeConfigurationRules;
89
+ const path_executeConfigurationRules = path + '.executeConfigurationRules';
90
+ if (typeof obj_executeConfigurationRules !== 'boolean') {
91
+ return new TypeError('Expected "boolean" but received "' + typeof obj_executeConfigurationRules + '" (at "' + path_executeConfigurationRules + '")');
92
+ }
93
+ }
94
+ if (obj.validateAmendRenewCancel !== undefined) {
95
+ const obj_validateAmendRenewCancel = obj.validateAmendRenewCancel;
96
+ const path_validateAmendRenewCancel = path + '.validateAmendRenewCancel';
97
+ if (typeof obj_validateAmendRenewCancel !== 'boolean') {
98
+ return new TypeError('Expected "boolean" but received "' + typeof obj_validateAmendRenewCancel + '" (at "' + path_validateAmendRenewCancel + '")');
99
+ }
100
+ }
101
+ if (obj.validateProductCatalog !== undefined) {
102
+ const obj_validateProductCatalog = obj.validateProductCatalog;
103
+ const path_validateProductCatalog = path + '.validateProductCatalog';
104
+ if (typeof obj_validateProductCatalog !== 'boolean') {
105
+ return new TypeError('Expected "boolean" but received "' + typeof obj_validateProductCatalog + '" (at "' + path_validateProductCatalog + '")');
106
+ }
107
+ }
108
+ })();
109
+ return v_error === undefined ? null : v_error;
110
+ }
111
+
75
112
  function validate$2(obj, path = 'PlaceOrderInputRepresentation') {
76
113
  const v_error = (() => {
77
114
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
78
115
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
79
116
  }
117
+ if (obj.configurationInput !== undefined) {
118
+ const obj_configurationInput = obj.configurationInput;
119
+ const path_configurationInput = path + '.configurationInput';
120
+ if (typeof obj_configurationInput !== 'string') {
121
+ return new TypeError('Expected "string" but received "' + typeof obj_configurationInput + '" (at "' + path_configurationInput + '")');
122
+ }
123
+ }
124
+ if (obj.configurationOptions !== undefined) {
125
+ const obj_configurationOptions = obj.configurationOptions;
126
+ const path_configurationOptions = path + '.configurationOptions';
127
+ const referencepath_configurationOptionsValidationError = validate$3(obj_configurationOptions, path_configurationOptions);
128
+ if (referencepath_configurationOptionsValidationError !== null) {
129
+ let message = 'Object doesn\'t match ConfiguratorOptionsInputRepresentation (at "' + path_configurationOptions + '")\n';
130
+ message += referencepath_configurationOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
131
+ return new TypeError(message);
132
+ }
133
+ }
80
134
  const obj_graph = obj.graph;
81
135
  const path_graph = path + '.graph';
82
136
  if (typeof obj_graph !== 'object' || ArrayIsArray(obj_graph) || obj_graph === null) {
@@ -87,13 +141,6 @@ function validate$2(obj, path = 'PlaceOrderInputRepresentation') {
87
141
  if (typeof obj_pricingPref !== 'string') {
88
142
  return new TypeError('Expected "string" but received "' + typeof obj_pricingPref + '" (at "' + path_pricingPref + '")');
89
143
  }
90
- if (obj.shouldSkipValidation !== undefined) {
91
- const obj_shouldSkipValidation = obj.shouldSkipValidation;
92
- const path_shouldSkipValidation = path + '.shouldSkipValidation';
93
- if (typeof obj_shouldSkipValidation !== 'boolean') {
94
- return new TypeError('Expected "boolean" but received "' + typeof obj_shouldSkipValidation + '" (at "' + path_shouldSkipValidation + '")');
95
- }
96
- }
97
144
  })();
98
145
  return v_error === undefined ? null : v_error;
99
146
  }
@@ -0,0 +1,37 @@
1
+ import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
+ export declare const VERSION = "e21b1d6113b662cbaf3514ea2c1eeaa4";
3
+ export declare function validate(obj: any, path?: string): TypeError | null;
4
+ export declare const RepresentationType: string;
5
+ export declare function normalize(input: ConfiguratorOptionsInputRepresentation, existing: ConfiguratorOptionsInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ConfiguratorOptionsInputRepresentationNormalized;
6
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
7
+ export declare function equals(existing: ConfiguratorOptionsInputRepresentationNormalized, incoming: ConfiguratorOptionsInputRepresentationNormalized): boolean;
8
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
9
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: ConfiguratorOptionsInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
+ /**
11
+ * Input Representation for the Configurator Options
12
+ *
13
+ * Keys:
14
+ * (none)
15
+ */
16
+ export interface ConfiguratorOptionsInputRepresentationNormalized {
17
+ /** Whether to add default configurations */
18
+ addDefaultConfiguration?: boolean;
19
+ /** Whether to execute Configuration Rules */
20
+ executeConfigurationRules?: boolean;
21
+ /** Whether to run amend/renew/cancel related validations */
22
+ validateAmendRenewCancel?: boolean;
23
+ /** Whether to run validations against the Product Catalog */
24
+ validateProductCatalog?: boolean;
25
+ }
26
+ /**
27
+ * Input Representation for the Configurator Options
28
+ *
29
+ * Keys:
30
+ * (none)
31
+ */
32
+ export interface ConfiguratorOptionsInputRepresentation {
33
+ addDefaultConfiguration?: boolean;
34
+ executeConfigurationRules?: boolean;
35
+ validateAmendRenewCancel?: boolean;
36
+ validateProductCatalog?: boolean;
37
+ }
@@ -1,5 +1,6 @@
1
+ import { ConfiguratorOptionsInputRepresentation as ConfiguratorOptionsInputRepresentation_ConfiguratorOptionsInputRepresentation } from './ConfiguratorOptionsInputRepresentation';
1
2
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
- export declare const VERSION = "a7f99754f37072010a0c1e84c2602393";
3
+ export declare const VERSION = "4dfa3a3c6ebf40557cfab63b63832a41";
3
4
  export declare function validate(obj: any, path?: string): TypeError | null;
4
5
  export declare const RepresentationType: string;
5
6
  export declare function normalize(input: PlaceOrderInputRepresentation, existing: PlaceOrderInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): PlaceOrderInputRepresentationNormalized;
@@ -14,12 +15,13 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
14
15
  * (none)
15
16
  */
16
17
  export interface PlaceOrderInputRepresentationNormalized {
18
+ /** Configuration input to control the call to config API */
19
+ configurationInput?: string;
20
+ configurationOptions?: ConfiguratorOptionsInputRepresentation_ConfiguratorOptionsInputRepresentation;
17
21
  /** The sobject graph representing the order payload to be ingested. */
18
22
  graph: {};
19
23
  /** Pricing Preference for this place order process. */
20
24
  pricingPref: string;
21
- /** Indicates whether to run business rule validations, such as configuration rules, product eligibility rules, asset rules, etc., after the ingestion is completed (true) or not (false). The default is false. */
22
- shouldSkipValidation?: boolean;
23
25
  }
24
26
  /**
25
27
  * Place Order API input representation
@@ -28,7 +30,8 @@ export interface PlaceOrderInputRepresentationNormalized {
28
30
  * (none)
29
31
  */
30
32
  export interface PlaceOrderInputRepresentation {
33
+ configurationInput?: string;
34
+ configurationOptions?: ConfiguratorOptionsInputRepresentation_ConfiguratorOptionsInputRepresentation;
31
35
  graph: {};
32
36
  pricingPref: string;
33
- shouldSkipValidation?: boolean;
34
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-revenue-place-order",
3
- "version": "1.252.0",
3
+ "version": "1.253.0",
4
4
  "description": "Place Order Connect API ",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/revenue-place-order.js",
package/sfdc/index.js CHANGED
@@ -81,11 +81,65 @@ function createLink(ref) {
81
81
  };
82
82
  }
83
83
 
84
+ function validate$3(obj, path = 'ConfiguratorOptionsInputRepresentation') {
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
+ if (obj.addDefaultConfiguration !== undefined) {
90
+ const obj_addDefaultConfiguration = obj.addDefaultConfiguration;
91
+ const path_addDefaultConfiguration = path + '.addDefaultConfiguration';
92
+ if (typeof obj_addDefaultConfiguration !== 'boolean') {
93
+ return new TypeError('Expected "boolean" but received "' + typeof obj_addDefaultConfiguration + '" (at "' + path_addDefaultConfiguration + '")');
94
+ }
95
+ }
96
+ if (obj.executeConfigurationRules !== undefined) {
97
+ const obj_executeConfigurationRules = obj.executeConfigurationRules;
98
+ const path_executeConfigurationRules = path + '.executeConfigurationRules';
99
+ if (typeof obj_executeConfigurationRules !== 'boolean') {
100
+ return new TypeError('Expected "boolean" but received "' + typeof obj_executeConfigurationRules + '" (at "' + path_executeConfigurationRules + '")');
101
+ }
102
+ }
103
+ if (obj.validateAmendRenewCancel !== undefined) {
104
+ const obj_validateAmendRenewCancel = obj.validateAmendRenewCancel;
105
+ const path_validateAmendRenewCancel = path + '.validateAmendRenewCancel';
106
+ if (typeof obj_validateAmendRenewCancel !== 'boolean') {
107
+ return new TypeError('Expected "boolean" but received "' + typeof obj_validateAmendRenewCancel + '" (at "' + path_validateAmendRenewCancel + '")');
108
+ }
109
+ }
110
+ if (obj.validateProductCatalog !== undefined) {
111
+ const obj_validateProductCatalog = obj.validateProductCatalog;
112
+ const path_validateProductCatalog = path + '.validateProductCatalog';
113
+ if (typeof obj_validateProductCatalog !== 'boolean') {
114
+ return new TypeError('Expected "boolean" but received "' + typeof obj_validateProductCatalog + '" (at "' + path_validateProductCatalog + '")');
115
+ }
116
+ }
117
+ })();
118
+ return v_error === undefined ? null : v_error;
119
+ }
120
+
84
121
  function validate$2(obj, path = 'PlaceOrderInputRepresentation') {
85
122
  const v_error = (() => {
86
123
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
87
124
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
88
125
  }
126
+ if (obj.configurationInput !== undefined) {
127
+ const obj_configurationInput = obj.configurationInput;
128
+ const path_configurationInput = path + '.configurationInput';
129
+ if (typeof obj_configurationInput !== 'string') {
130
+ return new TypeError('Expected "string" but received "' + typeof obj_configurationInput + '" (at "' + path_configurationInput + '")');
131
+ }
132
+ }
133
+ if (obj.configurationOptions !== undefined) {
134
+ const obj_configurationOptions = obj.configurationOptions;
135
+ const path_configurationOptions = path + '.configurationOptions';
136
+ const referencepath_configurationOptionsValidationError = validate$3(obj_configurationOptions, path_configurationOptions);
137
+ if (referencepath_configurationOptionsValidationError !== null) {
138
+ let message = 'Object doesn\'t match ConfiguratorOptionsInputRepresentation (at "' + path_configurationOptions + '")\n';
139
+ message += referencepath_configurationOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
140
+ return new TypeError(message);
141
+ }
142
+ }
89
143
  const obj_graph = obj.graph;
90
144
  const path_graph = path + '.graph';
91
145
  if (typeof obj_graph !== 'object' || ArrayIsArray(obj_graph) || obj_graph === null) {
@@ -96,13 +150,6 @@ function validate$2(obj, path = 'PlaceOrderInputRepresentation') {
96
150
  if (typeof obj_pricingPref !== 'string') {
97
151
  return new TypeError('Expected "string" but received "' + typeof obj_pricingPref + '" (at "' + path_pricingPref + '")');
98
152
  }
99
- if (obj.shouldSkipValidation !== undefined) {
100
- const obj_shouldSkipValidation = obj.shouldSkipValidation;
101
- const path_shouldSkipValidation = path + '.shouldSkipValidation';
102
- if (typeof obj_shouldSkipValidation !== 'boolean') {
103
- return new TypeError('Expected "boolean" but received "' + typeof obj_shouldSkipValidation + '" (at "' + path_shouldSkipValidation + '")');
104
- }
105
- }
106
153
  })();
107
154
  return v_error === undefined ? null : v_error;
108
155
  }
@@ -341,4 +388,4 @@ withDefaultLuvio((luvio) => {
341
388
  });
342
389
 
343
390
  export { placeOrder };
344
- // version: 1.252.0-eca5ba0ae
391
+ // version: 1.253.0-15fc9805a
package/src/raml/api.raml CHANGED
@@ -25,7 +25,7 @@ annotationTypes:
25
25
  type: string
26
26
  allowedTargets: TypeDeclaration
27
27
  types:
28
- PlaceOrderInputWrapperRepresentation: # Hand-rolled W-8334626
28
+ PlaceOrderInputWrapperRepresentation: # TODO hand rolled. W-8334626
29
29
  description: Wrapper for place order input representation
30
30
  type: object
31
31
  properties:
@@ -46,12 +46,18 @@ types:
46
46
  - Force
47
47
  - Skip
48
48
  - System
49
- shouldSkipValidation:
50
- description: Indicates whether to run business rule validations, such as configuration
51
- rules, product eligibility rules, asset rules, etc., after the ingestion
52
- is completed (true) or not (false). The default is false.
53
- type: boolean
54
- required: false #handrolled
49
+ configurationInput:
50
+ description: Configuration input to control the call to config API
51
+ type: string
52
+ enum:
53
+ - Skip
54
+ - RunAndAllowErrors
55
+ - RunAndBlockErrors
56
+ required: false # TODO hand rolled. W-9275477
57
+ configurationOptions:
58
+ description: Configuration options to specify which config API functionality to opt in/out of
59
+ type: ConfiguratorOptionsInputRepresentation
60
+ required: false # TODO hand rolled. W-9275477
55
61
  PlaceOrderErrorResponseRepresentation:
56
62
  description: Place Order Error response representation
57
63
  type: object
@@ -81,14 +87,34 @@ types:
81
87
  description: The request id of the process that can be used to query async
82
88
  status.
83
89
  type: string
84
- required: false #handrolled
90
+ required: false # TODO hand rolled. W-9275477
85
91
  statusURL:
86
92
  description: The async status URL, if available
87
93
  type: string
88
- required: false #handrolled
94
+ required: false # TODO hand rolled. W-9275477
89
95
  success:
90
96
  description: Whether or not the synchronous part of the processing is successful
91
97
  type: boolean
98
+ ConfiguratorOptionsInputRepresentation:
99
+ description: Input Representation for the Configurator Options
100
+ type: object
101
+ properties:
102
+ addDefaultConfiguration:
103
+ description: Whether to add default configurations
104
+ type: boolean
105
+ required: false # TODO hand rolled. W-9275477
106
+ executeConfigurationRules:
107
+ description: Whether to execute Configuration Rules
108
+ type: boolean
109
+ required: false # TODO hand rolled. W-9275477
110
+ validateAmendRenewCancel:
111
+ description: Whether to run amend/renew/cancel related validations
112
+ type: boolean
113
+ required: false # TODO hand rolled. W-9275477
114
+ validateProductCatalog:
115
+ description: Whether to run validations against the Product Catalog
116
+ type: boolean
117
+ required: false # TODO hand rolled. W-9275477
92
118
  /commerce/sales-orders/actions/place:
93
119
  post:
94
120
  displayName: postPlaceOrder
@@ -24,7 +24,14 @@ types:
24
24
  "inputRequest":
25
25
  {
26
26
  "pricingPref": "Force",
27
- "shouldSkipValidation": true,
27
+ "configurationInput": "RunAndAllowErrors",
28
+ "configuratorOptions":
29
+ {
30
+ "addDefaultConfiguration": true,
31
+ "executeConfigurationRules": true,
32
+ "validateAmendRenewCancel": true,
33
+ "validateProductCatalog": true
34
+ },
28
35
  "graph":
29
36
  {
30
37
  "graphId": "placeOrder",
@@ -64,7 +71,11 @@ types:
64
71
  invalidConfigs:
65
72
  - |
66
73
  {
67
- "shouldSkipValidation": true
74
+ "pricingPref": "Skip"
75
+ }
76
+ - |
77
+ {
78
+ "configurationInput": "Skip"
68
79
  }
69
80
  - |
70
81
  {