MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / #allSinglePage

Method #allSinglePage

integrations/shopify/src/rest.ts:107–146  ·  view source on GitHub ↗
(
    key: string,
    pageNumber: number,
    params?: Optional<Parameters<TResource["all"]>[0], "session">
  )

Source from the content-addressed store, hash-verified

105 }
106
107 async #allSinglePage(
108 key: string,
109 pageNumber: number,
110 params?: Optional<Parameters<TResource["all"]>[0], "session">
111 ): AllReturnType<TResource> {
112 const { session, ...paramsWithoutSession } = params ?? {};
113
114 return this.runTask(
115 `${key}-page-${String(pageNumber)}`,
116 async (client, task, io) => {
117 const allResponse = await client.rest[this.resourceType].all(
118 this.#withSession(params ?? {})
119 );
120
121 task.outputProperties = [
122 {
123 label: `${this.resourceType}s`,
124 text: String(allResponse.data.length),
125 },
126 ];
127
128 return {
129 data: serializeShopifyResource(allResponse.data) as Awaited<
130 AllReturnType<TResource>
131 >["data"],
132 pageInfo: allResponse.pageInfo,
133 };
134 },
135 {
136 name: `Get All ${this.resourceType}s`,
137 params: paramsWithoutSession,
138 properties: [
139 {
140 label: "Page Number",
141 text: String(pageNumber),
142 },
143 ],
144 }
145 );
146 }
147
148 /**
149 * Fetch all resources of a given type.

Callers 1

allMethod · 0.95

Calls 4

#withSessionMethod · 0.95
serializeShopifyResourceFunction · 0.90
runTaskMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected