@zodic/shared 0.0.352 → 0.0.354

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.352",
3
+ "version": "0.0.354",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -159,8 +159,8 @@ export const sendRequest = async (
159
159
  throw new Error('PiAPI FaceSwap Error: Invalid response structure');
160
160
  }
161
161
 
162
- // Check the response code
163
- if (data.code !== 0) {
162
+ // Check the response code (accept both 0 and 200 as success)
163
+ if (data.code !== 0 && data.code !== 200) {
164
164
  const errorMsg = data.message || 'Unknown error';
165
165
  const detailedError = data.data.error
166
166
  ? ` - ${data.data.error.message || 'No detailed error message'}`
@@ -183,17 +183,6 @@ export const sendRequest = async (
183
183
  throw new Error(`PiAPI FaceSwap Error: Task failed - ${errorMsg}`);
184
184
  }
185
185
 
186
- // Ensure the task is in a valid state for creation
187
- if (
188
- data.data.status !== Status.Staged &&
189
- data.data.status !== Status.Pending &&
190
- data.data.status !== Status.Processing
191
- ) {
192
- throw new Error(
193
- `PiAPI FaceSwap Error: Unexpected task status - ${data.data.status}`
194
- );
195
- }
196
-
197
186
  return data;
198
187
  } catch (err: any) {
199
188
  if (