rerobe-js-orm 2.7.43 → 2.9.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.
Files changed (28) hide show
  1. package/lib/factories/Merchant/MerchantFromFormState.js +6 -6
  2. package/lib/factories/User/UserFromAuthTemplateMethod.js +3 -10
  3. package/lib/factories/User/UserFromFormState.js +24 -29
  4. package/lib/form-states/Merchant/MerchantFormState.js +2 -0
  5. package/lib/helpers/AnalyticsHelpers.js +1 -2
  6. package/lib/index.d.ts +2 -1
  7. package/lib/index.js +3 -1
  8. package/lib/models/Merchant.d.ts +3 -3
  9. package/lib/models/Merchant.js +6 -18
  10. package/lib/models/MerchantWebPage.d.ts +18 -0
  11. package/lib/models/MerchantWebPage.js +44 -0
  12. package/lib/models/User.d.ts +0 -5
  13. package/lib/models/User.js +0 -19
  14. package/lib/types/merchant-types.d.ts +5 -3
  15. package/lib/types/merchant-webshop-types.d.ts +25 -0
  16. package/lib/types/merchant-webshop-types.js +2 -0
  17. package/lib/types/rerobe-user-types.d.ts +0 -10
  18. package/lib/types/webshop-page/common/web-page-element-common-interface.d.ts +10 -0
  19. package/lib/types/webshop-page/common/web-page-element-common-interface.js +2 -0
  20. package/lib/types/webshop-page/common/web-page-element-property-types.d.ts +62 -0
  21. package/lib/types/webshop-page/common/web-page-element-property-types.js +2 -0
  22. package/lib/types/webshop-page/elements/button-element-interface.d.ts +15 -0
  23. package/lib/types/webshop-page/elements/button-element-interface.js +2 -0
  24. package/lib/types/webshop-page/elements/layout-element-interface.d.ts +17 -0
  25. package/lib/types/webshop-page/elements/layout-element-interface.js +2 -0
  26. package/lib/types/webshop-page/elements/typography-element-interface.d.ts +14 -0
  27. package/lib/types/webshop-page/elements/typography-element-interface.js +2 -0
  28. package/package.json +1 -1
@@ -4,7 +4,7 @@ const MerchantFactory_1 = require("./MerchantFactory");
4
4
  const Merchant_1 = require("../../models/Merchant");
