@tec.pet/tecpet-sdk 0.0.195 → 0.0.202

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.
@@ -130,6 +130,7 @@ export interface ChatbotActionJson {
130
130
  operationsDays: OperationDaysJson[];
131
131
  chatbotFlux: ChatbotFluxJson;
132
132
  allowPetRegistration?: boolean;
133
+ restrictedPetsBookingEnabled?: boolean;
133
134
  }
134
135
  export interface ChatbotFluxJson {
135
136
  id: string;
@@ -8,10 +8,13 @@ class EmployeeService {
8
8
  }
9
9
  async getEmployeesByServiceCategory(filter, shopId) {
10
10
  const response = await this.api.get(`/employee/list`, filter, shopId);
11
- if (response && response.data?.length) {
12
- return response.data;
11
+ // A API pode responder 200 carregando um corpo de erro (`{message}`) em vez da
12
+ // lista. Sem esta checagem o retorno virava `[]`, indistinguível de "loja sem
13
+ // funcionários" — e o chatbot exibia uma seleção vazia em vez de falhar.
14
+ if (!response || !Array.isArray(response.data)) {
15
+ throw new Error(`Invalid response from /employee/list: ${JSON.stringify(response)}`);
13
16
  }
14
- return [];
17
+ return response.data;
15
18
  }
16
19
  }
17
20
  exports.EmployeeService = EmployeeService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tec.pet/tecpet-sdk",
3
- "version": "0.0.195",
3
+ "version": "0.0.202",
4
4
  "description": "TecPet SDK for integration with TecPet services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",