rerobe-js-orm 3.5.1 → 3.5.3
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/lib/constants/ledger-constants.d.ts +4 -0
- package/lib/constants/ledger-constants.js +36 -1
- package/lib/factories/ProductCollection/ProductCollectionFromFormState.js +1 -1
- package/lib/form-states/Product/options.js +1 -1
- package/lib/form-states/ProductCollection/ProductCollectionFormState.js +1 -1
- package/lib/helpers/ReRobeProductHelpers.js +2 -2
- package/lib/helpers/SellerProductLedgerHelpers.js +1 -1
- package/lib/helpers/Utilities.js +6 -6
- package/lib/models/SellerProductLedger.js +3 -2
- package/lib/models/SellerProductLedgerActivityLog.d.ts +15 -0
- package/lib/models/SellerProductLedgerActivityLog.js +34 -0
- package/lib/types/analytics-types.d.ts +3 -3
- package/lib/types/customer-notification-types.d.ts +11 -11
- package/lib/types/ledger-transaction-types.d.ts +12 -10
- package/lib/types/ledger-transaction-types.js +5 -5
- package/lib/types/merchant-types.d.ts +14 -14
- package/lib/types/merchant-webshop-types.d.ts +3 -3
- package/lib/types/payout-account-types.d.ts +4 -4
- package/lib/types/product-collection-types.d.ts +8 -8
- package/lib/types/rerobe-chatroom-types.d.ts +6 -6
- package/lib/types/rerobe-document-types.d.ts +1 -1
- package/lib/types/rerobe-form-types.d.ts +4 -4
- package/lib/types/rerobe-klarna-types.d.ts +2 -2
- package/lib/types/rerobe-order-types.d.ts +86 -86
- package/lib/types/rerobe-pickup-types.d.ts +2 -2
- package/lib/types/rerobe-product-state-types.d.ts +3 -3
- package/lib/types/rerobe-product-types.d.ts +22 -22
- package/lib/types/rerobe-sellRequest-types.d.ts +3 -3
- package/lib/types/rerobe-user-types.d.ts +12 -12
- package/lib/types/response-types.d.ts +9 -9
- package/lib/types/webshop-page/common/web-page-element-property-types.d.ts +11 -11
- package/lib/types/webshop-page/elements/button-element-interface.d.ts +1 -1
- package/lib/types/webshop-page/elements/layout-element-interface.d.ts +1 -1
- package/lib/types/webshop-page/elements/typography-element-interface.d.ts +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,10 @@ export declare const CUSTOMER_CREDIT_REASONS: {
|
|
|
14
14
|
customerCompensation: string;
|
|
15
15
|
refund: string;
|
|
16
16
|
};
|
|
17
|
+
export declare const ActivityLogActorTypes: Record<ActivityLogActorTypes, string>;
|
|
18
|
+
export declare const SaleType: Record<SaleType, string>;
|
|
19
|
+
export declare const SellerProductLedgerStatus: Record<SellerProductLedgerStatus, string>;
|
|
20
|
+
export declare const SellerProductLedgerActivityLogAction: Record<SellerProductLedgerActivityLogAction, string>;
|
|
17
21
|
export declare const SellerProductLedgerStatusDescriptions: Record<SellerProductLedgerStatus, {
|
|
18
22
|
label: string;
|
|
19
23
|
description: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SellerProductLedgerActivityLogActionDescriptions = exports.SellerProductLedgerStatusDescriptions = exports.CUSTOMER_CREDIT_REASONS = exports.TRANSACTION_TYPES = void 0;
|
|
3
|
+
exports.SellerProductLedgerActivityLogActionDescriptions = exports.SellerProductLedgerStatusDescriptions = exports.SellerProductLedgerActivityLogAction = exports.SellerProductLedgerStatus = exports.SaleType = exports.ActivityLogActorTypes = exports.CUSTOMER_CREDIT_REASONS = exports.TRANSACTION_TYPES = void 0;
|
|
4
4
|
exports.TRANSACTION_TYPES = {
|
|
5
5
|
merchantCredit: 'MERCHANT_CREDIT',
|
|
6
6
|
merchantDebit: 'MERCHANT_DEBIT',
|
|
@@ -17,6 +17,41 @@ exports.CUSTOMER_CREDIT_REASONS = {
|
|
|
17
17
|
customerCompensation: 'CUSTOMER_COMPENSATION',
|
|
18
18
|
refund: 'REFUND',
|
|
19
19
|
};
|
|
20
|
+
exports.ActivityLogActorTypes = {
|
|
21
|
+
SYSTEM: 'SYSTEM',
|
|
22
|
+
MERCHANT: 'MERCHANT',
|
|
23
|
+
};
|
|
24
|
+
exports.SaleType = {
|
|
25
|
+
CONSIGNMENT: 'CONSIGNMENT',
|
|
26
|
+
DIRECT_SALE: 'DIRECT_SALE',
|
|
27
|
+
};
|
|
28
|
+
exports.SellerProductLedgerStatus = {
|
|
29
|
+
PENDING_RETURN_PERIOD_COMPLETION: 'PENDING_RETURN_PERIOD_COMPLETION',
|
|
30
|
+
RETURNED_AND_RELISTED: 'RETURNED_AND_RELISTED',
|
|
31
|
+
SELLER_LIQUIDATED: 'SELLER_LIQUIDATED',
|
|
32
|
+
MERCHANT_DONATED: 'MERCHANT_DONATED',
|
|
33
|
+
SELLER_TO_BE_PAID: 'SELLER_TO_BE_PAID',
|
|
34
|
+
PAYMENT_IN_PROGRESS: 'PAYMENT_IN_PROGRESS',
|
|
35
|
+
SELLER_PAID: 'SELLER_PAID',
|
|
36
|
+
DISPUTED: 'DISPUTED',
|
|
37
|
+
RESOLVED: 'RESOLVED',
|
|
38
|
+
DIRECT_SALE_PENDING: 'DIRECT_SALE_PENDING',
|
|
39
|
+
DIRECT_SALE_COMPLETED: 'DIRECT_SALE_COMPLETED',
|
|
40
|
+
};
|
|
41
|
+
exports.SellerProductLedgerActivityLogAction = {
|
|
42
|
+
STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION: 'STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION',
|
|
43
|
+
STATUS_CHANGED_TO_RETURNED_AND_RELISTED: 'STATUS_CHANGED_TO_RETURNED_AND_RELISTED',
|
|
44
|
+
STATUS_CHANGED_TO_SELLER_LIQUIDATED: 'STATUS_CHANGED_TO_SELLER_LIQUIDATED',
|
|
45
|
+
STATUS_CHANGED_TO_MERCHANT_DONATED: 'STATUS_CHANGED_TO_MERCHANT_DONATED',
|
|
46
|
+
STATUS_CHANGED_TO_SELLER_TO_BE_PAID: 'STATUS_CHANGED_TO_SELLER_TO_BE_PAID',
|
|
47
|
+
STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS: 'STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS',
|
|
48
|
+
STATUS_CHANGED_TO_SELLER_PAID: 'STATUS_CHANGED_TO_SELLER_PAID',
|
|
49
|
+
STATUS_CHANGED_TO_DISPUTED: 'STATUS_CHANGED_TO_DISPUTED',
|
|
50
|
+
STATUS_CHANGED_TO_RESOLVED: 'STATUS_CHANGED_TO_RESOLVED',
|
|
51
|
+
STATUS_CHANGED_TO_DIRECT_SALE_PENDING: 'STATUS_CHANGED_TO_DIRECT_SALE_PENDING',
|
|
52
|
+
STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED: 'STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED',
|
|
53
|
+
MERCHANT_ADJUSTMENT_MADE: 'MERCHANT_ADJUSTMENT_MADE',
|
|
54
|
+
};
|
|
20
55
|
exports.SellerProductLedgerStatusDescriptions = {
|
|
21
56
|
PENDING_RETURN_PERIOD_COMPLETION: {
|
|
22
57
|
label: 'The sold product is in a return period; payment to the seller is pending its completion',
|
|
@@ -9,7 +9,7 @@ class ProductCollectionFromFormState extends ProductCollectionFactory_1.default
|
|
|
9
9
|
var _a;
|
|
10
10
|
let collectionId = fs.fields.collectionId.inputValue;
|
|
11
11
|
if (!collectionId) {
|
|
12
|
-
collectionId = lodash_1.camelCase(fs.fields.title.inputValue) + new Date().toISOString().split('T')[0];
|
|
12
|
+
collectionId = (0, lodash_1.camelCase)(fs.fields.title.inputValue) + new Date().toISOString().split('T')[0];
|
|
13
13
|
}
|
|
14
14
|
const productCollectionAttributes = {
|
|
15
15
|
documentId: ((_a = fs.props) === null || _a === void 0 ? void 0 : _a.documentId) || '',
|
|
@@ -30,7 +30,7 @@ const publishTypeOptions = [
|
|
|
30
30
|
];
|
|
31
31
|
exports.publishTypeOptions = publishTypeOptions;
|
|
32
32
|
const statusOptions = Object.values(product_constants_1.PRODUCT_STATES).map((val) => ({
|
|
33
|
-
label: lodash_1.startCase(lodash_1.toLower(val)),
|
|
33
|
+
label: (0, lodash_1.startCase)((0, lodash_1.toLower)(val)),
|
|
34
34
|
value: val,
|
|
35
35
|
}));
|
|
36
36
|
exports.statusOptions = statusOptions;
|
|
@@ -43,7 +43,7 @@ class ProductCollectionFormState extends FormState_1.default {
|
|
|
43
43
|
const valid = !!this.props[fieldKey];
|
|
44
44
|
let onChangeHandler = (val) => this.textInputChangeHandler(fieldKey, String(val));
|
|
45
45
|
if (fieldKey === 'collectionId') {
|
|
46
|
-
onChangeHandler = (val) => this.textInputChangeHandler(fieldKey, lodash_1.camelCase(String(val)));
|
|
46
|
+
onChangeHandler = (val) => this.textInputChangeHandler(fieldKey, (0, lodash_1.camelCase)(String(val)));
|
|
47
47
|
}
|
|
48
48
|
return {
|
|
49
49
|
inputValue,
|
|
@@ -104,7 +104,7 @@ class ReRobeProductHelpers {
|
|
|
104
104
|
if (materialComposition) {
|
|
105
105
|
return Object.keys(materialComposition)
|
|
106
106
|
.reduce((acc, cur, idx) => {
|
|
107
|
-
acc.push(`${Object.values(materialComposition)[idx]}% ${lodash_1.startCase(cur)}`);
|
|
107
|
+
acc.push(`${Object.values(materialComposition)[idx]}% ${(0, lodash_1.startCase)(cur)}`);
|
|
108
108
|
return acc;
|
|
109
109
|
}, [])
|
|
110
110
|
.join(', ');
|
|
@@ -121,7 +121,7 @@ class ReRobeProductHelpers {
|
|
|
121
121
|
return Object.keys(measurementsObj)
|
|
122
122
|
.filter((key) => key !== 'unit' && !!measurementsObj[key])
|
|
123
123
|
.map((key) => {
|
|
124
|
-
const label = product_constants_1.MEASUREMENT_FIELDS_DICT[key] || lodash_1.startCase(key);
|
|
124
|
+
const label = product_constants_1.MEASUREMENT_FIELDS_DICT[key] || (0, lodash_1.startCase)(key);
|
|
125
125
|
return `${measurementsObj[key]} ${measurementsObj.unit} ${label}`;
|
|
126
126
|
})
|
|
127
127
|
.join(' x ');
|
|
@@ -12,7 +12,7 @@ class SellerProductLedgerHelpers {
|
|
|
12
12
|
action: (payload === null || payload === void 0 ? void 0 : payload.action) || SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION,
|
|
13
13
|
details: (payload === null || payload === void 0 ? void 0 : payload.details) || '',
|
|
14
14
|
actorId: (payload === null || payload === void 0 ? void 0 : payload.actorId) || 'system',
|
|
15
|
-
actorType: (payload === null || payload === void 0 ? void 0 : payload.actorType) ||
|
|
15
|
+
actorType: (payload === null || payload === void 0 ? void 0 : payload.actorType) || ActivityLogActorTypes.SYSTEM,
|
|
16
16
|
data: (payload === null || payload === void 0 ? void 0 : payload.data) || {},
|
|
17
17
|
};
|
|
18
18
|
}
|
package/lib/helpers/Utilities.js
CHANGED
|
@@ -6,7 +6,7 @@ class Utilities {
|
|
|
6
6
|
addOrRemoveValToArray(arr, val) {
|
|
7
7
|
let res;
|
|
8
8
|
if (Array.isArray(arr)) {
|
|
9
|
-
const idx = arr.findIndex((v) => lodash_1.isEqual(v, val));
|
|
9
|
+
const idx = arr.findIndex((v) => (0, lodash_1.isEqual)(v, val));
|
|
10
10
|
if (idx !== -1) {
|
|
11
11
|
arr.splice(idx, 1);
|
|
12
12
|
}
|
|
@@ -29,10 +29,10 @@ class Utilities {
|
|
|
29
29
|
return re.test(phone);
|
|
30
30
|
}
|
|
31
31
|
uniqArray(arr) {
|
|
32
|
-
return lodash_1.uniq(arr);
|
|
32
|
+
return (0, lodash_1.uniq)(arr);
|
|
33
33
|
}
|
|
34
34
|
uniqObjArray(arr, objKey) {
|
|
35
|
-
return lodash_1.uniqBy(arr, objKey);
|
|
35
|
+
return (0, lodash_1.uniqBy)(arr, objKey);
|
|
36
36
|
}
|
|
37
37
|
getWeekNumberFromDate(dateString) {
|
|
38
38
|
const date = new Date(dateString);
|
|
@@ -45,13 +45,13 @@ class Utilities {
|
|
|
45
45
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
46
46
|
}
|
|
47
47
|
startCase(s) {
|
|
48
|
-
return lodash_1.startCase(s);
|
|
48
|
+
return (0, lodash_1.startCase)(s);
|
|
49
49
|
}
|
|
50
50
|
camelCase(s) {
|
|
51
|
-
return lodash_1.camelCase(s);
|
|
51
|
+
return (0, lodash_1.camelCase)(s);
|
|
52
52
|
}
|
|
53
53
|
constantCase(str) {
|
|
54
|
-
return lodash_1.snakeCase(str).toUpperCase();
|
|
54
|
+
return (0, lodash_1.snakeCase)(str).toUpperCase();
|
|
55
55
|
}
|
|
56
56
|
makeRandId(length) {
|
|
57
57
|
let result = '';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const Base_1 = require("../Base");
|
|
4
|
+
const ledger_constants_1 = require("../constants/ledger-constants");
|
|
4
5
|
class SellerProductLedger extends Base_1.default {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super();
|
|
@@ -15,14 +16,14 @@ class SellerProductLedger extends Base_1.default {
|
|
|
15
16
|
this.sellerFirstName = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerFirstName);
|
|
16
17
|
this.sellerLastName = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerLastName);
|
|
17
18
|
this.sellerEmail = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerEmail);
|
|
18
|
-
this.saleType = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.saleType) || SaleType.CONSIGNMENT);
|
|
19
|
+
this.saleType = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.saleType) || ledger_constants_1.SaleType.CONSIGNMENT);
|
|
19
20
|
this.productId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productId);
|
|
20
21
|
this.productTitle = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productTitle);
|
|
21
22
|
this.productImgUrl = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productImgUrl);
|
|
22
23
|
this.merchantCommission = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.merchantCommission);
|
|
23
24
|
this.priceSold = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.priceSold);
|
|
24
25
|
this.amountOwedToSeller = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.amountOwedToSeller);
|
|
25
|
-
this.status = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.status) || SellerProductLedgerStatus.PENDING_RETURN_PERIOD_COMPLETION);
|
|
26
|
+
this.status = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.status) || ledger_constants_1.SellerProductLedgerStatus.PENDING_RETURN_PERIOD_COMPLETION);
|
|
26
27
|
this.feesForSeller = Array.isArray(props === null || props === void 0 ? void 0 : props.feesForSeller) ? props === null || props === void 0 ? void 0 : props.feesForSeller : [];
|
|
27
28
|
this.tags = this.utilities.sanitzeStringArr(props === null || props === void 0 ? void 0 : props.tags);
|
|
28
29
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Base from '../Base';
|
|
2
|
+
export default class SellerProductLedgerActivityLog extends Base {
|
|
3
|
+
documentId: string;
|
|
4
|
+
sellerProductLedgerId: string;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
action: SellerProductLedgerActivityLogAction;
|
|
7
|
+
details: string;
|
|
8
|
+
actorId: string;
|
|
9
|
+
actorType: ActivityLogActorTypes;
|
|
10
|
+
data?: {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
};
|
|
13
|
+
constructor(props?: any);
|
|
14
|
+
toObj(): ActivityLog;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Base_1 = require("../Base");
|
|
4
|
+
const ledger_constants_1 = require("../constants/ledger-constants");
|
|
5
|
+
class SellerProductLedgerActivityLog extends Base_1.default {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
var _a;
|
|
8
|
+
super();
|
|
9
|
+
this.documentId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
|
|
10
|
+
this.sellerProductLedgerId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerProductLedgerId);
|
|
11
|
+
this.timestamp = this.utilities.sanitizeMillisTimeStamp(props === null || props === void 0 ? void 0 : props.timestamp);
|
|
12
|
+
this.action = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.action) || ledger_constants_1.SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION);
|
|
13
|
+
this.details = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.details) ||
|
|
14
|
+
((_a = ledger_constants_1.SellerProductLedgerActivityLogActionDescriptions[(props === null || props === void 0 ? void 0 : props.action) ||
|
|
15
|
+
ledger_constants_1.SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION]) === null || _a === void 0 ? void 0 : _a.description));
|
|
16
|
+
this.actorId = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.actorId) || '');
|
|
17
|
+
this.actorType = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.actorType) || ledger_constants_1.ActivityLogActorTypes.SYSTEM);
|
|
18
|
+
this.data = (props === null || props === void 0 ? void 0 : props.data) || {};
|
|
19
|
+
}
|
|
20
|
+
toObj() {
|
|
21
|
+
const activityLogObj = {
|
|
22
|
+
documentId: this.documentId,
|
|
23
|
+
sellerProductLedgerId: this.sellerProductLedgerId,
|
|
24
|
+
timestamp: this.timestamp,
|
|
25
|
+
action: this.action,
|
|
26
|
+
details: this.details,
|
|
27
|
+
actorId: this.actorId,
|
|
28
|
+
actorType: this.actorType,
|
|
29
|
+
data: this.data,
|
|
30
|
+
};
|
|
31
|
+
return activityLogObj;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = SellerProductLedgerActivityLog;
|
|
@@ -2,14 +2,14 @@ interface BaseTraits {
|
|
|
2
2
|
createdAt: string;
|
|
3
3
|
updatedAt: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type SegmentAddressType = {
|
|
6
6
|
street: string;
|
|
7
7
|
city: string;
|
|
8
8
|
state: string;
|
|
9
9
|
postalCode: string;
|
|
10
10
|
country: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type SegmentReservedTraits = {
|
|
13
13
|
firstName?: string;
|
|
14
14
|
lastName?: string;
|
|
15
15
|
email?: string;
|
|
@@ -22,7 +22,7 @@ declare type SegmentReservedTraits = {
|
|
|
22
22
|
interface Traits extends BaseTraits {
|
|
23
23
|
[key: string]: any;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
type IdentifyPayload = {
|
|
26
26
|
userId: string;
|
|
27
27
|
traits: Traits;
|
|
28
28
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
type DeliveryResponse = {
|
|
2
2
|
isDelivered: boolean;
|
|
3
3
|
errorMsg: string;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
type RecipientList = {
|
|
6
6
|
channel: string;
|
|
7
7
|
to: string;
|
|
8
8
|
isMerchant?: boolean;
|
|
9
9
|
deliveryResponse?: DeliveryResponse;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type CustomerNotificationAttributes = {
|
|
12
12
|
documentId: string;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
merchantId: string;
|
|
@@ -24,11 +24,11 @@ declare type CustomerNotificationAttributes = {
|
|
|
24
24
|
skipSend?: boolean;
|
|
25
25
|
messageToAdmin?: string;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
type ORDER_CONFIRMATION_TYPE = 'ORDER_CONFIRMATION';
|
|
28
|
+
type ORDER_CANCELLATION_TYPE = 'ORDER_CANCELLATION';
|
|
29
|
+
type ORDER_REFUND = 'ORDER_REFUND';
|
|
30
|
+
type ORDER_READY_FOR_PICK_UP = 'ORDER_READY_FOR_PICK_UP';
|
|
31
|
+
type SHIPPING_CONFIRMATION = 'SHIPPING_CONFIRMATION';
|
|
32
|
+
type GENERAL_MESSAGE = 'GENERAL_MESSAGE';
|
|
33
|
+
type ABANDONED_CART = 'ABANDONED_CART';
|
|
34
|
+
type CustomerNotificationType = ORDER_CONFIRMATION_TYPE | ORDER_CANCELLATION_TYPE | SHIPPING_CONFIRMATION | ORDER_REFUND | GENERAL_MESSAGE | ABANDONED_CART;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type LedgerTransactionTypeOptions = 'MERCHANT_CREDIT' | 'MERCHANT_DEBIT' | 'SELLER_CREDIT' | 'SELLER_DEBIT' | 'CUSTOMER_CREDIT' | 'CUSTOMER_DEBIT';
|
|
2
|
+
type SellerLedgerTransactionType = {
|
|
3
3
|
documentId: string;
|
|
4
4
|
createdAtTimestamp: number;
|
|
5
5
|
createdAt?: string;
|
|
@@ -24,7 +24,7 @@ declare type SellerLedgerTransactionType = {
|
|
|
24
24
|
productionFee?: string | number;
|
|
25
25
|
fulfillmentFee?: string | number;
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
type CustomerLedgerTransactionType = {
|
|
28
28
|
documentId: string;
|
|
29
29
|
createdAtTimestamp: number;
|
|
30
30
|
createdAt?: string;
|
|
@@ -43,7 +43,7 @@ declare type CustomerLedgerTransactionType = {
|
|
|
43
43
|
description: string;
|
|
44
44
|
reason: string;
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
type TypesenseSellerLedgerTransactionObj = {
|
|
47
47
|
id: string;
|
|
48
48
|
documentId: string;
|
|
49
49
|
createdAtTimestamp: number;
|
|
@@ -67,7 +67,7 @@ declare type TypesenseSellerLedgerTransactionObj = {
|
|
|
67
67
|
productionFee: number;
|
|
68
68
|
fulfillmentFee: number;
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
type TypesenseCustomerLedgerTransactionObj = {
|
|
71
71
|
id: string;
|
|
72
72
|
documentId: string;
|
|
73
73
|
createdAtTimestamp: number;
|
|
@@ -85,7 +85,7 @@ declare type TypesenseCustomerLedgerTransactionObj = {
|
|
|
85
85
|
description: string;
|
|
86
86
|
reason: string;
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
type SellerProductLedgerType = {
|
|
89
89
|
documentId: string;
|
|
90
90
|
createdAtTimestamp: number;
|
|
91
91
|
updatedAtTimestamp: number;
|
|
@@ -107,7 +107,7 @@ declare type SellerProductLedgerType = {
|
|
|
107
107
|
feesForSeller: Fee[];
|
|
108
108
|
tags?: string[];
|
|
109
109
|
};
|
|
110
|
-
|
|
110
|
+
type TypesenseSellerProductLedgerObj = {
|
|
111
111
|
documentId: string;
|
|
112
112
|
createdAtTimestamp: number;
|
|
113
113
|
updatedAtTimestamp: number;
|
|
@@ -165,7 +165,7 @@ declare enum SellerProductLedgerActivityLogAction {
|
|
|
165
165
|
STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED = "STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED",
|
|
166
166
|
MERCHANT_ADJUSTMENT_MADE = "MERCHANT_ADJUSTMENT_MADE"
|
|
167
167
|
}
|
|
168
|
-
declare enum
|
|
168
|
+
declare enum ActivityLogActorTypes {
|
|
169
169
|
SYSTEM = "SYSTEM",
|
|
170
170
|
MERCHANT = "MERCHANT"
|
|
171
171
|
}
|
|
@@ -176,6 +176,8 @@ interface ActivityLog {
|
|
|
176
176
|
action: SellerProductLedgerActivityLogAction;
|
|
177
177
|
details: string;
|
|
178
178
|
actorId: string;
|
|
179
|
-
actorType:
|
|
180
|
-
data?:
|
|
179
|
+
actorType: ActivityLogActorTypes;
|
|
180
|
+
data?: {
|
|
181
|
+
[key: string]: any;
|
|
182
|
+
};
|
|
181
183
|
}
|
|
@@ -33,8 +33,8 @@ var SellerProductLedgerActivityLogAction;
|
|
|
33
33
|
SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED"] = "STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED";
|
|
34
34
|
SellerProductLedgerActivityLogAction["MERCHANT_ADJUSTMENT_MADE"] = "MERCHANT_ADJUSTMENT_MADE";
|
|
35
35
|
})(SellerProductLedgerActivityLogAction || (SellerProductLedgerActivityLogAction = {}));
|
|
36
|
-
var
|
|
37
|
-
(function (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})(
|
|
36
|
+
var ActivityLogActorTypes;
|
|
37
|
+
(function (ActivityLogActorTypes) {
|
|
38
|
+
ActivityLogActorTypes["SYSTEM"] = "SYSTEM";
|
|
39
|
+
ActivityLogActorTypes["MERCHANT"] = "MERCHANT";
|
|
40
|
+
})(ActivityLogActorTypes || (ActivityLogActorTypes = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type SocialLinksType = {
|
|
2
2
|
facebook: string;
|
|
3
3
|
instagram: string;
|
|
4
4
|
linkedIn: string;
|
|
@@ -6,7 +6,7 @@ declare type SocialLinksType = {
|
|
|
6
6
|
pinterest: string;
|
|
7
7
|
tiktok: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type MerchantMutableData = {
|
|
10
10
|
name: string;
|
|
11
11
|
type: MerchantTypes | string;
|
|
12
12
|
contactEmail: string;
|
|
@@ -23,7 +23,7 @@ declare type MerchantMutableData = {
|
|
|
23
23
|
webhooks: MerchantWebHook[];
|
|
24
24
|
socialLinks: SocialLinksType | null;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
type MerchantSystemOnlyMutableData = {
|
|
27
27
|
paymentTier: RibbnPaymentTiers | string;
|
|
28
28
|
documentId: string;
|
|
29
29
|
numCustomers: number;
|
|
@@ -36,14 +36,14 @@ declare type MerchantSystemOnlyMutableData = {
|
|
|
36
36
|
webshopHomePageId: string;
|
|
37
37
|
defaultLocation: string;
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
type MerchantObj = MerchantMutableData & MerchantSystemOnlyMutableData;
|
|
40
|
+
type MerchantTypes = 'INDIVIDUAL' | 'BUSINESS';
|
|
41
|
+
type RibbnPaymentTiers = 'FREE' | 'TIER_ONE';
|
|
42
|
+
type MerchantIndustryTypes = 'BEAUTY' | 'CLOTHING' | 'ELECTRONICS' | 'FURNITURE' | 'HANDCRAFTS' | 'JEWELRY' | 'SPORTS' | 'TOYS' | 'OTHER';
|
|
43
|
+
type UnitSystemTypes = 'METRIC' | 'IMPERIAL';
|
|
44
|
+
type MetricWeightTypes = 'KILOGRAM' | 'GRAM';
|
|
45
|
+
type ImperialWeightTypes = 'POUND' | 'OUNCE';
|
|
46
|
+
type MerchantTheme = {
|
|
47
47
|
bgColor: string;
|
|
48
48
|
bgFooterColor: string;
|
|
49
49
|
errorColor: string;
|
|
@@ -56,11 +56,11 @@ declare type MerchantTheme = {
|
|
|
56
56
|
textColor: string;
|
|
57
57
|
warningColor: string;
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
type MerchantWebHook = {
|
|
60
60
|
event: string;
|
|
61
61
|
callBackUrl: string;
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
type MerchantFormFields = {
|
|
64
64
|
name: TextInputFormField<string>;
|
|
65
65
|
type: SingleSelectFormField<string>;
|
|
66
66
|
contactEmail: TextInputFormField<string>;
|
|
@@ -77,7 +77,7 @@ declare type MerchantFormFields = {
|
|
|
77
77
|
primaryDomain: TextInputFormField<string>;
|
|
78
78
|
socialLinks: SingleSelectFormField<SocialLinksType>;
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
type WebhookFormFields = {
|
|
81
81
|
event: SingleSelectFormField<string>;
|
|
82
82
|
callBackUrl: TextInputFormField<string>;
|
|
83
83
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { LayoutElement } from './webshop-page/elements/layout-element-interface';
|
|
2
2
|
import { TypographyElement } from './webshop-page/elements/typography-element-interface';
|
|
3
3
|
import { ButtonElement } from './webshop-page/elements/button-element-interface';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type WebPageElement = LayoutElement | TypographyElement | ButtonElement;
|
|
5
|
+
export type SeoMetadataType = {
|
|
6
6
|
title: string;
|
|
7
7
|
description: string;
|
|
8
8
|
favIconImgUrl: string;
|
|
9
9
|
ogImgUrl: string;
|
|
10
10
|
keywords: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type MerchantWebPageObj = {
|
|
13
13
|
pageTitle: string;
|
|
14
14
|
documentId: string;
|
|
15
15
|
layers: WebPageElement[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type PayoutType = 'bank-transfer' | 'paypal';
|
|
2
|
+
type MailingAddress = {
|
|
3
3
|
name: string;
|
|
4
4
|
street1: string;
|
|
5
5
|
street2?: string;
|
|
@@ -8,7 +8,7 @@ declare type MailingAddress = {
|
|
|
8
8
|
country: string;
|
|
9
9
|
region: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type PayoutAccountObj = {
|
|
12
12
|
recipientAccountId: string;
|
|
13
13
|
type: PayoutType;
|
|
14
14
|
currency: string;
|
|
@@ -28,7 +28,7 @@ declare type PayoutAccountObj = {
|
|
|
28
28
|
mailing: MailingAddress;
|
|
29
29
|
ibanOrSortCodeForGB: 'iban' | 'sort' | '';
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
type PayoutAccountFormFields = {
|
|
32
32
|
type: SingleSelectFormField<string>;
|
|
33
33
|
currency: SingleSelectFormField<string>;
|
|
34
34
|
emailAddress: TextInputFormField<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type ProductAttrRefinementsOptions = 'brand' | 'clothingSize' | 'color' | 'condition' | 'gender' | 'jeanSize' | 'materialComposition' | 'priceRange' | 'productCategory' | 'productType' | 'productStyle' | 'shoeSize' | 'status' | 'salesChannel';
|
|
2
|
+
type FiltersOptions = 'brandRefinement' | 'clothingSizeRefinement' | 'colorRefinement' | 'conditionRefinement' | 'genderRefinement' | 'jeanSizeRefinement' | 'materialCompositionRefinement' | 'priceRangeRefinement' | 'productCategoryRefinement' | 'productTypeRefinement' | 'productStyleRefinement' | 'shoeSizeRefinement' | 'statusRefinement' | 'salesChannelRefinement';
|
|
3
|
+
type FiltersObj = {
|
|
4
4
|
brand?: string[];
|
|
5
5
|
clothingSize?: string[];
|
|
6
6
|
color?: string[];
|
|
@@ -32,8 +32,8 @@ interface ProductRefinements {
|
|
|
32
32
|
statusRefinement?: string[];
|
|
33
33
|
salesChannelRefinement?: string[];
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
type CollectionType = 'AUTOMATED' | 'MANUAL';
|
|
36
|
+
type ProductCollectionType = {
|
|
37
37
|
createdAt?: string;
|
|
38
38
|
createdAtTimestamp?: number;
|
|
39
39
|
updatedAt?: string;
|
|
@@ -50,10 +50,10 @@ declare type ProductCollectionType = {
|
|
|
50
50
|
collectionId: string;
|
|
51
51
|
imageUrls: string[];
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
type CompleteProductCollection = ProductCollectionType & {
|
|
54
54
|
[key: string]: any;
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
type ProductCollectionFormFields = {
|
|
57
57
|
preTitle: TextInputFormField<string>;
|
|
58
58
|
title: TextInputFormField<string>;
|
|
59
59
|
subTitle: TextInputFormField<string>;
|
|
@@ -65,7 +65,7 @@ declare type ProductCollectionFormFields = {
|
|
|
65
65
|
imageUrls: MultiSelectFormField<string>;
|
|
66
66
|
collectionId: TextInputFormField<string>;
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
type TypesenseProductCollectionObj = {
|
|
69
69
|
id: string;
|
|
70
70
|
documentId: string;
|
|
71
71
|
merchantId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type ChatRoomAttributes = {
|
|
2
2
|
documentId: string;
|
|
3
3
|
createdAt: string;
|
|
4
4
|
createdAtTimestamp: number;
|
|
@@ -9,17 +9,17 @@ declare type ChatRoomAttributes = {
|
|
|
9
9
|
userInfo: ChatRoomUserInfoObj;
|
|
10
10
|
merchantId: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type ChatRoomType = 'CUSTOMER_SUPPORT' | 'SELLER_CONCIERGE';
|
|
13
|
+
type LastMessageObj = {
|
|
14
14
|
authorId: string;
|
|
15
15
|
authorName: string;
|
|
16
16
|
content: string;
|
|
17
17
|
createdAt: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type ChatRoomUserInfoObj = {
|
|
20
20
|
[key: string]: ChatRoomUserInfo;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
type ChatRoomUserInfo = {
|
|
23
23
|
userId: string;
|
|
24
24
|
displayName: string;
|
|
25
25
|
avatarUrl: string;
|
|
@@ -30,7 +30,7 @@ declare type ChatRoomUserInfo = {
|
|
|
30
30
|
isSeller?: boolean;
|
|
31
31
|
firstName?: string;
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
type TypesenseChatRoomObj = {
|
|
34
34
|
id: string;
|
|
35
35
|
documentId: string;
|
|
36
36
|
createdAtTimestamp: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type ChangeHandler = (...args: any[]) => any;
|
|
2
2
|
interface StandardFormField {
|
|
3
3
|
valid: boolean;
|
|
4
4
|
hidden?: boolean;
|
|
@@ -37,13 +37,13 @@ interface FileObj {
|
|
|
37
37
|
interface FileObjWithUploadIndex extends FileObj {
|
|
38
38
|
uploadIndex: number;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
type FormFieldType<T> = StandardFormField | SingleSelectFormField<T> | MultiSelectFormField<T> | TextInputFormField<T> | MultiMediaSelectFormField;
|
|
41
|
+
type FormFieldTypesDict<T> = {
|
|
42
42
|
singleSelect: SingleSelectFormField<T>;
|
|
43
43
|
multiSelect: MultiSelectFormField<T>;
|
|
44
44
|
textInput: TextInputFormField<T>;
|
|
45
45
|
multiMediaSelect: MultiMediaSelectFormField;
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
type FormStateObject = {
|
|
48
48
|
[key: string]: FormFieldType<any>;
|
|
49
49
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type KlarnaSessionObj = {
|
|
2
2
|
purchase_country: string;
|
|
3
3
|
purchase_currency: string;
|
|
4
4
|
locale: string;
|
|
@@ -6,7 +6,7 @@ declare type KlarnaSessionObj = {
|
|
|
6
6
|
order_tax_amount: number;
|
|
7
7
|
order_lines: OrderLine[];
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type OrderLine = {
|
|
10
10
|
type: string;
|
|
11
11
|
name: string;
|
|
12
12
|
quantity: number;
|