@dataggo/node-akeneo-api 1.0.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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -0
  3. package/dist/cjs/endpoints/asset-family.d.ts +39 -0
  4. package/dist/cjs/endpoints/asset-family.js +41 -0
  5. package/dist/cjs/endpoints/attribute.d.ts +24 -0
  6. package/dist/cjs/endpoints/attribute.js +30 -0
  7. package/dist/cjs/endpoints/category.d.ts +21 -0
  8. package/dist/cjs/endpoints/category.js +39 -0
  9. package/dist/cjs/endpoints/family.d.ts +15 -0
  10. package/dist/cjs/endpoints/family.js +21 -0
  11. package/dist/cjs/endpoints/index.d.ts +7 -0
  12. package/dist/cjs/endpoints/index.js +29 -0
  13. package/dist/cjs/endpoints/product-model.d.ts +17 -0
  14. package/dist/cjs/endpoints/product-model.js +31 -0
  15. package/dist/cjs/endpoints/product.d.ts +21 -0
  16. package/dist/cjs/endpoints/product.js +33 -0
  17. package/dist/cjs/endpoints/raw.d.ts +11 -0
  18. package/dist/cjs/endpoints/raw.js +92 -0
  19. package/dist/cjs/endpoints/reference-entity.d.ts +15 -0
  20. package/dist/cjs/endpoints/reference-entity.js +21 -0
  21. package/dist/cjs/error-handler.d.ts +2 -0
  22. package/dist/cjs/error-handler.js +32 -0
  23. package/dist/cjs/http-client.d.ts +16 -0
  24. package/dist/cjs/http-client.js +87 -0
  25. package/dist/cjs/index.d.ts +349 -0
  26. package/dist/cjs/index.js +166 -0
  27. package/dist/cjs/package.json +3 -0
  28. package/dist/cjs/types.d.ts +243 -0
  29. package/dist/cjs/types.js +2 -0
  30. package/dist/mjs/endpoints/asset-family.d.ts +39 -0
  31. package/dist/mjs/endpoints/asset-family.js +31 -0
  32. package/dist/mjs/endpoints/attribute.d.ts +24 -0
  33. package/dist/mjs/endpoints/attribute.js +22 -0
  34. package/dist/mjs/endpoints/category.d.ts +21 -0
  35. package/dist/mjs/endpoints/category.js +18 -0
  36. package/dist/mjs/endpoints/family.d.ts +15 -0
  37. package/dist/mjs/endpoints/family.js +17 -0
  38. package/dist/mjs/endpoints/index.d.ts +7 -0
  39. package/dist/mjs/endpoints/index.js +7 -0
  40. package/dist/mjs/endpoints/product-model.d.ts +17 -0
  41. package/dist/mjs/endpoints/product-model.js +22 -0
  42. package/dist/mjs/endpoints/product.d.ts +21 -0
  43. package/dist/mjs/endpoints/product.js +24 -0
  44. package/dist/mjs/endpoints/raw.d.ts +11 -0
  45. package/dist/mjs/endpoints/raw.js +81 -0
  46. package/dist/mjs/endpoints/reference-entity.d.ts +15 -0
  47. package/dist/mjs/endpoints/reference-entity.js +13 -0
  48. package/dist/mjs/error-handler.d.ts +2 -0
  49. package/dist/mjs/error-handler.js +33 -0
  50. package/dist/mjs/http-client.d.ts +16 -0
  51. package/dist/mjs/http-client.js +86 -0
  52. package/dist/mjs/index.d.ts +349 -0
  53. package/dist/mjs/index.js +124 -0
  54. package/dist/mjs/package.json +3 -0
  55. package/dist/mjs/types.d.ts +243 -0
  56. package/dist/mjs/types.js +1 -0
  57. package/package.json +75 -0