5
5
  class MerchantFromFormState extends MerchantFactory_1.default {
6
6
  createMerchant(fs) {
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
8
8
  const merchantAttributes = {
9
9
  id: ((_a = fs.props) === null || _a === void 0 ? void 0 : _a.id) || '',
10
10
  name: fs.fields.name.inputValue,
@@ -26,12 +26,12 @@ class MerchantFromFormState extends MerchantFactory_1.default {
26
26
  numFiles: (_e = fs.props) === null || _e === void 0 ? void 0 : _e.numFiles,
27
27
  numOrders: (_f = fs.props) === null || _f === void 0 ? void 0 : _f.numOrders,
28
28
  numProducts: (_g = fs.props) === null || _g === void 0 ? void 0 : _g.numProducts,
29
- orderTags: (_h = fs.props) === null || _h === void 0 ? void 0 : _h.orderTags,
30
- productTags: (_j = fs.props) === null || _j === void 0 ? void 0 : _j.productTags,
31
- theme: (_k = fs.props) === null || _k === void 0 ? void 0 : _k.theme,
32
- webshopTenantId: (_l = fs.props) === null || _l === void 0 ? void 0 : _l.webshopTenantId,
29
+ webshopTenantId: (_h = fs.props) === null || _h === void 0 ? void 0 : _h.webshopTenantId,
33
30
  webhooks: fs.fields.webhooks.selectedValues,
34
- sharedSecret: (_m = fs.props) === null || _m === void 0 ? void 0 : _m.sharedSecret,
31
+ sharedSecret: (_j = fs.props) === null || _j === void 0 ? void 0 : _j.sharedSecret,
32
+ ribbnId: fs.fields.ribbnId.inputValue,
33
+ primaryDomain: fs.fields.primaryDomain.inputValue,
34
+ webshopHomePageId: (_k = fs.props) === null || _k === void 0 ? void 0 : _k.webshopHomePageId,
35
35
  };
36
36
  return new Merchant_1.default(Object.assign({}, merchantAttributes));
37
37
  }
@@ -4,20 +4,13 @@ const UserFactory_1 = require("./UserFactory");
4
4
  const User_1 = require("../../models/User");
5
5
  class UserFromAuthTemplateMethod extends UserFactory_1.default {
6
6
  createUser(props) {
7
- const { authUserProfile, prevUserProfile, shoppingBag, savedItems, devicePlatform, shoppingSessionId = '', registrationSource = '', } = props;
8
- let prevShoppingBag = [];
9
- let prevSavedItems = [];
10
- if (prevUserProfile) {
11
- prevShoppingBag =
12
- prevUserProfile.shoppingBag && Array.isArray(prevUserProfile.shoppingBag) ? prevUserProfile.shoppingBag : [];
13
- prevSavedItems =
14
- prevUserProfile.savedItems && Array.isArray(prevUserProfile.savedItems) ? prevUserProfile.savedItems : [];
15
- }
7
+ const { authUserProfile, prevUserProfile, savedItems, devicePlatform, shoppingSessionId = '', registrationSource = '', } = props;
8
+ const prevSavedItems = [];
16
9
  let gid = 'noGid';
17
10
  if (authUserProfile.id && this.shopifyHelpers.getDecodedShopifyId(authUserProfile.id).includes('Customer/')) {
18
11
  [, gid] = this.shopifyHelpers.getDecodedShopifyId(authUserProfile.id).split('Customer/');
19
12
  }
20
- const newUserProfile = Object.assign(Object.assign({}, (prevUserProfile ? prevUserProfile : {})), { uid: authUserProfile.id, gid, displayName: authUserProfile.displayName, firstName: authUserProfile.firstName, lastName: authUserProfile.lastName, email: authUserProfile.email, phone: authUserProfile.phone, addresses: authUserProfile.addresses, referralCode: authUserProfile.id.slice(-7).toLowerCase(), shoppingBag: this.utilities.uniqArray([...prevShoppingBag, ...shoppingBag]), savedItems: this.utilities.uniqArray([...prevSavedItems, ...savedItems]), orders: authUserProfile.orders, devicePlatform,
13
+ const newUserProfile = Object.assign(Object.assign({}, (prevUserProfile ? prevUserProfile : {})), { uid: authUserProfile.id, gid, displayName: authUserProfile.displayName, firstName: authUserProfile.firstName, lastName: authUserProfile.lastName, email: authUserProfile.email, phone: authUserProfile.phone, addresses: authUserProfile.addresses, savedItems: this.utilities.uniqArray([...prevSavedItems, ...savedItems]), devicePlatform,
21
14
  shoppingSessionId, lastLogin: new Date().toISOString(), registrationSource });
22
15
  return new User_1.default(Object.assign({}, newUserProfile));
23
16
  }
@@ -4,7 +4,7 @@ const UserFactory_1 = require("./UserFactory");
4
4
  const User_1 = require("../../models/User");
5
5
  class UserFromFormState extends UserFactory_1.default {
6
6
  createUser(props) {
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
7
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
8
8
  const userAttributes = {
9
9
  documentId: ((_a = props.props) === null || _a === void 0 ? void 0 : _a.documentId) || '',
10
10
  uid: ((_b = props.props) === null || _b === void 0 ? void 0 : _b.uid) || '',
@@ -14,8 +14,7 @@ class UserFromFormState extends UserFactory_1.default {
14
14
  email: props.fields.email.inputValue,
15
15
  phone: props.fields.phone.inputValue,
16
16
  gid: ((_d = props.props) === null || _d === void 0 ? void 0 : _d.gid) || '',
17
- referralCode: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.referralCode) || '',
18
- tokens: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.tokens) || [],
17
+ tokens: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.tokens) || [],
19
18
  addresses: {
20
19
  delivery: props.fields.delivery.selectedValues || [],
21
20
  pickUp: props.fields.pickUp.selectedValue || {
@@ -42,38 +41,34 @@ class UserFromFormState extends UserFactory_1.default {
42
41
  zip: '',
43
42
  },
44
43
  },
45
- availableCredit: ((_g = props.props) === null || _g === void 0 ? void 0 : _g.availableCredit) || 0,
46
- createdAt: ((_h = props.props) === null || _h === void 0 ? void 0 : _h.createdAt) || '',
47
- updatedAt: ((_j = props.props) === null || _j === void 0 ? void 0 : _j.updatedAt) || '',
48
- devicePlatform: ((_k = props.props) === null || _k === void 0 ? void 0 : _k.devicePlatform) || '',
49
- shoppingSessionId: ((_l = props.props) === null || _l === void 0 ? void 0 : _l.shoppingSessionId) || '',
50
- orders: ((_m = props.props) === null || _m === void 0 ? void 0 : _m.orders) || [],
51
- savedItems: ((_o = props.props) === null || _o === void 0 ? void 0 : _o.savedItems) || [],
52
- shoppingBag: ((_p = props.props) === null || _p === void 0 ? void 0 : _p.shoppingBag) || [],
53
- remainingReferralCodes: ((_q = props.props) === null || _q === void 0 ? void 0 : _q.remainingReferralCodes) || 0,
54
- isSeller: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.isSeller) || false,
44
+ createdAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.createdAt) || '',
45
+ updatedAt: ((_g = props.props) === null || _g === void 0 ? void 0 : _g.updatedAt) || '',
46
+ devicePlatform: ((_h = props.props) === null || _h === void 0 ? void 0 : _h.devicePlatform) || '',
47
+ shoppingSessionId: ((_j = props.props) === null || _j === void 0 ? void 0 : _j.shoppingSessionId) || '',
48
+ savedItems: ((_k = props.props) === null || _k === void 0 ? void 0 : _k.savedItems) || [],
49
+ isSeller: ((_l = props.props) === null || _l === void 0 ? void 0 : _l.isSeller) || false,
55
50
  title: props.fields.title.inputValue,
56
51
  aboutMe: props.fields.aboutMe.inputValue,
57
52
  location: props.fields.location.inputValue,
58
53
  avatarUrl: props.fields.avatarUrl.selectedValue,
59
54
  tags: props.fields.tags.selectedValues,
60
55
  notes: props.fields.notes.inputValue,
61
- lastLogin: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.lastLogin) || '',
62
- ordersCount: ((_t = props.props) === null || _t === void 0 ? void 0 : _t.ordersCount) || 0,
63
- amountSpent: ((_u = props.props) === null || _u === void 0 ? void 0 : _u.amountSpent) || 0,
64
- emailVerified: ((_v = props.props) === null || _v === void 0 ? void 0 : _v.emailVerified) || false,
65
- createdAtTimestamp: ((_w = props.props) === null || _w === void 0 ? void 0 : _w.createdAtTimestamp) || 0,
66
- updatedAtTimestamp: ((_x = props.props) === null || _x === void 0 ? void 0 : _x.updatedAtTimestamp) || 0,
67
- itemsUploadedCount: ((_y = props.props) === null || _y === void 0 ? void 0 : _y.itemsUploadedCount) || 0,
68
- inventoryValue: ((_z = props.props) === null || _z === void 0 ? void 0 : _z.inventoryValue) || 0,
69
- inventoryCount: ((_0 = props.props) === null || _0 === void 0 ? void 0 : _0.inventoryCount) || 0,
70
- itemsSoldCount: ((_1 = props.props) === null || _1 === void 0 ? void 0 : _1.itemsSoldCount) || 0,
71
- itemsSoldValue: ((_2 = props.props) === null || _2 === void 0 ? void 0 : _2.itemsSoldValue) || 0,
72
- itemRejectionPct: ((_3 = props.props) === null || _3 === void 0 ? void 0 : _3.itemRejectionPct) || 0,
73
- itemSoldPct: ((_4 = props.props) === null || _4 === void 0 ? void 0 : _4.itemSoldPct) || 0,
74
- lastOrderDate: ((_5 = props.props) === null || _5 === void 0 ? void 0 : _5.lastOrderDate) || '',
75
- lastUploadDate: ((_6 = props.props) === null || _6 === void 0 ? void 0 : _6.lastUploadDate) || '',
76
- registrationSource: ((_7 = props.props) === null || _7 === void 0 ? void 0 : _7.registrationSource) || '',
56
+ lastLogin: ((_m = props.props) === null || _m === void 0 ? void 0 : _m.lastLogin) || '',
57
+ ordersCount: ((_o = props.props) === null || _o === void 0 ? void 0 : _o.ordersCount) || 0,
58
+ amountSpent: ((_p = props.props) === null || _p === void 0 ? void 0 : _p.amountSpent) || 0,
59
+ emailVerified: ((_q = props.props) === null || _q === void 0 ? void 0 : _q.emailVerified) || false,
60
+ createdAtTimestamp: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.createdAtTimestamp) || 0,
61
+ updatedAtTimestamp: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.updatedAtTimestamp) || 0,
62
+ itemsUploadedCount: ((_t = props.props) === null || _t === void 0 ? void 0 : _t.itemsUploadedCount) || 0,
63
+ inventoryValue: ((_u = props.props) === null || _u === void 0 ? void 0 : _u.inventoryValue) || 0,
64
+ inventoryCount: ((_v = props.props) === null || _v === void 0 ? void 0 : _v.inventoryCount) || 0,
65
+ itemsSoldCount: ((_w = props.props) === null || _w === void 0 ? void 0 : _w.itemsSoldCount) || 0,
66
+ itemsSoldValue: ((_x = props.props) === null || _x === void 0 ? void 0 : _x.itemsSoldValue) || 0,
67
+ itemRejectionPct: ((_y = props.props) === null || _y === void 0 ? void 0 : _y.itemRejectionPct) || 0,
68
+ itemSoldPct: ((_z = props.props) === null || _z === void 0 ? void 0 : _z.itemSoldPct) || 0,
69
+ lastOrderDate: ((_0 = props.props) === null || _0 === void 0 ? void 0 : _0.lastOrderDate) || '',
70
+ lastUploadDate: ((_1 = props.props) === null || _1 === void 0 ? void 0 : _1.lastUploadDate) || '',
71
+ registrationSource: ((_2 = props.props) === null || _2 === void 0 ? void 0 : _2.registrationSource) || '',
77
72
  };
78
73
  return new User_1.default(Object.assign({}, userAttributes));
79
74
  }
