@langchain/community
Version:
Third-party integrations for LangChain.js
1 lines • 1.69 kB
Source Map (JSON)
{"version":3,"file":"common.cjs","names":["timestamp: number"],"sources":["../../../src/utils/tencent_hunyuan/common.ts"],"sourcesContent":["export const service = \"hunyuan\";\nexport const signedHeaders = `content-type;host`;\n\nexport const getDate = (timestamp: number) => {\n const date = new Date(timestamp * 1000);\n const year = date.getUTCFullYear();\n const month = `0${(date.getUTCMonth() + 1).toString()}`.slice(-2);\n const day = `0${date.getUTCDate()}`.slice(-2);\n return `${year}-${month}-${day}`;\n};\n\n/**\n * Method that calculate Tencent Cloud API v3 signature\n * for making requests to the Tencent Cloud API.\n * See https://cloud.tencent.com/document/api/1729/101843.\n * @param host Tencent Cloud API host.\n * @param payload HTTP request body.\n * @param timestamp Sign timestamp in seconds.\n * @param secretId Tencent Cloud Secret ID, which can be obtained from https://console.cloud.tencent.com/cam/capi.\n * @param secretKey Tencent Cloud Secret Key, which can be obtained from https://console.cloud.tencent.com/cam/capi.\n * @param headers HTTP request headers.\n * @returns The signature for making requests to the Tencent API.\n */\nexport type sign = (\n host: string,\n payload: object,\n timestamp: number,\n secretId: string,\n secretKey: string,\n headers: Record<string, string>\n) => string;\n"],"mappings":";;AAAA,MAAa,UAAU;AACvB,MAAa,gBAAgB,CAAC,iBAAiB,CAAC;AAEhD,MAAa,UAAU,CAACA,cAAsB;CAC5C,MAAM,uBAAO,IAAI,KAAK,YAAY;CAClC,MAAM,OAAO,KAAK,gBAAgB;CAClC,MAAM,QAAQ,CAAC,CAAC,GAAG,KAAK,aAAa,GAAG,GAAG,UAAU,EAAE,CAAC,MAAM,GAAG;CACjE,MAAM,MAAM,CAAC,CAAC,EAAE,KAAK,YAAY,EAAE,CAAC,MAAM,GAAG;AAC7C,QAAO,GAAG,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK;AACjC"}