rerobe-js-orm 2.8.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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;
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,
@@ -31,6 +31,7 @@ class MerchantFromFormState extends MerchantFactory_1.default {
31
31
  sharedSecret: (_j = fs.props) === null || _j === void 0 ? void 0 : _j.sharedSecret,
32
32
  ribbnId: fs.fields.ribbnId.inputValue,
33
33
  primaryDomain: fs.fields.primaryDomain.inputValue,
34
+ webshopHomePageId: (_k = fs.props) === null || _k === void 0 ? void 0 : _k.webshopHomePageId,
34
35
  };
35
36
  return new Merchant_1.default(Object.assign({}, merchantAttributes));
36
37
  }
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");
@@ -61,6 +61,7 @@ export default class Merchant extends Base {
61
61
  sharedSecret: string;
62
62
  ribbnId: string;
63
63
  primaryDomain: string;
64
+ webshopHomePageId: string;
64
65
  constructor(props?: any);
65
66
  toObj(): MerchantObj;
66
67
  }
@@ -38,6 +38,7 @@ class Merchant extends Base_1.default {
38
38
  this.sharedSecret = (props === null || props === void 0 ? void 0 : props.sharedSecret) || '';
39
39
  this.ribbnId = (props === null || props === void 0 ? void 0 : props.ribbnId) || '';
40
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';
41
42
  }
42
43
  toObj() {
43
44
  return {
@@ -66,6 +67,7 @@ class Merchant extends Base_1.default {
66
67
  sharedSecret: this.sharedSecret,
67
68
  ribbnId: this.ribbnId,
68
69
  primaryDomain: this.primaryDomain,
70
+ webshopHomePageId: this.webshopHomePageId,
69
71
  };
70
72
  }
71
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,45 @@
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
+ var _a, _b;
7
+ super();
8
+ const docId = (props === null || props === void 0 ? void 0 : props.pageTitle) ? this.utilities.camelCase(props.pageTitle) : '';
9
+ this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || docId || this.utilities.makeRandId(28);
10
+ this.pageTitle = (props === null || props === void 0 ? void 0 : props.pageTitle) || '';
11
+ this.navigationTitle = (props === null || props === void 0 ? void 0 : props.navigationTitle) || (props === null || props === void 0 ? void 0 : props.pageTitle) || '';
12
+ this.urlSlug = (props === null || props === void 0 ? void 0 : props.urlSlug) || `/${(props === null || props === void 0 ? void 0 : props.documentId) || docId}`;
13
+ this.layers = (props === null || props === void 0 ? void 0 : props.layers) || [];
14
+ this.password = (props === null || props === void 0 ? void 0 : props.password) || '';
15
+ this.metadata = (props === null || props === void 0 ? void 0 : props.metadata) || {
16
+ title: (props === null || props === void 0 ? void 0 : props.pageTitle) || '',
17
+ description: '',
18
+ ogImgUrl: '',
19
+ keywords: '',
20
+ favIconImgUrl: '',
21
+ };
22
+ this.advancedSettings = (props === null || props === void 0 ? void 0 : props.advancedSettings) || '';
23
+ this.isCustomPage = (_a = props === null || props === void 0 ? void 0 : props.isCustomPage) !== null && _a !== void 0 ? _a : true;
24
+ this.isHidden = (_b = props === null || props === void 0 ? void 0 : props.isHidden) !== null && _b !== void 0 ? _b : false;
25
+ this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
26
+ this.updatedAt = (props === null || props === void 0 ? void 0 : props.updatedAt) || '';
27
+ }
28
+ toObj() {
29
+ return {
30
+ documentId: this.documentId,
31
+ pageTitle: this.pageTitle,
32
+ navigationTitle: this.navigationTitle,
33
+ urlSlug: this.urlSlug,
34
+ layers: this.layers,
35
+ password: this.password,
36
+ metadata: this.metadata,
37
+ advancedSettings: this.advancedSettings,
38
+ isCustomPage: this.isCustomPage,
39
+ isHidden: this.isHidden,
40
+ createdAt: this.createdAt,
41
+ updatedAt: this.updatedAt,
42
+ };
43
+ }
44
+ }
45
+ exports.default = MerchantWebPage;
@@ -24,6 +24,7 @@ declare type MerchantObj = {
24
24
  sharedSecret: string;
25
25
  ribbnId: string;
26
26
  primaryDomain: string;
27
+ webshopHomePageId: string;
27
28
  };
28
29
  declare type MerchantTypes = 'INDIVIDUAL' | 'BUSINESS';
29
30
  declare type RibbnPaymentTiers = 'FREE' | 'TIER_ONE';
@@ -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 });
@@ -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.8.0",
3
+ "version": "2.9.1",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",