@replohq/sdk 1.8.2 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_vendor/replo-utils/lib/json.mjs +5 -2
- package/_vendor/replo-utils/lib/misc.mjs +3 -2
- package/_vendor/replo-utils/lib/object.mjs +5 -0
- package/_vendor/schemas/contentEntry.mjs +3 -1
- package/_vendor/schemas/contentManifest.mjs +6 -3
- package/_vendor/schemas/money.mjs +3 -2
- package/_vendor/schemas/routing/locale.mjs +3 -2
- package/_vendor/schemas/routing/rules.mjs +3 -2
- package/analytics/sinks/converge-event-mapper.js +4 -10
- package/chunk-ACQS4AG5.mjs +592 -0
- package/{chunk-VKO7P3ED.mjs → chunk-C37TXOGI.mjs} +3 -10
- package/chunk-EUIVDITZ.mjs +15 -0
- package/{chunk-7OPH5UFQ.mjs → chunk-GZWV5XKV.mjs} +4 -5
- package/chunk-SSBIMQES.mjs +755 -0
- package/chunk-VVB7BEDE.mjs +84 -0
- package/chunk-ZKAX2FW3.mjs +703 -0
- package/lib/buildMetadata.js +3 -3
- package/package.json +4 -4
- package/chunk-AL3F36PH.mjs +0 -1392
- package/chunk-GV5FY7ZZ.mjs +0 -78
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export { jsonStringifyOrNull, omitJsonObjectFieldsOrNull, parseJsonOrNull } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
1
|
+
export { jsonStringifyOrNull, omitJsonObjectFieldsOrNull, parseJsonOrNull } from '../../../chunk-C37TXOGI.mjs';
|
|
2
|
+
import '../../../chunk-VVB7BEDE.mjs';
|
|
3
|
+
import '../../../chunk-ACQS4AG5.mjs';
|
|
4
|
+
import '../../../chunk-EUIVDITZ.mjs';
|
|
5
|
+
import '../../../chunk-SSBIMQES.mjs';
|
|
3
6
|
import '../../../chunk-UJCSKKID.mjs';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty,
|
|
2
|
-
export { isNumber_default as isNumber, isString_default as isString } from '../../../chunk-
|
|
1
|
+
export { coerceNumberToString, deepCloneAndMergeReplacingArrays, errorMessage, exhaustiveSwitch, formatFileSize, getFromRecordOrNull, hasOwnProperty, invariant, isEmpty, isNotNullish, isNullish, isPrimitive, mergeReplacingArrays, mergeReplacingObjects, noop, preventDefault, sleep, warning } from '../../../chunk-ZKAX2FW3.mjs';
|
|
2
|
+
export { isNumber_default as isNumber, isString_default as isString } from '../../../chunk-EUIVDITZ.mjs';
|
|
3
|
+
export { isFunction_default as isFunction } from '../../../chunk-SSBIMQES.mjs';
|
|
3
4
|
import '../../../chunk-UJCSKKID.mjs';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { deepEqual, filterUndefined, forEachPrimitiveValue, omit, shallowEqual, toNullableIfDefined } from '../../../chunk-VVB7BEDE.mjs';
|
|
2
|
+
import '../../../chunk-ACQS4AG5.mjs';
|
|
3
|
+
import '../../../chunk-EUIVDITZ.mjs';
|
|
4
|
+
import '../../../chunk-SSBIMQES.mjs';
|
|
5
|
+
import '../../../chunk-UJCSKKID.mjs';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { CONTENT_MANAGED_ENTRY_VALUE_KEYS, contentEntryFrontmatterSchema, convertLegacyContentEntryDocument, getContentEntryFieldValidationIssues, getContentRenderableEntryValues, parseContentEntryDocument, serializeContentEntryDocument } from '../../chunk-
|
|
1
|
+
export { CONTENT_MANAGED_ENTRY_VALUE_KEYS, contentEntryFrontmatterSchema, convertLegacyContentEntryDocument, getContentEntryFieldValidationIssues, getContentRenderableEntryValues, parseContentEntryDocument, serializeContentEntryDocument } from '../../chunk-GZWV5XKV.mjs';
|
|
2
2
|
import '../../chunk-EUQVEPSD.mjs';
|
|
3
|
+
import '../../chunk-ACQS4AG5.mjs';
|
|
4
|
+
import '../../chunk-SSBIMQES.mjs';
|
|
3
5
|
import '../../chunk-UJCSKKID.mjs';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { parseContentEntryDocument, getContentRenderableEntryValues, getContentEntryFieldValidationIssues } from '../../chunk-
|
|
1
|
+
import { parseContentEntryDocument, getContentRenderableEntryValues, getContentEntryFieldValidationIssues } from '../../chunk-GZWV5XKV.mjs';
|
|
2
2
|
import { isValidContentSlug, CONTENT_COLLECTION_SCHEMA_FILENAME, CONTENT_ENTRY_FILE_EXTENSION, contentCollectionFileSchema, CONTENT_ENTRY_PUBLISHED_FILE_EXTENSION } from '../../chunk-EUQVEPSD.mjs';
|
|
3
|
-
import { parseJsonOrNull } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
3
|
+
import { parseJsonOrNull } from '../../chunk-C37TXOGI.mjs';
|
|
4
|
+
import '../../chunk-VVB7BEDE.mjs';
|
|
5
|
+
import '../../chunk-ACQS4AG5.mjs';
|
|
6
|
+
import '../../chunk-EUIVDITZ.mjs';
|
|
7
|
+
import '../../chunk-SSBIMQES.mjs';
|
|
5
8
|
import '../../chunk-UJCSKKID.mjs';
|
|
6
9
|
import { z } from 'zod';
|
|
7
10
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReploError } from '../../chunk-YJQVNUW7.mjs';
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
import '../../chunk-ZKAX2FW3.mjs';
|
|
3
|
+
import '../../chunk-EUIVDITZ.mjs';
|
|
4
|
+
import '../../chunk-SSBIMQES.mjs';
|
|
4
5
|
import { __commonJS, __toESM } from '../../chunk-UJCSKKID.mjs';
|
|
5
6
|
import { z } from 'zod';
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReploError } from '../../../chunk-YJQVNUW7.mjs';
|
|
2
|
-
import '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
2
|
+
import '../../../chunk-ZKAX2FW3.mjs';
|
|
3
|
+
import '../../../chunk-EUIVDITZ.mjs';
|
|
4
|
+
import '../../../chunk-SSBIMQES.mjs';
|
|
4
5
|
import '../../../chunk-UJCSKKID.mjs';
|
|
5
6
|
import { z } from 'zod';
|
|
6
7
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getParamSegment, getRouteParams, hasRouteParam, matchSource } from '../../../chunk-VPEVERWE.mjs';
|
|
2
2
|
import { ReploError } from '../../../chunk-YJQVNUW7.mjs';
|
|
3
|
-
import '../../../chunk-
|
|
4
|
-
import '../../../chunk-
|
|
3
|
+
import '../../../chunk-ZKAX2FW3.mjs';
|
|
4
|
+
import '../../../chunk-EUIVDITZ.mjs';
|
|
5
|
+
import '../../../chunk-SSBIMQES.mjs';
|
|
5
6
|
import '../../../chunk-UJCSKKID.mjs';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { filterUndefined } from "../../_vendor/replo-utils/lib/object.mjs";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
const analyticsRecordSchema = z.record(z.string(), z.unknown());
|
|
3
4
|
const nonEmptyStringSchema = z.union([
|
|
@@ -60,11 +61,6 @@ function optionalProductProperties({
|
|
|
60
61
|
image_url: stringFrom(source, ["image_url", "imageUrl", "productImageUrl"]) ?? stringFrom(product, ["imageUrl", "image_url"])
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
function withoutUndefined(record) {
|
|
64
|
-
return Object.fromEntries(
|
|
65
|
-
Object.entries(record).filter(([, value]) => value !== void 0)
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
64
|
function mapProduct(value, defaults = {}) {
|
|
69
65
|
const source = parseRecord(value);
|
|
70
66
|
if (!source) {
|
|
@@ -87,9 +83,7 @@ function mapProduct(value, defaults = {}) {
|
|
|
87
83
|
name,
|
|
88
84
|
price,
|
|
89
85
|
currency,
|
|
90
|
-
...
|
|
91
|
-
optionalProductProperties({ source, variant, product })
|
|
92
|
-
),
|
|
86
|
+
...filterUndefined(optionalProductProperties({ source, variant, product })),
|
|
93
87
|
...quantity === void 0 ? {} : { quantity }
|
|
94
88
|
};
|
|
95
89
|
return mapped;
|
|
@@ -129,7 +123,7 @@ function mapConvergeCollection(data) {
|
|
|
129
123
|
return {
|
|
130
124
|
id,
|
|
131
125
|
name,
|
|
132
|
-
...
|
|
126
|
+
...filterUndefined({
|
|
133
127
|
description: stringFrom(data, ["description", "collectionDescription"]),
|
|
134
128
|
items: items.length > 0 ? items : void 0
|
|
135
129
|
})
|
|
@@ -149,7 +143,7 @@ function mapConvergeCart(data) {
|
|
|
149
143
|
total_tax: numberFrom(data, ["total_tax", "totalTax"]) ?? 0,
|
|
150
144
|
total_shipping: numberFrom(data, ["total_shipping", "totalShipping"]) ?? 0,
|
|
151
145
|
currency,
|
|
152
|
-
...
|
|
146
|
+
...filterUndefined({
|
|
153
147
|
total_discount: numberFrom(data, ["total_discount", "totalDiscount"]),
|
|
154
148
|
coupon: couponFrom(data),
|
|
155
149
|
items: items.length > 0 ? items : void 0
|