@aicats/sdk 1.0.4 → 1.1.0

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.
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ var Theme = /* @__PURE__ */ ((Theme2) => {
52
52
  return Theme2;
53
53
  })(Theme || {});
54
54
 
55
- // src/api/v1.api.ts
55
+ // src/api/ai-cats-api.ts
56
56
  var ApiUrl = "https://api.ai-cats.net/v1";
57
57
  async function toResponseType(buffer, type = "blob") {
58
58
  switch (type) {
@@ -94,7 +94,7 @@ async function random(options) {
94
94
  }
95
95
  async function getById(id, options) {
96
96
  const size = options?.size ?? "1024" /* Large */;
97
- const response = await fetch(`${ApiUrl}/cat/${id}?size=${size}`);
97
+ const response = await fetch(`${ApiUrl}/cat/${id}.jpg?size=${size}`);
98
98
  if (!response.ok) {
99
99
  throw new Error(`Error fetching cat image: ${response.statusText}`);
100
100
  }
@@ -166,7 +166,7 @@ async function getCount(theme) {
166
166
  const data = await response.json();
167
167
  return data.count;
168
168
  }
169
- var V1Api = {
169
+ var AiCatsAPI = {
170
170
  random,
171
171
  getById,
172
172
  getInfo,
@@ -178,7 +178,7 @@ var V1Api = {
178
178
  };
179
179
 
180
180
  // src/index.ts
181
- var AiCats = V1Api;
181
+ var AiCats = AiCatsAPI;
182
182
  // Annotate the CommonJS export names for ESM import in node:
183
183
  0 && (module.exports = {
184
184
  AiCats,
package/dist/index.mjs CHANGED
@@ -24,7 +24,7 @@ var Theme = /* @__PURE__ */ ((Theme2) => {
24
24
  return Theme2;
25
25
  })(Theme || {});
26
26
 
27
- // src/api/v1.api.ts
27
+ // src/api/ai-cats-api.ts
28
28
  var ApiUrl = "https://api.ai-cats.net/v1";
29
29
  async function toResponseType(buffer, type = "blob") {
30
30
  switch (type) {
@@ -66,7 +66,7 @@ async function random(options) {
66
66
  }
67
67
  async function getById(id, options) {
68
68
  const size = options?.size ?? "1024" /* Large */;
69
- const response = await fetch(`${ApiUrl}/cat/${id}?size=${size}`);
69
+ const response = await fetch(`${ApiUrl}/cat/${id}.jpg?size=${size}`);
70
70
  if (!response.ok) {
71
71
  throw new Error(`Error fetching cat image: ${response.statusText}`);
72
72
  }
@@ -138,7 +138,7 @@ async function getCount(theme) {
138
138
  const data = await response.json();
139
139
  return data.count;
140
140
  }
141
- var V1Api = {
141
+ var AiCatsAPI = {
142
142
  random,
143
143
  getById,
144
144
  getInfo,
@@ -150,7 +150,7 @@ var V1Api = {
150
150
  };
151
151
 
152
152
  // src/index.ts
153
- var AiCats = V1Api;
153
+ var AiCats = AiCatsAPI;
154
154
  export {
155
155
  AiCats,
156
156
  Size,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicats/sdk",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "Official JavaScript SDK for the ai-cats.net API",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",