@pintahub/shopify-api 1.5.6 → 1.5.8
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.
|
@@ -4,6 +4,19 @@ export interface GetImageInput extends Record<string, any> {
|
|
|
4
4
|
id: string;
|
|
5
5
|
}
|
|
6
6
|
export interface GetImageOutput extends Record<string, any> {
|
|
7
|
+
id: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
image: {
|
|
12
|
+
altText: string;
|
|
13
|
+
height: number;
|
|
14
|
+
url: string;
|
|
15
|
+
width: number;
|
|
16
|
+
};
|
|
17
|
+
originalSource: {
|
|
18
|
+
fileSize: number;
|
|
19
|
+
};
|
|
7
20
|
}
|
|
8
21
|
export declare class GetImage extends ActionBuilder<AdminApiClient, GetImageInput, GetImageOutput> {
|
|
9
22
|
run(args: GetImageInput): Promise<GetImageOutput>;
|
|
@@ -2,6 +2,7 @@ import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/types";
|
|
|
2
2
|
import { ActionBuilder } from "../../ActionBuilder";
|
|
3
3
|
export interface SearchImagesInput extends Record<string, any> {
|
|
4
4
|
after?: string;
|
|
5
|
+
limit?: number;
|
|
5
6
|
}
|
|
6
7
|
export interface SearchImagesOutput extends Record<string, any> {
|
|
7
8
|
items: any[];
|
|
@@ -15,12 +15,13 @@ const handleErrors_1 = require("../../../utils/handleErrors");
|
|
|
15
15
|
class SearchImages extends ActionBuilder_1.ActionBuilder {
|
|
16
16
|
run(args) {
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const { after } = Object.assign({}, args);
|
|
18
|
+
const { after, limit } = Object.assign({}, args);
|
|
19
|
+
const vLimit = limit || 10;
|
|
19
20
|
const query = `
|
|
20
21
|
{
|
|
21
22
|
files(
|
|
22
23
|
query: "media_type:IMAGE"
|
|
23
|
-
first:
|
|
24
|
+
first: ${vLimit}
|
|
24
25
|
sortKey: UPDATED_AT
|
|
25
26
|
reverse: true
|
|
26
27
|
${after ? `after: "${after}"` : ''}
|