picnic-api-fix 3.2.0 → 3.2.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/lib/index.d.ts CHANGED
@@ -1,216 +1,216 @@
1
- import { ApiConfig, ApiError, Article, Category, ConsentSetting, CountryCode, CustomerServiceContactInfo, Delivery, DeliveryPosition, DeliveryScenario, DeliveryStatus, GetDeliverySlotsResult, ImageSize, LoginResult, MgmDetails, MyStore, Order, OrderStatus, PaymentProfile, ProfileMenu, SearchResult, SetConsentSettingsInput, SetConsentSettingsResult, SingleArticle, SubCategory, SuggestionResult, User, UserInfo, WalletTransaction, WalletTransactionDetails } from "./types/picnic-api";
2
- declare const _default: {
3
- new (options?: ApiConfig): {
4
- countryCode: CountryCode;
5
- apiVersion: string;
6
- authKey: string | null;
7
- url: string;
8
- /**
9
- * Logs the user into picnic to be able to send requests.
10
- * @param {string} username The username of the Picnic account.
11
- * @param {string} password The password of the Picnic account.
12
- */
13
- login(username: string, password: string): Promise<LoginResult>;
14
- /**
15
- * Generates a 2FA code for the user to verify.
16
- * @param {string} channel The channel to send the code to. Can be 'SMS' or possibly something else.
17
- */
18
- generate2FACode(channel: string): Promise<null>;
19
- /**
20
- * Verifies the 2FA code from the user.
21
- * @param {string} code The code to verify.
22
- */
23
- verify2FACode(code: string): Promise<ApiError | null>;
24
- /**
25
- * Gets the details of the current logged in user.
26
- */
27
- getUserDetails(): Promise<User>;
28
- /**
29
- * Gets information about the user such as toggled features.
30
- */
31
- getUserInfo(): Promise<UserInfo>;
32
- /**
33
- * Gets information to display on the profile section.
34
- */
35
- getProfileMenu(): Promise<ProfileMenu>;
36
- /**
37
- * Searches in picnic products.
38
- * @param {string} query The keywords to search for.
39
- */
40
- search(query: string): Promise<SearchResult[]>;
41
- /**
42
- * @deprecated This endpoint seems to be deprecated.
43
- */
44
- getBundleArticleIds(soleArticleId: string): Promise<string[]>;
45
- /**
46
- * Returns the full product page. Some digging is required to get the properties you want. The response is not typed as the content seems to be quite dynamic. Good luck!
47
- * @param {string} productId The product ID to fetch the page for.
48
- */
49
- getProductDetailsPage(productId: string): Promise<any>;
50
- /**
51
- * returns a suggestion on Picnic products matching the query.
52
- * @param {string} query The keywords for suggestions.
53
- */
54
- getSuggestions(query: string): Promise<SuggestionResult[]>;
55
- /**
56
- * Returns the details of a specific product.
57
- * @param {string} productId The id of the product to get.
58
- */
59
- getArticle(productId: string): Promise<Article>;
60
- /**
61
- * Retreives product images from the server as an arrayBuffer.
62
- * @param {string} imageId The image id to retreive.
63
- * @param {ImageSize} size The size of the image to return.
64
- */
65
- getImage(imageId: string, size: ImageSize): Promise<string>;
66
- /**
67
- * Retreives product images from the server ad a DataUri.
68
- * @param {string} imageId The image id to retreive.
69
- * @param {ImageSize} size The size of the image to return.
70
- */
71
- getImageAsDataUri(imageId: string, size: ImageSize): Promise<string>;
72
- /**
73
- * Returns the catgories.
74
- * @param {number} [depth=0] The category depth of items to retrieve.
75
- */
76
- getCategories(depth?: number): Promise<MyStore>;
77
- /**
78
- * Returns the shopping cart information of the user and contents.
79
- */
80
- getShoppingCart(): Promise<Order>;
81
- /**
82
- * Adds a product to the shopping cart.
83
- * @param {string} productId The id of the product to add.
84
- * @param {number} [count=1] The amount of this product to add.
85
- */
86
- addProductToShoppingCart(productId: string, count?: number): Promise<Order>;
87
- /**
88
- * Removes a product from the shopping cart.
89
- * @param {string} productId The id of the product to remove.
90
- * @param {number} [count=1] The amount of this product to remove.
91
- */
92
- removeProductFromShoppingCart(productId: string, count?: number): Promise<Order>;
93
- /**
94
- * Clears the shopping cart of the user.
95
- */
96
- clearShoppingCart(): Promise<Order>;
97
- /**
98
- * Get all the delivery slots.
99
- */
100
- getDeliverySlots(): Promise<GetDeliverySlotsResult>;
101
- /**
102
- * Selects a delivery slot.
103
- * @param {string} slotId The id of the delivery slot to be selected.
104
- */
105
- setDeliverySlot(slotId: string): Promise<Order>;
106
- /**
107
- * Returns all past and current deliveries of the user.
108
- * @param {DeliveryStatus[]} [filter=[]] An array with the statusses of the deliveries to filter on.
109
- */
110
- getDeliveries(filter?: DeliveryStatus[]): Promise<Delivery[]>;
111
- /**
112
- * Get the details of one specific delivery.
113
- * @param {string} deliveryId The id of the delivery to look up.
114
- */
115
- getDelivery(deliveryId: string): Promise<Delivery>;
116
- /**
117
- * Get the position data of one specific delivery. For the route and delivery information, use the scenario call.
118
- * @param {string} deliveryId The id of the delivery to look up.
119
- */
120
- getDeliveryPosition(deliveryId: string): Promise<DeliveryPosition>;
121
- /**
122
- * Get the driver and route information of the delivery.
123
- * @param {string} deliveryId The id of the delivery to look up.
124
- */
125
- getDeliveryScenario(deliveryId: string): Promise<DeliveryScenario>;
126
- /**
127
- * Cancels the order with the given delivery id.
128
- * @param {string} deliveryId
129
- */
130
- cancelDelivery(deliveryId: string): Promise<any>;
131
- /**
132
- * Sets a rating for the delivery from 0 to 10. Will return 400 if a delivery already has a rating.
133
- * @param {string} deliveryId
134
- * @param {number} rating
135
- */
136
- setDeliveryRating(deliveryId: string, rating: number): Promise<string>;
137
- /**
138
- * (Re)sends the invoice email of the delivery.
139
- * @param {string} deliveryId
140
- */
141
- sendDeliveryInvoiceEmail(deliveryId: string): Promise<string>;
142
- /**
143
- * Returns the status of the order (not delivery) with the given id.
144
- * @param {string} orderId
145
- */
146
- getOrderStatus(orderId: string): Promise<OrderStatus>;
147
- /**
148
- * Returns all the lists and sublists.
149
- * @param {number} [depth=0] The category depth of items to retrieve.
150
- */
151
- getLists(depth?: number): Promise<Category[]>;
152
- /**
153
- * Returns the sublists of a list, the articles of a sublist if the subListId is given.
154
- * @param {string} listId The id of the list to get.
155
- * @param {string} [subListId] The id of the sub list to get.
156
- * @param {number} [depth=0] The category depth of items to retrieve.
157
- */
158
- getList(listId: string, subListId?: string, depth?: number): Promise<SubCategory[] | SingleArticle[]>;
159
- /**
160
- * Returns the MGM details. This are the friends discount data.
161
- */
162
- getMgmDetails(): Promise<MgmDetails>;
163
- /**
164
- * Returns the list of consent settings.
165
- * @param {boolean} [general=false] Returns only the 'general' consent settings.
166
- */
167
- getConsentSettings(general?: boolean): Promise<ConsentSetting[]>;
168
- /**
169
- * Sets one or multiple consent options to true or false.
170
- * @param {SetConsentSettingsInput} consentSettingsInput An array of objects of consent items.
171
- */
172
- setConsentSettings(consentSettingsInput: SetConsentSettingsInput): Promise<SetConsentSettingsResult>;
173
- /**
174
- * Returns the popup messages in the app. For example, the message after a delivery, asking if the delivery was satisfactory.
175
- */
176
- getMessages(): Promise<any>;
177
- /**
178
- * Returns the reminders.
179
- */
180
- getReminders(): Promise<any>;
181
- /**
182
- * Gets payment information.
183
- */
184
- getPaymentProfile(): Promise<PaymentProfile>;
185
- /**
186
- * Gets transactions made.
187
- * @param {number} pageNumber The page number to get the transactions from.
188
- */
189
- getWalletTransactions(pageNumber: number): Promise<WalletTransaction[]>;
190
- /**
191
- * Gets payment information.
192
- * @param {string} walletTransactionId The id of the transaction to get the details from.
193
- */
194
- getWalletTransactionDetails(walletTransactionId: string): Promise<WalletTransactionDetails>;
195
- /**
196
- * Gets payment information.
197
- */
198
- getCustomerServiceContactInfo(): Promise<CustomerServiceContactInfo>;
199
- /**
200
- * Gets parcels.
201
- * @todo Implement return type once known.
202
- */
203
- getParcels(): Promise<any[]>;
204
- /**
205
- * Can be used to send custom requests that are not implemented but do need authentication for it.
206
- * @param {string} method The HTTP method to use, such as GET, POST, PUT and DELETE.
207
- * @param {string} path The path, possibly including query params. Example: '/cart/set_delivery_slot' or '/my_store?depth=0'.
208
- * @param {TRequestData|null} [data=null] The request body, usually in case of a POST or PUT request.
209
- * @param {boolean} [includePicnicHeaders=false] If it should include x-picnic-agent and x-picnic-did headers.
210
- * @param {boolean} [isImageRequest=false] Will add the arrayBuffer response type if true.
211
- */
212
- sendRequest<TRequestData, TResponseData>(method: "GET" | "POST" | "PUT" | "DELETE", path: string, data?: TRequestData | null, includePicnicHeaders?: boolean, isImageRequest?: boolean): Promise<TResponseData>;
213
- };
214
- };
215
- export = _default;
1
+ import { ApiConfig, ApiError, Article, Category, ConsentSetting, CountryCode, CustomerServiceContactInfo, Delivery, DeliveryPosition, DeliveryScenario, DeliveryStatus, GetDeliverySlotsResult, ImageSize, LoginResult, MgmDetails, MyStore, Order, OrderStatus, PaymentProfile, ProfileMenu, SearchResult, SetConsentSettingsInput, SetConsentSettingsResult, SingleArticle, SubCategory, SuggestionResult, User, UserInfo, WalletTransaction, WalletTransactionDetails } from "./types/picnic-api";
2
+ declare const _default: {
3
+ new (options?: ApiConfig): {
4
+ countryCode: CountryCode;
5
+ apiVersion: string;
6
+ authKey: string | null;
7
+ url: string;
8
+ /**
9
+ * Logs the user into picnic to be able to send requests.
10
+ * @param {string} username The username of the Picnic account.
11
+ * @param {string} password The password of the Picnic account.
12
+ */
13
+ login(username: string, password: string): Promise<LoginResult>;
14
+ /**
15
+ * Generates a 2FA code for the user to verify.
16
+ * @param {string} channel The channel to send the code to. Can be 'SMS' or possibly something else.
17
+ */
18
+ generate2FACode(channel: string): Promise<null>;
19
+ /**
20
+ * Verifies the 2FA code from the user.
21
+ * @param {string} code The code to verify.
22
+ */
23
+ verify2FACode(code: string): Promise<ApiError | null>;
24
+ /**
25
+ * Gets the details of the current logged in user.
26
+ */
27
+ getUserDetails(): Promise<User>;
28
+ /**
29
+ * Gets information about the user such as toggled features.
30
+ */
31
+ getUserInfo(): Promise<UserInfo>;
32
+ /**
33
+ * Gets information to display on the profile section.
34
+ */
35
+ getProfileMenu(): Promise<ProfileMenu>;
36
+ /**
37
+ * Searches in picnic products.
38
+ * @param {string} query The keywords to search for.
39
+ */
40
+ search(query: string): Promise<SearchResult[]>;
41
+ /**
42
+ * @deprecated This endpoint seems to be deprecated.
43
+ */
44
+ getBundleArticleIds(soleArticleId: string): Promise<string[]>;
45
+ /**
46
+ * Returns the full product page. Some digging is required to get the properties you want. The response is not typed as the content seems to be quite dynamic. Good luck!
47
+ * @param {string} productId The product ID to fetch the page for.
48
+ */
49
+ getProductDetailsPage(productId: string): Promise<any>;
50
+ /**
51
+ * returns a suggestion on Picnic products matching the query.
52
+ * @param {string} query The keywords for suggestions.
53
+ */
54
+ getSuggestions(query: string): Promise<SuggestionResult[]>;
55
+ /**
56
+ * Returns the details of a specific product.
57
+ * @param {string} productId The id of the product to get.
58
+ */
59
+ getArticle(productId: string): Promise<Article>;
60
+ /**
61
+ * Retreives product images from the server as an arrayBuffer.
62
+ * @param {string} imageId The image id to retreive.
63
+ * @param {ImageSize} size The size of the image to return.
64
+ */
65
+ getImage(imageId: string, size: ImageSize): Promise<string>;
66
+ /**
67
+ * Retreives product images from the server ad a DataUri.
68
+ * @param {string} imageId The image id to retreive.
69
+ * @param {ImageSize} size The size of the image to return.
70
+ */
71
+ getImageAsDataUri(imageId: string, size: ImageSize): Promise<string>;
72
+ /**
73
+ * Returns the catgories.
74
+ * @param {number} [depth=0] The category depth of items to retrieve.
75
+ */
76
+ getCategories(depth?: number): Promise<MyStore>;
77
+ /**
78
+ * Returns the shopping cart information of the user and contents.
79
+ */
80
+ getShoppingCart(): Promise<Order>;
81
+ /**
82
+ * Adds a product to the shopping cart.
83
+ * @param {string} productId The id of the product to add.
84
+ * @param {number} [count=1] The amount of this product to add.
85
+ */
86
+ addProductToShoppingCart(productId: string, count?: number): Promise<Order>;
87
+ /**
88
+ * Removes a product from the shopping cart.
89
+ * @param {string} productId The id of the product to remove.
90
+ * @param {number} [count=1] The amount of this product to remove.
91
+ */
92
+ removeProductFromShoppingCart(productId: string, count?: number): Promise<Order>;
93
+ /**
94
+ * Clears the shopping cart of the user.
95
+ */
96
+ clearShoppingCart(): Promise<Order>;
97
+ /**
98
+ * Get all the delivery slots.
99
+ */
100
+ getDeliverySlots(): Promise<GetDeliverySlotsResult>;
101
+ /**
102
+ * Selects a delivery slot.
103
+ * @param {string} slotId The id of the delivery slot to be selected.
104
+ */
105
+ setDeliverySlot(slotId: string): Promise<Order>;
106
+ /**
107
+ * Returns all past and current deliveries of the user.
108
+ * @param {DeliveryStatus[]} [filter=[]] An array with the statusses of the deliveries to filter on.
109
+ */
110
+ getDeliveries(filter?: DeliveryStatus[]): Promise<Delivery[]>;
111
+ /**
112
+ * Get the details of one specific delivery.
113
+ * @param {string} deliveryId The id of the delivery to look up.
114
+ */
115
+ getDelivery(deliveryId: string): Promise<Delivery>;
116
+ /**
117
+ * Get the position data of one specific delivery. For the route and delivery information, use the scenario call.
118
+ * @param {string} deliveryId The id of the delivery to look up.
119
+ */
120
+ getDeliveryPosition(deliveryId: string): Promise<DeliveryPosition>;
121
+ /**
122
+ * Get the driver and route information of the delivery.
123
+ * @param {string} deliveryId The id of the delivery to look up.
124
+ */
125
+ getDeliveryScenario(deliveryId: string): Promise<DeliveryScenario>;
126
+ /**
127
+ * Cancels the order with the given delivery id.
128
+ * @param {string} deliveryId
129
+ */
130
+ cancelDelivery(deliveryId: string): Promise<any>;
131
+ /**
132
+ * Sets a rating for the delivery from 0 to 10. Will return 400 if a delivery already has a rating.
133
+ * @param {string} deliveryId
134
+ * @param {number} rating
135
+ */
136
+ setDeliveryRating(deliveryId: string, rating: number): Promise<string>;
137
+ /**
138
+ * (Re)sends the invoice email of the delivery.
139
+ * @param {string} deliveryId
140
+ */
141
+ sendDeliveryInvoiceEmail(deliveryId: string): Promise<string>;
142
+ /**
143
+ * Returns the status of the order (not delivery) with the given id.
144
+ * @param {string} orderId
145
+ */
146
+ getOrderStatus(orderId: string): Promise<OrderStatus>;
147
+ /**
148
+ * Returns all the lists and sublists.
149
+ * @param {number} [depth=0] The category depth of items to retrieve.
150
+ */
151
+ getLists(depth?: number): Promise<Category[]>;
152
+ /**
153
+ * Returns the sublists of a list, the articles of a sublist if the subListId is given.
154
+ * @param {string} listId The id of the list to get.
155
+ * @param {string} [subListId] The id of the sub list to get.
156
+ * @param {number} [depth=0] The category depth of items to retrieve.
157
+ */
158
+ getList(listId: string, subListId?: string, depth?: number): Promise<SubCategory[] | SingleArticle[]>;
159
+ /**
160
+ * Returns the MGM details. This are the friends discount data.
161
+ */
162
+ getMgmDetails(): Promise<MgmDetails>;
163
+ /**
164
+ * Returns the list of consent settings.
165
+ * @param {boolean} [general=false] Returns only the 'general' consent settings.
166
+ */
167
+ getConsentSettings(general?: boolean): Promise<ConsentSetting[]>;
168
+ /**
169
+ * Sets one or multiple consent options to true or false.
170
+ * @param {SetConsentSettingsInput} consentSettingsInput An array of objects of consent items.
171
+ */
172
+ setConsentSettings(consentSettingsInput: SetConsentSettingsInput): Promise<SetConsentSettingsResult>;
173
+ /**
174
+ * Returns the popup messages in the app. For example, the message after a delivery, asking if the delivery was satisfactory.
175
+ */
176
+ getMessages(): Promise<any>;
177
+ /**
178
+ * Returns the reminders.
179
+ */
180
+ getReminders(): Promise<any>;
181
+ /**
182
+ * Gets payment information.
183
+ */
184
+ getPaymentProfile(): Promise<PaymentProfile>;
185
+ /**
186
+ * Gets transactions made.
187
+ * @param {number} pageNumber The page number to get the transactions from.
188
+ */
189
+ getWalletTransactions(pageNumber: number): Promise<WalletTransaction[]>;
190
+ /**
191
+ * Gets payment information.
192
+ * @param {string} walletTransactionId The id of the transaction to get the details from.
193
+ */
194
+ getWalletTransactionDetails(walletTransactionId: string): Promise<WalletTransactionDetails>;
195
+ /**
196
+ * Gets payment information.
197
+ */
198
+ getCustomerServiceContactInfo(): Promise<CustomerServiceContactInfo>;
199
+ /**
200
+ * Gets parcels.
201
+ * @todo Implement return type once known.
202
+ */
203
+ getParcels(): Promise<any[]>;
204
+ /**
205
+ * Can be used to send custom requests that are not implemented but do need authentication for it.
206
+ * @param {string} method The HTTP method to use, such as GET, POST, PUT and DELETE.
207
+ * @param {string} path The path, possibly including query params. Example: '/cart/set_delivery_slot' or '/my_store?depth=0'.
208
+ * @param {TRequestData|null} [data=null] The request body, usually in case of a POST or PUT request.
209
+ * @param {boolean} [includePicnicHeaders=false] If it should include x-picnic-agent and x-picnic-did headers.
210
+ * @param {boolean} [isImageRequest=false] Will add the arrayBuffer response type if true.
211
+ */
212
+ sendRequest<TRequestData, TResponseData>(method: "GET" | "POST" | "PUT" | "DELETE", path: string, data?: TRequestData | null, includePicnicHeaders?: boolean, isImageRequest?: boolean): Promise<TResponseData>;
213
+ };
214
+ };
215
+ export = _default;
216
216
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,cAAc,EACd,WAAW,EACX,0BAA0B,EAC1B,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EAEd,sBAAsB,EACtB,SAAS,EAET,WAAW,EACX,UAAU,EACV,OAAO,EACP,KAAK,EACL,WAAW,EACX,cAAc,EACd,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EAExB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EAER,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,oBAAoB,CAAC;;mBAiBJ,SAAS;qBAblB,WAAW;oBACZ,MAAM;iBACT,MAAM,GAAG,IAAI;aACjB,MAAM;QAiBX;;;;WAIG;wBACmB,MAAM,YAAY,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;QAmCrE;;;WAGG;iCACsB,MAAM;QAI/B;;;WAGG;4BACiB,MAAM;QAI1B;;WAEG;0BACe,OAAO,CAAC,IAAI,CAAC;QAI/B;;WAEG;uBACY,OAAO,CAAC,QAAQ,CAAC;QAIhC;;WAEG;0BACe,OAAO,CAAC,WAAW,CAAC;QAItC;;;WAGG;sBACiB,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;QAKpD;;WAEG;2CACsC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QAyBnE;;;WAGG;yCACoC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;QAS5D;;;WAGG;8BACmB,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;Q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AI5B;;;;;;;WAOG;oBACe,YAAY,EAAE,aAAa,UACnC,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,QACnC,MAAM,SACN,YAAY,GAAG,IAAI,yBACH,OAAO,mBACb,OAAO,GACtB,OAAO,CAAC,aAAa,CAAC;;;AAva3B,kBAqcE"}
package/lib/index.js CHANGED
@@ -1,376 +1,380 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- const crypto_1 = __importDefault(require("crypto"));
6
- const jsonpath_plus_1 = require("jsonpath-plus");
7
- module.exports = class PicnicClient {
8
- /**
9
- * Builds the client that sends the requests.
10
- * @param {ApiConfig} options To configure the client.
11
- * @param {string} [options.countryCode=NL] The country code for the requests.
12
- * @param {string} [options.apiVersion=17] The api version for the requests. Does not seem to do anything yet.
13
- * @param {string} [options.authKey=null] The code for the x-picnic-auth header to make authenticated requests. If not supplied then login() needs to be called before making any other requests.
14
- * @param {string} [options.url] Custom defined endpoint.
15
- */
16
- constructor(options) {
17
- this.countryCode = options?.countryCode || "NL";
18
- this.apiVersion = options?.apiVersion || "15";
19
- this.authKey = options?.authKey || null;
20
- this.url = options?.url || `https://storefront-prod.${this.countryCode.toLowerCase()}.picnicinternational.com/api/${this.apiVersion}`;
21
- }
22
- /**
23
- * Logs the user into picnic to be able to send requests.
24
- * @param {string} username The username of the Picnic account.
25
- * @param {string} password The password of the Picnic account.
26
- */
27
- async login(username, password) {
28
- const secret = crypto_1.default.createHash("md5").update(password, "utf8").digest("hex");
29
- const response = await fetch(`${this.url}/user/login`, {
30
- method: "POST",
31
- headers: {
32
- "Content-Type": "application/json",
33
- },
34
- body: JSON.stringify({
35
- key: username,
36
- secret,
37
- client_id: 30100,
38
- }),
39
- });
40
- if (!response.ok) {
41
- const errorData = await response.json();
42
- throw new Error(`Login failed: ${errorData.error?.message || response.statusText}`);
43
- }
44
- const data = await response.json();
45
- this.authKey = response.headers.get(`x-picnic-auth`);
46
- if (!this.authKey) {
47
- throw new Error("Login failed: No auth key received.");
48
- }
49
- return {
50
- authKey: this.authKey,
51
- second_factor_authentication_required: data.second_factor_authentication_required,
52
- show_second_factor_authentication_intro: data.show_second_factor_authentication_intro,
53
- user_id: data.user_id,
54
- };
55
- }
56
- /**
57
- * Generates a 2FA code for the user to verify.
58
- * @param {string} channel The channel to send the code to. Can be 'SMS' or possibly something else.
59
- */
60
- generate2FACode(channel) {
61
- return this.sendRequest("POST", `/user/2fa/generate`, { channel }, true);
62
- }
63
- /**
64
- * Verifies the 2FA code from the user.
65
- * @param {string} code The code to verify.
66
- */
67
- verify2FACode(code) {
68
- return this.sendRequest("POST", `/user/2fa/verify`, { otp: code }, true);
69
- }
70
- /**
71
- * Gets the details of the current logged in user.
72
- */
73
- getUserDetails() {
74
- return this.sendRequest("GET", `/user`);
75
- }
76
- /**
77
- * Gets information about the user such as toggled features.
78
- */
79
- getUserInfo() {
80
- return this.sendRequest("GET", `/user-info`);
81
- }
82
- /**
83
- * Gets information to display on the profile section.
84
- */
85
- getProfileMenu() {
86
- return this.sendRequest("GET", `/profile-menu?fetch_mgm=true`, null, true);
87
- }
88
- /**
89
- * Searches in picnic products.
90
- * @param {string} query The keywords to search for.
91
- */
92
- async search(query) {
93
- const rawResults = await this.sendRequest("GET", `/pages/search-page-results?search_term=${encodeURIComponent(query)}`, null, true);
94
- return (0, jsonpath_plus_1.JSONPath)({ path: "$..sellingUnit", json: rawResults });
95
- }
96
- /**
97
- * @deprecated This endpoint seems to be deprecated.
98
- */
99
- async getBundleArticleIds(soleArticleId) {
100
- try {
101
- const response = await this.sendRequest("GET", `/pages/bundle-overview-page?sole_article_id=${soleArticleId}&show_category_action=true`, null, true);
102
- if (!response.body) {
103
- return [];
104
- }
105
- const articleIdMatches = Array.from(JSON.stringify(response.body).matchAll(/"product-page-bundle-item-(s[0-9]+)"/g)).map((match) => match[1]);
106
- const uniqueArticleIds = [...new Set(articleIdMatches)];
107
- return uniqueArticleIds;
108
- }
109
- catch (error) {
110
- throw new Error("Failed to parse the results and find the article id. This could mean that the response format from the picnic servers has changed. Please open an issue on the github repository.");
111
- }
112
- }
113
- /**
114
- * Returns the full product page. Some digging is required to get the properties you want. The response is not typed as the content seems to be quite dynamic. Good luck!
115
- * @param {string} productId The product ID to fetch the page for.
116
- */
117
- async getProductDetailsPage(productId) {
118
- return await this.sendRequest("GET", `/pages/product-details-page-root?id=${productId}&show_category_action=true&show_remove_from_purchases_page_action=false`, null, true);
119
- }
120
- /**
121
- * returns a suggestion on Picnic products matching the query.
122
- * @param {string} query The keywords for suggestions.
123
- */
124
- getSuggestions(query) {
125
- return this.sendRequest("GET", `/suggest?search_term=${encodeURIComponent(query)}`);
126
- }
127
- /**
128
- * Returns the details of a specific product.
129
- * @param {string} productId The id of the product to get.
130
- */
131
- getArticle(productId) {
132
- return this.sendRequest("GET", `/articles/${productId}`);
133
- }
134
- /**
135
- * Retreives product images from the server as an arrayBuffer.
136
- * @param {string} imageId The image id to retreive.
137
- * @param {ImageSize} size The size of the image to return.
138
- */
139
- getImage(imageId, size) {
140
- let alternateRoute = this.url.split("/api/")[0];
141
- return this.sendRequest("GET", `${alternateRoute}/static/images/${imageId}/${size}.png`, null, false, true);
142
- }
143
- /**
144
- * Retreives product images from the server ad a DataUri.
145
- * @param {string} imageId The image id to retreive.
146
- * @param {ImageSize} size The size of the image to return.
147
- */
148
- async getImageAsDataUri(imageId, size) {
149
- let arrayBuffer = await this.getImage(imageId, size);
150
- let dataUri = "data:image/png;base64," + Buffer.from(arrayBuffer, "binary").toString("base64");
151
- return dataUri;
152
- }
153
- /**
154
- * Returns the catgories.
155
- * @param {number} [depth=0] The category depth of items to retrieve.
156
- */
157
- getCategories(depth = 0) {
158
- return this.sendRequest("GET", `/my_store?depth=${depth}`);
159
- }
160
- /**
161
- * Returns the shopping cart information of the user and contents.
162
- */
163
- getShoppingCart() {
164
- return this.sendRequest("GET", `/cart`);
165
- }
166
- /**
167
- * Adds a product to the shopping cart.
168
- * @param {string} productId The id of the product to add.
169
- * @param {number} [count=1] The amount of this product to add.
170
- */
171
- addProductToShoppingCart(productId, count = 1) {
172
- return this.sendRequest("POST", `/cart/add_product`, { product_id: productId, count });
173
- }
174
- /**
175
- * Removes a product from the shopping cart.
176
- * @param {string} productId The id of the product to remove.
177
- * @param {number} [count=1] The amount of this product to remove.
178
- */
179
- removeProductFromShoppingCart(productId, count = 1) {
180
- return this.sendRequest("POST", `/cart/remove_product`, { product_id: productId, count });
181
- }
182
- /**
183
- * Clears the shopping cart of the user.
184
- */
185
- clearShoppingCart() {
186
- return this.sendRequest("POST", `/cart/clear`);
187
- }
188
- /**
189
- * Get all the delivery slots.
190
- */
191
- getDeliverySlots() {
192
- return this.sendRequest("GET", `/cart/delivery_slots`);
193
- }
194
- /**
195
- * Selects a delivery slot.
196
- * @param {string} slotId The id of the delivery slot to be selected.
197
- */
198
- setDeliverySlot(slotId) {
199
- return this.sendRequest("POST", `/cart/set_delivery_slot`, { slot_id: slotId });
200
- }
201
- /**
202
- * Returns all past and current deliveries of the user.
203
- * @param {DeliveryStatus[]} [filter=[]] An array with the statusses of the deliveries to filter on.
204
- */
205
- getDeliveries(filter = []) {
206
- return this.sendRequest("POST", `/deliveries/summary`, filter);
207
- }
208
- /**
209
- * Get the details of one specific delivery.
210
- * @param {string} deliveryId The id of the delivery to look up.
211
- */
212
- getDelivery(deliveryId) {
213
- return this.sendRequest("GET", `/deliveries/${deliveryId}`);
214
- }
215
- /**
216
- * Get the position data of one specific delivery. For the route and delivery information, use the scenario call.
217
- * @param {string} deliveryId The id of the delivery to look up.
218
- */
219
- getDeliveryPosition(deliveryId) {
220
- return this.sendRequest("GET", `/deliveries/${deliveryId}/position`, null, true);
221
- }
222
- /**
223
- * Get the driver and route information of the delivery.
224
- * @param {string} deliveryId The id of the delivery to look up.
225
- */
226
- getDeliveryScenario(deliveryId) {
227
- return this.sendRequest("GET", `/deliveries/${deliveryId}/scenario`, null, true);
228
- }
229
- /**
230
- * Cancels the order with the given delivery id.
231
- * @param {string} deliveryId
232
- */
233
- cancelDelivery(deliveryId) {
234
- return this.sendRequest("POST", `/order/delivery/${deliveryId}/cancel`);
235
- }
236
- /**
237
- * Sets a rating for the delivery from 0 to 10. Will return 400 if a delivery already has a rating.
238
- * @param {string} deliveryId
239
- * @param {number} rating
240
- */
241
- setDeliveryRating(deliveryId, rating) {
242
- return this.sendRequest("POST", `/deliveries/${deliveryId}/rating`, { rating });
243
- }
244
- /**
245
- * (Re)sends the invoice email of the delivery.
246
- * @param {string} deliveryId
247
- */
248
- sendDeliveryInvoiceEmail(deliveryId) {
249
- return this.sendRequest("POST", `/deliveries/${deliveryId}/resend_invoice_email`);
250
- }
251
- /**
252
- * Returns the status of the order (not delivery) with the given id.
253
- * @param {string} orderId
254
- */
255
- getOrderStatus(orderId) {
256
- return this.sendRequest("GET", `/cart/checkout/order/${orderId}/status`);
257
- }
258
- /**
259
- * Returns all the lists and sublists.
260
- * @param {number} [depth=0] The category depth of items to retrieve.
261
- */
262
- getLists(depth = 0) {
263
- return this.sendRequest("GET", `/lists?depth=${depth}`);
264
- }
265
- /**
266
- * Returns the sublists of a list, the articles of a sublist if the subListId is given.
267
- * @param {string} listId The id of the list to get.
268
- * @param {string} [subListId] The id of the sub list to get.
269
- * @param {number} [depth=0] The category depth of items to retrieve.
270
- */
271
- getList(listId, subListId, depth = 0) {
272
- let path = `/lists/${listId}`;
273
- if (subListId) {
274
- path += `?sublist=${subListId}`;
275
- }
276
- path += (subListId ? "&" : "?") + `depth=${depth}`;
277
- return this.sendRequest("GET", path);
278
- }
279
- /**
280
- * Returns the MGM details. This are the friends discount data.
281
- */
282
- getMgmDetails() {
283
- return this.sendRequest("GET", `/mgm`);
284
- }
285
- /**
286
- * Returns the list of consent settings.
287
- * @param {boolean} [general=false] Returns only the 'general' consent settings.
288
- */
289
- getConsentSettings(general = false) {
290
- return this.sendRequest("GET", `/consents${general ? "/general" : ""}/settings-page`);
291
- }
292
- /**
293
- * Sets one or multiple consent options to true or false.
294
- * @param {SetConsentSettingsInput} consentSettingsInput An array of objects of consent items.
295
- */
296
- setConsentSettings(consentSettingsInput) {
297
- return this.sendRequest("PUT", `/consents`, consentSettingsInput);
298
- }
299
- /**
300
- * Returns the popup messages in the app. For example, the message after a delivery, asking if the delivery was satisfactory.
301
- */
302
- getMessages() {
303
- return this.sendRequest("GET", `/messages`, null, true);
304
- }
305
- /**
306
- * Returns the reminders.
307
- */
308
- getReminders() {
309
- return this.sendRequest("GET", `/reminders`, null, true);
310
- }
311
- /**
312
- * Gets payment information.
313
- */
314
- getPaymentProfile() {
315
- return this.sendRequest("GET", `/payment-profile`, null, true);
316
- }
317
- /**
318
- * Gets transactions made.
319
- * @param {number} pageNumber The page number to get the transactions from.
320
- */
321
- getWalletTransactions(pageNumber) {
322
- return this.sendRequest("POST", `/wallet/transactions`, { page_number: pageNumber });
323
- }
324
- /**
325
- * Gets payment information.
326
- * @param {string} walletTransactionId The id of the transaction to get the details from.
327
- */
328
- getWalletTransactionDetails(walletTransactionId) {
329
- return this.sendRequest("GET", `/wallet/transactions/${walletTransactionId}`);
330
- }
331
- /**
332
- * Gets payment information.
333
- */
334
- getCustomerServiceContactInfo() {
335
- return this.sendRequest("GET", `/cs-contact-info`, null, true);
336
- }
337
- /**
338
- * Gets parcels.
339
- * @todo Implement return type once known.
340
- */
341
- getParcels() {
342
- return this.sendRequest("GET", `/parcels`, null, true);
343
- }
344
- /**
345
- * Can be used to send custom requests that are not implemented but do need authentication for it.
346
- * @param {string} method The HTTP method to use, such as GET, POST, PUT and DELETE.
347
- * @param {string} path The path, possibly including query params. Example: '/cart/set_delivery_slot' or '/my_store?depth=0'.
348
- * @param {TRequestData|null} [data=null] The request body, usually in case of a POST or PUT request.
349
- * @param {boolean} [includePicnicHeaders=false] If it should include x-picnic-agent and x-picnic-did headers.
350
- * @param {boolean} [isImageRequest=false] Will add the arrayBuffer response type if true.
351
- */
352
- async sendRequest(method, path, data = null, includePicnicHeaders = false, isImageRequest = false) {
353
- const headers = new Headers({
354
- "User-Agent": "okhttp/3.12.2",
355
- "Content-Type": "application/json; charset=UTF-8",
356
- ...(this.authKey && { "x-picnic-auth": this.authKey }),
357
- ...(includePicnicHeaders && { "x-picnic-agent": "30100;1.15.232-15154", "x-picnic-did": "3C417201548B2E3B" }),
358
- });
359
- const response = await fetch(`${this.url}${path}`, {
360
- method: method,
361
- headers: headers,
362
- body: data ? JSON.stringify(data) : null,
363
- });
364
- if (!response.ok) {
365
- try {
366
- const errorData = await response.json();
367
- throw new Error(`${errorData.error?.message || response.statusText}`);
368
- }
369
- catch (e) {
370
- throw new Error(`${response.status} ${response.statusText}`);
371
- }
372
- }
373
- return isImageRequest ? response.arrayBuffer() : response.json();
374
- }
375
- };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const crypto_1 = __importDefault(require("crypto"));
6
+ const jsonpath_plus_1 = require("jsonpath-plus");
7
+ module.exports = class PicnicClient {
8
+ /**
9
+ * Builds the client that sends the requests.
10
+ * @param {ApiConfig} options To configure the client.
11
+ * @param {string} [options.countryCode=NL] The country code for the requests.
12
+ * @param {string} [options.apiVersion=17] The api version for the requests. Does not seem to do anything yet.
13
+ * @param {string} [options.authKey=null] The code for the x-picnic-auth header to make authenticated requests. If not supplied then login() needs to be called before making any other requests.
14
+ * @param {string} [options.url] Custom defined endpoint.
15
+ */
16
+ constructor(options) {
17
+ this.countryCode = options?.countryCode || "NL";
18
+ this.apiVersion = options?.apiVersion || "15";
19
+ this.authKey = options?.authKey || null;
20
+ this.url = options?.url || `https://storefront-prod.${this.countryCode.toLowerCase()}.picnicinternational.com/api/${this.apiVersion}`;
21
+ }
22
+ /**
23
+ * Logs the user into picnic to be able to send requests.
24
+ * @param {string} username The username of the Picnic account.
25
+ * @param {string} password The password of the Picnic account.
26
+ */
27
+ async login(username, password) {
28
+ const secret = crypto_1.default.createHash("md5").update(password, "utf8").digest("hex");
29
+ const response = await fetch(`${this.url}/user/login`, {
30
+ method: "POST",
31
+ headers: {
32
+ "Content-Type": "application/json",
33
+ },
34
+ body: JSON.stringify({
35
+ key: username,
36
+ secret,
37
+ client_id: 30100,
38
+ }),
39
+ });
40
+ if (!response.ok) {
41
+ const errorData = await response.json();
42
+ throw new Error(`Login failed: ${errorData.error?.message || response.statusText}`);
43
+ }
44
+ const data = await response.json();
45
+ this.authKey = response.headers.get(`x-picnic-auth`);
46
+ if (!this.authKey) {
47
+ throw new Error("Login failed: No auth key received.");
48
+ }
49
+ return {
50
+ authKey: this.authKey,
51
+ second_factor_authentication_required: data.second_factor_authentication_required,
52
+ show_second_factor_authentication_intro: data.show_second_factor_authentication_intro,
53
+ user_id: data.user_id,
54
+ };
55
+ }
56
+ /**
57
+ * Generates a 2FA code for the user to verify.
58
+ * @param {string} channel The channel to send the code to. Can be 'SMS' or possibly something else.
59
+ */
60
+ generate2FACode(channel) {
61
+ return this.sendRequest("POST", `/user/2fa/generate`, { channel }, true);
62
+ }
63
+ /**
64
+ * Verifies the 2FA code from the user.
65
+ * @param {string} code The code to verify.
66
+ */
67
+ verify2FACode(code) {
68
+ return this.sendRequest("POST", `/user/2fa/verify`, { otp: code }, true);
69
+ }
70
+ /**
71
+ * Gets the details of the current logged in user.
72
+ */
73
+ getUserDetails() {
74
+ return this.sendRequest("GET", `/user`);
75
+ }
76
+ /**
77
+ * Gets information about the user such as toggled features.
78
+ */
79
+ getUserInfo() {
80
+ return this.sendRequest("GET", `/user-info`);
81
+ }
82
+ /**
83
+ * Gets information to display on the profile section.
84
+ */
85
+ getProfileMenu() {
86
+ return this.sendRequest("GET", `/profile-menu?fetch_mgm=true`, null, true);
87
+ }
88
+ /**
89
+ * Searches in picnic products.
90
+ * @param {string} query The keywords to search for.
91
+ */
92
+ async search(query) {
93
+ const rawResults = await this.sendRequest("GET", `/pages/search-page-results?search_term=${encodeURIComponent(query)}`, null, true);
94
+ return (0, jsonpath_plus_1.JSONPath)({ path: "$..sellingUnit", json: rawResults });
95
+ }
96
+ /**
97
+ * @deprecated This endpoint seems to be deprecated.
98
+ */
99
+ async getBundleArticleIds(soleArticleId) {
100
+ try {
101
+ const response = await this.sendRequest("GET", `/pages/bundle-overview-page?sole_article_id=${soleArticleId}&show_category_action=true`, null, true);
102
+ if (!response.body) {
103
+ return [];
104
+ }
105
+ const articleIdMatches = Array.from(JSON.stringify(response.body).matchAll(/"product-page-bundle-item-(s[0-9]+)"/g)).map((match) => match[1]);
106
+ const uniqueArticleIds = [...new Set(articleIdMatches)];
107
+ return uniqueArticleIds;
108
+ }
109
+ catch (error) {
110
+ throw new Error("Failed to parse the results and find the article id. This could mean that the response format from the picnic servers has changed. Please open an issue on the github repository.");
111
+ }
112
+ }
113
+ /**
114
+ * Returns the full product page. Some digging is required to get the properties you want. The response is not typed as the content seems to be quite dynamic. Good luck!
115
+ * @param {string} productId The product ID to fetch the page for.
116
+ */
117
+ async getProductDetailsPage(productId) {
118
+ return await this.sendRequest("GET", `/pages/product-details-page-root?id=${productId}&show_category_action=true&show_remove_from_purchases_page_action=false`, null, true);
119
+ }
120
+ /**
121
+ * returns a suggestion on Picnic products matching the query.
122
+ * @param {string} query The keywords for suggestions.
123
+ */
124
+ getSuggestions(query) {
125
+ return this.sendRequest("GET", `/suggest?search_term=${encodeURIComponent(query)}`);
126
+ }
127
+ /**
128
+ * Returns the details of a specific product.
129
+ * @param {string} productId The id of the product to get.
130
+ */
131
+ getArticle(productId) {
132
+ return this.sendRequest("GET", `/articles/${productId}`);
133
+ }
134
+ /**
135
+ * Retreives product images from the server as an arrayBuffer.
136
+ * @param {string} imageId The image id to retreive.
137
+ * @param {ImageSize} size The size of the image to return.
138
+ */
139
+ getImage(imageId, size) {
140
+ let alternateRoute = this.url.split("/api/")[0];
141
+ return this.sendRequest("GET", `${alternateRoute}/static/images/${imageId}/${size}.png`, null, false, true);
142
+ }
143
+ /**
144
+ * Retreives product images from the server ad a DataUri.
145
+ * @param {string} imageId The image id to retreive.
146
+ * @param {ImageSize} size The size of the image to return.
147
+ */
148
+ async getImageAsDataUri(imageId, size) {
149
+ let arrayBuffer = await this.getImage(imageId, size);
150
+ let dataUri = "data:image/png;base64," + Buffer.from(arrayBuffer, "binary").toString("base64");
151
+ return dataUri;
152
+ }
153
+ /**
154
+ * Returns the catgories.
155
+ * @param {number} [depth=0] The category depth of items to retrieve.
156
+ */
157
+ getCategories(depth = 0) {
158
+ return this.sendRequest("GET", `/my_store?depth=${depth}`);
159
+ }
160
+ /**
161
+ * Returns the shopping cart information of the user and contents.
162
+ */
163
+ getShoppingCart() {
164
+ return this.sendRequest("GET", `/cart`);
165
+ }
166
+ /**
167
+ * Adds a product to the shopping cart.
168
+ * @param {string} productId The id of the product to add.
169
+ * @param {number} [count=1] The amount of this product to add.
170
+ */
171
+ addProductToShoppingCart(productId, count = 1) {
172
+ return this.sendRequest("POST", `/cart/add_product`, { product_id: productId, count });
173
+ }
174
+ /**
175
+ * Removes a product from the shopping cart.
176
+ * @param {string} productId The id of the product to remove.
177
+ * @param {number} [count=1] The amount of this product to remove.
178
+ */
179
+ removeProductFromShoppingCart(productId, count = 1) {
180
+ return this.sendRequest("POST", `/cart/remove_product`, { product_id: productId, count });
181
+ }
182
+ /**
183
+ * Clears the shopping cart of the user.
184
+ */
185
+ clearShoppingCart() {
186
+ return this.sendRequest("POST", `/cart/clear`);
187
+ }
188
+ /**
189
+ * Get all the delivery slots.
190
+ */
191
+ getDeliverySlots() {
192
+ return this.sendRequest("GET", `/cart/delivery_slots`);
193
+ }
194
+ /**
195
+ * Selects a delivery slot.
196
+ * @param {string} slotId The id of the delivery slot to be selected.
197
+ */
198
+ setDeliverySlot(slotId) {
199
+ return this.sendRequest("POST", `/cart/set_delivery_slot`, { slot_id: slotId });
200
+ }
201
+ /**
202
+ * Returns all past and current deliveries of the user.
203
+ * @param {DeliveryStatus[]} [filter=[]] An array with the statusses of the deliveries to filter on.
204
+ */
205
+ getDeliveries(filter = []) {
206
+ return this.sendRequest("POST", `/deliveries/summary`, filter);
207
+ }
208
+ /**
209
+ * Get the details of one specific delivery.
210
+ * @param {string} deliveryId The id of the delivery to look up.
211
+ */
212
+ getDelivery(deliveryId) {
213
+ return this.sendRequest("GET", `/deliveries/${deliveryId}`);
214
+ }
215
+ /**
216
+ * Get the position data of one specific delivery. For the route and delivery information, use the scenario call.
217
+ * @param {string} deliveryId The id of the delivery to look up.
218
+ */
219
+ getDeliveryPosition(deliveryId) {
220
+ return this.sendRequest("GET", `/deliveries/${deliveryId}/position`, null, true);
221
+ }
222
+ /**
223
+ * Get the driver and route information of the delivery.
224
+ * @param {string} deliveryId The id of the delivery to look up.
225
+ */
226
+ getDeliveryScenario(deliveryId) {
227
+ return this.sendRequest("GET", `/deliveries/${deliveryId}/scenario`, null, true);
228
+ }
229
+ /**
230
+ * Cancels the order with the given delivery id.
231
+ * @param {string} deliveryId
232
+ */
233
+ cancelDelivery(deliveryId) {
234
+ return this.sendRequest("POST", `/order/delivery/${deliveryId}/cancel`);
235
+ }
236
+ /**
237
+ * Sets a rating for the delivery from 0 to 10. Will return 400 if a delivery already has a rating.
238
+ * @param {string} deliveryId
239
+ * @param {number} rating
240
+ */
241
+ setDeliveryRating(deliveryId, rating) {
242
+ return this.sendRequest("POST", `/deliveries/${deliveryId}/rating`, { rating });
243
+ }
244
+ /**
245
+ * (Re)sends the invoice email of the delivery.
246
+ * @param {string} deliveryId
247
+ */
248
+ sendDeliveryInvoiceEmail(deliveryId) {
249
+ return this.sendRequest("POST", `/deliveries/${deliveryId}/resend_invoice_email`);
250
+ }
251
+ /**
252
+ * Returns the status of the order (not delivery) with the given id.
253
+ * @param {string} orderId
254
+ */
255
+ getOrderStatus(orderId) {
256
+ return this.sendRequest("GET", `/cart/checkout/order/${orderId}/status`);
257
+ }
258
+ /**
259
+ * Returns all the lists and sublists.
260
+ * @param {number} [depth=0] The category depth of items to retrieve.
261
+ */
262
+ getLists(depth = 0) {
263
+ return this.sendRequest("GET", `/lists?depth=${depth}`);
264
+ }
265
+ /**
266
+ * Returns the sublists of a list, the articles of a sublist if the subListId is given.
267
+ * @param {string} listId The id of the list to get.
268
+ * @param {string} [subListId] The id of the sub list to get.
269
+ * @param {number} [depth=0] The category depth of items to retrieve.
270
+ */
271
+ getList(listId, subListId, depth = 0) {
272
+ let path = `/lists/${listId}`;
273
+ if (subListId) {
274
+ path += `?sublist=${subListId}`;
275
+ }
276
+ path += (subListId ? "&" : "?") + `depth=${depth}`;
277
+ return this.sendRequest("GET", path);
278
+ }
279
+ /**
280
+ * Returns the MGM details. This are the friends discount data.
281
+ */
282
+ getMgmDetails() {
283
+ return this.sendRequest("GET", `/mgm`);
284
+ }
285
+ /**
286
+ * Returns the list of consent settings.
287
+ * @param {boolean} [general=false] Returns only the 'general' consent settings.
288
+ */
289
+ getConsentSettings(general = false) {
290
+ return this.sendRequest("GET", `/consents${general ? "/general" : ""}/settings-page`);
291
+ }
292
+ /**
293
+ * Sets one or multiple consent options to true or false.
294
+ * @param {SetConsentSettingsInput} consentSettingsInput An array of objects of consent items.
295
+ */
296
+ setConsentSettings(consentSettingsInput) {
297
+ return this.sendRequest("PUT", `/consents`, consentSettingsInput);
298
+ }
299
+ /**
300
+ * Returns the popup messages in the app. For example, the message after a delivery, asking if the delivery was satisfactory.
301
+ */
302
+ getMessages() {
303
+ return this.sendRequest("GET", `/messages`, null, true);
304
+ }
305
+ /**
306
+ * Returns the reminders.
307
+ */
308
+ getReminders() {
309
+ return this.sendRequest("GET", `/reminders`, null, true);
310
+ }
311
+ /**
312
+ * Gets payment information.
313
+ */
314
+ getPaymentProfile() {
315
+ return this.sendRequest("GET", `/payment-profile`, null, true);
316
+ }
317
+ /**
318
+ * Gets transactions made.
319
+ * @param {number} pageNumber The page number to get the transactions from.
320
+ */
321
+ getWalletTransactions(pageNumber) {
322
+ return this.sendRequest("POST", `/wallet/transactions`, { page_number: pageNumber });
323
+ }
324
+ /**
325
+ * Gets payment information.
326
+ * @param {string} walletTransactionId The id of the transaction to get the details from.
327
+ */
328
+ getWalletTransactionDetails(walletTransactionId) {
329
+ return this.sendRequest("GET", `/wallet/transactions/${walletTransactionId}`);
330
+ }
331
+ /**
332
+ * Gets payment information.
333
+ */
334
+ getCustomerServiceContactInfo() {
335
+ return this.sendRequest("GET", `/cs-contact-info`, null, true);
336
+ }
337
+ /**
338
+ * Gets parcels.
339
+ * @todo Implement return type once known.
340
+ */
341
+ getParcels() {
342
+ return this.sendRequest("GET", `/parcels`, null, true);
343
+ }
344
+ /**
345
+ * Can be used to send custom requests that are not implemented but do need authentication for it.
346
+ * @param {string} method The HTTP method to use, such as GET, POST, PUT and DELETE.
347
+ * @param {string} path The path, possibly including query params. Example: '/cart/set_delivery_slot' or '/my_store?depth=0'.
348
+ * @param {TRequestData|null} [data=null] The request body, usually in case of a POST or PUT request.
349
+ * @param {boolean} [includePicnicHeaders=false] If it should include x-picnic-agent and x-picnic-did headers.
350
+ * @param {boolean} [isImageRequest=false] Will add the arrayBuffer response type if true.
351
+ */
352
+ async sendRequest(method, path, data = null, includePicnicHeaders = false, isImageRequest = false) {
353
+ const headers = new Headers({
354
+ "User-Agent": "okhttp/3.12.2",
355
+ "Content-Type": "application/json; charset=UTF-8",
356
+ ...(this.authKey && { "x-picnic-auth": this.authKey }),
357
+ ...(includePicnicHeaders && { "x-picnic-agent": "30100;1.15.232-15154", "x-picnic-did": "3C417201548B2E3B" }),
358
+ });
359
+ const response = await fetch(`${this.url}${path}`, {
360
+ method: method,
361
+ headers: headers,
362
+ body: data ? JSON.stringify(data) : null,
363
+ });
364
+ if (!response.ok) {
365
+ try {
366
+ const errorData = await response.json();
367
+ throw new Error(`${errorData.error?.message || response.statusText}`);
368
+ }
369
+ catch (e) {
370
+ throw new Error(`${response.status} ${response.statusText}`);
371
+ }
372
+ }
373
+ if (isImageRequest) {
374
+ return response.arrayBuffer();
375
+ }
376
+ const text = await response.text();
377
+ return (text ? JSON.parse(text) : null);
378
+ }
379
+ };
376
380
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,oDAA4B;AAwC5B,iDAAyC;AAEzC,iBAAS,MAAM,YAAY;IAMzB;;;;;;;OAOG;IACH,YAAY,OAAmB;QAC7B,IAAI,CAAC,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC;QAChD,IAAI,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,IAAI,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC;QACxC,IAAI,CAAC,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,2BAA2B,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,gCAAgC,IAAI,CAAC,UAAU,EAAE,CAAC;IACxI,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK,CAAC,QAAgB,EAAE,QAAgB;QAC5C,MAAM,MAAM,GAAG,gBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE/E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,aAAa,EAAE;YACrD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,GAAG,EAAE,QAAQ;gBACb,MAAM;gBACN,SAAS,EAAE,KAAK;aACH,CAAC;SACjB,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,SAAS,GAAQ,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC7C,MAAM,IAAI,KAAK,CAAC,iBAAiB,SAAS,CA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.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "Unofficial wrapper for the API of the online supermarket Picnic",
5
5
  "keywords": [
6
6
  "picnic",