@infrab4a/connect 4.16.0-beta.0 → 4.16.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.
package/index.cjs.js CHANGED
@@ -1843,55 +1843,6 @@ const parseDateTime = (value) => {
1843
1843
  return date;
1844
1844
  };
1845
1845
 
1846
- exports.CheckoutTypes = void 0;
1847
- (function (CheckoutTypes) {
1848
- CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
1849
- CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
1850
- CheckoutTypes[CheckoutTypes["ALL"] = 3] = "ALL";
1851
- })(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
1852
-
1853
- exports.CouponCategory = void 0;
1854
- (function (CouponCategory) {
1855
- CouponCategory["Reembolso"] = "Reembolso";
1856
- CouponCategory["Desculpas"] = "Desculpas";
1857
- CouponCategory["BFlu"] = "BFlu";
1858
- CouponCategory["ROYAL"] = "Royal";
1859
- CouponCategory["Glamqueens"] = "Glamqueens";
1860
- CouponCategory["Glamgirls"] = "Glamgirls";
1861
- CouponCategory["Glamdiva"] = "Glamdiva";
1862
- CouponCategory["Impulsionamento"] = "Impulsionamento";
1863
- CouponCategory["PaidMedia"] = "Paid Media";
1864
- CouponCategory["Organic"] = "Organic";
1865
- CouponCategory["Direct"] = "Direct";
1866
- CouponCategory["CRM"] = "CRM";
1867
- CouponCategory["LOJAUNICO"] = "Loja \u00FAnico";
1868
- CouponCategory["Outros"] = "Outros";
1869
- })(exports.CouponCategory || (exports.CouponCategory = {}));
1870
-
1871
- exports.CouponSubtypes = void 0;
1872
- (function (CouponSubtypes) {
1873
- CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
1874
- CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
1875
- })(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
1876
-
1877
- exports.CouponTypes = void 0;
1878
- (function (CouponTypes) {
1879
- CouponTypes[CouponTypes["ABSOLUTE"] = 1] = "ABSOLUTE";
1880
- CouponTypes[CouponTypes["PERCENTAGE"] = 2] = "PERCENTAGE";
1881
- CouponTypes[CouponTypes["SHIPPING"] = 3] = "SHIPPING";
1882
- })(exports.CouponTypes || (exports.CouponTypes = {}));
1883
-
1884
- exports.Exclusivities = void 0;
1885
- (function (Exclusivities) {
1886
- Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
1887
- Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
1888
- Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
1889
- Exclusivities[Exclusivities["ACTIVE_SUBSCRIBER"] = 4] = "ACTIVE_SUBSCRIBER";
1890
- Exclusivities[Exclusivities["INACTIVE_SUBSCRIBER"] = 5] = "INACTIVE_SUBSCRIBER";
1891
- Exclusivities[Exclusivities["NON_SUBSCRIBER"] = 6] = "NON_SUBSCRIBER";
1892
- })(exports.Exclusivities || (exports.Exclusivities = {}));
1893
-
1894
- const COUPON_EXPIRATION = +1000 * 60 * 60 * 24 * 30;
1895
1846
  class Coupon extends BaseModel {
1896
1847
  get isInfluencer() {
1897
1848
  return !lodash.isNil(this.influencerEmail);
@@ -1899,30 +1850,6 @@ class Coupon extends BaseModel {
1899
1850
  static get identifiersFields() {
1900
1851
  return ['id'];
1901
1852
  }
1902
- static createCoupon(userId) {
1903
- return this.toInstance({
1904
- nickname: `${Date.now()}`,
1905
- checkoutType: exports.CheckoutTypes.ECOMMERCE,
1906
- discount: {
1907
- subscriber: {
1908
- type: exports.CouponTypes.ABSOLUTE,
1909
- value: 10,
1910
- },
1911
- non_subscriber: {
1912
- type: exports.CouponTypes.ABSOLUTE,
1913
- value: 10,
1914
- },
1915
- subscription: {
1916
- type: exports.CouponTypes.ABSOLUTE,
1917
- value: 10,
1918
- },
1919
- },
1920
- user: userId,
1921
- createdAt: new Date(Date.now()),
1922
- beginAt: new Date(Date.now()),
1923
- expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
1924
- });
1925
- }
1926
1853
  }
1927
1854
 
1928
1855
  class SubscriptionPlan extends BaseModel {
@@ -2197,6 +2124,52 @@ tslib.__decorate([
2197
2124
  tslib.__metadata("design:type", Coupon)
2198
2125
  ], Checkout.prototype, "coupon", void 0);
2199
2126
 
2127
+ exports.CouponCategory = void 0;
2128
+ (function (CouponCategory) {
2129
+ CouponCategory["Reembolso"] = "Reembolso";
2130
+ CouponCategory["Desculpas"] = "Desculpas";
2131
+ CouponCategory["BFlu"] = "BFlu";
2132
+ CouponCategory["ROYAL"] = "Royal";
2133
+ CouponCategory["Glamdiva"] = "Glamdiva";
2134
+ CouponCategory["Impulsionamento"] = "Impulsionamento";
2135
+ CouponCategory["PaidMedia"] = "Paid Media";
2136
+ CouponCategory["Organic"] = "Organic";
2137
+ CouponCategory["Direct"] = "Direct";
2138
+ CouponCategory["CRM"] = "CRM";
2139
+ CouponCategory["LOJAUNICO"] = "Loja \u00FAnico";
2140
+ CouponCategory["Outros"] = "Outros";
2141
+ })(exports.CouponCategory || (exports.CouponCategory = {}));
2142
+
2143
+ exports.CouponSubtypes = void 0;
2144
+ (function (CouponSubtypes) {
2145
+ CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
2146
+ CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
2147
+ })(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
2148
+
2149
+ exports.CouponTypes = void 0;
2150
+ (function (CouponTypes) {
2151
+ CouponTypes[CouponTypes["ABSOLUTE"] = 1] = "ABSOLUTE";
2152
+ CouponTypes[CouponTypes["PERCENTAGE"] = 2] = "PERCENTAGE";
2153
+ CouponTypes[CouponTypes["SHIPPING"] = 3] = "SHIPPING";
2154
+ })(exports.CouponTypes || (exports.CouponTypes = {}));
2155
+
2156
+ exports.Exclusivities = void 0;
2157
+ (function (Exclusivities) {
2158
+ Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
2159
+ Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
2160
+ Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
2161
+ Exclusivities[Exclusivities["ACTIVE_SUBSCRIBER"] = 4] = "ACTIVE_SUBSCRIBER";
2162
+ Exclusivities[Exclusivities["INACTIVE_SUBSCRIBER"] = 5] = "INACTIVE_SUBSCRIBER";
2163
+ Exclusivities[Exclusivities["NON_SUBSCRIBER"] = 6] = "NON_SUBSCRIBER";
2164
+ })(exports.Exclusivities || (exports.Exclusivities = {}));
2165
+
2166
+ exports.CheckoutTypes = void 0;
2167
+ (function (CheckoutTypes) {
2168
+ CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
2169
+ CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
2170
+ CheckoutTypes[CheckoutTypes["ALL"] = 3] = "ALL";
2171
+ })(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
2172
+
2200
2173
  exports.OrderStatus = void 0;
2201
2174
  (function (OrderStatus) {
2202
2175
  OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
@@ -6527,6 +6500,9 @@ class VertexAxiosAdapter {
6527
6500
  throw error;
6528
6501
  }
6529
6502
  }
6503
+ bulkProducts(products) {
6504
+ return;
6505
+ }
6530
6506
  }
6531
6507
 
6532
6508
  class ProductsVertexSearch {
package/index.esm.js CHANGED
@@ -1837,55 +1837,6 @@ const parseDateTime = (value) => {
1837
1837
  return date;
1838
1838
  };
1839
1839
 
1840
- var CheckoutTypes;
1841
- (function (CheckoutTypes) {
1842
- CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
1843
- CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
1844
- CheckoutTypes[CheckoutTypes["ALL"] = 3] = "ALL";
1845
- })(CheckoutTypes || (CheckoutTypes = {}));
1846
-
1847
- var CouponCategory;
1848
- (function (CouponCategory) {
1849
- CouponCategory["Reembolso"] = "Reembolso";
1850
- CouponCategory["Desculpas"] = "Desculpas";
1851
- CouponCategory["BFlu"] = "BFlu";
1852
- CouponCategory["ROYAL"] = "Royal";
1853
- CouponCategory["Glamqueens"] = "Glamqueens";
1854
- CouponCategory["Glamgirls"] = "Glamgirls";
1855
- CouponCategory["Glamdiva"] = "Glamdiva";
1856
- CouponCategory["Impulsionamento"] = "Impulsionamento";
1857
- CouponCategory["PaidMedia"] = "Paid Media";
1858
- CouponCategory["Organic"] = "Organic";
1859
- CouponCategory["Direct"] = "Direct";
1860
- CouponCategory["CRM"] = "CRM";
1861
- CouponCategory["LOJAUNICO"] = "Loja \u00FAnico";
1862
- CouponCategory["Outros"] = "Outros";
1863
- })(CouponCategory || (CouponCategory = {}));
1864
-
1865
- var CouponSubtypes;
1866
- (function (CouponSubtypes) {
1867
- CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
1868
- CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
1869
- })(CouponSubtypes || (CouponSubtypes = {}));
1870
-
1871
- var CouponTypes;
1872
- (function (CouponTypes) {
1873
- CouponTypes[CouponTypes["ABSOLUTE"] = 1] = "ABSOLUTE";
1874
- CouponTypes[CouponTypes["PERCENTAGE"] = 2] = "PERCENTAGE";
1875
- CouponTypes[CouponTypes["SHIPPING"] = 3] = "SHIPPING";
1876
- })(CouponTypes || (CouponTypes = {}));
1877
-
1878
- var Exclusivities;
1879
- (function (Exclusivities) {
1880
- Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
1881
- Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
1882
- Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
1883
- Exclusivities[Exclusivities["ACTIVE_SUBSCRIBER"] = 4] = "ACTIVE_SUBSCRIBER";
1884
- Exclusivities[Exclusivities["INACTIVE_SUBSCRIBER"] = 5] = "INACTIVE_SUBSCRIBER";
1885
- Exclusivities[Exclusivities["NON_SUBSCRIBER"] = 6] = "NON_SUBSCRIBER";
1886
- })(Exclusivities || (Exclusivities = {}));
1887
-
1888
- const COUPON_EXPIRATION = +1000 * 60 * 60 * 24 * 30;
1889
1840
  class Coupon extends BaseModel {
1890
1841
  get isInfluencer() {
1891
1842
  return !isNil(this.influencerEmail);
@@ -1893,30 +1844,6 @@ class Coupon extends BaseModel {
1893
1844
  static get identifiersFields() {
1894
1845
  return ['id'];
1895
1846
  }
1896
- static createCoupon(userId) {
1897
- return this.toInstance({
1898
- nickname: `${Date.now()}`,
1899
- checkoutType: CheckoutTypes.ECOMMERCE,
1900
- discount: {
1901
- subscriber: {
1902
- type: CouponTypes.ABSOLUTE,
1903
- value: 10,
1904
- },
1905
- non_subscriber: {
1906
- type: CouponTypes.ABSOLUTE,
1907
- value: 10,
1908
- },
1909
- subscription: {
1910
- type: CouponTypes.ABSOLUTE,
1911
- value: 10,
1912
- },
1913
- },
1914
- user: userId,
1915
- createdAt: new Date(Date.now()),
1916
- beginAt: new Date(Date.now()),
1917
- expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
1918
- });
1919
- }
1920
1847
  }
1921
1848
 
1922
1849
  class SubscriptionPlan extends BaseModel {
@@ -2191,6 +2118,52 @@ __decorate([
2191
2118
  __metadata("design:type", Coupon)
2192
2119
  ], Checkout.prototype, "coupon", void 0);
2193
2120
 
2121
+ var CouponCategory;
2122
+ (function (CouponCategory) {
2123
+ CouponCategory["Reembolso"] = "Reembolso";
2124
+ CouponCategory["Desculpas"] = "Desculpas";
2125
+ CouponCategory["BFlu"] = "BFlu";
2126
+ CouponCategory["ROYAL"] = "Royal";
2127
+ CouponCategory["Glamdiva"] = "Glamdiva";
2128
+ CouponCategory["Impulsionamento"] = "Impulsionamento";
2129
+ CouponCategory["PaidMedia"] = "Paid Media";
2130
+ CouponCategory["Organic"] = "Organic";
2131
+ CouponCategory["Direct"] = "Direct";
2132
+ CouponCategory["CRM"] = "CRM";
2133
+ CouponCategory["LOJAUNICO"] = "Loja \u00FAnico";
2134
+ CouponCategory["Outros"] = "Outros";
2135
+ })(CouponCategory || (CouponCategory = {}));
2136
+
2137
+ var CouponSubtypes;
2138
+ (function (CouponSubtypes) {
2139
+ CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
2140
+ CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
2141
+ })(CouponSubtypes || (CouponSubtypes = {}));
2142
+
2143
+ var CouponTypes;
2144
+ (function (CouponTypes) {
2145
+ CouponTypes[CouponTypes["ABSOLUTE"] = 1] = "ABSOLUTE";
2146
+ CouponTypes[CouponTypes["PERCENTAGE"] = 2] = "PERCENTAGE";
2147
+ CouponTypes[CouponTypes["SHIPPING"] = 3] = "SHIPPING";
2148
+ })(CouponTypes || (CouponTypes = {}));
2149
+
2150
+ var Exclusivities;
2151
+ (function (Exclusivities) {
2152
+ Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
2153
+ Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
2154
+ Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
2155
+ Exclusivities[Exclusivities["ACTIVE_SUBSCRIBER"] = 4] = "ACTIVE_SUBSCRIBER";
2156
+ Exclusivities[Exclusivities["INACTIVE_SUBSCRIBER"] = 5] = "INACTIVE_SUBSCRIBER";
2157
+ Exclusivities[Exclusivities["NON_SUBSCRIBER"] = 6] = "NON_SUBSCRIBER";
2158
+ })(Exclusivities || (Exclusivities = {}));
2159
+
2160
+ var CheckoutTypes;
2161
+ (function (CheckoutTypes) {
2162
+ CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
2163
+ CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
2164
+ CheckoutTypes[CheckoutTypes["ALL"] = 3] = "ALL";
2165
+ })(CheckoutTypes || (CheckoutTypes = {}));
2166
+
2194
2167
  var OrderStatus;
2195
2168
  (function (OrderStatus) {
2196
2169
  OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
@@ -6521,6 +6494,9 @@ class VertexAxiosAdapter {
6521
6494
  throw error;
6522
6495
  }
6523
6496
  }
6497
+ bulkProducts(products) {
6498
+ return;
6499
+ }
6524
6500
  }
6525
6501
 
6526
6502
  class ProductsVertexSearch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.16.0-beta.0",
3
+ "version": "4.16.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -48,6 +48,7 @@ export declare class Coupon extends BaseModel<Coupon> {
48
48
  expiresIn?: Date;
49
49
  shopAvailability: Shops;
50
50
  personId?: number;
51
+ personEmail?: string;
51
52
  influencerEmail?: string;
52
53
  plan?: ClubeDaMensPlan;
53
54
  productsCategories: string[];
@@ -59,5 +60,4 @@ export declare class Coupon extends BaseModel<Coupon> {
59
60
  exclusivityType?: Exclusivities[];
60
61
  get isInfluencer(): boolean;
61
62
  static get identifiersFields(): GenericIdentifier[];
62
- static createCoupon(userId: string): Coupon;
63
63
  }
@@ -3,8 +3,6 @@ export declare enum CouponCategory {
3
3
  Desculpas = "Desculpas",
4
4
  BFlu = "BFlu",
5
5
  ROYAL = "Royal",
6
- Glamqueens = "Glamqueens",
7
- Glamgirls = "Glamgirls",
8
6
  Glamdiva = "Glamdiva",
9
7
  Impulsionamento = "Impulsionamento",
10
8
  PaidMedia = "Paid Media",
@@ -5,7 +5,7 @@ import { FirestoreRepository, FirestoreSubRepository } from '../types';
5
5
  export declare const withHelpers: <TMixinBase extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: MixinCtor<any, any[]> & TMixinBase) => {
6
6
  new (...args: any[]): {
7
7
  [x: string]: any;
8
- toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): T[];
8
+ toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T, import("firebase/firestore").DocumentData> | QueryDocumentSnapshot<T, import("firebase/firestore").DocumentData>[]): T[];
9
9
  isSubCollection<T_1 extends ModelBaseStructure<T_1, T_1["identifiersFields"][number]>, E extends ModelBaseStructure<E, E["identifiersFields"][number]>>(repository: FirestoreRepository<T_1> | FirestoreSubRepository<T_1, E>): repository is FirestoreSubRepository<T_1, E>;
10
10
  };
11
11
  } & TMixinBase;
@@ -1,9 +1,10 @@
1
1
  import { Product } from '../../../domain';
2
- import { ProductSearch } from '../types';
2
+ import { ProductBulk } from '../types';
3
3
  export interface VertexSearchAdapter<T> {
4
- query(searchTerm: string, total: number, gender?: String): Promise<ProductSearch[]>;
4
+ query(searchTerm: string, total: number, gender?: String): Promise<T[]>;
5
5
  get(id: string): Promise<T>;
6
6
  save(data: Product): Promise<any>;
7
7
  update(id: string, data: Product): Promise<any>;
8
8
  delete(id: string): Promise<void>;
9
+ bulkProducts(products: ProductBulk[]): Promise<void>;
9
10
  }
@@ -1,5 +1,5 @@
1
1
  import { Product } from '../../../domain';
2
- import { ProductSearch } from '../types';
2
+ import { ProductBulk, ProductSearch } from '../types';
3
3
  import { VertexSearchConfig } from '../types/axios-vertex-search-config';
4
4
  import { VertexSearchAdapter } from './vertex-ai-search.adapter';
5
5
  export declare class VertexAxiosAdapter implements VertexSearchAdapter<ProductSearch> {
@@ -11,4 +11,5 @@ export declare class VertexAxiosAdapter implements VertexSearchAdapter<ProductSe
11
11
  save(data: Product): Promise<any>;
12
12
  update(id: string, data: Product): Promise<any>;
13
13
  delete(id: string): Promise<void>;
14
+ bulkProducts(products: ProductBulk[]): Promise<void>;
14
15
  }
@@ -1,2 +1,3 @@
1
1
  export * from './axios-vertex-search-config';
2
+ export * from './product-bulk';
2
3
  export * from './product-search';
@@ -0,0 +1,4 @@
1
+ export type ProductBulk = {
2
+ id: string;
3
+ jsonData: string;
4
+ };