@@ -22,6 +22,8 @@ class MerchantFormState extends FormState_1.default {
22
22
  this.fields.unitSystem = this.fieldFactory('singleSelect', 'unitSystem', options_1.unitSystemOptions);
23
23
  this.fields.defaultWeightUnit = this.fieldFactory('singleSelect', 'defaultWeightUnit');
24
24
  this.fields.webhooks = this.fieldFactory('multiSelect', 'webhooks');
25
+ this.fields.ribbnId = this.fieldFactory('textInput', 'ribbnId');
26
+ this.fields.primaryDomain = this.fieldFactory('textInput', 'primaryDomain');
25
27
  }
26
28
  createMerchant() {
27
29
  const merchantFactory = new MerchantFromFormState_1.default();
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class AnalyticsHelpers {
4
4
  // Trait object for analytics.identify (https://segment.com/docs/connections/spec/identify/)
5
5
  static createIdentifyPayloadForSegment(userProps) {
6
- const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount = 0, amountSpent = 0, itemsUploadedCount = 0, lastOrderDate, inventoryValue = 0, inventoryCount = 0, itemsSoldCount = 0, itemsSoldValue = 0, itemRejectionPct, itemSoldPct, lastUploadDate, availableCredit, registrationSource = '', } = userProps;
6
+ const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount = 0, amountSpent = 0, itemsUploadedCount = 0, lastOrderDate, inventoryValue = 0, inventoryCount = 0, itemsSoldCount = 0, itemsSoldValue = 0, itemRejectionPct, itemSoldPct, lastUploadDate, registrationSource = '', } = userProps;
7
7
  // Step 1. Get all reserved traits (https://segment.com/docs/connections/spec/identify/#traits)
8
8
  const reservedTraitsObj = {
9
9
  firstName,
@@ -30,7 +30,6 @@ class AnalyticsHelpers {
30
30
  itemSoldPct,
31
31
  lastOrderDate,
32
32
  lastUploadDate,
33
- availableCredit,
34
33
  registrationSource,
35
34
  };
36
35
  return {
package/lib/index.d.ts CHANGED
@@ -25,6 +25,7 @@ import Product from './models/Product';
25
25
  import Order from './models/Order';
26
26
  import Merchant from './models/Merchant';
27
27
  import User from './models/User';
28
+ import MerchantWebPage from './models/MerchantWebPage';
28
29
  import ProductStateManager from './models/ProductStateManager';
29
30
  import PayoutAccount from './models/PayoutAccount';
30
31
  import PayoutAccountFormState from './form-states/PayoutAccount/PayoutAccountFormState';
@@ -33,4 +34,4 @@ import WebhookFormState from './form-states/Merchant/WebhookFormState';
33
34
  import ReRobeProductHelpers from './helpers/ReRobeProductHelpers';
34
35
  import AnalyticsHelpers from './helpers/AnalyticsHelpers';
35
36
  import OrderHelpers from './helpers/OrderHelpers';
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, };
37
+ 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, MerchantWebPage, };
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.ProductCollectionHelpers = exports.ProductCollectionFormStateFactory = exports.ProductFormStateFactory = exports.ProductFromShopifyJSClientJSONDoc = exports.ProductFromShopifyWebhookJSONDoc = exports.ProductFromAlgoliaJSONDoc = void 0;
3
+ exports.MerchantWebPage = 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");
@@ -55,6 +55,8 @@ const Merchant_1 = require("./models/Merchant");
55
55
  exports.Merchant = Merchant_1.default;
56
56
  const User_1 = require("./models/User");
57
57
  exports.User = User_1.default;
58
+ const MerchantWebPage_1 = require("./models/MerchantWebPage");
59
+ exports.MerchantWebPage = MerchantWebPage_1.default;
58
60
  const ProductStateManager_1 = require("./models/ProductStateManager");
59
61
  exports.ProductStateManager = ProductStateManager_1.default;
60
62
  const PayoutAccount_1 = require("./models/PayoutAccount");
@@ -56,12 +56,12 @@ export default class Merchant extends Base {
56
56
  numFiles: number;
57
57
  numOrders: number;
58
58
  numProducts: number;
59
- orderTags: string[];
60
- productTags: string[];
61
- theme: MerchantTheme;
62
59
  webshopTenantId: string;
63
60
  webhooks: MerchantWebHook[];
64
61
  sharedSecret: string;
62
+ ribbnId: string;
63
+ primaryDomain: string;
64
+ webshopHomePageId: string;
65
65
  constructor(props?: any);
66
66
  toObj(): MerchantObj;
67
67
  }
@@ -33,24 +33,12 @@ class Merchant extends Base_1.default {
33
33
  this.numFiles = (props === null || props === void 0 ? void 0 : props.numFiles) || 0;
34
34
  this.numOrders = (props === null || props === void 0 ? void 0 : props.numOrders) || 0;
35
35
  this.numProducts = (props === null || props === void 0 ? void 0 : props.numProducts) || 0;
36
- this.orderTags = (props === null || props === void 0 ? void 0 : props.orderTags) || [];
37
- this.productTags = (props === null || props === void 0 ? void 0 : props.productTags) || [];
38
- this.theme = (props === null || props === void 0 ? void 0 : props.theme) || {
39
- layoutType: 'StandardNavLayout',
40
- bgColor: '#fff',
41
- bgFooterColor: '#000',
42
- primaryColor: '#009688',
43
- footerTextColor: '#fff',
44
- textColor: '#000',
45
- successColor: '#009460',
46
- warningColor: '#edaf4a',
47
- errorColor: '#da344d',
48
- logoImageSrc: '',
49
- logoImageWidth: '60',
50
- };
51
36
  this.webshopTenantId = (props === null || props === void 0 ? void 0 : props.webshopTenantId) || '';
52
37
  this.webhooks = (props === null || props === void 0 ? void 0 : props.webhooks) || [];
53
38
  this.sharedSecret = (props === null || props === void 0 ? void 0 : props.sharedSecret) || '';
39
+ this.ribbnId = (props === null || props === void 0 ? void 0 : props.ribbnId) || '';
40
+ this.primaryDomain = (props === null || props === void 0 ? void 0 : props.primaryDomain) || '';
41
+ this.webshopHomePageId = (props === null || props === void 0 ? void 0 : props.webshopHomePageId) || 'home';
54
42
  }
55
43
  toObj() {
56
44
  return {
@@ -74,12 +62,12 @@ class Merchant extends Base_1.default {
74
62
  numFiles: this.numFiles,
75
63
  numOrders: this.numOrders,
76
64
  numProducts: this.numProducts,
77
- orderTags: this.orderTags,
78
- productTags: this.productTags,
79
- theme: this.theme,
80
65
  webshopTenantId: this.webshopTenantId,
81
66
  webhooks: this.webhooks,
82
67
  sharedSecret: this.sharedSecret,
68
+ ribbnId: this.ribbnId,
69
+ primaryDomain: this.primaryDomain,
70
+ webshopHomePageId: this.webshopHomePageId,
83
71
  };
84
72
  }
85
73
  }
@@ -0,0 +1,18 @@
1
+ import Base from '../Base';
2
+ import { MerchantWebPageObj, SeoMetadataType, WebPageElement } from '../types/merchant-webshop-types';
3
+ export default class MerchantWebPage extends Base {
4
+ documentId: string;
5
+ pageTitle: string;
6
+ navigationTitle: string;
7
+ urlSlug: string;
8
+ layers: WebPageElement[];
9
+ password?: string;
10
+ metadata: SeoMetadataType;
11
+ advancedSettings: string;
12
+ isCustomPage: boolean;
13
+ isHidden: boolean;
14
+ createdAt?: string;
15
+ updatedAt?: string;
16
+ constructor(props?: any);
17
+ toObj(): MerchantWebPageObj;
18
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Base_1 = require("../Base");
4
+ class MerchantWebPage extends Base_1.default {
5
+ constructor(props) {
6
+ super();
7
+ const docId = props.pageTitle ? this.utilities.camelCase(props.pageTitle) : '';
8
+ this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || docId;
9
+ this.pageTitle = (props === null || props === void 0 ? void 0 : props.pageTitle) || '';
10
+ this.navigationTitle = (props === null || props === void 0 ? void 0 : props.navigationTitle) || (props === null || props === void 0 ? void 0 : props.pageTitle) || '';
11
+ this.urlSlug = (props === null || props === void 0 ? void 0 : props.urlSlug) || `/${(props === null || props === void 0 ? void 0 : props.documentId) || docId}`;
12
+ this.layers = (props === null || props === void 0 ? void 0 : props.layers) || [];
13
+ this.password = (props === null || props === void 0 ? void 0 : props.password) || '';
14
+ this.metadata = (props === null || props === void 0 ? void 0 : props.metadata) || {
15
+ title: (props === null || props === void 0 ? void 0 : props.pageTitle) || '',
16
+ description: '',
17
+ ogImgUrl: '',
18
+ keywords: '',
19
+ favIconImgUrl: '',
20
+ };
21
+ this.advancedSettings = (props === null || props === void 0 ? void 0 : props.advancedSettings) || '';
22
+ this.isCustomPage = (props === null || props === void 0 ? void 0 : props.isCustomPage) || true;
23
+ this.isHidden = (props === null || props === void 0 ? void 0 : props.isHidden) || false;
24
+ this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
25
+ this.updatedAt = (props === null || props === void 0 ? void 0 : props.updatedAt) || '';
26
+ }
27
+ toObj() {
28
+ return {
29
+ documentId: this.documentId,
30
+ pageTitle: this.pageTitle,
31
+ navigationTitle: this.navigationTitle,
32
+ urlSlug: this.urlSlug,
33
+ layers: this.layers,
34
+ password: this.password,
35
+ metadata: this.metadata,
36
+ advancedSettings: this.advancedSettings,
37
+ isCustomPage: this.isCustomPage,
38
+ isHidden: this.isHidden,
39
+ createdAt: this.createdAt,
40
+ updatedAt: this.updatedAt,
41
+ };
42
+ }
43
+ }
44
+ exports.default = MerchantWebPage;
@@ -8,10 +8,8 @@ export default class User extends Base {
8
8
  email: string;
9
9
  phone: string;
10
10
  gid: string;
11
- referralCode: string;
12
11
  tokens: string[];
13
12
  addresses: UserAddress;
14
- availableCredit: number;
15
13
  createdAt: string | FireStoreTimeStamp;
16
14
  updatedAt: string | FireStoreTimeStamp;
17
15
  createdAtTimestamp: number;
@@ -19,10 +17,7 @@ export default class User extends Base {
19
17
  lastLogin: string;
20
18
  devicePlatform: string;
21
19
  shoppingSessionId: string;
22
- orders: any[];
23
20
  savedItems: string[];
24
- shoppingBag: string[];
25
- remainingReferralCodes: number;
26
21
  isSeller: boolean;
27
22
  title: string;
28
23
  aboutMe: string;
@@ -12,7 +12,6 @@ class User extends Base_1.default {
12
12
  this.email = (props === null || props === void 0 ? void 0 : props.email) || '';
13
13
  this.phone = (props === null || props === void 0 ? void 0 : props.phone) || '';
14
14
  this.gid = (props === null || props === void 0 ? void 0 : props.gid) || '';
15
- this.referralCode = (props === null || props === void 0 ? void 0 : props.referralCode) || '';
16
15
  this.tokens = (props === null || props === void 0 ? void 0 : props.tokens) || [];
17
16
  this.addresses = (props === null || props === void 0 ? void 0 : props.addresses) || {
18
17
  delivery: [],
@@ -31,17 +30,13 @@ class User extends Base_1.default {
31
30
  billing: [],
32
31
  payout: {},
33
32
  };
34
- this.availableCredit = (props === null || props === void 0 ? void 0 : props.availableCredit) || 0;
35
33
  this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
36
34
  this.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) || 0;
37
35
  this.updatedAtTimestamp = (props === null || props === void 0 ? void 0 : props.updatedAtTimestamp) || 0;
38
36
  this.updatedAt = (props === null || props === void 0 ? void 0 : props.updatedAt) || '';
39
37
  this.devicePlatform = (props === null || props === void 0 ? void 0 : props.devicePlatform) || '';
40
38
  this.shoppingSessionId = (props === null || props === void 0 ? void 0 : props.shoppingSessionId) || '';
41
- this.orders = (props === null || props === void 0 ? void 0 : props.orders) || [];
42
39
  this.savedItems = (props === null || props === void 0 ? void 0 : props.savedItems) || [];
43
- this.shoppingBag = (props === null || props === void 0 ? void 0 : props.shoppingBag) || [];
44
- this.remainingReferralCodes = (props === null || props === void 0 ? void 0 : props.remainingReferralCodes) || 5;
45
40
  this.isSeller = (props === null || props === void 0 ? void 0 : props.isSeller) || false;
46
41
  this.title = (props === null || props === void 0 ? void 0 : props.title) || '';
47
42
  this.aboutMe = (props === null || props === void 0 ? void 0 : props.aboutMe) || '';
@@ -77,20 +72,15 @@ class User extends Base_1.default {
77
72
  email: this.email,
78
73
  phone: this.phone,
79
74
  gid: this.gid,
80
- referralCode: this.referralCode,
81
75
  tokens: this.tokens,
82
76
  addresses: this.addresses,
83
- availableCredit: this.availableCredit,
84
77
  createdAt: this.createdAt,
85
78
  updatedAt: this.updatedAt,
86
79
  createdAtTimestamp: this.createdAtTimestamp,
87
80
  updatedAtTimestamp: this.updatedAtTimestamp,
88
81
  devicePlatform: this.devicePlatform,
89
82
  shoppingSessionId: this.shoppingSessionId,
90
- orders: this.orders,
91
83
  savedItems: this.savedItems,
92
- shoppingBag: this.shoppingBag,
93
- remainingReferralCodes: this.remainingReferralCodes,
94
84
  isSeller: this.isSeller,
95
85
  title: this.title,
96
86
  aboutMe: this.aboutMe,
@@ -166,11 +156,9 @@ class User extends Base_1.default {
166
156
  email: this.email,
167
157
  phone: this.phone,
168
158
  addresses: this.addresses,
169
- availableCredit: this.availableCredit,
170
159
  createdAt: this.createdAt,
171
160
  shoppingSessionId: this.shoppingSessionId,
172
161
  savedItems: this.savedItems,
173
- shoppingBag: this.shoppingBag,
174
162
  avatarUrl: this.avatarUrl,
175
163
  tags: this.tags,
176
164
  notes: this.notes,
@@ -180,7 +168,6 @@ class User extends Base_1.default {
180
168
  isSeller: this.isSeller,
181
169
  devicePlatform: this.devicePlatform,
182
170
  lastLogin: this.lastLogin,
183
- referralCode: this.referralCode,
184
171
  itemsUploadedCount: this.itemsUploadedCount,
185
172
  inventoryValue: this.inventoryValue,
186
173
  inventoryCount: this.inventoryCount,
@@ -303,11 +290,6 @@ class User extends Base_1.default {
303
290
  name: 'lastUploadTimestamp',
304
291
  type: 'int64',
305
292
  },
306
- {
307
- facet: true,
308
- name: 'availableCredit',
309
- type: 'float',
310
- },
311
293
  {
312
294
  facet: true,
313
295
  name: 'registrationSource',
@@ -340,7 +322,6 @@ class User extends Base_1.default {
340
322
  itemSoldPct: this.utilities.sanitizeNumber(this.itemSoldPct),
341
323
  lastOrderTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastOrderDate).getTime()),
342
324
  lastUploadTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastUploadDate).getTime()),
343
- availableCredit: this.utilities.sanitizeNumber(this.availableCredit),
344
325
  registrationSource: this.utilities.sanitizeString(this.registrationSource),
345
326
  };
346
327
  return stagedObj;
@@ -19,12 +19,12 @@ declare type MerchantObj = {
19
19
  numFiles: number;
20
20
  numOrders: number;
21
21
  numProducts: number;
22
- orderTags: string[];
23
- productTags: string[];
24
- theme: MerchantTheme;
25
22
  webhooks: MerchantWebHook[];
26
23
  webshopTenantId: string;
27
24
  sharedSecret: string;
25
+ ribbnId: string;
26
+ primaryDomain: string;
27
+ webshopHomePageId: string;
28
28
  };
29
29
  declare type MerchantTypes = 'INDIVIDUAL' | 'BUSINESS';
30
30
  declare type RibbnPaymentTiers = 'FREE' | 'TIER_ONE';
@@ -64,6 +64,8 @@ declare type MerchantFormFields = {
64
64
  unitSystem: SingleSelectFormField<string>;
65
65
  defaultWeightUnit: SingleSelectFormField<string>;
66
66
  webhooks: MultiSelectFormField<MerchantWebHook>;
67
+ ribbnId: TextInputFormField<string>;
68
+ primaryDomain: TextInputFormField<string>;
67
69
  };
68
70
  declare type WebhookFormFields = {
69
71
  event: SingleSelectFormField<string>;
@@ -0,0 +1,25 @@
1
+ import { LayoutElement } from './webshop-page/elements/layout-element-interface';
2
+ import { TypographyElement } from './webshop-page/elements/typography-element-interface';
3
+ import { ButtonElement } from './webshop-page/elements/button-element-interface';
4
+ export declare type WebPageElement = LayoutElement | TypographyElement | ButtonElement;
5
+ export declare type SeoMetadataType = {
6
+ title: string;
7
+ description: string;
8
+ favIconImgUrl: string;
9
+ ogImgUrl: string;
10
+ keywords: string;
11
+ };
12
+ export declare type MerchantWebPageObj = {
13
+ pageTitle: string;
14
+ documentId: string;
15
+ layers: WebPageElement[];
16
+ navigationTitle: string;
17
+ urlSlug: string;
18
+ password?: string;
19
+ metadata: SeoMetadataType;
20
+ advancedSettings: string;
21
+ isCustomPage: boolean;
22
+ isHidden: boolean;
23
+ createdAt?: string;
24
+ updatedAt?: string;
25
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,16 +6,11 @@ interface UserAttributes extends ReRobeDocument {
6
6
  email: string;
7
7
  phone: string;
8
8
  gid?: string;
9
- referralCode?: string;
10
9
  tokens?: string[];
11
10
  addresses: UserAddress;
12
- availableCredit: number;
13
11
  devicePlatform: string;
14
12
  shoppingSessionId: string;
15
- orders: any[];
16
13
  savedItems: string[];
17
- shoppingBag: string[];
18
- remainingReferralCodes: number;
19
14
  isSeller: boolean;
20
15
  title?: string;
21
16
  aboutMe?: string;
@@ -52,12 +47,10 @@ declare type RibbnCustomerObj = {
52
47
  email: string;
53
48
  phone?: string;
54
49
  addresses?: UserAddress;
55
- availableCredit?: number;
56
50
  createdAt?: string;
57
51
  updatedAt?: string;
58
52
  shoppingSessionId?: string;
59
53
  savedItems?: string[];
60
- shoppingBag?: string[];
61
54
  avatarUrl?: string | null;
62
55
  tags?: string[];
63
56
  notes?: string;
@@ -67,7 +60,6 @@ declare type RibbnCustomerObj = {
67
60
  isSeller?: boolean;
68
61
  devicePlatform?: string;
69
62
  lastLogin?: string;
70
- referralCode?: string;
71
63
  itemsUploadedCount?: number;
72
64
  inventoryValue?: number;
73
65
  inventoryCount?: number;
@@ -82,7 +74,6 @@ declare type RibbnCustomerObj = {
82
74
  declare type UserObjForAuthTemplateMethod = {
83
75
  authUserProfile: UserFromShopifyGraphQLResp;
84
76
  prevUserProfile: UserAttributes | undefined;
85
- shoppingBag: string[];
86
77
  savedItems: string[];
87
78
  devicePlatform: string;
88
79
  shoppingSessionId: string;
@@ -172,6 +163,5 @@ declare type TypesenseUserObj = {
172
163
  itemSoldPct: number;
173
164
  lastOrderTimestamp: number;
174
165
  lastUploadTimestamp: number;
175
- availableCredit: number;
176
166
  registrationSource: string;
177
167
  };
@@ -0,0 +1,10 @@
1
+ import { WebPageElementAttrProperties, WebPageElementSizeProperties, WebPageElementPositionProperties, WebPageElementMarginProperties, WebPageElementPaddingProperties } from './web-page-element-property-types';
2
+ export interface WebPageElementCommonInterface {
3
+ uniqueId: string;
4
+ elementId: string;
5
+ attributes: WebPageElementAttrProperties;
6
+ size: WebPageElementSizeProperties;
7
+ position: WebPageElementPositionProperties;
8
+ margin: WebPageElementMarginProperties;
9
+ padding: WebPageElementPaddingProperties;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,62 @@
1
+ export declare type WebPageElementAttrProperties = {
2
+ tag: string;
3
+ id: string;
4
+ [x: string]: any;
5
+ };
6
+ export declare type WebPageElementSizeProperties = {
7
+ width: string;
8
+ height: string;
9
+ minWidth: string;
10
+ minHeight: string;
11
+ maxWidth: string;
12
+ maxHeight: string;
13
+ };
14
+ export declare type WebPageElementPositionProperties = {
15
+ position: string;
16
+ left: string;
17
+ top: string;
18
+ justifySelf: string;
19
+ alignSelf: string;
20
+ };
21
+ export declare type WebPageElementMarginProperties = {
22
+ marginTop: string;
23
+ marginRight: string;
24
+ marginBottom: string;
25
+ marginLeft: string;
26
+ };
27
+ export declare type WebPageElementPaddingProperties = {
28
+ paddingTop: string;
29
+ paddingRight: string;
30
+ paddingBottom: string;
31
+ paddingLeft: string;
32
+ };
33
+ declare type WebPageElementPseudoClassOptions = 'focus' | 'hover' | 'active' | 'focus-within' | 'focus-visible';
34
+ export declare type WebPageElementDisplayStatesProperties<T> = {
35
+ [x in WebPageElementPseudoClassOptions]?: T;
36
+ };
37
+ export declare type WebPageElementBackgroundProperties = {
38
+ type: 'color' | 'gradient' | 'image' | '';
39
+ value: string;
40
+ };
41
+ export declare type InnerLayoutProperties = {
42
+ direction: 'row' | 'column';
43
+ justifyContent: 'flex-start' | 'center' | 'flex-end' | 'space-between';
44
+ alignItems: 'flex-start' | 'center' | 'flex-end' | 'stretch';
45
+ gap: string;
46
+ wrap: boolean;
47
+ };
48
+ export declare type TypographyProperties = {
49
+ fontFamily: string;
50
+ fontSize: string;
51
+ fontColor: string;
52
+ fontWeight: number;
53
+ };
54
+ export declare type ButtonProperties = {
55
+ fontFamily: string;
56
+ fontSize: string;
57
+ fontColor: string;
58
+ fontWeight: number;
59
+ buttonName: string;
60
+ buttonColor: string;
61
+ };
62
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import { WebPageElementDisplayStatesProperties } from '../common/web-page-element-property-types';
2
+ import { WebPageElementCommonInterface } from '../common/web-page-element-common-interface';
3
+ declare type ButtonProperties = {
4
+ fontFamily: string;
5
+ fontSize: string;
6
+ fontColor: string;
7
+ fontWeight: string;
8
+ buttonName: string;
9
+ buttonColor: string;
10
+ };
11
+ export interface ButtonElement extends WebPageElementCommonInterface {
12
+ displayStates: WebPageElementDisplayStatesProperties<Omit<ButtonElement, 'displayStates'>>;
13
+ button: ButtonProperties;
14
+ }
15
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { WebPageElementDisplayStatesProperties, WebPageElementBackgroundProperties } from '../common/web-page-element-property-types';
2
+ import { WebPageElementCommonInterface } from '../common/web-page-element-common-interface';
3
+ import { WebPageElement } from '../../merchant-webshop-types';
4
+ declare type InnerLayoutProperties = {
5
+ direction: 'row' | 'column';
6
+ justifyContent: 'flex-start' | 'center' | 'flex-end' | 'space-between';
7
+ alignItems: 'flex-start' | 'center' | 'flex-end' | 'stretch';
8
+ gap: string;
9
+ wrap: boolean;
10
+ };
11
+ export interface LayoutElement extends WebPageElementCommonInterface {
12
+ innerLayout: InnerLayoutProperties;
13
+ background: WebPageElementBackgroundProperties;
14
+ displayStates: WebPageElementDisplayStatesProperties<Omit<LayoutElement, 'displayStates' | 'layers'>>;
15
+ layers: WebPageElement[];
16
+ }
17
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { WebPageElementDisplayStatesProperties } from '../common/web-page-element-property-types';
2
+ import { WebPageElementCommonInterface } from '../common/web-page-element-common-interface';
3
+ declare type TypographyProperties = {
4
+ fontFamily: string;
5
+ fontSize: string;
6
+ fontColor: string;
7
+ fontWeight: string;
8
+ content: string;
9
+ };
10
+ export interface TypographyElement extends WebPageElementCommonInterface {
11
+ displayStates: WebPageElementDisplayStatesProperties<Omit<TypographyElement, 'displayStates'>>;
12
+ typography: TypographyProperties;
13
+ }
14
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.7.43",
3
+ "version": "2.9.0",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",