dcl-catalyst-client 22.0.1-38482794215.commit-a4a4e71 → 22.0.1-38602312773.commit-5d9befe

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.
@@ -1 +1 @@
1
- {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/client/utils/fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,KAAK,OAAO,GAAG;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnD,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AAGrF,eAAO,MAAM,eAAe,8CAA+C,OAAO,oBAWjF,CAAA;AAED,eAAe,eAAe,CAAA"}
1
+ {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/client/utils/fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,KAAK,OAAO,GAAG;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC5D,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AAcrF,eAAO,MAAM,eAAe,4DAA6D,OAAO,oBAyB/F,CAAA;AAED,eAAe,eAAe,CAAA"}
@@ -1,15 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCustomClient = void 0;
4
+ const errors_1 = require("./errors");
5
+ // Arrays become repeated keys; null and undefined are left out (presence flags would read them as set).
6
+ function toSearchParams(params) {
7
+ const searchParams = new URLSearchParams();
8
+ for (const [key, value] of Object.entries(params !== null && params !== void 0 ? params : {})) {
9
+ for (const item of Array.isArray(value) ? value : [value]) {
10
+ if (item !== undefined && item !== null)
11
+ searchParams.append(key, String(item));
12
+ }
13
+ }
14
+ return searchParams;
15
+ }
4
16
  // NOTE: used by orval generator
5
- const useCustomClient = ({ url, method, params, data, headers }) => {
17
+ const useCustomClient = ({ url, method, params, data, responseType, headers }) => {
6
18
  const relPath = url.substring('/lambdas'.length + 1);
7
19
  return async function (baseUrl, fetch) {
8
- const response = await fetch.fetch(`${baseUrl}/${relPath}?` + new URLSearchParams(params), {
20
+ var _a, _b;
21
+ const response = await fetch.fetch(`${baseUrl}/${relPath}?` + toSearchParams(params), {
9
22
  method,
10
23
  headers,
11
24
  ...(data ? { body: JSON.stringify(data) } : {})
12
25
  });
26
+ // A HEAD response has no body to parse.
27
+ if (method === 'head')
28
+ return undefined;
29
+ // Binary operations (images, thumbnails) aren't JSON
30
+ if (responseType === 'blob') {
31
+ if (!response.ok) {
32
+ // Read the error body so the connection is released
33
+ const body = await response.text().catch(() => undefined);
34
+ throw new errors_1.ContentDownloadError(`Failed to download ${relPath}: HTTP ${response.status}`, response.status, body);
35
+ }
36
+ const type = (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get('content-type')) !== null && _b !== void 0 ? _b : undefined;
37
+ return new Blob([await response.arrayBuffer()], type ? { type } : undefined);
38
+ }
13
39
  return response.json();
14
40
  };
15
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fetcher.js","sourceRoot":"","sources":["../../../src/client/utils/fetcher.ts"],"names":[],"mappings":";;;AAaA,gCAAgC;AACzB,MAAM,eAAe,GAAG,CAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAW,EAAmB,EAAE;IACrG,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACpD,OAAO,KAAK,WAAW,OAAe,EAAE,KAAsB;QAC5D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,OAAO,GAAG,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE;YACzF,MAAM;YACN,OAAO;YACP,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChD,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;IACxB,CAAC,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,eAAe,mBAW3B;AAED,kBAAe,uBAAe,CAAA"}
1
+ {"version":3,"file":"fetcher.js","sourceRoot":"","sources":["../../../src/client/utils/fetcher.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAa/C,wGAAwG;AACxG,SAAS,cAAc,CAAC,MAAgC;IACtD,MAAM,YAAY,GAAG,IAAI,eAAe,EAAE,CAAA;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,EAAE;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C,MAAM,EAAE,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;aAChH;YACD,MAAM,IAAI,GAAG,MAAA,MAAA,QAAQ,CAAC,OAAO,0CAAE,GAAG,CAAC,cAAc,CAAC,mCAAI,SAAS,CAAA;YAC/D,OAAO,IAAI,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAM,CAAA;SAClF;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;IACxB,CAAC,CAAA;AACH,CAAC,CAAA;AAzBY,QAAA,eAAe,mBAyB3B;AAED,kBAAe,uBAAe,CAAA"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export * from './client/CatalystClient';
2
2
  export * from './client/ContentClient';
3
3
  export * from './client/LambdasClient';
4
4
  export * from './client/utils';
5
- export { DeploymentError, PartialDeploymentNotSupportedError, PartialDeploymentRetryLaterError, PartialDeploymentValidationError } from './client/utils/errors';
5
+ export { ContentDownloadError, DeploymentError, PartialDeploymentNotSupportedError, PartialDeploymentRetryLaterError, PartialDeploymentValidationError } from './client/utils/errors';
6
6
  export { DEFAULT_MAX_BATCH_SIZE_BYTES, splitIntoBatches } from './client/utils/batching';
7
7
  export type { FileBatch } from './client/utils/batching';
8
8
  export type { FetchResponse, IFetchComponent, PartialDeploymentOptions, PartialDeploymentProgress, PartialDeploymentResult, RequestOptions, UploadPhase, UploadProgress, UploadProgressOptions } from './client/types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EACL,eAAe,EACf,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACxF,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,YAAY,EACV,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,cAAc,EACd,qBAAqB,EACtB,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACxF,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,YAAY,EACV,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,cAAc,EACd,qBAAqB,EACtB,MAAM,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -14,12 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.splitIntoBatches = exports.DEFAULT_MAX_BATCH_SIZE_BYTES = exports.PartialDeploymentValidationError = exports.PartialDeploymentRetryLaterError = exports.PartialDeploymentNotSupportedError = exports.DeploymentError = void 0;
17
+ exports.splitIntoBatches = exports.DEFAULT_MAX_BATCH_SIZE_BYTES = exports.PartialDeploymentValidationError = exports.PartialDeploymentRetryLaterError = exports.PartialDeploymentNotSupportedError = exports.DeploymentError = exports.ContentDownloadError = void 0;
18
18
  __exportStar(require("./client/CatalystClient"), exports);
19
19
  __exportStar(require("./client/ContentClient"), exports);
20
20
  __exportStar(require("./client/LambdasClient"), exports);
21
21
  __exportStar(require("./client/utils"), exports);
22
22
  var errors_1 = require("./client/utils/errors");
23
+ Object.defineProperty(exports, "ContentDownloadError", { enumerable: true, get: function () { return errors_1.ContentDownloadError; } });
23
24
  Object.defineProperty(exports, "DeploymentError", { enumerable: true, get: function () { return errors_1.DeploymentError; } });
24
25
  Object.defineProperty(exports, "PartialDeploymentNotSupportedError", { enumerable: true, get: function () { return errors_1.PartialDeploymentNotSupportedError; } });
25
26
  Object.defineProperty(exports, "PartialDeploymentRetryLaterError", { enumerable: true, get: function () { return errors_1.PartialDeploymentRetryLaterError; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,yDAAsC;AACtC,yDAAsC;AACtC,iDAA8B;AAC9B,gDAK8B;AAJ5B,yGAAA,eAAe,OAAA;AACf,4HAAA,kCAAkC,OAAA;AAClC,0HAAA,gCAAgC,OAAA;AAChC,0HAAA,gCAAgC,OAAA;AAElC,oDAAwF;AAA/E,wHAAA,4BAA4B,OAAA;AAAE,4GAAA,gBAAgB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,yDAAsC;AACtC,yDAAsC;AACtC,iDAA8B;AAC9B,gDAM8B;AAL5B,8GAAA,oBAAoB,OAAA;AACpB,yGAAA,eAAe,OAAA;AACf,4HAAA,kCAAkC,OAAA;AAClC,0HAAA,gCAAgC,OAAA;AAChC,0HAAA,gCAAgC,OAAA;AAElC,oDAAwF;AAA/E,wHAAA,4BAA4B,OAAA;AAAE,4GAAA,gBAAgB,OAAA"}
package/dist/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  "cookie": "^0.5.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@dcl/catalyst-api-specs": "^3.8.0",
43
+ "@dcl/catalyst-api-specs": "^4.0.0",
44
44
  "@dcl/eslint-config": "^1.1.9",
45
45
  "@well-known-components/env-config-provider": "^1.1.1",
46
46
  "@well-known-components/interfaces": "^1.4.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dcl-catalyst-client",
3
- "version": "22.0.1-38482794215.commit-a4a4e71",
4
- "commit": "a4a4e718414f545510e21b5e8aa28fa110669f4e",
3
+ "version": "22.0.1-38602312773.commit-5d9befe",
4
+ "commit": "5d9befe6dfce4e8d0399695cdef0f9c8f8215c20",
5
5
  "description": "A client to query and perform changes on Decentraland's catalyst servers",
6
6
  "main": "dist/index.js",
7
7
  "typings": "dist/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "cookie": "^0.5.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@dcl/catalyst-api-specs": "^3.8.0",
43
+ "@dcl/catalyst-api-specs": "^4.0.0",
44
44
  "@dcl/eslint-config": "^1.1.9",
45
45
  "@well-known-components/env-config-provider": "^1.1.1",
46
46
  "@well-known-components/interfaces": "^1.4.0",