@maioradv/cms-basic-lib 1.6.9 → 1.7.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 CHANGED
@@ -1,5 +1,5 @@
1
- # Maior Basic CMS Api - Library JS/TS
2
-
3
- ```bash
4
- yarn add @maioradv/cms-basic-lib
1
+ # Maior Basic CMS Api - Library JS/TS
2
+
3
+ ```bash
4
+ yarn add @maioradv/cms-basic-lib
5
5
  ```
@@ -5,54 +5,54 @@ exports.ApiTokensResolvers = {
5
5
  query: {
6
6
  apiTokens: {
7
7
  name: 'apiTokens',
8
- query: `query ApiTokenList($limit: Int, $after: Int, $before: Int, $sorting: String){
9
- apiTokens(limit: $limit, after: $after, before: $before, sorting: $sorting){
10
- edges {
11
- node {
12
- id
13
- }
14
- cursor
15
- }
16
- nodes {
17
- id
18
- name
19
- uuid
20
- permissions
21
- readOnly
22
- createdAt
23
- updatedAt
24
- }
25
- meta {
26
- startCursor
27
- endCursor
28
- hasNextPage
29
- hasPreviousPage
30
- }
31
- }
8
+ query: `query ApiTokenList($limit: Int, $after: Int, $before: Int, $sorting: String){
9
+ apiTokens(limit: $limit, after: $after, before: $before, sorting: $sorting){
10
+ edges {
11
+ node {
12
+ id
13
+ }
14
+ cursor
15
+ }
16
+ nodes {
17
+ id
18
+ name
19
+ uuid
20
+ permissions
21
+ readOnly
22
+ createdAt
23
+ updatedAt
24
+ }
25
+ meta {
26
+ startCursor
27
+ endCursor
28
+ hasNextPage
29
+ hasPreviousPage
30
+ }
31
+ }
32
32
  }`,
33
33
  },
34
34
  },
35
35
  mutation: {
36
36
  removeApiTokens: {
37
37
  name: 'removeApiTokens',
38
- query: `mutation ApiTokenDelete($id: [Int!]!){
39
- removeApiTokens(id: $id) {
40
- count
41
- }
38
+ query: `mutation ApiTokenDelete($id: [Int!]!){
39
+ removeApiTokens(id: $id) {
40
+ count
41
+ }
42
42
  }`,
43
43
  },
44
44
  syncPermissionsApiTokens: {
45
45
  name: 'syncPermissionsApiTokens',
46
- query: `mutation ApiTokenSyncPermissions {
47
- syncPermissionsApiTokens {
48
- id
49
- name
50
- uuid
51
- permissions
52
- readOnly
53
- createdAt
54
- updatedAt
55
- }
46
+ query: `mutation ApiTokenSyncPermissions {
47
+ syncPermissionsApiTokens {
48
+ id
49
+ name
50
+ uuid
51
+ permissions
52
+ readOnly
53
+ createdAt
54
+ updatedAt
55
+ }
56
56
  }`,
57
57
  },
58
58
  }
@@ -38,9 +38,6 @@ export declare enum Permission {
38
38
  write_productattributes = "write_productattributes",
39
39
  read_productattributevalues = "read_productattributevalues",
40
40
  write_productattributevalues = "write_productattributevalues",
41
- read_bulkoperations = "read_bulkoperations",
42
- write_bulkoperations = "write_bulkoperations",
43
- run_bulkoperations = "run_bulkoperations",
44
41
  read_discounts = "read_discounts",
45
42
  write_discounts = "write_discounts",
46
43
  read_languages = "read_languages",
@@ -64,5 +61,6 @@ export declare enum Permission {
64
61
  read_linkcollections = "read_linkcollections",
65
62
  write_linkcollections = "write_linkcollections",
66
63
  read_reservations = "read_reservations",
67
- write_reservations = "write_reservations"
64
+ write_reservations = "write_reservations",
65
+ push_reservations = "push_reservations"
68
66
  }
@@ -16,9 +16,6 @@ var Permission;
16
16
  Permission["write_productattributes"] = "write_productattributes";
17
17
  Permission["read_productattributevalues"] = "read_productattributevalues";
18
18
  Permission["write_productattributevalues"] = "write_productattributevalues";
19
- Permission["read_bulkoperations"] = "read_bulkoperations";
20
- Permission["write_bulkoperations"] = "write_bulkoperations";
21
- Permission["run_bulkoperations"] = "run_bulkoperations";
22
19
  Permission["read_discounts"] = "read_discounts";
23
20
  Permission["write_discounts"] = "write_discounts";
24
21
  Permission["read_languages"] = "read_languages";
@@ -43,4 +40,5 @@ var Permission;
43
40
  Permission["write_linkcollections"] = "write_linkcollections";
44
41
  Permission["read_reservations"] = "read_reservations";
45
42
  Permission["write_reservations"] = "write_reservations";
43
+ Permission["push_reservations"] = "push_reservations";
46
44
  })(Permission || (exports.Permission = Permission = {}));
