doordash-cli 0.2.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.
@@ -0,0 +1,530 @@
1
+ export type AuthResult = {
2
+ success: true;
3
+ isLoggedIn: boolean;
4
+ email: string | null;
5
+ firstName: string | null;
6
+ lastName: string | null;
7
+ consumerId: string | null;
8
+ marketId: string | null;
9
+ defaultAddress: {
10
+ printableAddress: string | null;
11
+ zipCode: string | null;
12
+ submarketId: string | null;
13
+ } | null;
14
+ cookiesPath: string;
15
+ storageStatePath: string;
16
+ };
17
+ export type AuthBootstrapResult = AuthResult & {
18
+ message: string;
19
+ };
20
+ export type SearchRestaurantResult = {
21
+ id: string;
22
+ name: string;
23
+ description: string | null;
24
+ cuisines: string[];
25
+ isRetail: boolean;
26
+ eta: string | null;
27
+ deliveryFee: string | null;
28
+ imageUrl: string | null;
29
+ url: string | null;
30
+ };
31
+ export type SearchResult = {
32
+ success: true;
33
+ query: string;
34
+ cuisineFilter: string | null;
35
+ count: number;
36
+ restaurants: SearchRestaurantResult[];
37
+ };
38
+ export type MenuItemSummary = {
39
+ id: string;
40
+ name: string;
41
+ description: string | null;
42
+ displayPrice: string | null;
43
+ imageUrl: string | null;
44
+ nextCursor: string | null;
45
+ storeId: string | null;
46
+ };
47
+ export type MenuCategoryResult = {
48
+ id: string;
49
+ name: string;
50
+ description: string | null;
51
+ itemCount: number;
52
+ items: MenuItemSummary[];
53
+ };
54
+ export type MenuResult = {
55
+ success: true;
56
+ restaurant: {
57
+ id: string;
58
+ name: string | null;
59
+ description: string | null;
60
+ businessName: string | null;
61
+ displayAddress: string | null;
62
+ averageRating: number | null;
63
+ numRatingsDisplayString: string | null;
64
+ coverImgUrl: string | null;
65
+ };
66
+ menu: {
67
+ id: string | null;
68
+ name: string | null;
69
+ };
70
+ categoryCount: number;
71
+ itemCount: number;
72
+ categories: MenuCategoryResult[];
73
+ };
74
+ export type ItemOptionResult = {
75
+ id: string;
76
+ name: string;
77
+ displayPrice: string | null;
78
+ unitAmount: number | null;
79
+ defaultQuantity: number | null;
80
+ nextCursor: string | null;
81
+ };
82
+ export type ItemOptionListResult = {
83
+ id: string;
84
+ name: string;
85
+ subtitle: string | null;
86
+ minNumOptions: number;
87
+ maxNumOptions: number;
88
+ numFreeOptions: number;
89
+ isOptional: boolean;
90
+ options: ItemOptionResult[];
91
+ };
92
+ export type ItemResult = {
93
+ success: true;
94
+ restaurantId: string;
95
+ item: {
96
+ id: string | null;
97
+ name: string | null;
98
+ description: string | null;
99
+ displayPrice: string | null;
100
+ unitAmount: number | null;
101
+ currency: string | null;
102
+ decimalPlaces: number | null;
103
+ menuId: string | null;
104
+ specialInstructionsMaxLength: number | null;
105
+ dietaryTags: Array<{
106
+ type: string | null;
107
+ abbreviatedTagDisplayString: string | null;
108
+ fullTagDisplayString: string | null;
109
+ }>;
110
+ reviewData: {
111
+ ratingDisplayString: string | null;
112
+ reviewCount: string | null;
113
+ itemReviewRankingCount: number | null;
114
+ } | null;
115
+ requiredOptionLists: ItemOptionListResult[];
116
+ optionLists: ItemOptionListResult[];
117
+ preferences: unknown[];
118
+ };
119
+ };
120
+ export type CartItemResult = {
121
+ cartItemId: string;
122
+ itemId: string | null;
123
+ name: string | null;
124
+ quantity: number;
125
+ specialInstructions: string | null;
126
+ priceDisplayString: string | null;
127
+ singlePrice: number | null;
128
+ totalPrice: number | null;
129
+ status: string | null;
130
+ options: Array<{
131
+ id: string;
132
+ name: string | null;
133
+ quantity: number | null;
134
+ }>;
135
+ };
136
+ export type CartResult = {
137
+ success: true;
138
+ cartId: string | null;
139
+ subtotal: number | null;
140
+ total: number | null;
141
+ currencyCode: string | null;
142
+ restaurant: {
143
+ id: string | null;
144
+ name: string | null;
145
+ slug: string | null;
146
+ businessName: string | null;
147
+ } | null;
148
+ menu: {
149
+ id: string | null;
150
+ name: string | null;
151
+ } | null;
152
+ itemCount: number;
153
+ items: CartItemResult[];
154
+ };
155
+ export type AddToCartResult = CartResult & {
156
+ sourceItem: {
157
+ id: string;
158
+ name: string;
159
+ menuId: string | null;
160
+ };
161
+ };
162
+ export type UpdateCartResult = CartResult & {
163
+ updatedCartItemId: string;
164
+ };
165
+ export type ExistingOrderLifecycleStatus = "draft" | "submitted" | "in-progress" | "fulfilled" | "cancelled" | "unknown";
166
+ export type ExistingOrderMoneyResult = {
167
+ unitAmount: number | null;
168
+ currency: string | null;
169
+ decimalPlaces: number | null;
170
+ displayString: string | null;
171
+ sign: string | null;
172
+ };
173
+ export type ExistingOrderQuantityResult = {
174
+ quantity: number | null;
175
+ unit: string | null;
176
+ };
177
+ export type ExistingOrderExtraOptionResult = {
178
+ menuExtraOptionId: string | null;
179
+ name: string | null;
180
+ description: string | null;
181
+ price: number | null;
182
+ quantity: number | null;
183
+ extras: ExistingOrderExtraResult[];
184
+ };
185
+ export type ExistingOrderExtraResult = {
186
+ menuItemExtraId: string | null;
187
+ name: string | null;
188
+ options: ExistingOrderExtraOptionResult[];
189
+ };
190
+ export type ExistingOrderItemResult = {
191
+ id: string | null;
192
+ name: string | null;
193
+ quantity: number;
194
+ specialInstructions: string | null;
195
+ substitutionPreferences: string | null;
196
+ originalItemPrice: number | null;
197
+ purchaseType: string | null;
198
+ purchaseQuantity: ExistingOrderQuantityResult | null;
199
+ fulfillQuantity: ExistingOrderQuantityResult | null;
200
+ extras: ExistingOrderExtraResult[];
201
+ };
202
+ export type ExistingOrderResult = {
203
+ id: string | null;
204
+ orderUuid: string | null;
205
+ deliveryUuid: string | null;
206
+ createdAt: string | null;
207
+ submittedAt: string | null;
208
+ cancelledAt: string | null;
209
+ fulfilledAt: string | null;
210
+ lifecycleStatus: ExistingOrderLifecycleStatus;
211
+ isActive: boolean;
212
+ hasLiveTracking: boolean;
213
+ pollingIntervalSeconds: number | null;
214
+ specialInstructions: string | null;
215
+ isReorderable: boolean;
216
+ isGift: boolean;
217
+ isPickup: boolean;
218
+ isRetail: boolean;
219
+ isMerchantShipping: boolean;
220
+ containsAlcohol: boolean;
221
+ fulfillmentType: string | null;
222
+ shoppingProtocol: string | null;
223
+ orderFilterType: string | null;
224
+ creator: {
225
+ id: string | null;
226
+ firstName: string | null;
227
+ lastName: string | null;
228
+ } | null;
229
+ deliveryAddress: {
230
+ id: string | null;
231
+ formattedAddress: string | null;
232
+ } | null;
233
+ store: {
234
+ id: string | null;
235
+ name: string | null;
236
+ businessName: string | null;
237
+ phoneNumber: string | null;
238
+ fulfillsOwnDeliveries: boolean | null;
239
+ customerArrivedPickupInstructions: string | null;
240
+ rerouteStoreId: string | null;
241
+ } | null;
242
+ grandTotal: ExistingOrderMoneyResult | null;
243
+ itemCount: number;
244
+ items: ExistingOrderItemResult[];
245
+ likelyOutOfStockItems: Array<{
246
+ menuItemId: string | null;
247
+ name: string | null;
248
+ photoUrl: string | null;
249
+ }>;
250
+ recurringOrderDetails: {
251
+ itemNames: string[];
252
+ consumerId: string | null;
253
+ recurringOrderUpcomingOrderUuid: string | null;
254
+ scheduledDeliveryDate: string | null;
255
+ arrivalTimeDisplayString: string | null;
256
+ storeName: string | null;
257
+ isCancelled: boolean | null;
258
+ } | null;
259
+ bundleOrderInfo: {
260
+ primaryBundleOrderUuid: string | null;
261
+ primaryBundleOrderId: string | null;
262
+ bundleOrderUuids: string[];
263
+ bundleType: string | null;
264
+ bundleOrderRole: string | null;
265
+ } | null;
266
+ cancellationPendingRefundState: string | null;
267
+ };
268
+ export type OrdersResult = {
269
+ success: true;
270
+ source: "graphql" | "orders-page-cache";
271
+ warning: string | null;
272
+ count: number;
273
+ activeCount: number;
274
+ orders: ExistingOrderResult[];
275
+ };
276
+ export type OrderResult = {
277
+ success: true;
278
+ source: "graphql" | "orders-page-cache";
279
+ warning: string | null;
280
+ matchedField: "id" | "orderUuid" | "deliveryUuid";
281
+ order: ExistingOrderResult;
282
+ };
283
+ export type RequestedOptionSelection = {
284
+ groupId: string;
285
+ optionId: string;
286
+ quantity?: number;
287
+ children?: RequestedOptionSelection[];
288
+ };
289
+ export type BuiltNestedOption = {
290
+ id: string;
291
+ quantity: number;
292
+ options: BuiltNestedOption[];
293
+ itemExtraOption: {
294
+ id: string;
295
+ name: string;
296
+ chargeAbove: number;
297
+ defaultQuantity: number;
298
+ description?: string;
299
+ price?: number;
300
+ itemExtraName?: null;
301
+ itemExtraId?: string;
302
+ itemExtraNumFreeOptions?: number;
303
+ menuItemExtraOptionPrice?: number;
304
+ menuItemExtraOptionBasePrice?: null;
305
+ };
306
+ };
307
+ export type SetAddressResult = {
308
+ success: true;
309
+ mode: "direct-saved-address" | "direct-added-address";
310
+ requestedAddress: string;
311
+ matchedAddressId: string;
312
+ matchedAddressSource: "saved-address" | "autocomplete-address-id" | "autocomplete-text" | "add-consumer-address";
313
+ printableAddress: string | null;
314
+ };
315
+ export type AddToCartPayload = {
316
+ addCartItemInput: {
317
+ storeId: string;
318
+ menuId: string;
319
+ itemId: string;
320
+ itemName: string;
321
+ itemDescription: string | null;
322
+ currency: string;
323
+ quantity: number;
324
+ nestedOptions: string;
325
+ specialInstructions: string | null;
326
+ substitutionPreference: string;
327
+ isBundle: boolean;
328
+ bundleType: string;
329
+ unitPrice: number;
330
+ cartId: string;
331
+ };
332
+ lowPriorityBatchAddCartItemInput: Array<{
333
+ cartId: string;
334
+ storeId: string;
335
+ menuId: string;
336
+ itemId: string;
337
+ itemName: string;
338
+ currency: string;
339
+ quantity: number;
340
+ unitPrice: number;
341
+ isBundle: boolean;
342
+ bundleType: string;
343
+ nestedOptions: string;
344
+ }>;
345
+ fulfillmentContext: {
346
+ shouldUpdateFulfillment: boolean;
347
+ fulfillmentType: string;
348
+ };
349
+ monitoringContext: {
350
+ isGroup: boolean;
351
+ };
352
+ cartContext: {
353
+ isBundle: boolean;
354
+ };
355
+ returnCartFromOrderService: boolean;
356
+ shouldKeepOnlyOneActiveCart: boolean;
357
+ };
358
+ type NestedOptionListsResolver = (input: {
359
+ restaurantId: string;
360
+ consumerId: string | null;
361
+ option: ItemOptionResult;
362
+ group: ItemOptionListResult;
363
+ selection: RequestedOptionSelection;
364
+ }) => Promise<ItemOptionListResult[]>;
365
+ type AddConsumerAddressPayload = {
366
+ lat: number;
367
+ lng: number;
368
+ city: string;
369
+ state: string;
370
+ zipCode: string;
371
+ printableAddress: string;
372
+ shortname: string;
373
+ googlePlaceId: string;
374
+ subpremise: null;
375
+ driverInstructions: null;
376
+ dropoffOptionId: null;
377
+ manualLat: null;
378
+ manualLng: null;
379
+ addressLinkType: "ADDRESS_LINK_TYPE_UNSPECIFIED";
380
+ buildingName: null;
381
+ entryCode: null;
382
+ personalAddressLabel: null;
383
+ };
384
+ export type UpdateCartPayload = {
385
+ updateCartItemApiParams: {
386
+ cartId: string;
387
+ cartItemId: string;
388
+ itemId: string;
389
+ quantity: number;
390
+ storeId: string;
391
+ purchaseTypeOptions: {
392
+ purchaseType: string;
393
+ continuousQuantity: number;
394
+ unit: string | null;
395
+ };
396
+ cartFilter: null;
397
+ };
398
+ fulfillmentContext: {
399
+ shouldUpdateFulfillment: boolean;
400
+ };
401
+ returnCartFromOrderService: boolean;
402
+ };
403
+ type AvailableAddressGraph = {
404
+ id?: string | null;
405
+ addressId?: string | null;
406
+ street?: string | null;
407
+ city?: string | null;
408
+ subpremise?: string | null;
409
+ state?: string | null;
410
+ zipCode?: string | null;
411
+ country?: string | null;
412
+ countryCode?: string | null;
413
+ lat?: number | null;
414
+ lng?: number | null;
415
+ districtId?: number | null;
416
+ manualLat?: number | null;
417
+ manualLng?: number | null;
418
+ timezone?: string | null;
419
+ shortname?: string | null;
420
+ printableAddress?: string | null;
421
+ driverInstructions?: string | null;
422
+ buildingName?: string | null;
423
+ entryCode?: string | null;
424
+ addressLinkType?: string | null;
425
+ formattedAddressSegmentedList?: string[] | null;
426
+ formattedAddressSegmentedNonUserEditableFieldsList?: string[] | null;
427
+ };
428
+ type AddressAutocompletePrediction = {
429
+ lat?: number | null;
430
+ lng?: number | null;
431
+ formatted_address?: string | null;
432
+ formatted_address_short?: string | null;
433
+ formatted_address_segmented?: string[] | null;
434
+ formatted_address_segmented_non_user_editable_fields?: string[] | null;
435
+ country_shortname?: string | null;
436
+ source_place_id?: string | null;
437
+ geo_address_id?: string | null;
438
+ postal_code?: string | null;
439
+ postal_code_suffix?: string | null;
440
+ administrative_area_level1?: string | null;
441
+ locality?: string | null;
442
+ street_address?: string | null;
443
+ };
444
+ type GeoAddressResponse = {
445
+ address?: {
446
+ id?: string | null;
447
+ formatted_address?: string | null;
448
+ formatted_address_short?: string | null;
449
+ street_address?: string | null;
450
+ locality?: string | null;
451
+ administrative_area_level1?: string | null;
452
+ postal_code?: string | null;
453
+ country_shortname?: string | null;
454
+ lat?: number | null;
455
+ lng?: number | null;
456
+ } | null;
457
+ };
458
+ export declare function checkAuthDirect(): Promise<AuthResult>;
459
+ export declare function bootstrapAuthSession(): Promise<AuthBootstrapResult>;
460
+ export declare function clearStoredSession(): Promise<{
461
+ success: true;
462
+ message: string;
463
+ cookiesPath: string;
464
+ storageStatePath: string;
465
+ }>;
466
+ export declare function setAddressDirect(address: string): Promise<SetAddressResult>;
467
+ export declare function searchRestaurantsDirect(query: string, cuisine?: string): Promise<SearchResult>;
468
+ export declare function getMenuDirect(restaurantId: string): Promise<MenuResult>;
469
+ export declare function getItemDirect(restaurantId: string, itemId: string): Promise<ItemResult>;
470
+ export declare function getCartDirect(): Promise<CartResult>;
471
+ export declare function getOrdersDirect(params?: {
472
+ limit?: number;
473
+ activeOnly?: boolean;
474
+ }): Promise<OrdersResult>;
475
+ export declare function getOrderDirect(orderId: string): Promise<OrderResult>;
476
+ export declare function addToCartDirect(params: {
477
+ restaurantId: string;
478
+ itemName?: string;
479
+ itemId?: string;
480
+ quantity: number;
481
+ specialInstructions?: string;
482
+ optionSelections?: RequestedOptionSelection[];
483
+ }): Promise<AddToCartResult>;
484
+ export declare function updateCartDirect(params: {
485
+ cartItemId: string;
486
+ quantity: number;
487
+ }): Promise<UpdateCartResult>;
488
+ export declare function cleanupDirect(): Promise<void>;
489
+ export declare function normalizeItemName(value: string): string;
490
+ export declare function buildAddToCartPayload(input: {
491
+ restaurantId: string;
492
+ cartId: string;
493
+ quantity: number;
494
+ specialInstructions: string | null;
495
+ optionSelections?: RequestedOptionSelection[];
496
+ item: MenuItemSummary;
497
+ itemDetail: ItemResult;
498
+ consumerId?: string | null;
499
+ resolveNestedOptionLists?: NestedOptionListsResolver;
500
+ }): Promise<AddToCartPayload>;
501
+ export declare function buildUpdateCartPayload(input: {
502
+ cartId: string;
503
+ cartItemId: string;
504
+ itemId: string;
505
+ quantity: number;
506
+ storeId: string;
507
+ }): UpdateCartPayload;
508
+ export declare function parseOptionSelectionsJson(value: string): RequestedOptionSelection[];
509
+ export declare function buildAddConsumerAddressPayload(input: {
510
+ requestedAddress: string;
511
+ prediction: AddressAutocompletePrediction;
512
+ createdAddress: GeoAddressResponse["address"];
513
+ }): AddConsumerAddressPayload;
514
+ export declare function resolveAvailableAddressMatch(input: {
515
+ input: string;
516
+ availableAddresses: AvailableAddressGraph[];
517
+ prediction?: AddressAutocompletePrediction | null;
518
+ createdAddress?: GeoAddressResponse["address"] | null;
519
+ }): {
520
+ id: string;
521
+ printableAddress: string | null;
522
+ source: SetAddressResult["matchedAddressSource"];
523
+ } | null;
524
+ export declare function parseSearchRestaurants(body: unknown[]): SearchRestaurantResult[];
525
+ export declare function parseSearchRestaurantRow(entry: unknown): SearchRestaurantResult | null;
526
+ export declare function parseExistingOrderLifecycleStatus(orderRoot: unknown): ExistingOrderLifecycleStatus;
527
+ export declare function parseExistingOrdersResponse(orderRoots: unknown[]): ExistingOrderResult[];
528
+ export declare function extractExistingOrdersFromApolloCache(cache: Record<string, unknown> | null): ExistingOrderResult[];
529
+ export declare function getStorageStatePath(): string;
530
+ export {};