@warpstore/warpstore-package 2.0.3 → 3.0.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.
- package/README.md +1 -1
- package/dist/src/index.js +4 -8
- package/dist/src/main.d.ts +12 -4
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +14 -4
- package/dist/src/modules/checkout/index.d.ts +6 -0
- package/dist/src/modules/checkout/index.d.ts.map +1 -0
- package/dist/src/modules/checkout/index.js +10 -0
- package/dist/src/modules/checkout/{dtos.d.ts → versions/v1/dto.d.ts} +4 -5
- package/dist/src/modules/checkout/versions/v1/dto.d.ts.map +1 -0
- package/dist/src/modules/checkout/versions/v1/errors/errors.d.ts +7 -0
- package/dist/src/modules/checkout/versions/v1/errors/errors.d.ts.map +1 -0
- package/dist/src/modules/checkout/{errors → versions/v1/errors}/errors.js +1 -1
- package/dist/src/modules/checkout/versions/v1/errors/index.d.ts +2 -0
- package/dist/src/modules/checkout/versions/v1/errors/index.d.ts.map +1 -0
- package/dist/src/modules/{template/versions → checkout/versions/v1/errors}/index.js +1 -1
- package/dist/src/modules/checkout/versions/v1/v1.d.ts +10 -0
- package/dist/src/modules/checkout/versions/v1/v1.d.ts.map +1 -0
- package/dist/src/modules/checkout/versions/v1/v1.js +17 -0
- package/dist/src/modules/coupons/index.d.ts +6 -0
- package/dist/src/modules/coupons/index.d.ts.map +1 -0
- package/dist/src/modules/coupons/index.js +10 -0
- package/dist/src/modules/coupons/versions/v1/dtos.d.ts +6 -0
- package/dist/src/modules/coupons/versions/v1/dtos.d.ts.map +1 -0
- package/dist/src/modules/coupons/versions/v1/dtos.js +2 -0
- package/dist/src/modules/coupons/versions/v1/errors/errors.d.ts +7 -0
- package/dist/src/modules/coupons/versions/v1/errors/errors.d.ts.map +1 -0
- package/dist/src/modules/coupons/versions/v1/errors/errors.js +10 -0
- package/dist/src/modules/coupons/versions/v1/errors/index.d.ts +2 -0
- package/dist/src/modules/coupons/versions/v1/errors/index.d.ts.map +1 -0
- package/dist/src/modules/coupons/versions/v1/errors/index.js +17 -0
- package/dist/src/modules/coupons/versions/v1/v1.d.ts +14 -0
- package/dist/src/modules/coupons/versions/v1/v1.d.ts.map +1 -0
- package/dist/src/modules/coupons/versions/v1/v1.js +18 -0
- package/dist/src/modules/discord-login/index.d.ts +6 -0
- package/dist/src/modules/discord-login/index.d.ts.map +1 -0
- package/dist/src/modules/discord-login/index.js +10 -0
- package/dist/src/modules/discord-login/versions/v1/dto.d.ts +7 -0
- package/dist/src/modules/discord-login/versions/v1/dto.d.ts.map +1 -0
- package/dist/src/modules/discord-login/versions/v1/dto.js +2 -0
- package/dist/src/modules/discord-login/versions/v1/v1.d.ts +26 -0
- package/dist/src/modules/discord-login/versions/v1/v1.d.ts.map +1 -0
- package/dist/src/modules/discord-login/versions/v1/v1.js +34 -0
- package/dist/src/modules/products/index.d.ts +6 -0
- package/dist/src/modules/products/index.d.ts.map +1 -0
- package/dist/src/modules/products/index.js +10 -0
- package/dist/src/modules/products/versions/v1/dtos.d.ts +24 -0
- package/dist/src/modules/products/versions/v1/dtos.d.ts.map +1 -0
- package/dist/src/modules/products/versions/v1/dtos.js +2 -0
- package/dist/src/modules/products/versions/v1/v1.d.ts +21 -0
- package/dist/src/modules/products/versions/v1/v1.d.ts.map +1 -0
- package/dist/src/modules/products/versions/v1/v1.js +27 -0
- package/dist/src/modules/store/index.d.ts +6 -0
- package/dist/src/modules/store/index.d.ts.map +1 -0
- package/dist/src/modules/store/index.js +10 -0
- package/dist/src/modules/store/versions/v1/dto.d.ts +81 -0
- package/dist/src/modules/store/versions/v1/dto.d.ts.map +1 -0
- package/dist/src/modules/store/versions/v1/errors/errors.d.ts +7 -0
- package/dist/src/modules/store/versions/v1/errors/errors.d.ts.map +1 -0
- package/dist/src/modules/store/versions/v1/errors/errors.js +10 -0
- package/dist/src/modules/store/versions/v1/errors/index.d.ts +2 -0
- package/dist/src/modules/store/versions/v1/errors/index.d.ts.map +1 -0
- package/dist/src/modules/store/versions/v1/errors/index.js +17 -0
- package/dist/src/modules/store/versions/v1/v1.d.ts +18 -0
- package/dist/src/modules/store/versions/v1/v1.d.ts.map +1 -0
- package/dist/src/modules/store/versions/v1/v1.js +27 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/dist/src/modules/checkout/checkout.d.ts +0 -9
- package/dist/src/modules/checkout/checkout.d.ts.map +0 -1
- package/dist/src/modules/checkout/checkout.js +0 -13
- package/dist/src/modules/checkout/dtos.d.ts.map +0 -1
- package/dist/src/modules/checkout/errors/errors.d.ts +0 -7
- package/dist/src/modules/checkout/errors/errors.d.ts.map +0 -1
- package/dist/src/modules/checkout/errors/index.d.ts +0 -1
- package/dist/src/modules/checkout/errors/index.d.ts.map +0 -1
- package/dist/src/modules/checkout/errors/index.js +0 -1
- package/dist/src/modules/template/index.d.ts +0 -5
- package/dist/src/modules/template/index.d.ts.map +0 -1
- package/dist/src/modules/template/index.js +0 -10
- package/dist/src/modules/template/versions/dtos.d.ts +0 -105
- package/dist/src/modules/template/versions/dtos.d.ts.map +0 -1
- package/dist/src/modules/template/versions/errors/errors.d.ts +0 -11
- package/dist/src/modules/template/versions/errors/errors.d.ts.map +0 -1
- package/dist/src/modules/template/versions/errors/errors.js +0 -16
- package/dist/src/modules/template/versions/errors/index.d.ts +0 -1
- package/dist/src/modules/template/versions/errors/index.d.ts.map +0 -1
- package/dist/src/modules/template/versions/errors/index.js +0 -1
- package/dist/src/modules/template/versions/index.d.ts +0 -2
- package/dist/src/modules/template/versions/index.d.ts.map +0 -1
- package/dist/src/modules/template/versions/v1.d.ts +0 -61
- package/dist/src/modules/template/versions/v1.d.ts.map +0 -1
- package/dist/src/modules/template/versions/v1.js +0 -80
- /package/dist/src/modules/checkout/{dtos.js → versions/v1/dto.js} +0 -0
- /package/dist/src/modules/{template/versions/dtos.js → store/versions/v1/dto.js} +0 -0
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ $ npm i @warpstore/warpstore-package
|
|
|
17
17
|
```javascript
|
|
18
18
|
const warpstore = new WarpStore()
|
|
19
19
|
|
|
20
|
-
const response = await warpstore.
|
|
20
|
+
const response = await warpstore.store.v1.getInfo({
|
|
21
21
|
subDomain: "seu_sub_dominio",
|
|
22
22
|
// domain: "ou_seu_dominio"
|
|
23
23
|
})
|
package/dist/src/index.js
CHANGED
|
@@ -3,14 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const main_1 = require("./main");
|
|
4
4
|
(async () => {
|
|
5
5
|
const warpstore = new main_1.WarpStore();
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
accessToken: "11aZi3CExHn1NTUHfShmz8esujwOdm"
|
|
6
|
+
const storeInfo = await warpstore.store.v1.getInfo({
|
|
7
|
+
subDomain: "demo",
|
|
8
|
+
// domain: "ou_seu_dominio"
|
|
10
9
|
});
|
|
11
|
-
console.log(
|
|
12
|
-
if (response.isFailure()) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
10
|
+
console.log(storeInfo.value);
|
|
15
11
|
})();
|
|
16
12
|
"sdddddsdddddddddddddddddd";
|
package/dist/src/main.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { Checkout } from "./modules/checkout
|
|
2
|
-
import {
|
|
1
|
+
import { Checkout } from "./modules/checkout";
|
|
2
|
+
import { Coupons } from "./modules/coupons";
|
|
3
|
+
import { DiscordLogin } from "./modules/discord-login";
|
|
4
|
+
import { Products } from "./modules/products";
|
|
5
|
+
import { Store } from "./modules/store";
|
|
3
6
|
export declare class WarpStore {
|
|
4
7
|
checkout: Checkout;
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
store: Store;
|
|
9
|
+
products: Products;
|
|
10
|
+
discordLogin: DiscordLogin;
|
|
11
|
+
coupons: Coupons;
|
|
12
|
+
constructor();
|
|
7
13
|
static apiUrl: string;
|
|
14
|
+
static storeId: string;
|
|
8
15
|
static setApiUrl(url: string): void;
|
|
16
|
+
static setStoreId(storeId: string): void;
|
|
9
17
|
}
|
|
10
18
|
//# sourceMappingURL=main.d.ts.map
|
package/dist/src/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,qBAAa,SAAS;IAClB,QAAQ,EAAE,QAAQ,CAAA;IAClB,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,EAAE,QAAQ,CAAA;IAClB,YAAY,EAAE,YAAY,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAA;;IAUhB,MAAM,CAAC,MAAM,SAA8B;IAE3C,MAAM,CAAC,OAAO,EAAE,MAAM,CAAM;IAE5B,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM;IAI5B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM;CAGpC"}
|
package/dist/src/main.js
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WarpStore = void 0;
|
|
4
|
-
const checkout_1 = require("./modules/checkout
|
|
5
|
-
const
|
|
4
|
+
const checkout_1 = require("./modules/checkout");
|
|
5
|
+
const coupons_1 = require("./modules/coupons");
|
|
6
|
+
const discord_login_1 = require("./modules/discord-login");
|
|
7
|
+
const products_1 = require("./modules/products");
|
|
8
|
+
const store_1 = require("./modules/store");
|
|
6
9
|
class WarpStore {
|
|
7
|
-
constructor(
|
|
10
|
+
constructor() {
|
|
8
11
|
this.checkout = new checkout_1.Checkout();
|
|
9
|
-
this.
|
|
12
|
+
this.store = new store_1.Store();
|
|
13
|
+
this.products = new products_1.Products();
|
|
14
|
+
this.discordLogin = new discord_login_1.DiscordLogin();
|
|
15
|
+
this.coupons = new coupons_1.Coupons();
|
|
10
16
|
}
|
|
11
17
|
static setApiUrl(url) {
|
|
12
18
|
WarpStore.apiUrl = url;
|
|
13
19
|
}
|
|
20
|
+
static setStoreId(storeId) {
|
|
21
|
+
WarpStore.storeId = storeId;
|
|
22
|
+
}
|
|
14
23
|
}
|
|
15
24
|
exports.WarpStore = WarpStore;
|
|
16
25
|
WarpStore.apiUrl = "https://api.warpstore.app";
|
|
26
|
+
WarpStore.storeId = "";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/checkout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,QAAQ;;IAGjB,EAAE,EAAE,UAAU,CAAmB;CACpC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Checkout = void 0;
|
|
4
|
+
const v1_1 = require("./versions/v1/v1");
|
|
5
|
+
class Checkout {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.v1 = new v1_1.CheckoutV1();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Checkout = Checkout;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { PaymentMethodsEnum } from "
|
|
2
|
-
export type
|
|
1
|
+
import { PaymentMethodsEnum } from "../../../store/versions/v1/dto";
|
|
2
|
+
export type OrderItemDto = {
|
|
3
3
|
productId: string;
|
|
4
4
|
quantity: number;
|
|
5
5
|
variables?: Record<string, string> | undefined;
|
|
6
6
|
};
|
|
7
7
|
export type PlaceOrderInputDto = {
|
|
8
|
-
items:
|
|
9
|
-
storeId: string;
|
|
8
|
+
items: OrderItemDto[];
|
|
10
9
|
customer: {
|
|
11
10
|
fullName: string;
|
|
12
11
|
email: string;
|
|
@@ -26,4 +25,4 @@ export type PlaceOrderOutputDto = {
|
|
|
26
25
|
paymentLink?: string;
|
|
27
26
|
[key: string]: any;
|
|
28
27
|
};
|
|
29
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/checkout/versions/v1/dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uCAAuC;AAEpE,MAAM,MAAM,YAAY,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;CACjD,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC7B,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,QAAQ,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,iBAAiB,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,OAAO,kBAAkB,CAAA;CAClD,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomDomainError } from "../../../../../core/errors";
|
|
2
|
+
type PlaceOrderErrorType = "GatewayNotEnabledError" | "ProductNotFoundError" | "StoreNotFoundError" | "InsufficientStockError" | "ProductNotFromSameStoreError" | "LimitPerUserReachedError" | "StoreIdNotProvidedError" | string;
|
|
3
|
+
export declare class PlaceOrderError extends CustomDomainError<PlaceOrderErrorType> {
|
|
4
|
+
constructor(name: PlaceOrderErrorType);
|
|
5
|
+
}
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/checkout/versions/v1/errors/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mCAAqB;AAEjD,KAAK,mBAAmB,GAAG,wBAAwB,GAC/C,sBAAsB,GACtB,oBAAoB,GACpB,wBAAwB,GACxB,8BAA8B,GAC9B,0BAA0B,GAAG,yBAAyB,GAAG,MAAM,CAAA;AAEnE,qBAAa,eAAgB,SAAQ,iBAAiB,CAAC,mBAAmB,CAAC;gBAC3D,IAAI,EAAE,mBAAmB;CAGxC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PlaceOrderError = void 0;
|
|
4
|
-
const errors_1 = require("
|
|
4
|
+
const errors_1 = require("../../../../../core/errors");
|
|
5
5
|
class PlaceOrderError extends errors_1.CustomDomainError {
|
|
6
6
|
constructor(name) {
|
|
7
7
|
super(name);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/checkout/versions/v1/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./errors"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Either } from "../../../../core/logic";
|
|
2
|
+
import { PlaceOrderInputDto, PlaceOrderOutputDto } from "./dto";
|
|
3
|
+
import { PlaceOrderError } from "./errors";
|
|
4
|
+
export declare class CheckoutV1 {
|
|
5
|
+
placeOrder(input: PlaceOrderInputDto): Promise<CheckoutV1.PlaceOrderOutput>;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace CheckoutV1 {
|
|
8
|
+
type PlaceOrderOutput = Either<PlaceOrderError, PlaceOrderOutputDto>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=v1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/checkout/versions/v1/v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,+BAAoB;AACrC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,qBAAa,UAAU;IACb,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC;CASpF;AAED,yBAAiB,UAAU,CAAC;IACxB,KAAY,gBAAgB,GAAG,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAA;CAC9E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckoutV1 = void 0;
|
|
4
|
+
const lib_1 = require("../../../../lib");
|
|
5
|
+
const main_1 = require("../../../../main");
|
|
6
|
+
class CheckoutV1 {
|
|
7
|
+
async placeOrder(input) {
|
|
8
|
+
return await lib_1.RequestManager.makeRequest("/store/checkout/order/place-order", {
|
|
9
|
+
method: "POST",
|
|
10
|
+
body: {
|
|
11
|
+
...input,
|
|
12
|
+
storeId: main_1.WarpStore.storeId
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.CheckoutV1 = CheckoutV1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/coupons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,OAAO;;IAGhB,EAAE,EAAE,SAAS,CAAkB;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dtos.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/coupons/versions/v1/dtos.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,GAAG,YAAY,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomDomainError } from "../../../../../core/errors";
|
|
2
|
+
type ValidateCouponType = "CouponNotEnabledError" | "CouponIsExpiredError" | "CouponUseLimitReachedError" | "SignatureNotFoundError";
|
|
3
|
+
export declare class ValidateCouponError extends CustomDomainError<ValidateCouponType> {
|
|
4
|
+
constructor(name: ValidateCouponType);
|
|
5
|
+
}
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/coupons/versions/v1/errors/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mCAAqB;AAEjD,KAAK,kBAAkB,GAAG,uBAAuB,GAAG,sBAAsB,GAAG,4BAA4B,GAAG,wBAAwB,CAAA;AAEpI,qBAAa,mBAAoB,SAAQ,iBAAiB,CAAC,kBAAkB,CAAC;gBAE9D,IAAI,EAAE,kBAAkB;CAGvC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidateCouponError = void 0;
|
|
4
|
+
const errors_1 = require("../../../../../core/errors");
|
|
5
|
+
class ValidateCouponError extends errors_1.CustomDomainError {
|
|
6
|
+
constructor(name) {
|
|
7
|
+
super(name);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ValidateCouponError = ValidateCouponError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/coupons/versions/v1/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./errors"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Either } from "../../../../core/logic";
|
|
2
|
+
import { CouponDto } from "./dtos";
|
|
3
|
+
import { ValidateCouponError } from "./errors";
|
|
4
|
+
export declare class CouponsV1 {
|
|
5
|
+
constructor();
|
|
6
|
+
validateCoupon(input: CouponsV1.ValidateCouponInput): Promise<CouponsV1.ValidateCouponOutput>;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace CouponsV1 {
|
|
9
|
+
type ValidateCouponInput = {
|
|
10
|
+
code: string;
|
|
11
|
+
};
|
|
12
|
+
type ValidateCouponOutput = Either<ValidateCouponError, CouponDto>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=v1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/coupons/versions/v1/v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,+BAAoB;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAG9C,qBAAa,SAAS;;IAGZ,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,oBAAoB,CAAC;CAStG;AAED,yBAAiB,SAAS,CAAC;IACvB,KAAY,mBAAmB,GAAG;QAC9B,IAAI,EAAE,MAAM,CAAA;KACf,CAAA;IAED,KAAY,oBAAoB,GAAG,MAAM,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAA;CAC5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CouponsV1 = void 0;
|
|
4
|
+
const lib_1 = require("../../../../lib");
|
|
5
|
+
const main_1 = require("../../../../main");
|
|
6
|
+
class CouponsV1 {
|
|
7
|
+
constructor() { }
|
|
8
|
+
async validateCoupon(input) {
|
|
9
|
+
return await lib_1.RequestManager.makeRequest("/template/v1/coupon/validate-coupon", {
|
|
10
|
+
method: "POST",
|
|
11
|
+
body: {
|
|
12
|
+
...input,
|
|
13
|
+
storeId: main_1.WarpStore.storeId
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.CouponsV1 = CouponsV1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/discord-login/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,YAAY;;IAGrB,EAAE,EAAE,cAAc,CAAuB;CAC5C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscordLogin = void 0;
|
|
4
|
+
const v1_1 = require("./versions/v1/v1");
|
|
5
|
+
class DiscordLogin {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.v1 = new v1_1.DiscordLoginV1();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.DiscordLogin = DiscordLogin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/discord-login/versions/v1/dto.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DomainError } from "../../../../core/errors";
|
|
2
|
+
import { Either } from "../../../../core/logic";
|
|
3
|
+
import { DiscordUserDto } from "./dto";
|
|
4
|
+
export declare class DiscordLoginV1 {
|
|
5
|
+
getLoginUrl(): Promise<Either<DomainError, {
|
|
6
|
+
url: string;
|
|
7
|
+
}>>;
|
|
8
|
+
changeCodeForToken(input: DiscordLoginV1.ChangeCodeForTokenInput): Promise<DiscordLoginV1.ChangeCodeForTokenOutput>;
|
|
9
|
+
getCurrentUser(input: DiscordLoginV1.GetCurrentUserInput): Promise<DiscordLoginV1.GetCurrentUserOutput>;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace DiscordLoginV1 {
|
|
12
|
+
type GetLoginUrlOutput = Either<DomainError, {
|
|
13
|
+
url: string;
|
|
14
|
+
}>;
|
|
15
|
+
type ChangeCodeForTokenInput = {
|
|
16
|
+
code: string;
|
|
17
|
+
};
|
|
18
|
+
type ChangeCodeForTokenOutput = Either<DomainError, {
|
|
19
|
+
accessToken: string;
|
|
20
|
+
}>;
|
|
21
|
+
type GetCurrentUserInput = {
|
|
22
|
+
accessToken: string;
|
|
23
|
+
};
|
|
24
|
+
type GetCurrentUserOutput = Either<DomainError, DiscordUserDto>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=v1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/discord-login/versions/v1/v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gCAAqB;AAC3C,OAAO,EAAE,MAAM,EAAE,+BAAoB;AAGrC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtC,qBAAa,cAAc;IACjB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAS5D,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,uBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC,wBAAwB,CAAC;IAUnH,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC;CAShH;AAED,yBAAiB,cAAc,CAAC;IAC5B,KAAY,iBAAiB,GAAG,MAAM,CAAC,WAAW,EAAE;QAChD,GAAG,EAAE,MAAM,CAAA;KACd,CAAC,CAAA;IAEF,KAAY,uBAAuB,GAAG;QAClC,IAAI,EAAE,MAAM,CAAA;KACf,CAAA;IAED,KAAY,wBAAwB,GAAG,MAAM,CAAC,WAAW,EAAE;QACvD,WAAW,EAAE,MAAM,CAAA;KACtB,CAAC,CAAA;IAEF,KAAY,mBAAmB,GAAG;QAC9B,WAAW,EAAE,MAAM,CAAA;KACtB,CAAA;IAED,KAAY,oBAAoB,GAAG,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;CACzE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscordLoginV1 = void 0;
|
|
4
|
+
const lib_1 = require("../../../../lib");
|
|
5
|
+
const main_1 = require("../../../../main");
|
|
6
|
+
class DiscordLoginV1 {
|
|
7
|
+
async getLoginUrl() {
|
|
8
|
+
return await lib_1.RequestManager.makeRequest("/template/v1/discord-login-url", {
|
|
9
|
+
method: "GET",
|
|
10
|
+
query: {
|
|
11
|
+
storeId: main_1.WarpStore.storeId
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async changeCodeForToken(input) {
|
|
16
|
+
return await lib_1.RequestManager.makeRequest("/template/v1/discord-login/change-code-for-token", {
|
|
17
|
+
method: "GET",
|
|
18
|
+
query: {
|
|
19
|
+
...input,
|
|
20
|
+
storeId: main_1.WarpStore.storeId
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async getCurrentUser(input) {
|
|
25
|
+
return await lib_1.RequestManager.makeRequest("/template/v1/discord-login/current-user", {
|
|
26
|
+
method: "GET",
|
|
27
|
+
query: {
|
|
28
|
+
...input,
|
|
29
|
+
storeId: main_1.WarpStore.storeId
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.DiscordLoginV1 = DiscordLoginV1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/products/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,QAAQ;;IAGjB,EAAE,EAAE,UAAU,CAAmB;CACpC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Products = void 0;
|
|
4
|
+
const v1_1 = require("./versions/v1/v1");
|
|
5
|
+
class Products {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.v1 = new v1_1.ProductsV1();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Products = Products;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type ProductDetailsDto = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
price: number;
|
|
6
|
+
image: string;
|
|
7
|
+
stock: {
|
|
8
|
+
quantity: number | null;
|
|
9
|
+
isAvaible: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type ProductsPaginationDto = {
|
|
13
|
+
products: ProductDetailsDto[];
|
|
14
|
+
limit: number;
|
|
15
|
+
page: number;
|
|
16
|
+
lastPage: number;
|
|
17
|
+
quantityReturned: number;
|
|
18
|
+
totalQuantity: number | null;
|
|
19
|
+
};
|
|
20
|
+
export type ValidateProductsDto = {
|
|
21
|
+
productsNotFound: string[];
|
|
22
|
+
products: ProductDetailsDto[];
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=dtos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dtos.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/products/versions/v1/dtos.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE;QACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,SAAS,EAAE,OAAO,CAAA;KACrB,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAA;CAChC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DomainError } from "../../../../core/errors";
|
|
2
|
+
import { Either } from "../../../../core/logic";
|
|
3
|
+
import { ProductsPaginationDto, ValidateProductsDto } from "./dtos";
|
|
4
|
+
export declare class ProductsV1 {
|
|
5
|
+
constructor();
|
|
6
|
+
getProducts({ ...input }: ProductsV1.GetProductsInput): Promise<ProductsV1.GetProductsOutput>;
|
|
7
|
+
validateProducts(input: ProductsV1.ValidateProductsInput): Promise<ProductsV1.ValidateProductsOutput>;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace ProductsV1 {
|
|
10
|
+
type GetProductsInput = {
|
|
11
|
+
categoryId: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
page?: number;
|
|
14
|
+
};
|
|
15
|
+
type GetProductsOutput = Either<DomainError, ProductsPaginationDto>;
|
|
16
|
+
type ValidateProductsInput = {
|
|
17
|
+
productsIds: string[];
|
|
18
|
+
};
|
|
19
|
+
type ValidateProductsOutput = Either<DomainError, ValidateProductsDto>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=v1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/products/versions/v1/v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gCAAqB;AAC3C,OAAO,EAAE,MAAM,EAAE,+BAAoB;AACrC,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAInE,qBAAa,UAAU;;IAGb,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,CAAC,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAU7F,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC;CAS9G;AAED,yBAAiB,UAAU,CAAC;IACxB,KAAY,gBAAgB,GAAG;QAC3B,UAAU,EAAE,MAAM,CAAA;QAClB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IAED,KAAY,iBAAiB,GAAG,MAAM,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAA;IAE1E,KAAY,qBAAqB,GAAG;QAChC,WAAW,EAAE,MAAM,EAAE,CAAA;KACxB,CAAA;IAED,KAAY,sBAAsB,GAAG,MAAM,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAA;CAChF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductsV1 = void 0;
|
|
4
|
+
const lib_1 = require("../../../../lib");
|
|
5
|
+
const main_1 = require("../../../../main");
|
|
6
|
+
class ProductsV1 {
|
|
7
|
+
constructor() { }
|
|
8
|
+
async getProducts({ ...input }) {
|
|
9
|
+
return await lib_1.RequestManager.makeRequest("/template/v1/products", {
|
|
10
|
+
method: "GET",
|
|
11
|
+
query: input,
|
|
12
|
+
headers: {
|
|
13
|
+
'store_id': main_1.WarpStore.storeId
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async validateProducts(input) {
|
|
18
|
+
return await lib_1.RequestManager.makeRequest("/template/v1/validate-products", {
|
|
19
|
+
method: "POST",
|
|
20
|
+
body: input,
|
|
21
|
+
headers: {
|
|
22
|
+
'store_id': main_1.WarpStore.storeId
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ProductsV1 = ProductsV1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,qBAAa,KAAK;;IAGd,EAAE,EAAE,OAAO,CAAgB;CAC9B"}
|