rerobe-js-orm 4.2.0 → 4.2.2

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.
@@ -61,3 +61,13 @@ export namespace RIBBN_WEBHOOK_EVENT_DICT {
61
61
  const productUpdate: string;
62
62
  const productDelete: string;
63
63
  }
64
+ export namespace SUBSCRIPTION_STATUSES {
65
+ const active: string;
66
+ const past_due: string;
67
+ const canceled: string;
68
+ const unpaid: string;
69
+ const trialing: string;
70
+ const incomplete: string;
71
+ const incomplete_expired: string;
72
+ const paused: string;
73
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RIBBN_WEBHOOK_EVENT_DICT = exports.IMPERIAL_WEIGHT_TYPES = exports.METRIC_WEIGHT_TYPES = exports.UNIT_SYSTEM_TYPES = exports.INDUSTRY_TYPES = exports.PAYMENT_TIERS = exports.MERCHANT_TYPES = void 0;
3
+ exports.SUBSCRIPTION_STATUSES = exports.RIBBN_WEBHOOK_EVENT_DICT = exports.IMPERIAL_WEIGHT_TYPES = exports.METRIC_WEIGHT_TYPES = exports.UNIT_SYSTEM_TYPES = exports.INDUSTRY_TYPES = exports.PAYMENT_TIERS = exports.MERCHANT_TYPES = void 0;
4
4
  exports.MERCHANT_TYPES = {
5
5
  individual: 'INDIVIDUAL',
6
6
  business: 'BUSINESS',
@@ -55,3 +55,13 @@ exports.RIBBN_WEBHOOK_EVENT_DICT = {
55
55
  productDelete: 'PRODUCT_DELETE',
56
56
  // TODO: Add webhook events for other models (Orders, User, etc)
57
57
  };
58
+ exports.SUBSCRIPTION_STATUSES = {
59
+ active: 'ACTIVE',
60
+ past_due: 'PAST_DUE',
61
+ canceled: 'CANCELED',
62
+ unpaid: 'UNPAID',
63
+ trialing: 'TRIALING',
64
+ incomplete: 'INCOMPLETE',
65
+ incomplete_expired: 'INCOMPLETE_EXPIRED',
66
+ paused: 'PAUSED',
67
+ };
@@ -759,7 +759,7 @@ class ReRobeProductHelpers {
759
759
  return {
760
760
  id: productObj.documentId,
761
761
  title: productObj.metaDataTitle || productObj.title,
762
- description: productObj.description || '',
762
+ description: productObj.metaDataDescription || this.autoCreateMetaDescription(productObj),
763
763
  availability: availabilityMapper(productObj.status),
764
764
  condition: 'used',
765
765
  price: `${Number(productObj.price).toFixed(2)} ${currency}`,
@@ -89,7 +89,8 @@ export default class Merchant extends Base {
89
89
  hasAutomatedPayouts?: boolean;
90
90
  hasAIQuickList?: boolean;
91
91
  hasReceiptPrinter?: boolean;
92
- activeSubscription?: StripeSubscription;
92
+ stripeSubscription?: StripeSubscription;
93
+ subscriptionStatus?: string;
93
94
  constructor(props?: any);
94
95
  toObj(): MerchantObj;
95
96
  toMerchantMutableData(): MerchantMutableData;
@@ -50,6 +50,7 @@ class Merchant extends Base_1.default {
50
50
  };
51
51
  this.organizationNumber = (props === null || props === void 0 ? void 0 : props.organizationNumber) || '';
52
52
  this.returnPolicy = (props === null || props === void 0 ? void 0 : props.returnPolicy) || '';
53
+ this.subscriptionStatus = (props === null || props === void 0 ? void 0 : props.subscriptionStatus) || merchant_constants_1.SUBSCRIPTION_STATUSES.trialing;
53
54
  if (props === null || props === void 0 ? void 0 : props.isChannelPartner) {
54
55
  this.isChannelPartner = props.isChannelPartner;
55
56
  }
@@ -103,6 +104,7 @@ class Merchant extends Base_1.default {
103
104
  socialLinks: this.socialLinks,
104
105
  organizationNumber: this.organizationNumber,
105
106
  returnPolicy: this.returnPolicy,
107
+ subscriptionStatus: this.subscriptionStatus,
106
108
  };
107
109
  if (this.isChannelPartner) {
108
110
  mObj.isChannelPartner = this.isChannelPartner;
@@ -45,6 +45,7 @@ type MerchantSystemOnlyMutableData = {
45
45
  hasAutomatedPayouts?: boolean;
46
46
  hasAIQuickList?: boolean;
47
47
  hasReceiptPrinter?: boolean;
48
+ subscriptionStatus?: string;
48
49
  };
49
50
  type MerchantObj = MerchantMutableData & MerchantSystemOnlyMutableData;
50
51
  type MerchantTypes = 'INDIVIDUAL' | 'BUSINESS';
@@ -104,7 +105,7 @@ interface LocationInput extends AddressInput {
104
105
  }
105
106
  type StripeSubscription = {
106
107
  id: string;
107
- status: 'active' | 'past_due' | 'canceled' | 'unpaid' | 'trialing' | 'incomplete' | 'incomplete_expired';
108
+ status: 'active' | 'past_due' | 'canceled' | 'unpaid' | 'trialing' | 'incomplete' | 'incomplete_expired' | 'paused';
108
109
  currentPeriodStart: number;
109
110
  currentPeriodEnd: number;
110
111
  priceId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",