@lingo.dev/_sdk 0.7.26 → 0.7.28

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/build/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/index.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;// src/index.ts
2
2
  var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);
3
3
  var __spec = require('@lingo.dev/_spec');
4
4
  var _cuid2 = require('@paralleldrive/cuid2');
@@ -93,6 +93,9 @@ var LingoDotDevEngine = class {
93
93
  }
94
94
  }
95
95
  const jsonResponse = await res.json();
96
+ if (!jsonResponse.data && jsonResponse.error) {
97
+ throw new Error(jsonResponse.error);
98
+ }
96
99
  return jsonResponse.data || {};
97
100
  }
98
101
  /**
@@ -321,18 +324,30 @@ var LingoDotDevEngine = class {
321
324
  return jsonResponse.locale;
322
325
  }
323
326
  };
324
- var ReplexicaEngine = class extends LingoDotDevEngine {
327
+ var ReplexicaEngine = (_class = class _ReplexicaEngine extends LingoDotDevEngine {
328
+ static __initStatic() {this.hasWarnedDeprecation = false}
325
329
  constructor(config) {
326
330
  super(config);
327
- console.warn("ReplexicaEngine is deprecated. Please use LingoDotDevEngine instead.");
331
+ if (!_ReplexicaEngine.hasWarnedDeprecation) {
332
+ console.warn(
333
+ "ReplexicaEngine is deprecated and will be removed in a future release. Please use LingoDotDevEngine instead. See https://docs.lingo.dev/migration for more information."
334
+ );
335
+ _ReplexicaEngine.hasWarnedDeprecation = true;
336
+ }
328
337
  }
329
- };
330
- var LingoEngine = class extends LingoDotDevEngine {
338
+ }, _class.__initStatic(), _class);
339
+ var LingoEngine = (_class2 = class _LingoEngine extends LingoDotDevEngine {
340
+ static __initStatic2() {this.hasWarnedDeprecation = false}
331
341
  constructor(config) {
332
342
  super(config);
333
- console.warn("LingoEngine is deprecated. Please use LingoDotDevEngine instead.");
343
+ if (!_LingoEngine.hasWarnedDeprecation) {
344
+ console.warn(
345
+ "LingoEngine is deprecated and will be removed in a future release. Please use LingoDotDevEngine instead. See https://docs.lingo.dev/migration for more information."
346
+ );
347
+ _LingoEngine.hasWarnedDeprecation = true;
348
+ }
334
349
  }
335
- };
350
+ }, _class2.__initStatic2(), _class2);
336
351
 
337
352
 
338
353
 
package/build/index.d.cts CHANGED
@@ -151,12 +151,14 @@ declare class LingoDotDevEngine {
151
151
  * @deprecated Use LingoDotDevEngine instead. This class is maintained for backwards compatibility.
152
152
  */
153
153
  declare class ReplexicaEngine extends LingoDotDevEngine {
154
+ private static hasWarnedDeprecation;
154
155
  constructor(config: Partial<Z.infer<typeof engineParamsSchema>>);
155
156
  }
156
157
  /**
157
158
  * @deprecated Use LingoDotDevEngine instead. This class is maintained for backwards compatibility.
158
159
  */
159
160
  declare class LingoEngine extends LingoDotDevEngine {
161
+ private static hasWarnedDeprecation;
160
162
  constructor(config: Partial<Z.infer<typeof engineParamsSchema>>);
161
163
  }
162
164
 
package/build/index.d.ts CHANGED
@@ -151,12 +151,14 @@ declare class LingoDotDevEngine {
151
151
  * @deprecated Use LingoDotDevEngine instead. This class is maintained for backwards compatibility.
152
152
  */
153
153
  declare class ReplexicaEngine extends LingoDotDevEngine {
154
+ private static hasWarnedDeprecation;
154
155
  constructor(config: Partial<Z.infer<typeof engineParamsSchema>>);
155
156
  }
156
157
  /**
157
158
  * @deprecated Use LingoDotDevEngine instead. This class is maintained for backwards compatibility.
158
159
  */
159
160
  declare class LingoEngine extends LingoDotDevEngine {
161
+ private static hasWarnedDeprecation;
160
162
  constructor(config: Partial<Z.infer<typeof engineParamsSchema>>);
161
163
  }
162
164
 
package/build/index.mjs CHANGED
@@ -93,6 +93,9 @@ var LingoDotDevEngine = class {
93
93
  }
94
94
  }
95
95
  const jsonResponse = await res.json();
96
+ if (!jsonResponse.data && jsonResponse.error) {
97
+ throw new Error(jsonResponse.error);
98
+ }
96
99
  return jsonResponse.data || {};
97
100
  }
98
101
  /**
@@ -321,16 +324,28 @@ var LingoDotDevEngine = class {
321
324
  return jsonResponse.locale;
322
325
  }
323
326
  };
324
- var ReplexicaEngine = class extends LingoDotDevEngine {
327
+ var ReplexicaEngine = class _ReplexicaEngine extends LingoDotDevEngine {
328
+ static hasWarnedDeprecation = false;
325
329
  constructor(config) {
326
330
  super(config);
327
- console.warn("ReplexicaEngine is deprecated. Please use LingoDotDevEngine instead.");
331
+ if (!_ReplexicaEngine.hasWarnedDeprecation) {
332
+ console.warn(
333
+ "ReplexicaEngine is deprecated and will be removed in a future release. Please use LingoDotDevEngine instead. See https://docs.lingo.dev/migration for more information."
334
+ );
335
+ _ReplexicaEngine.hasWarnedDeprecation = true;
336
+ }
328
337
  }
329
338
  };
330
- var LingoEngine = class extends LingoDotDevEngine {
339
+ var LingoEngine = class _LingoEngine extends LingoDotDevEngine {
340
+ static hasWarnedDeprecation = false;
331
341
  constructor(config) {
332
342
  super(config);
333
- console.warn("LingoEngine is deprecated. Please use LingoDotDevEngine instead.");
343
+ if (!_LingoEngine.hasWarnedDeprecation) {
344
+ console.warn(
345
+ "LingoEngine is deprecated and will be removed in a future release. Please use LingoDotDevEngine instead. See https://docs.lingo.dev/migration for more information."
346
+ );
347
+ _LingoEngine.hasWarnedDeprecation = true;
348
+ }
334
349
  }
335
350
  };
336
351
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_sdk",
3
- "version": "0.7.26",
3
+ "version": "0.7.28",
4
4
  "description": "Lingo.dev JS SDK",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -23,7 +23,7 @@
23
23
  "typescript": "^5.7.2",
24
24
  "vitest": "^2.1.8",
25
25
  "zod": "^3.24.1",
26
- "@lingo.dev/_spec": "0.26.3"
26
+ "@lingo.dev/_spec": "0.26.4"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/jsdom": "^21.1.7",