@@ -5,91 +5,91 @@ exports.BundlesResolvers = {
5
5
  query: {
6
6
  bundles: {
7
7
  name: 'bundles',
8
- query: `query BundleList($limit: Int, $after: Int, $before: Int, $collectionId: Int, $sorting: String){
9
- bundles(limit: $limit, after: $after, before: $before, collectionId: $collectionId, sorting: $sorting){
10
- edges {
11
- node {
12
- id
13
- }
14
- cursor
15
- }
16
- nodes {
17
- id
18
- slug
19
- title
20
- subtitle
21
- description
22
- tags
23
- BundleVariant {
24
- id
25
- title
26
- subtitle
27
- description
28
- translations {
29
- key
30
- locale
31
- value
32
- }
33
- metafields {
34
- key
35
- value
36
- }
37
- price
38
- fullPrice
39
- bundleId
40
- published
41
- createdAt
42
- updatedAt
43
- }
44
- BundleProduct {
45
- bundleId
46
- productId
47
- position
48
- createdAt
49
- updatedAt
50
- }
51
- translations {
52
- key
53
- locale
54
- value
55
- }
56
- metafields {
57
- key
58
- value
59
- }
60
- published
61
- createdAt
62
- updatedAt
63
- }
64
- meta {
65
- startCursor
66
- endCursor
67
- hasNextPage
68
- hasPreviousPage
69
- }
70
- }
8
+ query: `query BundleList($limit: Int, $after: Int, $before: Int, $collectionId: Int, $sorting: String){
9
+ bundles(limit: $limit, after: $after, before: $before, collectionId: $collectionId, sorting: $sorting){
10
+ edges {
11
+ node {
12
+ id
13
+ }
14
+ cursor
15
+ }
16
+ nodes {
17
+ id
18
+ slug
19
+ title
20
+ subtitle
21
+ description
22
+ tags
23
+ BundleVariant {
24
+ id
25
+ title
26
+ subtitle
27
+ description
28
+ translations {
29
+ key
30
+ locale
31
+ value
32
+ }
33
+ metafields {
34
+ key
35
+ value
36
+ }
37
+ price
38
+ fullPrice
39
+ bundleId
40
+ published
41
+ createdAt
42
+ updatedAt
43
+ }
44
+ BundleProduct {
45
+ bundleId
46
+ productId
47
+ position
48
+ createdAt
49
+ updatedAt
50
+ }
51
+ translations {
52
+ key
53
+ locale
54
+ value
55
+ }
56
+ metafields {
57
+ key
58
+ value
59
+ }
60
+ published
61
+ createdAt
62
+ updatedAt
63
+ }
64
+ meta {
65
+ startCursor
66
+ endCursor
67
+ hasNextPage
68
+ hasPreviousPage
69
+ }
70
+ }
71
71
  }`,
72
72
  },
73
73
  },
74
74
  mutation: {
75
75
  removeBundles: {
76
76
  name: 'removeBundles',
77
- query: `mutation BundleDelete($id: [Int!]!){
78
- removeBundles(id: $id) {
79
- count
80
- }
77
+ query: `mutation BundleDelete($id: [Int!]!){
78
+ removeBundles(id: $id) {
79
+ count
80
+ }
81
81
  }`,
82
82
  },
83
83
  updateManyBundleProducts: {
84
84
  name: 'updateManyBundleProducts',
85
- query: `mutation BundleProductsUpdate($bundleId: Int!, $updateList:[UpdateManyBundleProductsListDto!]!) {
86
- updateManyBundleProducts(bundleId:$bundleId,updateList:$updateList){
87
- bundleId
88
- productId
89
- position
90
- createdAt
91
- updatedAt
92
- }
85
+ query: `mutation BundleProductsUpdate($bundleId: Int!, $updateList:[UpdateManyBundleProductsListDto!]!) {
86
+ updateManyBundleProducts(bundleId:$bundleId,updateList:$updateList){
87
+ bundleId
88
+ productId
89
+ position
90
+ createdAt
91
+ updatedAt
92
+ }
93
93
  }`
94
94
  }
95
95
  }
@@ -0,0 +1,4 @@
1
+ import { ApiModule } from "../model";
2
+ export default class Cache extends ApiModule {
3
+ reset(): Promise<void>;
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const model_1 = require("../model");
4
+ class Cache extends model_1.ApiModule {
5
+ reset() {
6
+ return this._call('post', '/cache');
7
+ }
8
+ }
9
+ exports.default = Cache;
package/dist/client.d.ts CHANGED
@@ -21,6 +21,8 @@ import Bundles from "./bundles";
21
21
  import BundleVariants from "./bundles/variants";
22
22
  import LinkCollections from "./linkCollections";
23
23
  import Links from "./linkCollections/links";
24
+ import Cache from "./cache";
25
+ import Reservations from "./reservations";
24
26
  export declare class MaiorCmsApiClient implements ClientApiI {
25
27
  protected config: ApiConfigs;
26
28
  protected client: Axios;
@@ -45,6 +47,8 @@ export declare class MaiorCmsApiClient implements ClientApiI {
45
47
  bundleVariants: BundleVariants;
46
48
  linkCollections: LinkCollections;
47
49
  links: Links;
50
+ cache: Cache;
51
+ reservations: Reservations;
48
52
  constructor(config: ApiConfigs);
49
53
  protected _initClient(): Axios;
50
54
  protected _initModules(): void;
package/dist/client.js CHANGED
@@ -27,6 +27,8 @@ const bundles_1 = __importDefault(require("./bundles"));
27
27
  const variants_2 = __importDefault(require("./bundles/variants"));
28
28
  const linkCollections_1 = __importDefault(require("./linkCollections"));
29
29
  const links_1 = __importDefault(require("./linkCollections/links"));
30
+ const cache_1 = __importDefault(require("./cache"));
31
+ const reservations_1 = __importDefault(require("./reservations"));
30
32
  class MaiorCmsApiClient {
31
33
  constructor(config) {
32
34
  this.config = config;
@@ -62,6 +64,8 @@ class MaiorCmsApiClient {
62
64
  this.bundleVariants = new variants_2.default(this.client);
63
65
  this.linkCollections = new linkCollections_1.default(this.client);
64
66
  this.links = new links_1.default(this.client);
67
+ this.cache = new cache_1.default(this.client);
68
+ this.reservations = new reservations_1.default(this.client);
65
69
  }
66
70
  _setAccessToken(accessToken) {
67
71
  this.client.defaults.headers.common[types_1.ApiHeader.Authorization] = `Bearer ${accessToken}`;
@@ -5,104 +5,104 @@ exports.CollectionsResolvers = {
5
5
  query: {
6
6
  collections: {
7
7
  name: 'collections',
8
- query: `query CollectionList($limit: Int, $after: Int, $before: Int, $sorting: String){
9
- collections(limit: $limit, after: $after, before: $before, sorting: $sorting){
10
- edges {
11
- node {
12
- id
13
- }
14
- cursor
15
- }
16
- nodes {
17
- id
18
- slug
19
- title
20
- subtitle
21
- description
22
- translations {
23
- key
24
- locale
25
- value
26
- }
27
- metafields {
28
- key
29
- value
30
- }
31
- published
32
- position
33
- allowChildren
34
- parentId
35
- createdAt
36
- updatedAt
37
- }
38
- meta {
39
- startCursor
40
- endCursor
41
- hasNextPage
42
- hasPreviousPage
43
- }
44
- }
8
+ query: `query CollectionList($limit: Int, $after: Int, $before: Int, $sorting: String){
9
+ collections(limit: $limit, after: $after, before: $before, sorting: $sorting){
10
+ edges {
11
+ node {
12
+ id
13
+ }
14
+ cursor
15
+ }
16
+ nodes {
17
+ id
18
+ slug
19
+ title
20
+ subtitle
21
+ description
22
+ translations {
23
+ key
24
+ locale
25
+ value
26
+ }
27
+ metafields {
28
+ key
29
+ value
30
+ }
31
+ published
32
+ position
33
+ allowChildren
34
+ parentId
35
+ createdAt
36
+ updatedAt
37
+ }
38
+ meta {
39
+ startCursor
40
+ endCursor
41
+ hasNextPage
42
+ hasPreviousPage
43
+ }
44
+ }
45
45
  }`,
46
46
  },
47
47
  },
48
48
  mutation: {
49
49
  updateCollectionBundles: {
50
50
  name: 'updateCollectionBundles',
51
- query: `mutation CollectionUpdateBundles($collectionId: Int!, $updateList:[UpdateCollectionBundlesListDto!]!){
52
- updateCollectionBundles(collectionId:$collectionId,updateList:$updateList){
53
- collectionId
54
- bundleId
55
- position
56
- createdAt
57
- updatedAt
58
- }
51
+ query: `mutation CollectionUpdateBundles($collectionId: Int!, $updateList:[UpdateCollectionBundlesListDto!]!){
52
+ updateCollectionBundles(collectionId:$collectionId,updateList:$updateList){
53
+ collectionId
54
+ bundleId
55
+ position
56
+ createdAt
57
+ updatedAt
58
+ }
59
59
  }`,
60
60
  },
61
61
  updateCollectionProducts: {
62
62
  name: 'updateCollectionProducts',
63
- query: `mutation CollectionUpdateProducts($collectionId: Int!, $updateList:[UpdateCollectionProductsListDto!]!){
64
- updateCollectionProducts(collectionId:$collectionId,updateList:$updateList){
65
- collectionId
66
- productId
67
- position
68
- createdAt
69
- updatedAt
70
- }
63
+ query: `mutation CollectionUpdateProducts($collectionId: Int!, $updateList:[UpdateCollectionProductsListDto!]!){
64
+ updateCollectionProducts(collectionId:$collectionId,updateList:$updateList){
65
+ collectionId
66
+ productId
67
+ position
68
+ createdAt
69
+ updatedAt
70
+ }
71
71
  }`,
72
72
  },
73
73
  updateManyCollections: {
74
74
  name: 'updateManyCollections',
75
- query: `mutation CollectionsUpdate($updateList:[UpdateManyCollectionsListDto!]!) {
76
- updateManyCollections(updateList:$updateList){
77
- id
78
- slug
79
- title
80
- subtitle
81
- description
82
- translations {
83
- key
84
- locale
85
- value
86
- }
87
- metafields {
88
- key
89
- value
90
- }
91
- published
92
- position
93
- allowChildren
94
- parentId
95
- createdAt
96
- updatedAt
97
- }
75
+ query: `mutation CollectionsUpdate($updateList:[UpdateManyCollectionsListDto!]!) {
76
+ updateManyCollections(updateList:$updateList){
77
+ id
78
+ slug
79
+ title
80
+ subtitle
81
+ description
82
+ translations {
83
+ key
84
+ locale
85
+ value
86
+ }
87
+ metafields {
88
+ key
89
+ value
90
+ }
91
+ published
92
+ position
93
+ allowChildren
94
+ parentId
95
+ createdAt
96
+ updatedAt
97
+ }
98
98
  }`
99
99
  },
100
100
  removeCollections: {
101
101
  name: 'removeCollections',
102
- query: `mutation CollectionDelete($id: [Int!]!){
103
- removeCollections(id: $id) {
104
- count
105
- }
102
+ query: `mutation CollectionDelete($id: [Int!]!){
103
+ removeCollections(id: $id) {
104
+ count
105
+ }
106
106
  }`,
107
107
  },
108
108
  }
@@ -71,6 +71,7 @@ export type QueryCollectionProductsDto = Omit<QueryParamsDto<SortingParamsDto<{}
71
71
  excludeAttributes?: NumberClause;
72
72
  search?: StringClause;
73
73
  published?: BooleanClause;
74
+ hasImages?: BooleanClause;
74
75
  }>>, 'sorting'>;
75
76
  export type FindAllCollectionBundlesDto = WithRelation<BundleCollection, 'Bundle', WithRelations<Bundle, {
76
77
  BundleVariant: BundleVariant[];