@dokamerce/web-sdk 0.9.0 → 0.9.3
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 +61 -19
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web-sdk/src/services/attributes.d.ts +1 -1
- package/dist/web-sdk/src/services/attributes.js +4 -4
- package/dist/web-sdk/src/services/attributes.js.map +1 -1
- package/dist/web-sdk/src/services/brands.d.ts +1 -1
- package/dist/web-sdk/src/services/brands.js +4 -4
- package/dist/web-sdk/src/services/brands.js.map +1 -1
- package/dist/web-sdk/src/services/categories.d.ts +1 -1
- package/dist/web-sdk/src/services/categories.js +4 -4
- package/dist/web-sdk/src/services/categories.js.map +1 -1
- package/dist/web-sdk/src/services/colors.d.ts +1 -1
- package/dist/web-sdk/src/services/colors.js +4 -4
- package/dist/web-sdk/src/services/colors.js.map +1 -1
- package/dist/web-sdk/src/services/customers.d.ts +1 -1
- package/dist/web-sdk/src/services/customers.js +6 -6
- package/dist/web-sdk/src/services/customers.js.map +1 -1
- package/dist/web-sdk/src/services/files.d.ts +1 -1
- package/dist/web-sdk/src/services/files.js +4 -4
- package/dist/web-sdk/src/services/files.js.map +1 -1
- package/dist/web-sdk/src/services/metrics.d.ts +1 -1
- package/dist/web-sdk/src/services/metrics.js +3 -3
- package/dist/web-sdk/src/services/metrics.js.map +1 -1
- package/dist/web-sdk/src/services/orders.d.ts +1 -1
- package/dist/web-sdk/src/services/orders.js +6 -6
- package/dist/web-sdk/src/services/orders.js.map +1 -1
- package/dist/web-sdk/src/services/products.d.ts +1 -1
- package/dist/web-sdk/src/services/products.js +7 -7
- package/dist/web-sdk/src/services/products.js.map +1 -1
- package/dist/web-sdk/src/services/sellers.d.ts +1 -1
- package/dist/web-sdk/src/services/sellers.js +6 -6
- package/dist/web-sdk/src/services/sellers.js.map +1 -1
- package/package.json +16 -3
- package/.ls-lint.yml +0 -8
- package/.nvmrc +0 -1
- package/.prettierignore +0 -0
- package/.prettierrc.js +0 -3
- package/codegen.yml +0 -11
- package/src/constants/graphql-base.constant.ts +0 -1
- package/src/contexts/index.ts +0 -33
- package/src/functions/init-sdk-client.function.ts +0 -19
- package/src/functions/init-sdk.function.ts +0 -26
- package/src/functions/safe-call.function.ts +0 -29
- package/src/index.d.ts +0 -0
- package/src/index.ts +0 -74
- package/src/services/attributes.ts +0 -42
- package/src/services/brands.ts +0 -41
- package/src/services/categories.ts +0 -41
- package/src/services/colors.ts +0 -41
- package/src/services/customers.ts +0 -60
- package/src/services/files.ts +0 -58
- package/src/services/index.ts +0 -9
- package/src/services/metrics.ts +0 -39
- package/src/services/orders.ts +0 -59
- package/src/services/products.ts +0 -65
- package/src/services/sellers.ts +0 -91
- package/src/typings/pagination.typing.ts +0 -18
- package/src/typings/sdk.typing.ts +0 -27
- package/src/utils/fetch-all-infinite.util.ts +0 -41
- package/tsconfig.dev.json +0 -32
- package/tsconfig.json +0 -37
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { PaginatedAttributesQuery, PaginatedAttributesQueryVariables, InfiniteAttributesQuery, InfiniteAttributesQueryVariables } from "
|
|
2
|
+
import { PaginatedAttributesQuery, PaginatedAttributesQueryVariables, InfiniteAttributesQuery, InfiniteAttributesQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface AttributesSdk {
|
|
4
4
|
paginated: (variables?: PaginatedAttributesQueryVariables) => Promise<PaginatedAttributesQuery>;
|
|
5
5
|
infinite: (variables: InfiniteAttributesQueryVariables) => Promise<InfiniteAttributesQuery>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createAttributesSdk = createAttributesSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createAttributesSdk(client) {
|
|
7
7
|
const paginated = {
|
|
8
8
|
paginated(variables = {}) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.PaginatedAttributesDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
const infinite = {
|
|
13
13
|
infinite(variables) {
|
|
14
|
-
return client.request(
|
|
14
|
+
return client.request(gateway_1.InfiniteAttributesDocument, variables);
|
|
15
15
|
},
|
|
16
16
|
all(variables) {
|
|
17
17
|
const sdk = {
|
|
18
|
-
listInfinite: (v) => client.request(
|
|
18
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteAttributesDocument, v),
|
|
19
19
|
};
|
|
20
20
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteAttributes);
|
|
21
21
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../../src/services/attributes.ts"],"names":[],"mappings":";;AAoBA,kDAqBC;AAxCD,
|
|
1
|
+
{"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../../src/services/attributes.ts"],"names":[],"mappings":";;AAoBA,kDAqBC;AAxCD,0DAOsC;AACtC,6EAAoF;AAWpF,SAAgB,mBAAmB,CAAC,MAAqB;IAEvD,MAAM,SAAS,GAAG;QAChB,SAAS,CAAC,YAA+C,EAAE;YACzD,OAAO,MAAM,CAAC,OAAO,CAA2B,qCAA2B,EAAE,SAAS,CAAC,CAAC;QAC1F,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAA2C;YAClD,OAAO,MAAM,CAAC,OAAO,CAA0B,oCAA0B,EAAE,SAAS,CAAC,CAAC;QACxF,CAAC;QACD,GAAG,CAAC,SAA2C;YAC7C,MAAM,GAAG,GAA+E;gBACtF,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAA0B,oCAA0B,EAAE,CAAC,CAAC;aAC5F,CAAC;YACF,OAAO,IAAA,0CAAgB,EAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { PaginatedBrandsQuery, PaginatedBrandsQueryVariables, InfiniteBrandsQuery, InfiniteBrandsQueryVariables } from "
|
|
2
|
+
import { PaginatedBrandsQuery, PaginatedBrandsQueryVariables, InfiniteBrandsQuery, InfiniteBrandsQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface BrandsSdk {
|
|
4
4
|
paginated: (variables?: PaginatedBrandsQueryVariables) => Promise<PaginatedBrandsQuery>;
|
|
5
5
|
infinite: (variables: InfiniteBrandsQueryVariables) => Promise<InfiniteBrandsQuery>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createBrandsSdk = createBrandsSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createBrandsSdk(client) {
|
|
7
7
|
const paginated = {
|
|
8
8
|
paginated(variables = {}) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.PaginatedBrandsDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
const infinite = {
|
|
13
13
|
infinite(variables) {
|
|
14
|
-
return client.request(
|
|
14
|
+
return client.request(gateway_1.InfiniteBrandsDocument, variables);
|
|
15
15
|
},
|
|
16
16
|
all(variables) {
|
|
17
17
|
const sdk = {
|
|
18
|
-
listInfinite: (v) => client.request(
|
|
18
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteBrandsDocument, v),
|
|
19
19
|
};
|
|
20
20
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteBrands);
|
|
21
21
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../../src/services/brands.ts"],"names":[],"mappings":";;AAmBA,0CAqBC;AAvCD,
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../../src/services/brands.ts"],"names":[],"mappings":";;AAmBA,0CAqBC;AAvCD,0DAOsC;AACtC,6EAAoF;AAUpF,SAAgB,eAAe,CAAC,MAAqB;IAEnD,MAAM,SAAS,GAAG;QAChB,SAAS,CAAC,YAA2C,EAAE;YACrD,OAAO,MAAM,CAAC,OAAO,CAAuB,iCAAuB,EAAE,SAAS,CAAC,CAAC;QAClF,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAAuC;YAC9C,OAAO,MAAM,CAAC,OAAO,CAAsB,gCAAsB,EAAE,SAAS,CAAC,CAAC;QAChF,CAAC;QACD,GAAG,CAAC,SAAuC;YACzC,MAAM,GAAG,GAAuE;gBAC9E,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAsB,gCAAsB,EAAE,CAAC,CAAC;aACpF,CAAC;YACF,OAAO,IAAA,0CAAgB,EAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACvE,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { PaginatedCategoriesQuery, PaginatedCategoriesQueryVariables, InfiniteCategoriesQuery, InfiniteCategoriesQueryVariables } from "
|
|
2
|
+
import { PaginatedCategoriesQuery, PaginatedCategoriesQueryVariables, InfiniteCategoriesQuery, InfiniteCategoriesQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface CategoriesSdk {
|
|
4
4
|
paginated: (variables?: PaginatedCategoriesQueryVariables) => Promise<PaginatedCategoriesQuery>;
|
|
5
5
|
infinite: (variables: InfiniteCategoriesQueryVariables) => Promise<InfiniteCategoriesQuery>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createCategoriesSdk = createCategoriesSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createCategoriesSdk(client) {
|
|
7
7
|
const paginated = {
|
|
8
8
|
paginated(variables = {}) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.PaginatedCategoriesDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
const infinite = {
|
|
13
13
|
infinite(variables) {
|
|
14
|
-
return client.request(
|
|
14
|
+
return client.request(gateway_1.InfiniteCategoriesDocument, variables);
|
|
15
15
|
},
|
|
16
16
|
all(variables) {
|
|
17
17
|
const sdk = {
|
|
18
|
-
listInfinite: (v) => client.request(
|
|
18
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteCategoriesDocument, v),
|
|
19
19
|
};
|
|
20
20
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteCategories);
|
|
21
21
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../../src/services/categories.ts"],"names":[],"mappings":";;AAmBA,kDAqBC;AAvCD,
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../../src/services/categories.ts"],"names":[],"mappings":";;AAmBA,kDAqBC;AAvCD,0DAOsC;AACtC,6EAAoF;AAUpF,SAAgB,mBAAmB,CAAC,MAAqB;IAEvD,MAAM,SAAS,GAAG;QAChB,SAAS,CAAC,YAA+C,EAAE;YACzD,OAAO,MAAM,CAAC,OAAO,CAA2B,qCAA2B,EAAE,SAAS,CAAC,CAAC;QAC1F,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAA2C;YAClD,OAAO,MAAM,CAAC,OAAO,CAA0B,oCAA0B,EAAE,SAAS,CAAC,CAAC;QACxF,CAAC;QACD,GAAG,CAAC,SAA2C;YAC7C,MAAM,GAAG,GAA+E;gBACtF,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAA0B,oCAA0B,EAAE,CAAC,CAAC;aAC5F,CAAC;YACF,OAAO,IAAA,0CAAgB,EAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { PaginatedColorsQuery, PaginatedColorsQueryVariables, InfiniteColorsQuery, InfiniteColorsQueryVariables } from "
|
|
2
|
+
import { PaginatedColorsQuery, PaginatedColorsQueryVariables, InfiniteColorsQuery, InfiniteColorsQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface ColorsSdk {
|
|
4
4
|
paginated: (variables?: PaginatedColorsQueryVariables) => Promise<PaginatedColorsQuery>;
|
|
5
5
|
infinite: (variables: InfiniteColorsQueryVariables) => Promise<InfiniteColorsQuery>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createColorsSdk = createColorsSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createColorsSdk(client) {
|
|
7
7
|
const paginated = {
|
|
8
8
|
paginated(variables = {}) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.PaginatedColorsDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
const infinite = {
|
|
13
13
|
infinite(variables) {
|
|
14
|
-
return client.request(
|
|
14
|
+
return client.request(gateway_1.InfiniteColorsDocument, variables);
|
|
15
15
|
},
|
|
16
16
|
all(variables) {
|
|
17
17
|
const sdk = {
|
|
18
|
-
listInfinite: (v) => client.request(
|
|
18
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteColorsDocument, v),
|
|
19
19
|
};
|
|
20
20
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteColors);
|
|
21
21
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../../src/services/colors.ts"],"names":[],"mappings":";;AAmBA,0CAqBC;AAvCD,
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../../src/services/colors.ts"],"names":[],"mappings":";;AAmBA,0CAqBC;AAvCD,0DAOsC;AACtC,6EAAoF;AAUpF,SAAgB,eAAe,CAAC,MAAqB;IAEnD,MAAM,SAAS,GAAG;QAChB,SAAS,CAAC,YAA2C,EAAE;YACrD,OAAO,MAAM,CAAC,OAAO,CAAuB,iCAAuB,EAAE,SAAS,CAAC,CAAC;QAClF,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAAuC;YAC9C,OAAO,MAAM,CAAC,OAAO,CAAsB,gCAAsB,EAAE,SAAS,CAAC,CAAC;QAChF,CAAC;QACD,GAAG,CAAC,SAAuC;YACzC,MAAM,GAAG,GAAuE;gBAC9E,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAsB,gCAAsB,EAAE,CAAC,CAAC;aACpF,CAAC;YACF,OAAO,IAAA,0CAAgB,EAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACvE,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { CreateCustomerMutation, CreateCustomerMutationVariables, UpdateCustomerMutation, UpdateCustomerMutationVariables, PaginatedCustomersQuery, PaginatedCustomersQueryVariables, InfiniteCustomersQuery, InfiniteCustomersQueryVariables } from "
|
|
2
|
+
import { CreateCustomerMutation, CreateCustomerMutationVariables, UpdateCustomerMutation, UpdateCustomerMutationVariables, PaginatedCustomersQuery, PaginatedCustomersQueryVariables, InfiniteCustomersQuery, InfiniteCustomersQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface CustomersSdk {
|
|
4
4
|
create: (variables: CreateCustomerMutationVariables) => Promise<CreateCustomerMutation>;
|
|
5
5
|
update: (variables: UpdateCustomerMutationVariables) => Promise<UpdateCustomerMutation>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createCustomersSdk = createCustomersSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createCustomersSdk(client) {
|
|
7
7
|
const mutations = {
|
|
8
8
|
create(variables) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.CreateCustomerDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
update(variables) {
|
|
12
|
-
return client.request(
|
|
12
|
+
return client.request(gateway_1.UpdateCustomerDocument, variables);
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
const paginated = {
|
|
16
16
|
paginated(variables = {}) {
|
|
17
|
-
return client.request(
|
|
17
|
+
return client.request(gateway_1.PaginatedCustomersDocument, variables);
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
const infinite = {
|
|
21
21
|
infinite(variables) {
|
|
22
|
-
return client.request(
|
|
22
|
+
return client.request(gateway_1.InfiniteCustomersDocument, variables);
|
|
23
23
|
},
|
|
24
24
|
all(variables) {
|
|
25
25
|
const sdk = {
|
|
26
|
-
listInfinite: (v) => client.request(
|
|
26
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteCustomersDocument, v),
|
|
27
27
|
};
|
|
28
28
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteCustomers);
|
|
29
29
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customers.js","sourceRoot":"","sources":["../../../../src/services/customers.ts"],"names":[],"mappings":";;AA8BA,gDA6BC;AA1DD,
|
|
1
|
+
{"version":3,"file":"customers.js","sourceRoot":"","sources":["../../../../src/services/customers.ts"],"names":[],"mappings":";;AA8BA,gDA6BC;AA1DD,0DAasC;AACtC,6EAAoF;AAepF,SAAgB,kBAAkB,CAAC,MAAqB;IACtD,MAAM,SAAS,GAAG;QAChB,MAAM,CAAC,SAA0C;YAC/C,OAAO,MAAM,CAAC,OAAO,CAAyB,gCAAsB,EAAE,SAAS,CAAC,CAAC;QACnF,CAAC;QACD,MAAM,CAAC,SAA0C;YAC/C,OAAO,MAAM,CAAC,OAAO,CAAyB,gCAAsB,EAAE,SAAS,CAAC,CAAC;QACnF,CAAC;KACF,CAAC;IAEF,MAAM,SAAS,GAAG;QAChB,SAAS,CAAC,YAA8C,EAAE;YACxD,OAAO,MAAM,CAAC,OAAO,CAA0B,oCAA0B,EAAE,SAAS,CAAC,CAAC;QACxF,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAA0C;YACjD,OAAO,MAAM,CAAC,OAAO,CAAyB,mCAAyB,EAAE,SAAS,CAAC,CAAC;QACtF,CAAC;QACD,GAAG,CAAC,SAA0C;YAC5C,MAAM,GAAG,GAA6E;gBACpF,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAyB,mCAAyB,EAAE,CAAC,CAAC;aAC1F,CAAC;YACF,OAAO,IAAA,0CAAgB,EAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC1E,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { InitiateFileUploadMutation, InitiateFileUploadMutationVariables, CompleteFileUploadMutation, CompleteFileUploadMutationVariables, FileQuery, FileQueryVariables } from "
|
|
2
|
+
import { InitiateFileUploadMutation, InitiateFileUploadMutationVariables, CompleteFileUploadMutation, CompleteFileUploadMutationVariables, FileQuery, FileQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface FileUploadSdk {
|
|
4
4
|
initiate: (variables: InitiateFileUploadMutationVariables) => Promise<InitiateFileUploadMutation>;
|
|
5
5
|
complete: (variables: CompleteFileUploadMutationVariables) => Promise<CompleteFileUploadMutation>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFileUploadSdk = createFileUploadSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
function createFileUploadSdk(client) {
|
|
6
6
|
const mutations = {
|
|
7
7
|
initiate(variables) {
|
|
8
|
-
return client.request(
|
|
8
|
+
return client.request(gateway_1.InitiateFileUploadDocument, variables);
|
|
9
9
|
},
|
|
10
10
|
complete(variables) {
|
|
11
|
-
return client.request(
|
|
11
|
+
return client.request(gateway_1.CompleteFileUploadDocument, variables);
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
14
|
const queries = {
|
|
15
15
|
file(variables) {
|
|
16
|
-
return client.request(
|
|
16
|
+
return client.request(gateway_1.FileDocument, variables);
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
19
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../src/services/files.ts"],"names":[],"mappings":";;AA8BA,kDA2BC;AAxDD,
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../src/services/files.ts"],"names":[],"mappings":";;AA8BA,kDA2BC;AAxDD,0DAUsC;AAmBtC,SAAgB,mBAAmB,CAAC,MAAqB;IACvD,MAAM,SAAS,GAAG;QAChB,QAAQ,CAAC,SAA8C;YACrD,OAAO,MAAM,CAAC,OAAO,CACnB,oCAA0B,EAC1B,SAAS,CACV,CAAC;QACJ,CAAC;QAED,QAAQ,CAAC,SAA8C;YACrD,OAAO,MAAM,CAAC,OAAO,CACnB,oCAA0B,EAC1B,SAAS,CACV,CAAC;QACJ,CAAC;KACF,CAAC;IAEF,MAAM,OAAO,GAAG;QACd,IAAI,CAAC,SAA6B;YAChC,OAAO,MAAM,CAAC,OAAO,CAAY,sBAAY,EAAE,SAAS,CAAC,CAAC;QAC5D,CAAC;KACF,CAAC;IAEF,OAAO;QACL,GAAG,SAAS;QACZ,GAAG,OAAO;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { InfiniteMetricsQuery, InfiniteMetricsQueryVariables } from "
|
|
2
|
+
import { InfiniteMetricsQuery, InfiniteMetricsQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface MetricsSdk {
|
|
4
4
|
infinite: (variables: InfiniteMetricsQueryVariables) => Promise<InfiniteMetricsQuery>;
|
|
5
5
|
all: (variables: InfiniteMetricsQueryVariables) => Promise<InfiniteMetricsQuery["infiniteMetrics"]["edges"][number]["node"][]>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createMetricsSdk = createMetricsSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createMetricsSdk(client) {
|
|
7
7
|
const infinite = {
|
|
8
8
|
infinite(variables) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.InfiniteMetricsDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
all(variables) {
|
|
12
12
|
const sdk = {
|
|
13
|
-
listInfinite: (v) => client.request(
|
|
13
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteMetricsDocument, v),
|
|
14
14
|
};
|
|
15
15
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteMetrics);
|
|
16
16
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../../src/services/metrics.ts"],"names":[],"mappings":";;AAiBA,4CAqBC;AArCD,
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../../src/services/metrics.ts"],"names":[],"mappings":";;AAiBA,4CAqBC;AArCD,0DAOsC;AACtC,6EAAoF;AAQpF,SAAgB,gBAAgB,CAAC,MAAqB;IAQpD,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAAwC;YAC/C,OAAO,MAAM,CAAC,OAAO,CAAuB,iCAAuB,EAAE,SAAS,CAAC,CAAC;QAClF,CAAC;QACD,GAAG,CAAC,SAAwC;YAC1C,MAAM,GAAG,GAAyE;gBAChF,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAuB,iCAAuB,EAAE,CAAC,CAAC;aACtF,CAAC;YACF,OAAO,IAAA,0CAAgB,EAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACxE,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { CreateOrderMutation, CreateOrderMutationVariables, UpdateOrderMutation, UpdateOrderMutationVariables, PaginatedOrdersQuery, PaginatedOrdersQueryVariables, InfiniteOrdersQuery, InfiniteOrdersQueryVariables } from "
|
|
2
|
+
import { CreateOrderMutation, CreateOrderMutationVariables, UpdateOrderMutation, UpdateOrderMutationVariables, PaginatedOrdersQuery, PaginatedOrdersQueryVariables, InfiniteOrdersQuery, InfiniteOrdersQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface OrdersSdk {
|
|
4
4
|
create: (variables: CreateOrderMutationVariables) => Promise<CreateOrderMutation>;
|
|
5
5
|
update: (variables: UpdateOrderMutationVariables) => Promise<UpdateOrderMutation>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createOrdersSdk = createOrdersSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createOrdersSdk(client) {
|
|
7
7
|
const mutations = {
|
|
8
8
|
create(variables) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.CreateOrderDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
update(variables) {
|
|
12
|
-
return client.request(
|
|
12
|
+
return client.request(gateway_1.UpdateOrderDocument, variables);
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
const paginated = {
|
|
16
16
|
paginated(variables = {}) {
|
|
17
|
-
return client.request(
|
|
17
|
+
return client.request(gateway_1.PaginatedOrdersDocument, variables);
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
const infinite = {
|
|
21
21
|
infinite(variables) {
|
|
22
|
-
return client.request(
|
|
22
|
+
return client.request(gateway_1.InfiniteOrdersDocument, variables);
|
|
23
23
|
},
|
|
24
24
|
all(variables) {
|
|
25
25
|
const sdk = {
|
|
26
|
-
listInfinite: (v) => client.request(
|
|
26
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteOrdersDocument, v),
|
|
27
27
|
};
|
|
28
28
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteOrders);
|
|
29
29
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders.js","sourceRoot":"","sources":["../../../../src/services/orders.ts"],"names":[],"mappings":";;AA6BA,0CA6BC;AAzDD,
|
|
1
|
+
{"version":3,"file":"orders.js","sourceRoot":"","sources":["../../../../src/services/orders.ts"],"names":[],"mappings":";;AA6BA,0CA6BC;AAzDD,0DAasC;AACtC,6EAAoF;AAcpF,SAAgB,eAAe,CAAC,MAAqB;IACnD,MAAM,SAAS,GAAG;QAChB,MAAM,CAAC,SAAuC;YAC5C,OAAO,MAAM,CAAC,OAAO,CAAsB,6BAAmB,EAAE,SAAS,CAAC,CAAC;QAC7E,CAAC;QACD,MAAM,CAAC,SAAuC;YAC5C,OAAO,MAAM,CAAC,OAAO,CAAsB,6BAAmB,EAAE,SAAS,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC;IAEF,MAAM,SAAS,GAAG;QAChB,SAAS,CAAC,YAA2C,EAAE;YACrD,OAAO,MAAM,CAAC,OAAO,CAAuB,iCAAuB,EAAE,SAAS,CAAC,CAAC;QAClF,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAAuC;YAC9C,OAAO,MAAM,CAAC,OAAO,CAAsB,gCAAsB,EAAE,SAAS,CAAC,CAAC;QAChF,CAAC;QACD,GAAG,CAAC,SAAuC;YACzC,MAAM,GAAG,GAAuE;gBAC9E,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAsB,gCAAsB,EAAE,CAAC,CAAC;aACpF,CAAC;YACF,OAAO,IAAA,0CAAgB,EAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACvE,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { CreateProductMutation, CreateProductMutationVariables, UpdateProductMutation, UpdateProductMutationVariables, DeleteProductMutation, DeleteProductMutationVariables, PaginatedProductsQuery, PaginatedProductsQueryVariables, InfiniteProductsQuery, InfiniteProductsQueryVariables } from "
|
|
2
|
+
import { CreateProductMutation, CreateProductMutationVariables, UpdateProductMutation, UpdateProductMutationVariables, DeleteProductMutation, DeleteProductMutationVariables, PaginatedProductsQuery, PaginatedProductsQueryVariables, InfiniteProductsQuery, InfiniteProductsQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface ProductsSdk {
|
|
4
4
|
create: (variables: CreateProductMutationVariables) => Promise<CreateProductMutation>;
|
|
5
5
|
update: (variables: UpdateProductMutationVariables) => Promise<UpdateProductMutation>;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createProductsSdk = createProductsSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createProductsSdk(client) {
|
|
7
7
|
const mutations = {
|
|
8
8
|
create(variables) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.CreateProductDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
update(variables) {
|
|
12
|
-
return client.request(
|
|
12
|
+
return client.request(gateway_1.UpdateProductDocument, variables);
|
|
13
13
|
},
|
|
14
14
|
delete(variables) {
|
|
15
|
-
return client.request(
|
|
15
|
+
return client.request(gateway_1.DeleteProductDocument, variables);
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
18
|
const paginated = {
|
|
19
19
|
paginated(variables = {}) {
|
|
20
|
-
return client.request(
|
|
20
|
+
return client.request(gateway_1.PaginatedProductsDocument, variables);
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
const infinite = {
|
|
24
24
|
infinite(variables) {
|
|
25
|
-
return client.request(
|
|
25
|
+
return client.request(gateway_1.InfiniteProductsDocument, variables);
|
|
26
26
|
},
|
|
27
27
|
all(variables) {
|
|
28
28
|
const sdk = {
|
|
29
|
-
listInfinite: (v) => client.request(
|
|
29
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteProductsDocument, v),
|
|
30
30
|
};
|
|
31
31
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteProducts);
|
|
32
32
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../../../src/services/products.ts"],"names":[],"mappings":";;AAgCA,8CAgCC;AA/DD,
|
|
1
|
+
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../../../src/services/products.ts"],"names":[],"mappings":";;AAgCA,8CAgCC;AA/DD,0DAgBsC;AACtC,6EAAoF;AAcpF,SAAgB,iBAAiB,CAAC,MAAqB;IACrD,MAAM,SAAS,GAAG;QAChB,MAAM,CAAC,SAAyC;YAC9C,OAAO,MAAM,CAAC,OAAO,CAAwB,+BAAqB,EAAE,SAAS,CAAC,CAAC;QACjF,CAAC;QACD,MAAM,CAAC,SAAyC;YAC9C,OAAO,MAAM,CAAC,OAAO,CAAwB,+BAAqB,EAAE,SAAS,CAAC,CAAC;QACjF,CAAC;QACD,MAAM,CAAC,SAAyC;YAC9C,OAAO,MAAM,CAAC,OAAO,CAAwB,+BAAqB,EAAE,SAAS,CAAC,CAAC;QACjF,CAAC;KACF,CAAC;IAEF,MAAM,SAAS,GAAG;QAChB,SAAS,CAAC,YAA6C,EAAE;YACvD,OAAO,MAAM,CAAC,OAAO,CAAyB,mCAAyB,EAAE,SAAS,CAAC,CAAC;QACtF,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAAyC;YAChD,OAAO,MAAM,CAAC,OAAO,CAAwB,kCAAwB,EAAE,SAAS,CAAC,CAAC;QACpF,CAAC;QACD,GAAG,CAAC,SAAyC;YAC3C,MAAM,GAAG,GAA2E;gBAClF,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAwB,kCAAwB,EAAE,CAAC,CAAC;aACxF,CAAC;YACF,OAAO,IAAA,0CAAgB,EAAC,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACzE,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
import { CreateSellerMutation, CreateSellerMutationVariables, UpdateSellerMutation, UpdateSellerMutationVariables, PaginatedSellersQuery, PaginatedSellersQueryVariables, InfiniteSellersQuery, InfiniteSellersQueryVariables } from "
|
|
2
|
+
import { CreateSellerMutation, CreateSellerMutationVariables, UpdateSellerMutation, UpdateSellerMutationVariables, PaginatedSellersQuery, PaginatedSellersQueryVariables, InfiniteSellersQuery, InfiniteSellersQueryVariables } from "../../../graphql/src/gateway";
|
|
3
3
|
export interface SellersSdk {
|
|
4
4
|
create: (variables: CreateSellerMutationVariables) => Promise<CreateSellerMutation>;
|
|
5
5
|
update: (variables: UpdateSellerMutationVariables) => Promise<UpdateSellerMutation>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createSellersSdk = createSellersSdk;
|
|
4
|
-
const
|
|
4
|
+
const gateway_1 = require("../../../graphql/src/gateway");
|
|
5
5
|
const fetch_all_infinite_util_1 = require("@/utils/fetch-all-infinite.util");
|
|
6
6
|
function createSellersSdk(client) {
|
|
7
7
|
const mutations = {
|
|
8
8
|
create(variables) {
|
|
9
|
-
return client.request(
|
|
9
|
+
return client.request(gateway_1.CreateSellerDocument, variables);
|
|
10
10
|
},
|
|
11
11
|
update(variables) {
|
|
12
|
-
return client.request(
|
|
12
|
+
return client.request(gateway_1.UpdateSellerDocument, variables);
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
const paginated = {
|
|
16
16
|
paginated(variables = {}) {
|
|
17
|
-
return client.request(
|
|
17
|
+
return client.request(gateway_1.PaginatedSellersDocument, variables);
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
const infinite = {
|
|
21
21
|
infinite(variables) {
|
|
22
|
-
return client.request(
|
|
22
|
+
return client.request(gateway_1.InfiniteSellersDocument, variables);
|
|
23
23
|
},
|
|
24
24
|
all(variables) {
|
|
25
25
|
const sdk = {
|
|
26
|
-
listInfinite: (v) => client.request(
|
|
26
|
+
listInfinite: (v) => client.request(gateway_1.InfiniteSellersDocument, v),
|
|
27
27
|
};
|
|
28
28
|
return (0, fetch_all_infinite_util_1.fetchAllInfinite)(sdk, variables, (res) => res.infiniteSellers);
|
|
29
29
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sellers.js","sourceRoot":"","sources":["../../../../src/services/sellers.ts"],"names":[],"mappings":";;AAyCA,4CAiDC;AAzFD,
|
|
1
|
+
{"version":3,"file":"sellers.js","sourceRoot":"","sources":["../../../../src/services/sellers.ts"],"names":[],"mappings":";;AAyCA,4CAiDC;AAzFD,0DAasC;AACtC,6EAGyC;AAuBzC,SAAgB,gBAAgB,CAAC,MAAqB;IACpD,MAAM,SAAS,GAAG;QAChB,MAAM,CAAC,SAAwC;YAC7C,OAAO,MAAM,CAAC,OAAO,CACnB,8BAAoB,EACpB,SAAS,CACV,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,SAAwC;YAC7C,OAAO,MAAM,CAAC,OAAO,CACnB,8BAAoB,EACpB,SAAS,CACV,CAAC;QACJ,CAAC;KACF,CAAC;IAEF,MAAM,SAAS,GAAG;QAChB,SAAS,CAAC,YAA4C,EAAE;YACtD,OAAO,MAAM,CAAC,OAAO,CACnB,kCAAwB,EACxB,SAAS,CACV,CAAC;QACJ,CAAC;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG;QACf,QAAQ,CAAC,SAAwC;YAC/C,OAAO,MAAM,CAAC,OAAO,CACnB,iCAAuB,EACvB,SAAS,CACV,CAAC;QACJ,CAAC;QACD,GAAG,CAAC,SAAwC;YAC1C,MAAM,GAAG,GAGL;gBACF,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAClB,MAAM,CAAC,OAAO,CAAuB,iCAAuB,EAAE,CAAC,CAAC;aACnE,CAAC;YACF,OAAO,IAAA,0CAAgB,EAIrB,GAAG,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAClD,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAE,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dokamerce/web-sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "./dist/web-sdk/src/index.js",
|
|
6
|
+
"types": "./dist/web-sdk/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/web-sdk/src/index.js",
|
|
10
|
+
"require": "./dist/web-sdk/src/index.js",
|
|
11
|
+
"types": "./dist/web-sdk/src/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
7
17
|
"scripts": {
|
|
8
18
|
"build": "rimraf dist && tsc",
|
|
9
19
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
@@ -14,6 +24,9 @@
|
|
|
14
24
|
"dependencies": {
|
|
15
25
|
"graphql": "^16.12.0",
|
|
16
26
|
"graphql-request": "^7.2.0",
|
|
27
|
+
"graphql-tag": "^2.12.6"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
17
30
|
"rimraf": "^6.1.2",
|
|
18
31
|
"typescript": "^5.9.2"
|
|
19
32
|
}
|
package/.ls-lint.yml
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v22.13.1
|
package/.prettierignore
DELETED
|
File without changes
|
package/.prettierrc.js
DELETED
package/codegen.yml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
schema: "https://api.example.com/graphql"
|
|
2
|
-
documents: "src/queries/**/*.graphql"
|
|
3
|
-
generates:
|
|
4
|
-
src/types/graphql.ts:
|
|
5
|
-
plugins:
|
|
6
|
-
- "typescript"
|
|
7
|
-
- "typescript-operations"
|
|
8
|
-
- "typescript-graphql-request"
|
|
9
|
-
config:
|
|
10
|
-
rawRequest: false
|
|
11
|
-
useTypeImports: true
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const GRAPHQL_BASE_URL = ""
|
package/src/contexts/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
|
|
3
|
-
type SDKStatus = "unknown" | "ready" | "initializing" | "change" | "fails"
|
|
4
|
-
|
|
5
|
-
interface ContextInterface {
|
|
6
|
-
status: SDKStatus;
|
|
7
|
-
client: GraphQLClient | undefined | null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const _context: ContextInterface = {
|
|
11
|
-
status: "unknown",
|
|
12
|
-
client: null,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function setSdkClient(client: GraphQLClient) {
|
|
16
|
-
if (!_context.client) {
|
|
17
|
-
_context.client = client;
|
|
18
|
-
}
|
|
19
|
-
return _context.client;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function getSdkClient(): GraphQLClient {
|
|
23
|
-
if (!_context.client) throw new Error("ou must initialize first");
|
|
24
|
-
return _context.client;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function setSdkStatus(status: SDKStatus) {
|
|
28
|
-
_context.status = status;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function getSdkStatus(): SDKStatus {
|
|
32
|
-
return _context.status;
|
|
33
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { setSdkClient } from "../contexts";
|
|
2
|
-
import { GraphQLClient } from "graphql-request";
|
|
3
|
-
|
|
4
|
-
interface InitSdkClientArgs {
|
|
5
|
-
base: string;
|
|
6
|
-
realm: string;
|
|
7
|
-
key: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function initSdkClient({ base, realm, key }: InitSdkClientArgs) {
|
|
11
|
-
const client = new GraphQLClient(`${base}`, {
|
|
12
|
-
headers: {
|
|
13
|
-
"x-realm-key": realm,
|
|
14
|
-
"x-api-token": key,
|
|
15
|
-
"x-origin": "sdk",
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
setSdkClient(client);
|
|
19
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { getSdkStatus, setSdkStatus } from "../contexts";
|
|
2
|
-
import { initSdkClient } from "./init-sdk-client.function";
|
|
3
|
-
import { GRAPHQL_BASE_URL } from "../constants/graphql-base.constant";
|
|
4
|
-
|
|
5
|
-
interface InitSdkArgs {
|
|
6
|
-
realm: string;
|
|
7
|
-
key: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function initSdk({ realm, key }: InitSdkArgs) {
|
|
11
|
-
try {
|
|
12
|
-
if (getSdkStatus() !== "unknown") return;
|
|
13
|
-
setSdkStatus("initializing");
|
|
14
|
-
|
|
15
|
-
initSdkClient({
|
|
16
|
-
base: GRAPHQL_BASE_URL,
|
|
17
|
-
key,
|
|
18
|
-
realm,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
setSdkStatus("ready");
|
|
22
|
-
|
|
23
|
-
} catch (error) {
|
|
24
|
-
setSdkStatus("fails");
|
|
25
|
-
}
|
|
26
|
-
}
|