rerobe-js-orm 3.0.3 → 3.0.5

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.
@@ -0,0 +1,5 @@
1
+ export namespace CUSTOMER_NOTIFICATION_TYPES {
2
+ const orderCancellation: string;
3
+ const orderConfirmation: string;
4
+ const orderRefund: string;
5
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CUSTOMER_NOTIFICATION_TYPES = void 0;
4
+ exports.CUSTOMER_NOTIFICATION_TYPES = {
5
+ orderCancellation: 'orderCancellation',
6
+ orderConfirmation: 'orderConfirmation',
7
+ orderRefund: 'orderRefund',
8
+ };
package/lib/index.d.ts CHANGED
@@ -27,6 +27,8 @@ import Merchant from './models/Merchant';
27
27
  import User from './models/User';
28
28
  import MerchantWebPage from './models/MerchantWebPage';
29
29
  import ShopifyMerchantAccount from './models/ShopifyMerchantAccount';
30
+ import CustomerNotification from './models/CustomerNotification/CustomerNotification';
31
+ import OrderConfirmationNotification from './models/CustomerNotification/orders/OrderConfirmationNotification';
30
32
  import ProductStateManager from './models/ProductStateManager';
31
33
  import PayoutAccount from './models/PayoutAccount';
32
34
  import PayoutAccountFormState from './form-states/PayoutAccount/PayoutAccountFormState';
@@ -35,4 +37,4 @@ import WebhookFormState from './form-states/Merchant/WebhookFormState';
35
37
  import ReRobeProductHelpers from './helpers/ReRobeProductHelpers';
36
38
  import AnalyticsHelpers from './helpers/AnalyticsHelpers';
37
39
  import OrderHelpers from './helpers/OrderHelpers';
38
- 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, ShopifyMerchantAccount, };
40
+ 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, ShopifyMerchantAccount, CustomerNotification, OrderConfirmationNotification, };
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShopifyMerchantAccount = 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;
3
+ exports.OrderConfirmationNotification = exports.CustomerNotification = exports.ShopifyMerchantAccount = 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");
@@ -59,6 +59,10 @@ const MerchantWebPage_1 = require("./models/MerchantWebPage");
59
59
  exports.MerchantWebPage = MerchantWebPage_1.default;
60
60
  const ShopifyMerchantAccount_1 = require("./models/ShopifyMerchantAccount");
61
61
  exports.ShopifyMerchantAccount = ShopifyMerchantAccount_1.default;
62
+ const CustomerNotification_1 = require("./models/CustomerNotification/CustomerNotification");
63
+ exports.CustomerNotification = CustomerNotification_1.default;
64
+ const OrderConfirmationNotification_1 = require("./models/CustomerNotification/orders/OrderConfirmationNotification");
65
+ exports.OrderConfirmationNotification = OrderConfirmationNotification_1.default;
62
66
  const ProductStateManager_1 = require("./models/ProductStateManager");
63
67
  exports.ProductStateManager = ProductStateManager_1.default;
64
68
  const PayoutAccount_1 = require("./models/PayoutAccount");
