yaschema-api-google-cloud-task-creator
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -17,5 +17,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./api-fetch/exports"), exports); | ||
__exportStar(require("./config/exports"), exports); | ||
__exportStar(require("./create-google-cloud-task/exports"), exports); | ||
__exportStar(require("./types/exports"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
'form-data': () => undefined, | ||
json: JSON.stringify | ||
json: (body) => Buffer.from(JSON.stringify(body), 'utf-8') | ||
}; | ||
@@ -9,0 +9,0 @@ const encodeBody = ({ requestType = 'json', body }) => encodersByRequestType[requestType](body); |
@@ -1,4 +0,4 @@ | ||
export * from './api-fetch/exports'; | ||
export * from './config/exports'; | ||
export * from './create-google-cloud-task/exports'; | ||
export * from './types/exports'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,7 +1,7 @@ | ||
/// <reference types="node" /> | ||
import type { AnyBody, HttpRequestType } from 'yaschema-api'; | ||
import type { EncodedRequestBody } from '../api-fetch/types/EncodedRequestBody'; | ||
export declare const encodeBody: ({ requestType, body }: { | ||
requestType: HttpRequestType | undefined; | ||
body: AnyBody; | ||
}) => EncodedRequestBody; | ||
}) => Buffer | undefined; | ||
//# sourceMappingURL=encode-body.d.ts.map |
@@ -1,4 +0,4 @@ | ||
export * from './api-fetch/exports'; | ||
export * from './config/exports'; | ||
export * from './create-google-cloud-task/exports'; | ||
export * from './types/exports'; | ||
//# sourceMappingURL=index.js.map |
const encodersByRequestType = { | ||
'form-data': () => undefined, | ||
json: JSON.stringify | ||
json: (body) => Buffer.from(JSON.stringify(body), 'utf-8') | ||
}; | ||
export const encodeBody = ({ requestType = 'json', body }) => encodersByRequestType[requestType](body); | ||
//# sourceMappingURL=encode-body.js.map |
{ | ||
"name": "yaschema-api-google-cloud-task-creator", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Google Cloud createTask support for yaschema-api", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,3 +0,3 @@ | ||
export * from './api-fetch/exports'; | ||
export * from './config/exports'; | ||
export * from './create-google-cloud-task/exports'; | ||
export * from './types/exports'; |
import type { AnyBody, HttpRequestType } from 'yaschema-api'; | ||
import type { EncodedRequestBody } from '../api-fetch/types/EncodedRequestBody'; | ||
type RequestBodyEncoder = (body: AnyBody) => Buffer | undefined; | ||
type RequestBodyEncoder = (body: AnyBody) => EncodedRequestBody; | ||
const encodersByRequestType: Record<HttpRequestType, RequestBodyEncoder> = { | ||
'form-data': () => undefined, | ||
json: JSON.stringify | ||
json: (body) => Buffer.from(JSON.stringify(body), 'utf-8') | ||
}; | ||
@@ -11,0 +9,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
159678
199
1910