UNPKG

@langchain/community

Version:
1 lines 1.56 kB
{"version":3,"file":"common.cjs","names":[],"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;AAE7B,MAAa,WAAW,cAAsB;CAC5C,MAAM,uBAAO,IAAI,KAAK,YAAY,IAAK;AAIvC,QAAO,GAHM,KAAK,gBAAgB,CAGnB,GAFD,KAAK,KAAK,aAAa,GAAG,GAAG,UAAU,GAAG,MAAM,GAAG,CAEzC,GADZ,IAAI,KAAK,YAAY,GAAG,MAAM,GAAG"}