rerobe-js-orm 2.4.67 → 2.4.71
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/factories/FormState/ProductCollection/ProductCollectionFormStateFactory.js +1 -1
- package/lib/factories/Order/OrderFromApp.js +3 -1
- package/lib/factories/ProductCollection/ProductCollectionFromFormState.js +10 -0
- package/lib/form-states/ProductCollection/ProductCollectionFormState.d.ts +1 -2
- package/lib/form-states/ProductCollection/ProductCollectionFormState.js +32 -3
- package/lib/helpers/ProductCollectionHelpers.d.ts +4 -0
- package/lib/helpers/ProductCollectionHelpers.js +27 -0
- package/lib/index.d.ts +3 -2
- package/lib/index.js +5 -3
- package/lib/models/Order.d.ts +1 -0
- package/lib/models/Order.js +2 -0
- package/lib/models/ProductCollection.d.ts +2 -0
- package/lib/models/ProductCollection.js +5 -1
- package/lib/types/product-collection-types.d.ts +25 -5
- package/lib/types/rerobe-order-types.d.ts +3 -0
- package/package.json +3 -2
|
@@ -4,7 +4,7 @@ const FormStateFactory_1 = require("../FormStateFactory");
|
|
|
4
4
|
const ProductCollectionFormState_1 = require("../../../form-states/ProductCollection/ProductCollectionFormState");
|
|
5
5
|
class ProductCollectionFormStateFactory extends FormStateFactory_1.default {
|
|
6
6
|
createFormState(props, opts) {
|
|
7
|
-
return new ProductCollectionFormState_1.default(props);
|
|
7
|
+
return new ProductCollectionFormState_1.default(props, opts);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.default = ProductCollectionFormStateFactory;
|
|
@@ -6,7 +6,7 @@ const OrderHelpers_1 = require("../../helpers/OrderHelpers");
|
|
|
6
6
|
const orderHelpers = new OrderHelpers_1.default();
|
|
7
7
|
class OrderFromApp extends OrderFactory_1.default {
|
|
8
8
|
createOrder(order) {
|
|
9
|
-
const { id, orderNumber, amount, currencyCode = 'SEK', shippingDetails, appliedDiscount, products, paymentType, paymentMethod, shippingType, shopifyId, shopifyOrderNumber, state, userId, email, salesChannel, tags, paymentDetails, financialStatus, fulfillmentStatus, } = order;
|
|
9
|
+
const { id, orderNumber, amount, currencyCode = 'SEK', shippingDetails, appliedDiscount, products, paymentType, paymentMethod, shippingType, shopifyId, ribbnOrderNumber, shopifyOrderNumber, state, userId, email, customerName, salesChannel, tags, paymentDetails, financialStatus, fulfillmentStatus, } = order;
|
|
10
10
|
let discount = 0;
|
|
11
11
|
let shippingFee = 0;
|
|
12
12
|
let subTotal = 0;
|
|
@@ -52,12 +52,14 @@ class OrderFromApp extends OrderFactory_1.default {
|
|
|
52
52
|
paymentType: paymentType ? this.utilities.constantCase(paymentType) : Order_1.default.PAYMENT_TYPES.creditCard,
|
|
53
53
|
shippingType: shippingType ? this.utilities.constantCase(shippingType) : Order_1.default.SHIPPING_TYPES.localPickUp,
|
|
54
54
|
shopifyId,
|
|
55
|
+
ribbnOrderNumber,
|
|
55
56
|
shopifyOrderNumber,
|
|
56
57
|
shippingAddress: shippingDetails && shippingDetails.deliveryAddress ? shippingDetails.deliveryAddress : null,
|
|
57
58
|
lineItems,
|
|
58
59
|
state,
|
|
59
60
|
userId,
|
|
60
61
|
email,
|
|
62
|
+
customerName,
|
|
61
63
|
paymentDetails,
|
|
62
64
|
tags,
|
|
63
65
|
salesChannel,
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ProductCollectionFactory_1 = require("./ProductCollectionFactory");
|
|
4
4
|
const ProductCollection_1 = require("../../models/ProductCollection");
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
const lodash_1 = require("lodash");
|
|
5
7
|
class ProductCollectionFromFormState extends ProductCollectionFactory_1.default {
|
|
6
8
|
createProductCollection(fs) {
|
|
9
|
+
var _a;
|
|
10
|
+
let collectionId = fs.fields.collectionId.inputValue;
|
|
11
|
+
if (!collectionId) {
|
|
12
|
+
collectionId = lodash_1.camelCase(fs.fields.title.inputValue) + new Date().toISOString().split('T')[0];
|
|
13
|
+
}
|
|
7
14
|
const productCollectionAttributes = {
|
|
15
|
+
documentId: ((_a = fs.props) === null || _a === void 0 ? void 0 : _a.documentId) || '',
|
|
8
16
|
preTitle: fs.fields.preTitle.inputValue || '',
|
|
9
17
|
title: fs.fields.title.inputValue || '',
|
|
10
18
|
subTitle: fs.fields.subTitle.inputValue || '',
|
|
@@ -12,6 +20,8 @@ class ProductCollectionFromFormState extends ProductCollectionFactory_1.default
|
|
|
12
20
|
type: fs.fields.type.selectedValue || '',
|
|
13
21
|
imgUrl: fs.fields.imgUrl.inputValue || '',
|
|
14
22
|
refinements: fs.fields.refinements.selectedValue || {},
|
|
23
|
+
tags: fs.fields.tags.selectedValues || [],
|
|
24
|
+
collectionId,
|
|
15
25
|
};
|
|
16
26
|
return new ProductCollection_1.default(Object.assign({}, productCollectionAttributes));
|
|
17
27
|
}
|
|
@@ -4,8 +4,7 @@ export default class ProductCollectionFormState extends FormState {
|
|
|
4
4
|
fields: ProductCollectionFormFields;
|
|
5
5
|
props: CompleteProductCollection;
|
|
6
6
|
opts: {
|
|
7
|
-
|
|
8
|
-
productAttrValuesOptions: string[];
|
|
7
|
+
tagOptions: string[];
|
|
9
8
|
};
|
|
10
9
|
constructor(props?: any, opts?: any);
|
|
11
10
|
createProductCollection(): ProductCollection;
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const FormState_1 = require("../FormState");
|
|
4
4
|
const ProductCollection_1 = require("../../models/ProductCollection");
|
|
5
5
|
const ProductCollectionFromFormState_1 = require("../../factories/ProductCollection/ProductCollectionFromFormState");
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
6
8
|
class ProductCollectionFormState extends FormState_1.default {
|
|
7
9
|
constructor(props, opts) {
|
|
8
10
|
super();
|
|
@@ -15,17 +17,19 @@ class ProductCollectionFormState extends FormState_1.default {
|
|
|
15
17
|
this.fields.type = this.fieldFactory('singleSelect', 'type');
|
|
16
18
|
this.fields.imgUrl = this.fieldFactory('textInput', 'imgUrl');
|
|
17
19
|
this.fields.refinements = this.fieldFactory('singleSelect', 'refinements');
|
|
20
|
+
this.fields.tags = this.fieldFactory('multiSelect', 'tags', []);
|
|
21
|
+
this.fields.collectionId = this.fieldFactory('textInput', 'collectionId');
|
|
18
22
|
}
|
|
19
23
|
createProductCollection() {
|
|
20
24
|
const productCollectionFactory = new ProductCollectionFromFormState_1.default();
|
|
21
25
|
return productCollectionFactory.createProductCollection(this);
|
|
22
26
|
}
|
|
23
27
|
fieldFactory(fieldType, fieldKey, fieldOptions) {
|
|
28
|
+
let options = fieldOptions || [];
|
|
24
29
|
if (fieldType === 'singleSelect') {
|
|
25
|
-
const options = fieldOptions || [];
|
|
26
30
|
const selectedValue = this.props[fieldKey] || '';
|
|
27
31
|
const valid = !!this.props[fieldKey];
|
|
28
|
-
const onChangeHandler = (val) => this.singleSelectChangeHandler(fieldKey,
|
|
32
|
+
const onChangeHandler = (val) => this.singleSelectChangeHandler(fieldKey, val);
|
|
29
33
|
return {
|
|
30
34
|
options,
|
|
31
35
|
selectedValue,
|
|
@@ -36,13 +40,38 @@ class ProductCollectionFormState extends FormState_1.default {
|
|
|
36
40
|
if (fieldType === 'textInput') {
|
|
37
41
|
const inputValue = this.props[fieldKey] || '';
|
|
38
42
|
const valid = !!this.props[fieldKey];
|
|
39
|
-
|
|
43
|
+
let onChangeHandler = (val) => this.textInputChangeHandler(fieldKey, String(val));
|
|
44
|
+
if (fieldKey === 'collectionId') {
|
|
45
|
+
onChangeHandler = (val) => this.textInputChangeHandler(fieldKey, lodash_1.camelCase(String(val)));
|
|
46
|
+
}
|
|
40
47
|
return {
|
|
41
48
|
inputValue,
|
|
42
49
|
valid,
|
|
43
50
|
onChangeHandler,
|
|
44
51
|
};
|
|
45
52
|
}
|
|
53
|
+
if (fieldType === 'multiSelect') {
|
|
54
|
+
let selectedValues = [];
|
|
55
|
+
let valid = true;
|
|
56
|
+
const onChangeHandler = (val) => this.multiSelectChangeHandler(fieldKey, val);
|
|
57
|
+
if (fieldKey === 'tags') {
|
|
58
|
+
if (this.props.tags) {
|
|
59
|
+
if (Array.isArray(this.props.tags)) {
|
|
60
|
+
selectedValues = this.props.tags;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (this.opts && this.opts.tagOptions && this.opts.tagOptions.length > 0) {
|
|
64
|
+
options = this.utilities.uniqObjArray([...options, ...this.opts.tagOptions.map((t) => ({ label: t, value: t }))], 'value');
|
|
65
|
+
}
|
|
66
|
+
valid = true;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
options,
|
|
70
|
+
selectedValues,
|
|
71
|
+
valid,
|
|
72
|
+
onChangeHandler,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
46
75
|
return {
|
|
47
76
|
valid: false,
|
|
48
77
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class ProductCollectionHelpers {
|
|
4
|
+
getFiltersByCollectionConditions(collectionRefinementsVal) {
|
|
5
|
+
if (!collectionRefinementsVal && !Object.keys(collectionRefinementsVal).length) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
return Object.keys(collectionRefinementsVal).reduce((result, key) => {
|
|
9
|
+
const keyName = key.replace('Refinement', '');
|
|
10
|
+
result[keyName] = collectionRefinementsVal[key];
|
|
11
|
+
return result;
|
|
12
|
+
}, {});
|
|
13
|
+
}
|
|
14
|
+
getCollectionRefinementsFromFilters(filtersList) {
|
|
15
|
+
if (!filtersList && !Object.keys(filtersList).length) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
return Object.keys(filtersList).reduce((result, key) => {
|
|
19
|
+
if (!filtersList[key].length) {
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
result[`${key}Refinement`] = [...filtersList[key]];
|
|
23
|
+
return result;
|
|
24
|
+
}, {});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = ProductCollectionHelpers;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import ProductFromShopifyJSClientJSONDoc from './factories/Product/ProductFromSh
|
|
|
2
2
|
import ProductFromAlgoliaJSONDoc from './factories/Product/ProductFromAlgoliaJSONDoc';
|
|
3
3
|
import ProductFromShopifyWebhookJSONDoc from './factories/Product/ProductFromShopifyWebhookJSONDoc';
|
|
4
4
|
import ProductFormStateFactory from './factories/FormState/Product/ProductFormStateFactory';
|
|
5
|
-
import
|
|
5
|
+
import ProductCollectionFormStateFactory from './factories/FormState/ProductCollection/ProductCollectionFormStateFactory';
|
|
6
|
+
import ProductCollectionHelpers from './helpers/ProductCollectionHelpers';
|
|
6
7
|
import SellRequestFormStateFactory from './factories/FormState/SellRequest/SellRequestFormStateFactory';
|
|
7
8
|
import PickUpFormStateFactory from './factories/FormState/PickUp/PickUpFormStateFactory';
|
|
8
9
|
import UserFormStateFactory from './factories/FormState/User/UserFormStateFactory';
|
|
@@ -32,4 +33,4 @@ import WebhookFormState from './form-states/Merchant/WebhookFormState';
|
|
|
32
33
|
import ReRobeProductHelpers from './helpers/ReRobeProductHelpers';
|
|
33
34
|
import AnalyticsHelpers from './helpers/AnalyticsHelpers';
|
|
34
35
|
import OrderHelpers from './helpers/OrderHelpers';
|
|
35
|
-
export { ProductFromAlgoliaJSONDoc, ProductFromShopifyWebhookJSONDoc, ProductFromShopifyJSClientJSONDoc, ProductFormStateFactory,
|
|
36
|
+
export { ProductFromAlgoliaJSONDoc, ProductFromShopifyWebhookJSONDoc, ProductFromShopifyJSClientJSONDoc, ProductFormStateFactory, ProductCollectionFormStateFactory, ProductCollectionHelpers, SellRequestFormStateFactory, PickUpFormStateFactory, AddressFormStateFactory, UserFormStateFactory, UserFromShopifyWebhookJSONDoc, UserFromAuthTemplateMethod, DraftOrderFromMirakl, DraftOrderFromApp, ChatRoomFromNewUserSignUp, KlarnaSessionFactory, Product, ProductStateManager, Order, OrderFromShopifyWebhook, OrderFromShopifyAdminApi, OrderFromShopifyStorefrontApi, OrderFromApp, OrderFormStateFactory, RefundFormStateFactory, PayoutAccount, PayoutAccountFormState, Merchant, MerchantFormState, MerchantFormStateFactory, ReRobeProductHelpers, User, AnalyticsHelpers, OrderHelpers, WebhookFormState, };
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebhookFormState = exports.OrderHelpers = exports.AnalyticsHelpers = exports.User = exports.ReRobeProductHelpers = exports.MerchantFormStateFactory = exports.MerchantFormState = exports.Merchant = exports.PayoutAccountFormState = exports.PayoutAccount = exports.RefundFormStateFactory = exports.OrderFormStateFactory = exports.OrderFromApp = exports.OrderFromShopifyStorefrontApi = exports.OrderFromShopifyAdminApi = exports.OrderFromShopifyWebhook = exports.Order = exports.ProductStateManager = exports.Product = exports.KlarnaSessionFactory = exports.ChatRoomFromNewUserSignUp = exports.DraftOrderFromApp = exports.DraftOrderFromMirakl = exports.UserFromAuthTemplateMethod = exports.UserFromShopifyWebhookJSONDoc = exports.UserFormStateFactory = exports.AddressFormStateFactory = exports.PickUpFormStateFactory = exports.SellRequestFormStateFactory = exports.
|
|
3
|
+
exports.WebhookFormState = exports.OrderHelpers = exports.AnalyticsHelpers = exports.User = exports.ReRobeProductHelpers = exports.MerchantFormStateFactory = exports.MerchantFormState = exports.Merchant = exports.PayoutAccountFormState = exports.PayoutAccount = exports.RefundFormStateFactory = exports.OrderFormStateFactory = exports.OrderFromApp = exports.OrderFromShopifyStorefrontApi = exports.OrderFromShopifyAdminApi = exports.OrderFromShopifyWebhook = exports.Order = exports.ProductStateManager = exports.Product = exports.KlarnaSessionFactory = exports.ChatRoomFromNewUserSignUp = exports.DraftOrderFromApp = exports.DraftOrderFromMirakl = exports.UserFromAuthTemplateMethod = exports.UserFromShopifyWebhookJSONDoc = exports.UserFormStateFactory = exports.AddressFormStateFactory = exports.PickUpFormStateFactory = exports.SellRequestFormStateFactory = exports.ProductCollectionHelpers = exports.ProductCollectionFormStateFactory = exports.ProductFormStateFactory = exports.ProductFromShopifyJSClientJSONDoc = exports.ProductFromShopifyWebhookJSONDoc = exports.ProductFromAlgoliaJSONDoc = void 0;
|
|
4
4
|
const ProductFromShopifyJSClientJSONDoc_1 = require("./factories/Product/ProductFromShopifyJSClientJSONDoc");
|
|
5
5
|
exports.ProductFromShopifyJSClientJSONDoc = ProductFromShopifyJSClientJSONDoc_1.default;
|
|
6
6
|
const ProductFromAlgoliaJSONDoc_1 = require("./factories/Product/ProductFromAlgoliaJSONDoc");
|
|
@@ -9,8 +9,10 @@ const ProductFromShopifyWebhookJSONDoc_1 = require("./factories/Product/ProductF
|
|
|
9
9
|
exports.ProductFromShopifyWebhookJSONDoc = ProductFromShopifyWebhookJSONDoc_1.default;
|
|
10
10
|
const ProductFormStateFactory_1 = require("./factories/FormState/Product/ProductFormStateFactory");
|
|
11
11
|
exports.ProductFormStateFactory = ProductFormStateFactory_1.default;
|
|
12
|
-
const
|
|
13
|
-
exports.
|
|
12
|
+
const ProductCollectionFormStateFactory_1 = require("./factories/FormState/ProductCollection/ProductCollectionFormStateFactory");
|
|
13
|
+
exports.ProductCollectionFormStateFactory = ProductCollectionFormStateFactory_1.default;
|
|
14
|
+
const ProductCollectionHelpers_1 = require("./helpers/ProductCollectionHelpers");
|
|
15
|
+
exports.ProductCollectionHelpers = ProductCollectionHelpers_1.default;
|
|
14
16
|
const SellRequestFormStateFactory_1 = require("./factories/FormState/SellRequest/SellRequestFormStateFactory");
|
|
15
17
|
exports.SellRequestFormStateFactory = SellRequestFormStateFactory_1.default;
|
|
16
18
|
const PickUpFormStateFactory_1 = require("./factories/FormState/PickUp/PickUpFormStateFactory");
|
package/lib/models/Order.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export default class Order extends Base {
|
|
|
55
55
|
shippingType: ReRobeShippingAndDeliveryTypes;
|
|
56
56
|
shopifyId: string | null;
|
|
57
57
|
shopifyOrderNumber: number | null;
|
|
58
|
+
ribbnOrderNumber: number | null;
|
|
58
59
|
subtotalPrice: Money;
|
|
59
60
|
tags: string[] | string | null;
|
|
60
61
|
totalDiscount: Money;
|
package/lib/models/Order.js
CHANGED
|
@@ -49,6 +49,7 @@ class Order extends Base_1.default {
|
|
|
49
49
|
this.shippingType = (props === null || props === void 0 ? void 0 : props.shippingType) || Order.SHIPPING_TYPES.localPickUp;
|
|
50
50
|
this.shopifyId = (props === null || props === void 0 ? void 0 : props.shopifyId) || null;
|
|
51
51
|
this.shopifyOrderNumber = (props === null || props === void 0 ? void 0 : props.shopifyOrderNumber) || null;
|
|
52
|
+
this.ribbnOrderNumber = (props === null || props === void 0 ? void 0 : props.ribbnOrderNumber) || null;
|
|
52
53
|
this.subtotalPrice = (props === null || props === void 0 ? void 0 : props.subtotalPrice) || {
|
|
53
54
|
amount: 0,
|
|
54
55
|
};
|
|
@@ -124,6 +125,7 @@ class Order extends Base_1.default {
|
|
|
124
125
|
shippingType: this.shippingType,
|
|
125
126
|
shopifyId: this.shopifyId,
|
|
126
127
|
shopifyOrderNumber: this.shopifyOrderNumber,
|
|
128
|
+
ribbnOrderNumber: this.ribbnOrderNumber,
|
|
127
129
|
subtotalPrice: this.subtotalPrice,
|
|
128
130
|
tags: this.tags,
|
|
129
131
|
totalDiscount: this.totalDiscount,
|
|
@@ -4,7 +4,7 @@ const Base_1 = require("../Base");
|
|
|
4
4
|
class ProductCollection extends Base_1.default {
|
|
5
5
|
constructor(props) {
|
|
6
6
|
super();
|
|
7
|
-
this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) ||
|
|
7
|
+
this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
|
|
8
8
|
this.preTitle = (props === null || props === void 0 ? void 0 : props.preTitle) || '';
|
|
9
9
|
this.title = (props === null || props === void 0 ? void 0 : props.title) || '';
|
|
10
10
|
this.subTitle = (props === null || props === void 0 ? void 0 : props.subTitle) || '';
|
|
@@ -12,6 +12,8 @@ class ProductCollection extends Base_1.default {
|
|
|
12
12
|
this.type = (props === null || props === void 0 ? void 0 : props.type) || 'AUTOMATED';
|
|
13
13
|
this.imgUrl = (props === null || props === void 0 ? void 0 : props.imgUrl) || '';
|
|
14
14
|
this.refinements = (props === null || props === void 0 ? void 0 : props.refinements) || {};
|
|
15
|
+
this.tags = (props === null || props === void 0 ? void 0 : props.tags) || [];
|
|
16
|
+
this.collectionId = (props === null || props === void 0 ? void 0 : props.collectionId) || '';
|
|
15
17
|
}
|
|
16
18
|
toObj() {
|
|
17
19
|
const productCollectionObj = {
|
|
@@ -23,6 +25,8 @@ class ProductCollection extends Base_1.default {
|
|
|
23
25
|
type: this.type,
|
|
24
26
|
imgUrl: this.imgUrl,
|
|
25
27
|
refinements: this.refinements,
|
|
28
|
+
tags: this.tags,
|
|
29
|
+
collectionId: this.collectionId,
|
|
26
30
|
};
|
|
27
31
|
return productCollectionObj;
|
|
28
32
|
}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
declare type ProductAttrRefinementsOptions = 'brand' | 'clothingSize' | 'color' | 'condition' | 'gender' | 'jeanSize' | 'materialComposition' | 'priceRange' | 'productCategory' | 'productType' | 'productStyle' | 'shoeSize';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
declare type ProductAttrRefinementsOptions = 'brand' | 'clothingSize' | 'color' | 'condition' | 'gender' | 'jeanSize' | 'materialComposition' | 'priceRange' | 'productCategory' | 'productType' | 'productStyle' | 'shoeSize' | 'status' | 'salesChannel';
|
|
2
|
+
declare type FiltersOptions = 'brandRefinement' | 'clothingSizeRefinement' | 'colorRefinement' | 'conditionRefinement' | 'genderRefinement' | 'jeanSizeRefinement' | 'materialCompositionRefinement' | 'priceRangeRefinement' | 'productCategoryRefinement' | 'productTypeRefinement' | 'productStyleRefinement' | 'shoeSizeRefinement' | 'statusRefinement' | 'salesChannelRefinement';
|
|
3
|
+
declare type FiltersObj = {
|
|
4
|
+
brand?: string[];
|
|
5
|
+
clothingSize?: string[];
|
|
6
|
+
color?: string[];
|
|
7
|
+
condition?: string[];
|
|
8
|
+
gender?: string[];
|
|
9
|
+
jeanSize?: string[];
|
|
10
|
+
materialComposition?: string[];
|
|
11
|
+
priceRange?: string[];
|
|
12
|
+
productCategory?: string[];
|
|
13
|
+
productType?: string[];
|
|
14
|
+
productStyle?: string[];
|
|
15
|
+
shoeSize?: string[];
|
|
16
|
+
status?: string[];
|
|
17
|
+
salesChannel?: string[];
|
|
18
|
+
};
|
|
19
|
+
interface ProductRefinements {
|
|
6
20
|
brandRefinement?: string[];
|
|
7
21
|
clothingSizeRefinement?: string[];
|
|
8
22
|
colorRefinement?: string[];
|
|
@@ -15,6 +29,8 @@ interface ProductRefinements extends Refinements {
|
|
|
15
29
|
productTypeRefinement?: string[];
|
|
16
30
|
productStyleRefinement?: string[];
|
|
17
31
|
shoeSizeRefinement?: string[];
|
|
32
|
+
statusRefinement?: string[];
|
|
33
|
+
salesChannelRefinement?: string[];
|
|
18
34
|
}
|
|
19
35
|
declare type CollectionType = 'AUTOMATED' | 'MANUAL';
|
|
20
36
|
declare type ProductCollectionType = {
|
|
@@ -28,6 +44,8 @@ declare type ProductCollectionType = {
|
|
|
28
44
|
type: CollectionType;
|
|
29
45
|
imgUrl: string;
|
|
30
46
|
refinements: ProductRefinements;
|
|
47
|
+
tags: string[];
|
|
48
|
+
collectionId: string;
|
|
31
49
|
};
|
|
32
50
|
declare type CompleteProductCollection = ProductCollectionType & {
|
|
33
51
|
[key: string]: any;
|
|
@@ -40,4 +58,6 @@ declare type ProductCollectionFormFields = {
|
|
|
40
58
|
type: SingleSelectFormField<CollectionType>;
|
|
41
59
|
imgUrl: TextInputFormField<string>;
|
|
42
60
|
refinements: SingleSelectFormField<ProductRefinements>;
|
|
61
|
+
tags: MultiSelectFormField<string>;
|
|
62
|
+
collectionId: TextInputFormField<string>;
|
|
43
63
|
};
|
|
@@ -39,6 +39,7 @@ declare type ReRobeOrderObj = {
|
|
|
39
39
|
shippingType: ReRobeShippingAndDeliveryTypes | string;
|
|
40
40
|
shopifyId?: string | null;
|
|
41
41
|
shopifyOrderNumber?: number | null;
|
|
42
|
+
ribbnOrderNumber?: number | null;
|
|
42
43
|
subtotalPrice: Money;
|
|
43
44
|
tags?: string[] | string | null;
|
|
44
45
|
totalDiscount: Money;
|
|
@@ -95,10 +96,12 @@ declare type OrderInput = {
|
|
|
95
96
|
products: CompleteProduct[];
|
|
96
97
|
appliedDiscount?: AppliedDiscount;
|
|
97
98
|
shopifyId?: string | null;
|
|
99
|
+
ribbnOrderNumber?: number | null;
|
|
98
100
|
shopifyOrderNumber?: number | null;
|
|
99
101
|
state?: ReRobeOrderStates | string | null;
|
|
100
102
|
userId?: string | null;
|
|
101
103
|
email?: string | null;
|
|
104
|
+
customerName?: string | null;
|
|
102
105
|
tags?: string[];
|
|
103
106
|
salesChannel?: SalesChannels | string | null;
|
|
104
107
|
paymentDetails?: PaymentDetails | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rerobe-js-orm",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.71",
|
|
4
4
|
"description": "ReRobe's Javascript ORM Framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"prepublishOnly": "npm test && npm run lint",
|
|
15
15
|
"preversion": "npm run lint",
|
|
16
16
|
"version": "npm run format && git add -A src",
|
|
17
|
-
"postversion": "git push && git push --tags"
|
|
17
|
+
"postversion": "git push && git push --tags",
|
|
18
|
+
"clean": "npm run format && npm run lint"
|
|
18
19
|
},
|
|
19
20
|
"repository": {
|
|
20
21
|
"type": "git",
|