@@ -0,0 +1,11 @@
1
+ import Base from '../../Base';
2
+ export default class CustomerNotification extends Base {
3
+ documentId: string;
4
+ createdAt: string;
5
+ merchantId: string;
6
+ customerId: string;
7
+ type: CustomerNotificationType;
8
+ data: any;
9
+ constructor(props?: any);
10
+ toObj(): CustomerNotificationAttributes;
11
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Base_1 = require("../../Base");
4
+ class CustomerNotification extends Base_1.default {
5
+ constructor(props) {
6
+ super();
7
+ this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
8
+ this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
9
+ this.merchantId = (props === null || props === void 0 ? void 0 : props.merchantId) || '';
10
+ this.customerId = (props === null || props === void 0 ? void 0 : props.merchantId) || '';
11
+ this.type = props === null || props === void 0 ? void 0 : props.type;
12
+ this.data = props === null || props === void 0 ? void 0 : props.data;
13
+ }
14
+ toObj() {
15
+ return {
16
+ documentId: this.documentId,
17
+ createdAt: this.createdAt,
18
+ merchantId: this.merchantId,
19
+ customerId: this.customerId,
20
+ type: this.type,
21
+ data: this.data,
22
+ };
23
+ }
24
+ }
25
+ exports.default = CustomerNotification;
@@ -0,0 +1,11 @@
1
+ import BaseCustomerNotification from '../CustomerNotification';
2
+ export default class OrderConfirmationNotification extends BaseCustomerNotification {
3
+ documentId: string;
4
+ createdAt: string;
5
+ merchantId: string;
6
+ customerId: string;
7
+ type: CustomerNotificationType;
8
+ data: any;
9
+ constructor(props?: any);
10
+ toObj(): CustomerNotificationAttributes;
11
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const CustomerNotification_1 = require("../CustomerNotification");
4
+ class OrderConfirmationNotification extends CustomerNotification_1.default {
5
+ constructor(props) {
6
+ super();
7
+ this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
8
+ this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
9
+ this.merchantId = (props === null || props === void 0 ? void 0 : props.merchantId) || '';
10
+ this.customerId = (props === null || props === void 0 ? void 0 : props.merchantId) || '';
11
+ this.type = props === null || props === void 0 ? void 0 : props.type;
12
+ this.data = props === null || props === void 0 ? void 0 : props.data;
13
+ }
14
+ toObj() {
15
+ return {
16
+ documentId: this.documentId,
17
+ createdAt: this.createdAt,
18
+ merchantId: this.merchantId,
19
+ customerId: this.customerId,
20
+ type: this.type,
21
+ data: this.data,
22
+ };
23
+ }
24
+ }
25
+ exports.default = OrderConfirmationNotification;
@@ -222,74 +222,16 @@ class Product extends Base_1.default {
222
222
  }
223
223
  toProductInputObjForShopifyV2(locationId, weightUnit) {
224
224
  const shopifyId = this.attributes.shopifyId;
225
+ const passedTags = this.filterAttributes.tags && Array.isArray(this.filterAttributes.tags) ? this.filterAttributes.tags : [];
225
226
  const productInputObj = {
226
227
  title: this.attributes.title,
227
228
  descriptionHtml: this.attributes.description,
228
229
  productType: this.filterAttributes.productType,
229
230
  vendor: this.attributes.vendorId,
230
231
  tags: [
231
- `gender_attribute:${this.filterAttributes.gender}`,
232
- `productcategory_attribute:${this.filterAttributes.productCategory}`,
233
- `producttype_attribute:${this.filterAttributes.productType}`,
234
- `brand_attribute:${this.filterAttributes.brand}`,
235
- `pricerange_attribute:${this.filterAttributes.priceRange}`,
236
- `color_attribute:${this.filterAttributes.color}`,
237
- `condition_attribute:${this.filterAttributes.condition}`,
238
- `publishType:${this.consignmentAttributes.publishType}`,
239
- this.filterAttributes.jeanSize ? `jeansize_attribute:${this.filterAttributes.jeanSize}` : null,
240
- this.filterAttributes.shoeSize ? `shoesize_attribute:${this.filterAttributes.shoeSize}` : null,
241
- this.filterAttributes.documentId ? `documentId:${this.filterAttributes.documentId}` : null,
242
- this.consignmentAttributes.sellRequestId ? `sellRequestId:${this.consignmentAttributes.sellRequestId}` : null,
243
- this.consignmentAttributes.reRobeCommission
244
- ? `reRobeCommission:${this.consignmentAttributes.reRobeCommission}`
245
- : null,
246
- this.consignmentAttributes.suggestedResalePrice
247
- ? `suggestedResalePrice:${this.consignmentAttributes.suggestedResalePrice}`
248
- : null,
249
- this.consignmentAttributes.nextAvailableSeason
250
- ? `nextAvailableSeason:${this.consignmentAttributes.nextAvailableSeason}`
251
- : null,
252
- this.consignmentAttributes.notesForProductionTeam
253
- ? `notesForProductionTeam:${this.consignmentAttributes.notesForProductionTeam}`
254
- : null,
255
- this.consignmentAttributes.reviewedBy ? `reviewedBy:${this.consignmentAttributes.reviewedBy}` : null,
256
- this.consignmentAttributes.conditionRemarks
257
- ? `conditionRemarks:${this.consignmentAttributes.conditionRemarks}`
258
- : null,
259
- this.consignmentAttributes.productRemarks
260
- ? `productRemarks:${this.consignmentAttributes.productRemarks}`
261
- : null,
262
- this.consignmentAttributes.status ? `status:${this.consignmentAttributes.status}` : null,
263
- this.consignmentAttributes.purchasePrice ? `purchasePrice:${this.consignmentAttributes.purchasePrice}` : null,
264
- this.consignmentAttributes.yearPurchased ? `yearPurchased:${this.consignmentAttributes.yearPurchased}` : null,
265
- this.consignmentAttributes.rejectedReason
266
- ? `rejectedReason:${this.consignmentAttributes.rejectedReason}`
267
- : null,
268
- this.consignmentAttributes.dateSold ? `dateSold:${this.consignmentAttributes.dateSold}` : null,
269
- this.consignmentAttributes.dateInQualityControl
270
- ? `dateInQualityControl:${this.consignmentAttributes.dateInQualityControl}`
271
- : null,
272
- this.consignmentAttributes.dateInPendingPublication
273
- ? `dateInPendingPublication:${this.consignmentAttributes.dateInPendingPublication}`
274
- : null,
275
- this.consignmentAttributes.dateListedOnline
276
- ? `dateListedOnline:${this.consignmentAttributes.dateListedOnline}`
277
- : null,
278
- this.consignmentAttributes.sizeComment ? `sizeComment:${this.consignmentAttributes.sizeComment}` : null,
279
- this.consignmentAttributes.salePrice ? `salePrice:${this.consignmentAttributes.salePrice}` : null,
280
- this.consignmentAttributes.isOnSale ? `isOnSale:${this.consignmentAttributes.isOnSale}` : null,
281
- this.consignmentAttributes.discountType ? `discountType:${this.consignmentAttributes.discountType}` : null,
282
- this.consignmentAttributes.discountValue ? `discountValue:${this.consignmentAttributes.discountValue}` : null,
283
- this.consignmentAttributes.selectedForClearance
284
- ? `selectedForClearance:${this.consignmentAttributes.selectedForClearance}`
285
- : null,
286
- ]
287
- .concat(this.filterAttributes.clothingSize.map((s) => `clothingsize_attribute:${s}`))
288
- .concat(this.filterAttributes.productStyle.map((s) => `productstyle_attribute:${s}`))
289
- .concat(this.materialCompTagsArrayForShopify().map((mc) => `materialcomposition_attribute:${mc}`))
290
- .concat(this.consignmentAttributes.previousSellers.map((prevSellerGid) => `previousSeller:${prevSellerGid}`))
291
- .concat(this.consignmentAttributes.salesChannel.map((s) => `salesChannel:${s}`))
292
- .filter((t) => t),
232
+ this.filterAttributes.documentId ? `ribbnId:${this.filterAttributes.documentId}` : null,
233
+ ...passedTags,
234
+ ].filter((t) => t),
293
235
  variants: [
294
236
  {
295
237
  inventoryPolicy: 'DENY',
@@ -0,0 +1,9 @@
1
+ declare type CustomerNotificationAttributes = {
2
+ documentId: string;
3
+ createdAt: string;
4
+ merchantId: string;
5
+ customerId: string;
6
+ type: CustomerNotificationType;
7
+ data: any;
8
+ };
9
+ declare type CustomerNotificationType = 'CUSTOMER_SUPPORT' | 'SELLER_CONCIERGE';
@@ -0,0 +1 @@
1
+ "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",