@codeguide/core 0.0.44 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,13 @@ export declare abstract class BaseService {
19
19
  validateAuthentication(): AuthenticationResult;
20
20
  private setupInterceptors;
21
21
  protected get<T>(url: string, config?: any): Promise<T>;
22
+ /**
23
+ * Get request that returns raw response including headers (for binary data like ZIP files)
24
+ */
25
+ protected getRaw(url: string, config?: any): Promise<{
26
+ data: any;
27
+ headers: Record<string, string>;
28
+ }>;
22
29
  /**
23
30
  * Safely format error message to avoid [object Object]
24
31
  */
@@ -175,6 +175,19 @@ class BaseService {
175
175
  const response = await this.client.get(url, config);
176
176
  return response.data;
177
177
  }
178
+ /**
179
+ * Get request that returns raw response including headers (for binary data like ZIP files)
180
+ */
181
+ async getRaw(url, config) {
182
+ const response = await this.client.get(url, {
183
+ ...config,
184
+ responseType: 'arraybuffer',
185
+ });
186
+ return {
187
+ data: response.data,
188
+ headers: response.headers,
189
+ };
190
+ }
178
191
  /**
179
192
  * Safely format error message to avoid [object Object]
180
193
  */
@@ -19,7 +19,7 @@ class StarterKitsService extends base_service_1.BaseService {
19
19
  if (params?.repo_name) {
20
20
  queryParams.append('repo_name', params.repo_name);
21
21
  }
22
- const url = `/starter-kits${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
22
+ const url = `/starter-kits/${queryParams.toString() ? `?${queryParams.toString()}` : ''}`;
23
23
  const response = await this.get(url);
24
24
  return response.data;
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeguide/core",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "description": "Core package for code guidance with programmatic API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -218,6 +218,20 @@ export abstract class BaseService {
218
218
  return response.data
219
219
  }
220
220
 
221
+ /**
222
+ * Get request that returns raw response including headers (for binary data like ZIP files)
223
+ */
224
+ protected async getRaw(url: string, config?: any): Promise<{ data: any; headers: Record<string, string> }> {
225
+ const response = await this.client.get(url, {
226
+ ...config,
227
+ responseType: 'arraybuffer',
228
+ })
229
+ return {
230
+ data: response.data,
231
+ headers: response.headers as Record<string, string>,
232
+ }
233
+ }
234
+
221
235
  /**
222
236
  * Safely format error message to avoid [object Object]
223
237
  */
@@ -144,4 +144,5 @@ export class ProjectService extends BaseService {
144
144
  const url = `/ai-tools/${queryParams.toString() ? `?${queryParams.toString()}` : ''}`
145
145
  return this.get<GetAiToolsResponse>(url)
146
146
  }
147
+
147
148
  }
@@ -268,3 +268,4 @@ export interface GetAiToolsResponse {
268
268
  status: string
269
269
  data: AITool[]
270
270
  }
271
+
@@ -1,9 +1,5 @@
1
1
  import { BaseService } from '../base/base-service'
2
- import {
3
- StarterKit,
4
- GetStarterKitsRequest,
5
- GetStarterKitsResponse,
6
- } from './starter-kits-types'
2
+ import { StarterKit, GetStarterKitsRequest, GetStarterKitsResponse } from './starter-kits-types'
7
3
 
8
4
  export class StarterKitsService extends BaseService {
9
5
  /**
@@ -25,9 +21,8 @@ export class StarterKitsService extends BaseService {
25
21
  queryParams.append('repo_name', params.repo_name)
26
22
  }
27
23
 
28
- const url = `/starter-kits${queryParams.toString() ? `?${queryParams.toString()}` : ''}`
24
+ const url = `/starter-kits/${queryParams.toString() ? `?${queryParams.toString()}` : ''}`
29
25
  const response = await this.get<GetStarterKitsResponse>(url)
30
26
  return response.data
31
27
  }
32
28
  }
33
-