include node_modules so release .zip is deployable

This commit is contained in:
2023-11-24 17:44:25 -05:00
parent 6c86cfe5d2
commit 8b11c41267
8963 changed files with 874175 additions and 1 deletions
@@ -0,0 +1,20 @@
export const deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {
const { response } = await next(args);
try {
const parsed = await deserializer(response, options);
return {
response,
output: parsed,
};
}
catch (error) {
Object.defineProperty(error, "$response", {
value: response,
});
if (!("$metadata" in error)) {
const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
error.message += "\n " + hint;
}
throw error;
}
};
+3
View File
@@ -0,0 +1,3 @@
export * from "./deserializerMiddleware";
export * from "./serdePlugin";
export * from "./serializerMiddleware";
+22
View File
@@ -0,0 +1,22 @@
import { deserializerMiddleware } from "./deserializerMiddleware";
import { serializerMiddleware } from "./serializerMiddleware";
export const deserializerMiddlewareOption = {
name: "deserializerMiddleware",
step: "deserialize",
tags: ["DESERIALIZER"],
override: true,
};
export const serializerMiddlewareOption = {
name: "serializerMiddleware",
step: "serialize",
tags: ["SERIALIZER"],
override: true,
};
export function getSerdePlugin(config, serializer, deserializer) {
return {
applyToStack: (commandStack) => {
commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);
commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);
},
};
}
+13
View File
@@ -0,0 +1,13 @@
export const serializerMiddleware = (options, serializer) => (next, context) => async (args) => {
const endpoint = context.endpointV2?.url && options.urlParser
? async () => options.urlParser(context.endpointV2.url)
: options.endpoint;
if (!endpoint) {
throw new Error("No valid endpoint provider available.");
}
const request = await serializer(args.input, { ...options, endpoint });
return next({
...args,
request,
});
};