MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / customerIds

Function customerIds

e2e/src/surfaces/autumn.ts:168–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166 });
167
168 const customerIds = () =>
169 Effect.gen(function* () {
170 const response = yield* Effect.promise(() =>
171 fetch(`${autumnUrl}/v1/customers.list`, {
172 method: "POST",
173 headers: { "content-type": "application/json" },
174 body: "{}",
175 }),
176 );
177 if (!response.ok) {
178 return yield* Effect.fail(
179 `autumn customers.list responded ${response.status}: ${yield* Effect.promise(() => response.text())}`,
180 );
181 }
182 const body = (yield* Effect.promise(() => response.json())) as {
183 readonly list?: ReadonlyArray<{ readonly id?: string }>;
184 };
185 return (body.list ?? []).map((customer) => customer.id ?? "");
186 });
187
188 const settleCheckout = (sessionId: string) =>
189 Effect.gen(function* () {

Callers

nothing calls this directly

Calls 3

textMethod · 0.65
jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected