next-tinacms-azure 1.0.6 → 1.0.8

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/auth.js CHANGED
@@ -697,7 +697,7 @@ var require_headers = __commonJS({
697
697
  }
698
698
  const lowercased = prop.toLowerCase();
699
699
  const original = Object.keys(headers2).find((o) => o.toLowerCase() === lowercased);
700
- return _reflect.ReflectAdapter.set(target, original != null ? original : prop, value, receiver);
700
+ return _reflect.ReflectAdapter.set(target, original ?? prop, value, receiver);
701
701
  },
702
702
  has(target, prop) {
703
703
  if (typeof prop === "symbol") return _reflect.ReflectAdapter.has(target, prop);
@@ -412,14 +412,13 @@ var require_next_url = __commonJS({
412
412
  options = opts || baseOrOpts || {};
413
413
  }
414
414
  this[Internal] = {
415
- url: parseURL(input, base != null ? base : options.base),
415
+ url: parseURL(input, base ?? options.base),
416
416
  options,
417
417
  basePath: ""
418
418
  };
419
419
  this.analyze();
420
420
  }
421
421
  analyze() {
422
- var _a, _b;
423
422
  var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1;
424
423
  const info = (0, _getnextpathnameinfo.getNextPathnameInfo)(this[Internal].url.pathname, {
425
424
  nextConfig: this[Internal].options.nextConfig,
@@ -431,9 +430,9 @@ var require_next_url = __commonJS({
431
430
  const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale);
432
431
  this[Internal].url.pathname = info.pathname;
433
432
  this[Internal].defaultLocale = defaultLocale;
434
- this[Internal].basePath = (_a = info.basePath) != null ? _a : "";
433
+ this[Internal].basePath = info.basePath ?? "";
435
434
  this[Internal].buildId = info.buildId;
436
- this[Internal].locale = (_b = info.locale) != null ? _b : defaultLocale;
435
+ this[Internal].locale = info.locale ?? defaultLocale;
437
436
  this[Internal].trailingSlash = info.trailingSlash;
438
437
  }
439
438
  formatPathname() {
@@ -456,8 +455,7 @@ var require_next_url = __commonJS({
456
455
  this[Internal].buildId = buildId;
457
456
  }
458
457
  get locale() {
459
- var _a;
460
- return (_a = this[Internal].locale) != null ? _a : "";
458
+ return this[Internal].locale ?? "";
461
459
  }
462
460
  set locale(locale) {
463
461
  var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig;
@@ -1332,8 +1330,7 @@ var require_response = __commonJS({
1332
1330
  return new _NextResponse(response.body, response);
1333
1331
  }
1334
1332
  static redirect(url, init) {
1335
- var _a;
1336
- const status = typeof init === "number" ? init : (_a = init == null ? void 0 : init.status) != null ? _a : 307;
1333
+ const status = typeof init === "number" ? init : (init == null ? void 0 : init.status) ?? 307;
1337
1334
  if (!REDIRECTS.has(status)) {
1338
1335
  throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
1339
1336
  }
@@ -1717,7 +1714,6 @@ var SUPPORTED_IMAGE_TYPES = [
1717
1714
  var createMediaDeliveryHandlers = (config) => {
1718
1715
  return {
1719
1716
  async GET(req, context) {
1720
- var _a, _b;
1721
1717
  try {
1722
1718
  const accountNameMatch = /AccountName=([^;]+)/.exec(
1723
1719
  config.connectionString
@@ -1806,10 +1802,10 @@ var createMediaDeliveryHandlers = (config) => {
1806
1802
  }
1807
1803
  let outputFormat = "jpeg";
1808
1804
  let outputContentType = "image/jpeg";
1809
- if (format === "webp" || format === "auto" && ((_a = req.headers.get("accept")) == null ? void 0 : _a.includes("image/webp"))) {
1805
+ if (format === "webp" || format === "auto" && req.headers.get("accept")?.includes("image/webp")) {
1810
1806
  outputFormat = "webp";
1811
1807
  outputContentType = "image/webp";
1812
- } else if (format === "avif" || format === "auto" && ((_b = req.headers.get("accept")) == null ? void 0 : _b.includes("image/avif"))) {
1808
+ } else if (format === "avif" || format === "auto" && req.headers.get("accept")?.includes("image/avif")) {
1813
1809
  outputFormat = "avif";
1814
1810
  outputContentType = "image/avif";
1815
1811
  }
package/dist/handlers.js CHANGED
@@ -412,14 +412,13 @@ var require_next_url = __commonJS({
412
412
  options = opts || baseOrOpts || {};
413
413
  }
414
414
  this[Internal] = {
415
- url: parseURL(input, base != null ? base : options.base),
415
+ url: parseURL(input, base ?? options.base),
416
416
  options,
417
417
  basePath: ""
418
418
  };
419
419
  this.analyze();
420
420
  }
421
421
  analyze() {
422
- var _a, _b;
423
422
  var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1;
424
423
  const info = (0, _getnextpathnameinfo.getNextPathnameInfo)(this[Internal].url.pathname, {
425
424
  nextConfig: this[Internal].options.nextConfig,
@@ -431,9 +430,9 @@ var require_next_url = __commonJS({
431
430
  const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale);
432
431
  this[Internal].url.pathname = info.pathname;
433
432
  this[Internal].defaultLocale = defaultLocale;
434
- this[Internal].basePath = (_a = info.basePath) != null ? _a : "";
433
+ this[Internal].basePath = info.basePath ?? "";
435
434
  this[Internal].buildId = info.buildId;
436
- this[Internal].locale = (_b = info.locale) != null ? _b : defaultLocale;
435
+ this[Internal].locale = info.locale ?? defaultLocale;
437
436
  this[Internal].trailingSlash = info.trailingSlash;
438
437
  }
439
438
  formatPathname() {
@@ -456,8 +455,7 @@ var require_next_url = __commonJS({
456
455
  this[Internal].buildId = buildId;
457
456
  }
458
457
  get locale() {
459
- var _a;
460
- return (_a = this[Internal].locale) != null ? _a : "";
458
+ return this[Internal].locale ?? "";
461
459
  }
462
460
  set locale(locale) {
463
461
  var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig;
@@ -1332,8 +1330,7 @@ var require_response = __commonJS({
1332
1330
  return new _NextResponse(response.body, response);
1333
1331
  }
1334
1332
  static redirect(url, init) {
1335
- var _a;
1336
- const status = typeof init === "number" ? init : (_a = init == null ? void 0 : init.status) != null ? _a : 307;
1333
+ const status = typeof init === "number" ? init : (init == null ? void 0 : init.status) ?? 307;
1337
1334
  if (!REDIRECTS.has(status)) {
1338
1335
  throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
1339
1336
  }
@@ -1705,7 +1702,7 @@ __export(handlers_exports, {
1705
1702
  });
1706
1703
  module.exports = __toCommonJS(handlers_exports);
1707
1704
  var import_storage_blob = require("@azure/storage-blob");
1708
- var import_node_path = __toESM(require("path"));
1705
+ var import_node_path = __toESM(require("node:path"));
1709
1706
  var import_server = __toESM(require_server());
1710
1707
  var createMediaHandlers = (config) => {
1711
1708
  function withAuth(handler) {
@@ -1773,7 +1770,6 @@ async function deleteAsset(_, context, config) {
1773
1770
  });
1774
1771
  }
1775
1772
  async function listMedia(req, config) {
1776
- var _a;
1777
1773
  try {
1778
1774
  const client = import_storage_blob.BlobServiceClient.fromConnectionString(
1779
1775
  config.connectionString
@@ -1786,7 +1782,7 @@ async function listMedia(req, config) {
1786
1782
  filesOnly: req.nextUrl.searchParams.get("filesOnly") === "true" || false
1787
1783
  };
1788
1784
  const useRootDirectory = !mediaListOptions.directory || mediaListOptions.directory === "/" || mediaListOptions.directory === '""';
1789
- const prefix = useRootDirectory ? "" : ((_a = mediaListOptions.directory) == null ? void 0 : _a.endsWith("/")) ? mediaListOptions.directory : `${mediaListOptions.directory}/`;
1785
+ const prefix = useRootDirectory ? "" : mediaListOptions.directory?.endsWith("/") ? mediaListOptions.directory : `${mediaListOptions.directory}/`;
1790
1786
  const files = [];
1791
1787
  const folders = [];
1792
1788
  for await (const blob of containerClient.listBlobsByHierarchy("/", {
package/dist/index.js CHANGED
@@ -118,9 +118,9 @@
118
118
  };
119
119
  }
120
120
  buildQuery(options) {
121
- const params = Object.keys(options).filter(
122
- (key) => options[key] !== "" && options[key] !== void 0
123
- ).map((key) => `${key}=${options[key]}`).join("&");
121
+ const params = Object.entries(options).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => {
122
+ return typeof value === "object" ? `${key}=${encodeURIComponent(JSON.stringify(value))}` : `${key}=${encodeURIComponent(String(value))}`;
123
+ }).join("&");
124
124
  return `?${params}`;
125
125
  }
126
126
  }
package/dist/index.mjs CHANGED
@@ -115,9 +115,9 @@ class AzureMediaStore {
115
115
  };
116
116
  }
117
117
  buildQuery(options) {
118
- const params = Object.keys(options).filter(
119
- (key) => options[key] !== "" && options[key] !== void 0
120
- ).map((key) => `${key}=${options[key]}`).join("&");
118
+ const params = Object.entries(options).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => {
119
+ return typeof value === "object" ? `${key}=${encodeURIComponent(JSON.stringify(value))}` : `${key}=${encodeURIComponent(String(value))}`;
120
+ }).join("&");
121
121
  return `?${params}`;
122
122
  }
123
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-tinacms-azure",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -38,12 +38,12 @@
38
38
  "react": "^18.3.1",
39
39
  "react-dom": "^18.3.1",
40
40
  "typescript": "^5.7.3",
41
- "@tinacms/scripts": "1.3.4",
42
- "tinacms": "2.7.6"
41
+ "@tinacms/scripts": "1.3.5",
42
+ "tinacms": "2.7.8"
43
43
  },
44
44
  "peerDependencies": {
45
- "tinacms": "2.7.6",
46
- "@tinacms/auth": "1.0.12"
45
+ "@tinacms/auth": "1.0.12",
46
+ "tinacms": "2.7.8"
47
47
  },
48
48
  "publishConfig": {
49
49
  "registry": "https://registry.npmjs.org"