(
body: Record<string, any>,
eventName: string,
schema: string,
zodSchema: AnyZodObject,
)
| 34 | } |
| 35 | |
| 36 | async addBaseValues( |
| 37 | body: Record<string, any>, |
| 38 | eventName: string, |
| 39 | schema: string, |
| 40 | zodSchema: AnyZodObject, |
| 41 | ): Promise<Record<string, any>> { |
| 42 | const newBody = { ...body }; |
| 43 | const ideSettings = await this.ideSettingsPromise; |
| 44 | const ideInfo = await this.ideInfoPromise; |
| 45 | |
| 46 | if ("eventName" in zodSchema.shape) { |
| 47 | newBody.eventName = eventName; |
| 48 | } |
| 49 | if (!newBody.timestamp && "timestamp" in zodSchema.shape) { |
| 50 | newBody.timestamp = new Date().toISOString(); |
| 51 | } |
| 52 | if ("schema" in zodSchema.shape) { |
| 53 | newBody.schema = schema; |
| 54 | } |
| 55 | if ("userAgent" in zodSchema.shape) { |
| 56 | newBody.userAgent = ideInfo |
| 57 | ? `${ideInfo.name}/${ideInfo.version} (Continue/${ideInfo.extensionVersion})` |
| 58 | : "Unknown/Unknown (Continue/Unknown)"; |
| 59 | } |
| 60 | if ("selectedProfileId" in zodSchema.shape) { |
| 61 | newBody.selectedProfileId = |
| 62 | this.core?.configHandler.currentProfile?.profileDescription.id ?? ""; |
| 63 | } |
| 64 | if ("userId" in zodSchema.shape) { |
| 65 | newBody.userId = ideSettings?.userToken ?? ""; |
| 66 | } |
| 67 | |
| 68 | return newBody; |
| 69 | } |
| 70 | |
| 71 | async logLocalData(event: DevDataLogEvent) { |
| 72 | try { |
no outgoing calls
no test coverage detected