@opengis/gis 0.2.165 → 0.2.167

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,7 +1,7 @@
1
1
  import { defineComponent as F, mergeModels as O, defineAsyncComponent as I, useModel as R, ref as y, watch as K, openBlock as o, createElementBlock as s, createElementVNode as e, createVNode as $, unref as x, withCtx as S, createStaticVNode as V, useSlots as P, computed as H, Fragment as b, createTextVNode as U, createCommentVNode as N, renderList as A, normalizeStyle as Q, toDisplayString as M, normalizeClass as z, withModifiers as X, createBlock as Y, resolveDynamicComponent as ee, withDirectives as te, renderSlot as ne } from "vue";
2
2
  import { notify as E } from "@opengis/core";
3
3
  import { Edit as le, Trash as oe } from "lucide-vue-next";
4
- import { _ as u } from "./index-ClqqnPEd.js";
4
+ import { _ as u } from "./index-CdB0VXro.js";
5
5
  const se = { class: "flex items-center justify-center col-span-3 gap-2" }, re = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, ie = /* @__PURE__ */ F({
6
6
  __name: "vs-datatable-controls",
7
7
  props: /* @__PURE__ */ O({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/gis",
3
- "version": "0.2.165",
3
+ "version": "0.2.167",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "main": "./dist/index.js",
@@ -176,12 +176,14 @@ async function createIcon(options) {
176
176
  return sharp(Buffer.from(svg)).png().toBuffer();
177
177
  }
178
178
 
179
- async function getOrCreateIcon(options) {
179
+ async function getIcon(options, nocache = false) {
180
180
  await iconDirectoryReady;
181
181
 
182
182
  const iconPath = path.join(iconDirectory, options.filename);
183
- const cachedIcon = await readFileIfExists(iconPath);
184
- if (cachedIcon) return cachedIcon;
183
+ if (!nocache) {
184
+ const cachedIcon = await readFileIfExists(iconPath);
185
+ if (cachedIcon) return cachedIcon;
186
+ }
185
187
 
186
188
  const icon = await createIcon(options);
187
189
  if (!icon) return null;
@@ -194,11 +196,12 @@ export default async function gisIconApi(req, reply) {
194
196
  const options = parseIconFilename(req.params?.['*'] || '');
195
197
  if (!options) return reply.status(400).send('invalid icon name');
196
198
 
197
- const image = await getOrCreateIcon(options);
199
+ const nocache = !!req.query?.nocache;
200
+ const image = await getIcon(options, nocache);
198
201
  if (!image) return reply.status(404).send('icon not found');
199
202
 
200
203
  return reply
201
204
  .type(contentTypeByFormat[options.format])
202
- .header('Cache-Control', 'public, max-age=31536000, immutable')
205
+ .header('Cache-Control', nocache ? 'no-cache' : 'public, max-age=31536000, immutable')
203
206
  .send(image);
204
207
  }