@@ -0,0 +1,243 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ export declare type AppParams = {
3
+ /**
4
+ * API host
5
+ */
6
+ url: string;
7
+ /**
8
+ * App access token
9
+ */
10
+ accessToken: string;
11
+ /**
12
+ * Optional: axiosOptions (https://github.com/axios/axios#request-config)
13
+ */
14
+ axiosOptions?: AxiosRequestConfig;
15
+ };
16
+ export declare type ClientParams = {
17
+ /**
18
+ * API host
19
+ */
20
+ url: string;
21
+ /**
22
+ * username
23
+ */
24
+ username: string;
25
+ /**
26
+ * password
27
+ */
28
+ password: string;
29
+ /**
30
+ * clientId of your app
31
+ */
32
+ clientId: string;
33
+ /**
34
+ * matching secret
35
+ */
36
+ secret: string;
37
+ /**
38
+ * Optional: axiosOptions (https://github.com/axios/axios#request-config)
39
+ */
40
+ axiosOptions?: AxiosRequestConfig;
41
+ };
42
+ export declare type PaginationType = 'page' | 'search_after';
43
+ export declare type ProductModelQueryParameters = {
44
+ search?: string;
45
+ scope?: string;
46
+ locales?: string;
47
+ attributes?: string;
48
+ pagination_type?: PaginationType;
49
+ page?: number;
50
+ search_after?: string;
51
+ limit?: number;
52
+ with_count?: boolean;
53
+ };
54
+ export declare type ProductQueryParameters = {
55
+ search?: string;
56
+ scope?: string;
57
+ locales?: string;
58
+ attributes?: string;
59
+ pagination_type?: PaginationType;
60
+ page?: number;
61
+ search_after?: string;
62
+ limit?: number;
63
+ with_count?: boolean;
64
+ with_attribute_options?: boolean;
65
+ with_quality_scores?: boolean;
66
+ };
67
+ export declare type CategoryQueryParameters = {
68
+ search?: string;
69
+ page?: number;
70
+ limit?: number;
71
+ with_count?: boolean;
72
+ };
73
+ export declare type AttributeQueryParameters = {
74
+ search?: string;
75
+ page?: number;
76
+ limit?: number;
77
+ with_count?: boolean;
78
+ };
79
+ export declare type AttributeOptionQueryParameters = {
80
+ page?: number;
81
+ limit?: number;
82
+ with_count?: boolean;
83
+ };
84
+ export declare type ReferenceEntityQueryParameters = {
85
+ search?: string;
86
+ page?: number;
87
+ limit?: number;
88
+ with_count?: boolean;
89
+ };
90
+ export declare type FamilyQueryParameters = {
91
+ search?: string;
92
+ page?: number;
93
+ limit?: number;
94
+ with_count?: boolean;
95
+ };
96
+ export declare type FamilyVariantQueryParameters = {
97
+ page?: number;
98
+ limit?: number;
99
+ with_count?: boolean;
100
+ };
101
+ export declare type ReferenceEntityRecordQueryParameters = {
102
+ search_after?: string;
103
+ };
104
+ export declare type AssetFamilyQueryParameters = {
105
+ search_after?: string;
106
+ };
107
+ export declare type AssetQueryParameters = {
108
+ search?: string;
109
+ channel?: string;
110
+ locales?: string;
111
+ search_after?: string;
112
+ };
113
+ export declare type ListResponse<T> = {
114
+ items_count?: number;
115
+ current_page?: number;
116
+ items: T[];
117
+ };
118
+ declare type Association = {
119
+ products: string[];
120
+ product_models: string[];
121
+ groups: string[];
122
+ };
123
+ export declare type ProductModel = {
124
+ code: string;
125
+ family: string;
126
+ family_variant: string;
127
+ parent?: string;
128
+ categories: string[];
129
+ values: Record<string, any>;
130
+ created: string;
131
+ updated: string;
132
+ associations: Record<string, Association>;
133
+ quantified_associations: Record<string, Association>;
134
+ metadata: Record<string, any>;
135
+ };
136
+ export declare type Product = {
137
+ identifier: string;
138
+ uuid?: string;
139
+ enabled: boolean;
140
+ family: string;
141
+ categories: string[];
142
+ groups: string[];
143
+ parent: string;
144
+ values: Record<string, any>;
145
+ associations: Record<string, Association>;
146
+ created: string;
147
+ updated: string;
148
+ quantified_associations: Record<string, Association>;
149
+ metadata: Record<string, any>;
150
+ };
151
+ export declare type Family = {
152
+ code: string;
153
+ attribute_as_label: string;
154
+ attribute_as_image: string;
155
+ attributes: string[];
156
+ attribute_requirements: Record<string, any>;
157
+ labels: Record<string, any>;
158
+ };
159
+ declare type VariantAttributeSet = {
160
+ level: number;
161
+ attributes: string[];
162
+ axes: string[];
163
+ };
164
+ export declare type Variant = {
165
+ code: string;
166
+ variant_attribute_sets: VariantAttributeSet[];
167
+ labels: Record<string, any>;
168
+ };
169
+ export declare type Attribute = {
170
+ code: string;
171
+ type: string;
172
+ labels: Record<string, string>;
173
+ group: string;
174
+ group_labels: Record<string, string>;
175
+ sort_order: number;
176
+ localizable: boolean;
177
+ scopable: boolean;
178
+ available_locales: string[];
179
+ unique: boolean;
180
+ useable_as_grid_filter: boolean;
181
+ max_characters: number;
182
+ validation_rule: string;
183
+ validation_regexp: string;
184
+ wysiwyg_enabled: boolean;
185
+ number_min: string;
186
+ number_max: string;
187
+ decimals_allowed: boolean;
188
+ negative_allowed: boolean;
189
+ metric_family: string;
190
+ default_metric_unit: string;
191
+ date_min: string;
192
+ date_max: string;
193
+ allowed_extensions: string[];
194
+ max_file_size: string;
195
+ reference_data_name: string;
196
+ default_value: boolean;
197
+ };
198
+ export declare type AttributeOption = {
199
+ code: string;
200
+ attribute: string;
201
+ sort_order: number;
202
+ labels: Record<string, string>;
203
+ };
204
+ declare type ValuesRecord = {
205
+ locale: string;
206
+ channel: string;
207
+ data: string | string[];
208
+ };
209
+ export declare type KeyValueMap = Record<string, any>;
210
+ export declare type Entity = {
211
+ code: string;
212
+ labels: KeyValueMap;
213
+ };
214
+ export declare type EntityRecord = {
215
+ code: string;
216
+ values: Record<string, ValuesRecord[]>;
217
+ };
218
+ export declare type Category<T = KeyValueMap> = {
219
+ code: string;
220
+ parent?: string;
221
+ labels: T;
222
+ };
223
+ export declare type AssetFamily = {
224
+ code: string;
225
+ labels: Record<string, string>;
226
+ attribute_as_main_media: string;
227
+ product_link_rules: Record<string, Record<string, string>>[];
228
+ transformations: any[];
229
+ naming_convention: {
230
+ source: {
231
+ property: string;
232
+ channel: any;
233
+ locale: any;
234
+ };
235
+ pattern: string;
236
+ abort_asset_creation_on_error: boolean;
237
+ };
238
+ };
239
+ export declare type Asset = {
240
+ code: string;
241
+ values: Record<string, ValuesRecord[]>;
242
+ };
243
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@dataggo/node-akeneo-api",
3
+ "version": "1.0.0",
4
+ "description": "A Node Rest Client for the Akeneo PIM",
5
+ "author": "Constant B <contact@dataggo>",
6
+ "license": "MIT",
7
+ "types": "dist/cjs/index.d.ts",
8
+ "exports": {
9
+ "import": "./dist/mjs/index.js",
10
+ "require": "./dist/cjs/index.js"
11
+ },
12
+ "main": "./dist/cjs/index.js",
13
+ "files": [
14
+ "dist/**/*"
15
+ ],
16
+ "scripts": {
17
+ "build": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && ./fixup",
18
+ "build:docs": "typedoc --tsconfig tsconfig-base.json",
19
+ "build:types": "rimraf dist/typings && tsc -p tsconfig-cjs.json --declaration --noEmit false --emitDeclarationOnly true --allowJs false",
20
+ "watch": "tsc -w -p tsconfig.json && tsc -w -p tsconfig-cjs.json",
21
+ "prepare": "husky install",
22
+ "lint": "eslint src --max-warnings 0",
23
+ "test": "jest",
24
+ "prepublishOnly": "npm run build",
25
+ "publish": "npm publish --access public"
26
+ },
27
+ "dependencies": {
28
+ "axios": "^0.21.1",
29
+ "qs": "^6.9.6",
30
+ "ramda": "^0.27.1"
31
+ },
32
+ "devDependencies": {
33
+ "@types/axios": "^0.14.0",
34
+ "@types/jest": "^26.0.20",
35
+ "@types/node": "^14.14.22",
36
+ "@types/qs": "^6.9.5",
37
+ "@types/ramda": "^0.27.36",
38
+ "@typescript-eslint/eslint-plugin": "^4.15.2",
39
+ "@typescript-eslint/parser": "^4.15.2",
40
+ "eslint": "^7.21.0",
41
+ "eslint-config-airbnb-base": "14.2.1",
42
+ "eslint-config-prettier": "^8.1.0",
43
+ "eslint-plugin-import": "^2.22.1",
44
+ "eslint-plugin-jest": "^24.1.5",
45
+ "eslint-plugin-prettier": "^3.3.1",
46
+ "husky": "^5.1.3",
47
+ "jest": "^26.6.3",
48
+ "jest-html-reporters": "^2.1.2",
49
+ "prettier": "^2.2.1",
50
+ "ts-jest": "^26.5.2",
51
+ "typedoc": "^0.20.19",
52
+ "typescript": "^4.1.3"
53
+ },
54
+ "jest": {
55
+ "moduleFileExtensions": [
56
+ "js",
57
+ "json",
58
+ "ts"
59
+ ],
60
+ "reporters": [
61
+ "default",
62
+ "jest-html-reporters"
63
+ ],
64
+ "testRegex": ".*\\.spec\\.ts$",
65
+ "transform": {
66
+ "^.+\\.(t|j)s$": "ts-jest"
67
+ },
68
+ "collectCoverage": true,
69
+ "collectCoverageFrom": [
70
+ "src/**/*.(t|j)s"
71
+ ],
72
+ "coverageDirectory": "coverage",
73
+ "testEnvironment": "node"
74
+ }
75
+ }