Rocky_Mountain_Vending/.pnpm-store/v10/files/f4/5a96f67005473bae17ddce5caf82b67f66882371f02df4eee57d2d41aa5289b11a382771663829b88bb3da13b958e4c3d99a0fa2b60b8761fa6c85b2b03e21
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

69 lines
1.8 KiB
Text

import { HttpRequest } from "@smithy/protocol-http";
import { resolvedPath } from "./resolve-path";
export function requestBuilder(input, context) {
return new RequestBuilder(input, context);
}
export class RequestBuilder {
input;
context;
query = {};
method = "";
headers = {};
path = "";
body = null;
hostname = "";
resolvePathStack = [];
constructor(input, context) {
this.input = input;
this.context = context;
}
async build() {
const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
this.path = basePath;
for (const resolvePath of this.resolvePathStack) {
resolvePath(this.path);
}
return new HttpRequest({
protocol,
hostname: this.hostname || hostname,
port,
method: this.method,
path: this.path,
query: this.query,
body: this.body,
headers: this.headers,
});
}
hn(hostname) {
this.hostname = hostname;
return this;
}
bp(uriLabel) {
this.resolvePathStack.push((basePath) => {
this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
});
return this;
}
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
this.resolvePathStack.push((path) => {
this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
});
return this;
}
h(headers) {
this.headers = headers;
return this;
}
q(query) {
this.query = query;
return this;
}
b(body) {
this.body = body;
return this;
}
m(method) {
this.method = method;
return this;
}
}