Skip to content

Commit 6573c25

Browse files
authored
[ts] Fix nested array type error with new IPaginatedResult type (MONEI#479)
1 parent 7873562 commit 6573c25

File tree

1 file changed

+45
-59
lines changed

1 file changed

+45
-59
lines changed

index.d.ts

Lines changed: 45 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ declare class Shopify {
4444
get: (id: number, params?: any) => Promise<Shopify.IApplicationCharge>;
4545
list: (
4646
params?: any
47-
) => Promise<Shopify.IPaginatedResult<Shopify.IApplicationCharge[]>>;
47+
) => Promise<Shopify.IPaginatedResult<Shopify.IApplicationCharge>>;
4848
};
4949
applicationCredit: {
5050
create: (
@@ -69,7 +69,7 @@ declare class Shopify {
6969
list: (
7070
blogId: number,
7171
params?: any
72-
) => Promise<Shopify.IPaginatedResult<Shopify.IArticle[]>>;
72+
) => Promise<Shopify.IPaginatedResult<Shopify.IArticle>>;
7373
tags: (blogId?: number, params?: any) => Promise<string[]>;
7474
update: (
7575
blogId: number,
@@ -89,16 +89,16 @@ declare class Shopify {
8989
};
9090
balance: {
9191
list: () => Promise<Shopify.IBalance[]>;
92-
transactions: () => Promise<
93-
Shopify.IPaginatedResult<Shopify.IBalanceTransaction[]>
94-
>;
92+
transactions: (
93+
params?: any
94+
) => Promise<Shopify.IPaginatedResult<Shopify.IBalanceTransaction>>;
9595
};
9696
blog: {
9797
count: () => Promise<number>;
9898
create: (params: Shopify.ICreateBlog) => Promise<Shopify.IBlog>;
9999
delete: (id: number) => Promise<void>;
100100
get: (id: number, params?: any) => Promise<Shopify.IBlog>;
101-
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IBlog[]>>;
101+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IBlog>>;
102102
update: (id: number, params: any) => Promise<Shopify.IBlog>;
103103
};
104104
cancellationRequest: {
@@ -134,7 +134,7 @@ declare class Shopify {
134134
get: (token: string) => Promise<Shopify.ICheckout>;
135135
list: (
136136
params?: any
137-
) => Promise<Shopify.IPaginatedResult<Shopify.ICheckout[]>>;
137+
) => Promise<Shopify.IPaginatedResult<Shopify.ICheckout>>;
138138
shippingRates: (token: string) => Promise<any>;
139139
update: (token: any, params: any) => Promise<Shopify.ICheckout>;
140140
};
@@ -143,32 +143,28 @@ declare class Shopify {
143143
create: (params: Shopify.ICreateCollect) => Promise<Shopify.ICollect>;
144144
delete: (id: number) => Promise<void>;
145145
get: (id: number, params?: any) => Promise<Shopify.ICollect>;
146-
list: (
147-
params?: any
148-
) => Promise<Shopify.IPaginatedResult<Shopify.ICollect[]>>;
146+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.ICollect>>;
149147
};
150148
collection: {
151149
get: (id: number, params?: any) => Promise<Shopify.ICollection>;
152150
products: (
153151
id: number,
154152
params?: any
155-
) => Promise<Shopify.IPaginatedResult<Shopify.IProduct[]>>;
153+
) => Promise<Shopify.IPaginatedResult<Shopify.IProduct>>;
156154
};
157155
collectionListing: {
158156
get: (id: number, params?: any) => Promise<Shopify.ICollectionListing>;
159157
list: (
160158
params?: any
161-
) => Promise<Shopify.IPaginatedResult<Shopify.ICollectionListing[]>>;
159+
) => Promise<Shopify.IPaginatedResult<Shopify.ICollectionListing>>;
162160
productIds: (id: number, params?: any) => Promise<any>;
163161
};
164162
comment: {
165163
approve: (id: number) => Promise<Shopify.IComment>;
166164
count: (params?: any) => Promise<number>;
167165
create: (params: Shopify.ICreateComment) => Promise<Shopify.IComment>;
168166
get: (id: number, params?: any) => Promise<Shopify.IComment>;
169-
list: (
170-
params?: any
171-
) => Promise<Shopify.IPaginatedResult<Shopify.IComment[]>>;
167+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IComment>>;
172168
notSpam: (id: number) => Promise<Shopify.IComment>;
173169
remove: (id: number) => Promise<Shopify.IComment>;
174170
restore: (id: number) => Promise<Shopify.IComment>;
@@ -199,7 +195,7 @@ declare class Shopify {
199195
get: (id: number, params?: any) => Promise<Shopify.ICustomCollection>;
200196
list: (
201197
params?: any
202-
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomCollection[]>>;
198+
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomCollection>>;
203199
update: (id: number, params: any) => Promise<Shopify.ICustomCollection>;
204200
};
205201
customer: {
@@ -210,10 +206,10 @@ declare class Shopify {
210206
get: (id: number, params?: any) => Promise<Shopify.ICustomer>;
211207
list: (
212208
params?: any
213-
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomer[]>>;
209+
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomer>>;
214210
search: (
215211
params: any
216-
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomer[]>>;
212+
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomer>>;
217213
sendInvite: (
218214
id: number,
219215
params?: Shopify.ICustomerSendInvite
@@ -235,7 +231,7 @@ declare class Shopify {
235231
list: (
236232
customerId: number,
237233
params?: any
238-
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomerAddress[]>>;
234+
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomerAddress>>;
239235
set: (customerId: number, params: any) => Promise<any>;
240236
update: (
241237
customerId: number,
@@ -251,7 +247,7 @@ declare class Shopify {
251247
get: (id: number, params?: any) => Promise<Shopify.ICustomerSavedSearch>;
252248
list: (
253249
params?: any
254-
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomerSavedSearch[]>>;
250+
) => Promise<Shopify.IPaginatedResult<Shopify.ICustomerSavedSearch>>;
255251
update: (id: number, params: any) => Promise<Shopify.ICustomerSavedSearch>;
256252
};
257253
discountCode: {
@@ -264,7 +260,7 @@ declare class Shopify {
264260
list: (
265261
priceRuleId: number,
266262
params?: any
267-
) => Promise<Shopify.IPaginatedResult<Shopify.IDiscountCode[]>>;
263+
) => Promise<Shopify.IPaginatedResult<Shopify.IDiscountCode>>;
268264
lookup: (params: any) => Promise<Shopify.IDiscountCode>;
269265
update: (
270266
priceRuleId: number,
@@ -285,9 +281,7 @@ declare class Shopify {
285281
};
286282
dispute: {
287283
get: (id: number) => Promise<Shopify.IDispute>;
288-
list: (
289-
params?: any
290-
) => Promise<Shopify.IPaginatedResult<Shopify.IDispute[]>>;
284+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IDispute>>;
291285
};
292286
draftOrder: {
293287
complete: (id: number, params?: any) => Promise<Shopify.IDraftOrder>;
@@ -297,14 +291,14 @@ declare class Shopify {
297291
get: (id: number) => Promise<Shopify.IDraftOrder>;
298292
list: (
299293
params?: any
300-
) => Promise<Shopify.IPaginatedResult<Shopify.IDraftOrder[]>>;
294+
) => Promise<Shopify.IPaginatedResult<Shopify.IDraftOrder>>;
301295
sendInvoice: (id: number, params?: any) => Promise<any>;
302296
update: (id: number, params?: any) => Promise<Shopify.IDraftOrder>;
303297
};
304298
event: {
305299
count: (params?: any) => Promise<number>;
306300
get: (id: number, params?: any) => Promise<Shopify.IEvent>;
307-
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IEvent[]>>;
301+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IEvent>>;
308302
};
309303
fulfillment: {
310304
cancel: (orderId: number, id: number) => Promise<Shopify.IFulfillment>;
@@ -320,7 +314,7 @@ declare class Shopify {
320314
list: (
321315
orderId: number,
322316
params?: any
323-
) => Promise<Shopify.IPaginatedResult<Shopify.IFulfillment[]>>;
317+
) => Promise<Shopify.IPaginatedResult<Shopify.IFulfillment>>;
324318
open: (orderId: number, id: number) => Promise<Shopify.IFulfillment>;
325319
update: (
326320
orderId: number,
@@ -399,10 +393,10 @@ declare class Shopify {
399393
get: (id: number) => Promise<Shopify.IGiftCard>;
400394
list: (
401395
params?: any
402-
) => Promise<Shopify.IPaginatedResult<Shopify.IGiftCard[]>>;
396+
) => Promise<Shopify.IPaginatedResult<Shopify.IGiftCard>>;
403397
search: (
404398
params: any
405-
) => Promise<Shopify.IPaginatedResult<Shopify.IGiftCard[]>>;
399+
) => Promise<Shopify.IPaginatedResult<Shopify.IGiftCard>>;
406400
update: (id: number, params: any) => Promise<Shopify.IGiftCard>;
407401
};
408402
giftCardAdjustment: {
@@ -421,7 +415,7 @@ declare class Shopify {
421415
get: (id: number) => Promise<Shopify.IInventoryItem>;
422416
list: (
423417
params?: any
424-
) => Promise<Shopify.IPaginatedResult<Shopify.IInventoryItem[]>>;
418+
) => Promise<Shopify.IPaginatedResult<Shopify.IInventoryItem>>;
425419
update: (id: number, params: any) => Promise<Shopify.IInventoryItem>;
426420
};
427421
inventoryLevel: {
@@ -430,7 +424,7 @@ declare class Shopify {
430424
delete: (params: any) => Promise<void>;
431425
list: (
432426
params: any
433-
) => Promise<Shopify.IPaginatedResult<Shopify.IInventoryLevel[]>>;
427+
) => Promise<Shopify.IPaginatedResult<Shopify.IInventoryLevel>>;
434428
set: (params: any) => Promise<Shopify.IInventoryLevel>;
435429
};
436430
location: {
@@ -440,7 +434,7 @@ declare class Shopify {
440434
id: number,
441435
params?: any
442436
) => Promise<Shopify.IInventoryLevel[]>;
443-
list: () => Promise<Shopify.IPaginatedResult<Shopify.ILocation[]>>;
437+
list: () => Promise<Shopify.IPaginatedResult<Shopify.ILocation>>;
444438
};
445439
marketingEvent: {
446440
count: (params?: any) => Promise<number>;
@@ -449,7 +443,7 @@ declare class Shopify {
449443
get: (id: number, params?: any) => Promise<Shopify.IMarketingEvent>;
450444
list: (
451445
params?: any
452-
) => Promise<Shopify.IPaginatedResult<Shopify.IMarketingEvent[]>>;
446+
) => Promise<Shopify.IPaginatedResult<Shopify.IMarketingEvent>>;
453447
update: (id: number, params: any) => Promise<Shopify.IMarketingEvent>;
454448
engagements: (id: number, params: any) => Promise<any>;
455449
};
@@ -460,7 +454,7 @@ declare class Shopify {
460454
get: (id: number, params?: any) => Promise<Shopify.IMetafield>;
461455
list: (
462456
params?: any
463-
) => Promise<Shopify.IPaginatedResult<Shopify.IMetafield[]>>;
457+
) => Promise<Shopify.IPaginatedResult<Shopify.IMetafield>>;
464458
update: (id: number, params: any) => Promise<Shopify.IMetafield>;
465459
};
466460
on(
@@ -479,7 +473,7 @@ declare class Shopify {
479473
delete: (id: number) => Promise<any>;
480474
fulfillmentOrders: (id: number) => Promise<Shopify.IFulfillmentOrder[]>;
481475
get: (id: number, params?: any) => Promise<Shopify.IOrder>;
482-
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IOrder[]>>;
476+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IOrder>>;
483477
open: (id: number) => Promise<Shopify.IOrder>;
484478
update: (id: number, params: any) => Promise<Shopify.IOrder>;
485479
};
@@ -489,7 +483,7 @@ declare class Shopify {
489483
get: (orderId: number, id: number) => Promise<Shopify.IOrderRisk>;
490484
list: (
491485
orderId: number
492-
) => Promise<Shopify.IPaginatedResult<Shopify.IOrderRisk[]>>;
486+
) => Promise<Shopify.IPaginatedResult<Shopify.IOrderRisk>>;
493487
update: (
494488
orderId: number,
495489
id: number,
@@ -501,7 +495,7 @@ declare class Shopify {
501495
create: (params: any) => Promise<Shopify.IPage>;
502496
delete: (id: number) => Promise<void>;
503497
get: (id: number, params?: any) => Promise<Shopify.IPage>;
504-
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IPage[]>>;
498+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IPage>>;
505499
update: (id: number, params: any) => Promise<Shopify.IPage>;
506500
};
507501
payment: {
@@ -512,9 +506,7 @@ declare class Shopify {
512506
};
513507
payout: {
514508
get: (id: number) => Promise<Shopify.IPayout>;
515-
list: (
516-
params?: any
517-
) => Promise<Shopify.IPaginatedResult<Shopify.IPayout[]>>;
509+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IPayout>>;
518510
};
519511
policy: {
520512
list: (params?: any) => Promise<Shopify.IPolicy[]>;
@@ -525,17 +517,15 @@ declare class Shopify {
525517
get: (id: number, params?: any) => Promise<Shopify.IPriceRule>;
526518
list: (
527519
params?: any
528-
) => Promise<Shopify.IPaginatedResult<Shopify.IPriceRule[]>>;
520+
) => Promise<Shopify.IPaginatedResult<Shopify.IPriceRule>>;
529521
update: (id: number, params: any) => Promise<Shopify.IPriceRule>;
530522
};
531523
product: {
532524
count: (params?: any) => Promise<number>;
533525
create: (params: any) => Promise<Shopify.IProduct>;
534526
delete: (id: number) => Promise<void>;
535527
get: (id: number, params?: any) => Promise<Shopify.IProduct>;
536-
list: (
537-
params?: any
538-
) => Promise<Shopify.IPaginatedResult<Shopify.IProduct[]>>;
528+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IProduct>>;
539529
update: (id: number, params: any) => Promise<Shopify.IProduct>;
540530
};
541531
productImage: {
@@ -564,7 +554,7 @@ declare class Shopify {
564554
get: (productId: number) => Promise<Shopify.IProductListing>;
565555
list: (
566556
params?: any
567-
) => Promise<Shopify.IPaginatedResult<Shopify.IProductListing[]>>;
557+
) => Promise<Shopify.IPaginatedResult<Shopify.IProductListing>>;
568558
productIds: (params?: any) => Promise<any>;
569559
};
570560
productResourceFeedback: {
@@ -588,7 +578,7 @@ declare class Shopify {
588578
list: (
589579
productId: number,
590580
params?: any
591-
) => Promise<Shopify.IPaginatedResult<Shopify.IProductVariant[]>>;
581+
) => Promise<Shopify.IPaginatedResult<Shopify.IProductVariant>>;
592582
update: (id: number, params: any) => Promise<Shopify.IProductVariant>;
593583
};
594584
province: {
@@ -631,7 +621,7 @@ declare class Shopify {
631621
get: (id: number, params?: any) => Promise<Shopify.IRedirect>;
632622
list: (
633623
params?: any
634-
) => Promise<Shopify.IPaginatedResult<Shopify.IRedirect[]>>;
624+
) => Promise<Shopify.IPaginatedResult<Shopify.IRedirect>>;
635625
update: (
636626
id: number,
637627
params: Shopify.IUpdateRedirect
@@ -648,15 +638,13 @@ declare class Shopify {
648638
list: (
649639
orderId: number,
650640
params?: any
651-
) => Promise<Shopify.IPaginatedResult<Shopify.IRefund[]>>;
641+
) => Promise<Shopify.IPaginatedResult<Shopify.IRefund>>;
652642
};
653643
report: {
654644
create: (params: any) => Promise<Shopify.IReport>;
655645
delete: (id: number) => Promise<void>;
656646
get: (id: number, params?: any) => Promise<Shopify.IReport>;
657-
list: (
658-
params?: any
659-
) => Promise<Shopify.IPaginatedResult<Shopify.IReport[]>>;
647+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IReport>>;
660648
update: (id: number, params: any) => Promise<Shopify.IReport>;
661649
};
662650
resourceFeedback: {
@@ -670,7 +658,7 @@ declare class Shopify {
670658
get: (id: number, params?: any) => Promise<Shopify.IScriptTag>;
671659
list: (
672660
params?: any
673-
) => Promise<Shopify.IPaginatedResult<Shopify.IScriptTag[]>>;
661+
) => Promise<Shopify.IPaginatedResult<Shopify.IScriptTag>>;
674662
update: (
675663
id: number,
676664
params: Shopify.IUpdateScriptTag
@@ -689,7 +677,7 @@ declare class Shopify {
689677
get: (id: number, params?: any) => Promise<Shopify.ISmartCollection>;
690678
list: (
691679
params?: any
692-
) => Promise<Shopify.IPaginatedResult<Shopify.ISmartCollection[]>>;
680+
) => Promise<Shopify.IPaginatedResult<Shopify.ISmartCollection>>;
693681
order: (id: number, params: any) => Promise<void>;
694682
products: (id: number, params: any) => Promise<Shopify.IProduct>;
695683
update: (id: number, params: any) => Promise<Shopify.ISmartCollection>;
@@ -702,7 +690,7 @@ declare class Shopify {
702690
tenderTransaction: {
703691
list: (
704692
params?: any
705-
) => Promise<Shopify.IPaginatedResult<Shopify.ITenderTransaction[]>>;
693+
) => Promise<Shopify.IPaginatedResult<Shopify.ITenderTransaction>>;
706694
};
707695
theme: {
708696
create: (params: any) => Promise<Shopify.ITheme>;
@@ -722,7 +710,7 @@ declare class Shopify {
722710
list: (
723711
orderId: number,
724712
params?: any
725-
) => Promise<Shopify.IPaginatedResult<Shopify.ITransaction[]>>;
713+
) => Promise<Shopify.IPaginatedResult<Shopify.ITransaction>>;
726714
};
727715
usageCharge: {
728716
create: (
@@ -742,16 +730,14 @@ declare class Shopify {
742730
user: {
743731
current: () => Promise<Shopify.IUser>;
744732
get: (id: number) => Promise<Shopify.IUser>;
745-
list: () => Promise<Shopify.IPaginatedResult<Shopify.IUser[]>>;
733+
list: () => Promise<Shopify.IPaginatedResult<Shopify.IUser>>;
746734
};
747735
webhook: {
748736
count: (params?: any) => Promise<number>;
749737
create: (params: Shopify.ICreateWebhook) => Promise<Shopify.IWebhook>;
750738
delete: (id: number) => Promise<void>;
751739
get: (id: number, params?: any) => Promise<Shopify.IWebhook>;
752-
list: (
753-
params?: any
754-
) => Promise<Shopify.IPaginatedResult<Shopify.IWebhook[]>>;
740+
list: (params?: any) => Promise<Shopify.IPaginatedResult<Shopify.IWebhook>>;
755741
update: (
756742
id: number,
757743
params: Shopify.IUpdateWebhook

0 commit comments

Comments
 (0)