@antlur/backstage 1.12.11 → 1.12.12

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.
@@ -12,9 +12,9 @@ export interface UpdateWebsiteParams {
12
12
  }
13
13
  export declare class WebsiteService extends BaseService {
14
14
  getWebsites(options?: RequestInit): Promise<Website[]>;
15
- getWebsite(id?: string, options?: RequestInit): Promise<Website>;
15
+ getWebsite(options?: RequestInit): Promise<Website>;
16
16
  createWebsite(params: CreateWebsiteParams, options?: RequestInit): Promise<Website>;
17
17
  updateWebsite(id: string, params: UpdateWebsiteParams, options?: RequestInit): Promise<Website>;
18
- routes(websiteId?: string, options?: RequestInit): Promise<string[]>;
18
+ routes(options?: RequestInit): Promise<string[]>;
19
19
  }
20
20
  //# sourceMappingURL=website.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"website.d.ts","sourceRoot":"","sources":["../../src/endpoints/website.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4C,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,qBAAa,cAAe,SAAQ,WAAW;IACvC,WAAW,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAKtD,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAShE,aAAa,CAAC,MAA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AE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAKvD"}
@@ -4,11 +4,12 @@ export class WebsiteService extends BaseService {
4
4
  const { data } = await this.client.get("/websites", options);
5
5
  return data;
6
6
  }
7
- async getWebsite(id, options) {
8
- if (id) {
9
- const { data } = await this.client.get(`/websites/${id}`, options);
10
- return data;
11
- }
7
+ async getWebsite(options) {
8
+ // Handle case where id might be an object (e.g., RequestInit passed as first param)
9
+ // if (id && typeof id === "string") {
10
+ // const { data } = await this.client.get<ApiSingleResponse<Website>>(`/websites/${id}`, options);
11
+ // return data;
12
+ // }
12
13
  const res = await this.client.get("/websites", options);
13
14
  return res.data[0];
14
15
  }
@@ -20,8 +21,9 @@ export class WebsiteService extends BaseService {
20
21
  const { data } = await this.client.put(`/websites/${id}`, params, options);
21
22
  return data;
22
23
  }
23
- async routes(websiteId, options) {
24
- const id = websiteId || (await this.getWebsite()).id;
25
- return this.client.get(`/websites/${id}/routes`, options);
24
+ async routes(options) {
25
+ // const id = websiteId || (await this.getWebsite()).id;
26
+ const website = await this.getWebsite();
27
+ return this.client.get(`/websites/${website.id}/routes`, options);
26
28
  }
27
29
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antlur/backstage",
3
3
  "author": "Anthony Holmes",
4
- "version": "1.12.11",
4
+ "version": "1.12.12",
5
5
  "description": "A simple client for Backstage CMS",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -19,11 +19,12 @@ export class WebsiteService extends BaseService {
19
19
  return data;
20
20
  }
21
21
 
22
- async getWebsite(id?: string, options?: RequestInit): Promise<Website> {
23
- if (id) {
24
- const { data } = await this.client.get<ApiSingleResponse<Website>>(`/websites/${id}`, options);
25
- return data;
26
- }
22
+ async getWebsite(options?: RequestInit): Promise<Website> {
23
+ // Handle case where id might be an object (e.g., RequestInit passed as first param)
24
+ // if (id && typeof id === "string") {
25
+ // const { data } = await this.client.get<ApiSingleResponse<Website>>(`/websites/${id}`, options);
26
+ // return data;
27
+ // }
27
28
  const res = await this.client.get<ApiCollectionResponse<Website>>("/websites", options);
28
29
  return res.data[0];
29
30
  }
@@ -38,8 +39,9 @@ export class WebsiteService extends BaseService {
38
39
  return data;
39
40
  }
40
41
 
41
- async routes(websiteId?: string, options?: RequestInit): Promise<string[]> {
42
- const id = websiteId || (await this.getWebsite()).id;
43
- return this.client.get<string[]>(`/websites/${id}/routes`, options);
42
+ async routes(options?: RequestInit): Promise<string[]> {
43
+ // const id = websiteId || (await this.getWebsite()).id;
44
+ const website = await this.getWebsite();
45
+ return this.client.get<string[]>(`/websites/${website.id}/routes`, options);
44
46
  }
45
47
  }