@webiny/utils
Advanced tools
+1
-8
@@ -1,9 +0,2 @@ | ||
| /// <reference types="node" /> | ||
| import type { BinaryToTextEncoding } from "crypto"; | ||
| export type ICacheKeyKeys = Record<string, any> | string | number; | ||
| export interface ICacheKeyOptions { | ||
| algorithm?: CacheKeyAlgorithmType; | ||
| encoding?: BinaryToTextEncoding; | ||
| } | ||
| export type CacheKeyAlgorithmType = "md5" | "sha1" | "sha224" | "sha256" | "sha384" | "sha512"; | ||
| export declare const createCacheKey: (input: ICacheKeyKeys, options?: ICacheKeyOptions) => string; | ||
| export declare const createCacheKey: (input: ICacheKeyKeys) => string; |
+5
-11
@@ -1,9 +0,3 @@ | ||
| "use strict"; | ||
| var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.createCacheKey = void 0; | ||
| var _crypto = _interopRequireDefault(require("crypto")); | ||
| import { sha256 } from "@noble/hashes/sha2.js"; | ||
| import { utf8ToBytes, bytesToHex } from "@noble/hashes/utils.js"; | ||
| const getCacheKey = input => { | ||
@@ -17,8 +11,8 @@ if (typeof input === "string") { | ||
| }; | ||
| const createCacheKey = (input, options) => { | ||
| export const createCacheKey = input => { | ||
| const key = getCacheKey(input); | ||
| return _crypto.default.createHash(options?.algorithm || "sha1").update(key).digest(options?.encoding || "hex"); | ||
| const hash = sha256(utf8ToBytes(key)); | ||
| return bytesToHex(hash); | ||
| }; | ||
| exports.createCacheKey = createCacheKey; | ||
| //# sourceMappingURL=cacheKey.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_crypto","_interopRequireDefault","require","getCacheKey","input","JSON","stringify","createCacheKey","options","key","crypto","createHash","algorithm","update","digest","encoding","exports"],"sources":["cacheKey.ts"],"sourcesContent":["import type { BinaryToTextEncoding } from \"crypto\";\nimport crypto from \"crypto\";\n\nexport type ICacheKeyKeys = Record<string, any> | string | number;\n\nexport interface ICacheKeyOptions {\n algorithm?: CacheKeyAlgorithmType;\n encoding?: BinaryToTextEncoding;\n}\n\nexport type CacheKeyAlgorithmType = \"md5\" | \"sha1\" | \"sha224\" | \"sha256\" | \"sha384\" | \"sha512\";\n\nconst getCacheKey = (input: ICacheKeyKeys): string => {\n if (typeof input === \"string\") {\n return input;\n } else if (typeof input === \"number\") {\n return `${input}`;\n }\n return JSON.stringify(input);\n};\n\nexport const createCacheKey = (input: ICacheKeyKeys, options?: ICacheKeyOptions): string => {\n const key = getCacheKey(input);\n return crypto\n .createHash(options?.algorithm || \"sha1\")\n .update(key)\n .digest(options?.encoding || \"hex\");\n};\n"],"mappings":";;;;;;;AACA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAWA,MAAMC,WAAW,GAAIC,KAAoB,IAAa;EAClD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAClC,OAAO,GAAGA,KAAK,EAAE;EACrB;EACA,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;AAChC,CAAC;AAEM,MAAMG,cAAc,GAAGA,CAACH,KAAoB,EAAEI,OAA0B,KAAa;EACxF,MAAMC,GAAG,GAAGN,WAAW,CAACC,KAAK,CAAC;EAC9B,OAAOM,eAAM,CACRC,UAAU,CAACH,OAAO,EAAEI,SAAS,IAAI,MAAM,CAAC,CACxCC,MAAM,CAACJ,GAAG,CAAC,CACXK,MAAM,CAACN,OAAO,EAAEO,QAAQ,IAAI,KAAK,CAAC;AAC3C,CAAC;AAACC,OAAA,CAAAT,cAAA,GAAAA,cAAA","ignoreList":[]} | ||
| {"version":3,"names":["sha256","utf8ToBytes","bytesToHex","getCacheKey","input","JSON","stringify","createCacheKey","key","hash"],"sources":["cacheKey.ts"],"sourcesContent":["import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { utf8ToBytes, bytesToHex } from \"@noble/hashes/utils.js\";\n\nexport type ICacheKeyKeys = Record<string, any> | string | number;\n\nconst getCacheKey = (input: ICacheKeyKeys): string => {\n if (typeof input === \"string\") {\n return input;\n } else if (typeof input === \"number\") {\n return `${input}`;\n }\n return JSON.stringify(input);\n};\n\nexport const createCacheKey = (input: ICacheKeyKeys): string => {\n const key = getCacheKey(input);\n\n const hash = sha256(utf8ToBytes(key));\n\n return bytesToHex(hash);\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,WAAW,EAAEC,UAAU,QAAQ,wBAAwB;AAIhE,MAAMC,WAAW,GAAIC,KAAoB,IAAa;EAClD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAClC,OAAO,GAAGA,KAAK,EAAE;EACrB;EACA,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;AAChC,CAAC;AAED,OAAO,MAAMG,cAAc,GAAIH,KAAoB,IAAa;EAC5D,MAAMI,GAAG,GAAGL,WAAW,CAACC,KAAK,CAAC;EAE9B,MAAMK,IAAI,GAAGT,MAAM,CAACC,WAAW,CAACO,GAAG,CAAC,CAAC;EAErC,OAAON,UAAU,CAACO,IAAI,CAAC;AAC3B,CAAC","ignoreList":[]} |
+2
-9
@@ -1,9 +0,2 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.composeAsync = composeAsync; | ||
| exports.composeSync = composeSync; | ||
| function composeAsync(functions = []) { | ||
| export function composeAsync(functions = []) { | ||
| return input => { | ||
@@ -25,3 +18,3 @@ if (!functions.length) { | ||
| } | ||
| function composeSync(functions = []) { | ||
| export function composeSync(functions = []) { | ||
| return input => { | ||
@@ -28,0 +21,0 @@ if (!functions.length) { |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["composeAsync","functions","input","length","Promise","resolve","index","next","fn","composeSync"],"sources":["compose.ts"],"sourcesContent":["export interface NextAsyncProcessor<TInput, TOutput> {\n (input: TInput): Promise<TOutput>;\n}\n\nexport interface AsyncProcessor<TInput, TOutput = TInput> {\n (next: NextAsyncProcessor<TInput, TOutput>): NextAsyncProcessor<TInput, TOutput>;\n}\n\nexport interface NextSyncProcessor<TInput, TOutput = TInput> {\n (input: TInput): TOutput;\n}\n\nexport interface SyncProcessor<TInput, TOutput = TInput> {\n (next: NextSyncProcessor<TInput, TOutput>): NextSyncProcessor<TInput, TOutput>;\n}\n\nexport function composeAsync<TInput = unknown, TOutput = TInput>(\n functions: Array<AsyncProcessor<TInput, TOutput>> = []\n): NextAsyncProcessor<TInput, TOutput> {\n return (input: TInput): Promise<TOutput> => {\n if (!functions.length) {\n return Promise.resolve(input as unknown as TOutput);\n }\n\n let index = -1;\n\n const next: NextAsyncProcessor<TInput, TOutput> = async input => {\n index++;\n\n const fn = functions[index];\n if (!fn) {\n return input as unknown as TOutput;\n }\n\n return fn(next)(input);\n };\n\n return next(input);\n };\n}\n\nexport function composeSync<TInput = unknown, TOutput = TInput>(\n functions: Array<SyncProcessor<TInput, TOutput>> = []\n): NextSyncProcessor<TInput, TOutput> {\n return (input: TInput): TOutput => {\n if (!functions.length) {\n return input as unknown as TOutput;\n }\n\n // Create a clone of function chain to prevent modifying the original array with `shift()`\n let index = -1;\n\n const next: NextSyncProcessor<TInput, TOutput> = input => {\n index++;\n\n const fn = functions[index];\n if (!fn) {\n return input as unknown as TOutput;\n }\n\n return fn(next)(input);\n };\n\n return next(input);\n };\n}\n"],"mappings":";;;;;;;AAgBO,SAASA,YAAYA,CACxBC,SAAiD,GAAG,EAAE,EACnB;EACnC,OAAQC,KAAa,IAAuB;IACxC,IAAI,CAACD,SAAS,CAACE,MAAM,EAAE;MACnB,OAAOC,OAAO,CAACC,OAAO,CAACH,KAA2B,CAAC;IACvD;IAEA,IAAII,KAAK,GAAG,CAAC,CAAC;IAEd,MAAMC,IAAyC,GAAG,MAAML,KAAK,IAAI;MAC7DI,KAAK,EAAE;MAEP,MAAME,EAAE,GAAGP,SAAS,CAACK,KAAK,CAAC;MAC3B,IAAI,CAACE,EAAE,EAAE;QACL,OAAON,KAAK;MAChB;MAEA,OAAOM,EAAE,CAACD,IAAI,CAAC,CAACL,KAAK,CAAC;IAC1B,CAAC;IAED,OAAOK,IAAI,CAACL,KAAK,CAAC;EACtB,CAAC;AACL;AAEO,SAASO,WAAWA,CACvBR,SAAgD,GAAG,EAAE,EACnB;EAClC,OAAQC,KAAa,IAAc;IAC/B,IAAI,CAACD,SAAS,CAACE,MAAM,EAAE;MACnB,OAAOD,KAAK;IAChB;;IAEA;IACA,IAAII,KAAK,GAAG,CAAC,CAAC;IAEd,MAAMC,IAAwC,GAAGL,KAAK,IAAI;MACtDI,KAAK,EAAE;MAEP,MAAME,EAAE,GAAGP,SAAS,CAACK,KAAK,CAAC;MAC3B,IAAI,CAACE,EAAE,EAAE;QACL,OAAON,KAAK;MAChB;MAEA,OAAOM,EAAE,CAACD,IAAI,CAAC,CAACL,KAAK,CAAC;IAC1B,CAAC;IAED,OAAOK,IAAI,CAACL,KAAK,CAAC;EACtB,CAAC;AACL","ignoreList":[]} | ||
| {"version":3,"names":["composeAsync","functions","input","length","Promise","resolve","index","next","fn","composeSync"],"sources":["compose.ts"],"sourcesContent":["export interface NextAsyncProcessor<TInput, TOutput> {\n (input: TInput): Promise<TOutput>;\n}\n\nexport interface AsyncProcessor<TInput, TOutput = TInput> {\n (next: NextAsyncProcessor<TInput, TOutput>): NextAsyncProcessor<TInput, TOutput>;\n}\n\nexport interface NextSyncProcessor<TInput, TOutput = TInput> {\n (input: TInput): TOutput;\n}\n\nexport interface SyncProcessor<TInput, TOutput = TInput> {\n (next: NextSyncProcessor<TInput, TOutput>): NextSyncProcessor<TInput, TOutput>;\n}\n\nexport function composeAsync<TInput = unknown, TOutput = TInput>(\n functions: Array<AsyncProcessor<TInput, TOutput>> = []\n): NextAsyncProcessor<TInput, TOutput> {\n return (input: TInput): Promise<TOutput> => {\n if (!functions.length) {\n return Promise.resolve(input as unknown as TOutput);\n }\n\n let index = -1;\n\n const next: NextAsyncProcessor<TInput, TOutput> = async input => {\n index++;\n\n const fn = functions[index];\n if (!fn) {\n return input as unknown as TOutput;\n }\n\n return fn(next)(input);\n };\n\n return next(input);\n };\n}\n\nexport function composeSync<TInput = unknown, TOutput = TInput>(\n functions: Array<SyncProcessor<TInput, TOutput>> = []\n): NextSyncProcessor<TInput, TOutput> {\n return (input: TInput): TOutput => {\n if (!functions.length) {\n return input as unknown as TOutput;\n }\n\n // Create a clone of function chain to prevent modifying the original array with `shift()`\n let index = -1;\n\n const next: NextSyncProcessor<TInput, TOutput> = input => {\n index++;\n\n const fn = functions[index];\n if (!fn) {\n return input as unknown as TOutput;\n }\n\n return fn(next)(input);\n };\n\n return next(input);\n };\n}\n"],"mappings":"AAgBA,OAAO,SAASA,YAAYA,CACxBC,SAAiD,GAAG,EAAE,EACnB;EACnC,OAAQC,KAAa,IAAuB;IACxC,IAAI,CAACD,SAAS,CAACE,MAAM,EAAE;MACnB,OAAOC,OAAO,CAACC,OAAO,CAACH,KAA2B,CAAC;IACvD;IAEA,IAAII,KAAK,GAAG,CAAC,CAAC;IAEd,MAAMC,IAAyC,GAAG,MAAML,KAAK,IAAI;MAC7DI,KAAK,EAAE;MAEP,MAAME,EAAE,GAAGP,SAAS,CAACK,KAAK,CAAC;MAC3B,IAAI,CAACE,EAAE,EAAE;QACL,OAAON,KAAK;MAChB;MAEA,OAAOM,EAAE,CAACD,IAAI,CAAC,CAACL,KAAK,CAAC;IAC1B,CAAC;IAED,OAAOK,IAAI,CAACL,KAAK,CAAC;EACtB,CAAC;AACL;AAEA,OAAO,SAASO,WAAWA,CACvBR,SAAgD,GAAG,EAAE,EACnB;EAClC,OAAQC,KAAa,IAAc;IAC/B,IAAI,CAACD,SAAS,CAACE,MAAM,EAAE;MACnB,OAAOD,KAAK;IAChB;;IAEA;IACA,IAAII,KAAK,GAAG,CAAC,CAAC;IAEd,MAAMC,IAAwC,GAAGL,KAAK,IAAI;MACtDI,KAAK,EAAE;MAEP,MAAME,EAAE,GAAGP,SAAS,CAACK,KAAK,CAAC;MAC3B,IAAI,CAACE,EAAE,EAAE;QACL,OAAON,KAAK;MAChB;MAEA,OAAOM,EAAE,CAACD,IAAI,CAAC,CAACL,KAAK,CAAC;IAC1B,CAAC;IAED,OAAOK,IAAI,CAACL,KAAK,CAAC;EACtB,CAAC;AACL","ignoreList":[]} |
@@ -1,13 +0,6 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.CompressionPlugin = void 0; | ||
| var _plugins = require("@webiny/plugins"); | ||
| class CompressionPlugin extends _plugins.Plugin { | ||
| import { Plugin } from "@webiny/plugins"; | ||
| export class CompressionPlugin extends Plugin { | ||
| static type = "utils.compression"; | ||
| } | ||
| exports.CompressionPlugin = CompressionPlugin; | ||
| //# sourceMappingURL=CompressionPlugin.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_plugins","require","CompressionPlugin","Plugin","type","exports"],"sources":["CompressionPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ICompressedValue {\n compression: string;\n value: string;\n}\n\nexport abstract class CompressionPlugin extends Plugin {\n public static override type: string = \"utils.compression\";\n public abstract canCompress(data: any): boolean;\n public abstract compress(data: any): Promise<ICompressedValue>;\n public abstract canDecompress(data: ICompressedValue | unknown): boolean;\n public abstract decompress(data: ICompressedValue | unknown): Promise<any>;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAeC,iBAAiB,SAASC,eAAM,CAAC;EACnD,OAAuBC,IAAI,GAAW,mBAAmB;AAK7D;AAACC,OAAA,CAAAH,iBAAA,GAAAA,iBAAA","ignoreList":[]} | ||
| {"version":3,"names":["Plugin","CompressionPlugin","type"],"sources":["CompressionPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ICompressedValue {\n compression: string;\n value: string;\n}\n\nexport abstract class CompressionPlugin extends Plugin {\n public static override type: string = \"utils.compression\";\n public abstract canCompress(data: any): boolean;\n public abstract compress(data: any): Promise<ICompressedValue>;\n public abstract canDecompress(data: ICompressedValue | unknown): boolean;\n public abstract decompress(data: ICompressedValue | unknown): Promise<any>;\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,iBAAiB;AAOxC,OAAO,MAAeC,iBAAiB,SAASD,MAAM,CAAC;EACnD,OAAuBE,IAAI,GAAW,mBAAmB;AAK7D","ignoreList":[]} |
| import type { PluginsContainer } from "@webiny/plugins"; | ||
| import { type ICompressedValue } from "./CompressionPlugin"; | ||
| import { type ICompressedValue } from "./CompressionPlugin.js"; | ||
| export interface ICompressorParams { | ||
@@ -4,0 +4,0 @@ plugins: PluginsContainer; |
@@ -1,14 +0,8 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.createDefaultCompressor = void 0; | ||
| var _CompressionPlugin = require("./CompressionPlugin"); | ||
| var _GzipCompression = require("./plugins/GzipCompression"); | ||
| var _JsonpackCompression = require("./plugins/JsonpackCompression"); | ||
| import { CompressionPlugin } from "./CompressionPlugin.js"; | ||
| import { createGzipCompression } from "./plugins/GzipCompression.js"; | ||
| import { createJsonpackCompression } from "./plugins/JsonpackCompression.js"; | ||
| class Compressor { | ||
| disabled = new Set(); | ||
| get plugins() { | ||
| return this._plugins.byType(_CompressionPlugin.CompressionPlugin.type).reverse(); | ||
| return this._plugins.byType(CompressionPlugin.type).reverse(); | ||
| } | ||
@@ -59,7 +53,7 @@ constructor(params) { | ||
| } | ||
| const createDefaultCompressor = params => { | ||
| export const createDefaultCompressor = params => { | ||
| const { | ||
| plugins | ||
| } = params; | ||
| plugins.register([(0, _JsonpackCompression.createJsonpackCompression)(), (0, _GzipCompression.createGzipCompression)()]); | ||
| plugins.register([createJsonpackCompression(), createGzipCompression()]); | ||
| return new Compressor({ | ||
@@ -69,4 +63,3 @@ plugins | ||
| }; | ||
| exports.createDefaultCompressor = createDefaultCompressor; | ||
| //# sourceMappingURL=Compressor.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_CompressionPlugin","require","_GzipCompression","_JsonpackCompression","Compressor","disabled","Set","plugins","_plugins","byType","CompressionPlugin","type","reverse","constructor","params","disable","name","add","enable","delete","compress","data","plugin","has","canCompress","ex","console","error","log","decompress","canDecompress","createDefaultCompressor","register","createJsonpackCompression","createGzipCompression","exports"],"sources":["Compressor.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport { CompressionPlugin, type ICompressedValue } from \"./CompressionPlugin\";\nimport { createGzipCompression } from \"./plugins/GzipCompression\";\nimport { createJsonpackCompression } from \"./plugins/JsonpackCompression\";\n\nexport interface ICompressorParams {\n plugins: PluginsContainer;\n}\n\nexport interface ICompressor {\n disable(name: string): void;\n enable(name: string): void;\n /**\n * Compresses the given data using the first plugin that can compress it.\n */\n compress<T = unknown>(data: T): Promise<T | ICompressedValue>;\n /**\n * Decompresses the given data using the first plugin that can decompress it.\n */\n decompress<T = unknown>(data: ICompressedValue | unknown): Promise<T>;\n}\n\nclass Compressor implements ICompressor {\n private readonly _plugins: PluginsContainer;\n\n private readonly disabled: Set<string> = new Set();\n\n private get plugins(): CompressionPlugin[] {\n return this._plugins.byType<CompressionPlugin>(CompressionPlugin.type).reverse();\n }\n\n public constructor(params: ICompressorParams) {\n this._plugins = params.plugins;\n }\n\n public disable(name: string): void {\n this.disabled.add(name);\n }\n\n public enable(name: string): void {\n this.disabled.delete(name);\n }\n\n public async compress<T = unknown>(data: T): Promise<T | ICompressedValue> {\n for (const plugin of this.plugins) {\n /**\n * We skip disabled plugins.\n */\n if (plugin.name && this.disabled.has(plugin.name)) {\n continue;\n }\n if (plugin.canCompress(data) === false) {\n continue;\n }\n try {\n return await plugin.compress(data);\n } catch (ex) {\n console.error(\n `Could not compress given data. More info in next line. Trying next plugin.`\n );\n console.log(ex);\n }\n }\n return data;\n }\n\n public async decompress<T = unknown>(data: ICompressedValue | unknown): Promise<T> {\n for (const plugin of this.plugins) {\n if (plugin.canDecompress(data) === false) {\n continue;\n }\n try {\n return await plugin.decompress(data);\n } catch (ex) {\n console.error(\n `Could not decompress given data. More info in next line. Trying next plugin.`\n );\n console.log(ex);\n }\n }\n return data as T;\n }\n}\n\nexport const createDefaultCompressor = (params: ICompressorParams) => {\n const { plugins } = params;\n plugins.register([createJsonpackCompression(), createGzipCompression()]);\n return new Compressor({\n plugins\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAmBA,MAAMG,UAAU,CAAwB;EAGnBC,QAAQ,GAAgB,IAAIC,GAAG,CAAC,CAAC;EAElD,IAAYC,OAAOA,CAAA,EAAwB;IACvC,OAAO,IAAI,CAACC,QAAQ,CAACC,MAAM,CAAoBC,oCAAiB,CAACC,IAAI,CAAC,CAACC,OAAO,CAAC,CAAC;EACpF;EAEOC,WAAWA,CAACC,MAAyB,EAAE;IAC1C,IAAI,CAACN,QAAQ,GAAGM,MAAM,CAACP,OAAO;EAClC;EAEOQ,OAAOA,CAACC,IAAY,EAAQ;IAC/B,IAAI,CAACX,QAAQ,CAACY,GAAG,CAACD,IAAI,CAAC;EAC3B;EAEOE,MAAMA,CAACF,IAAY,EAAQ;IAC9B,IAAI,CAACX,QAAQ,CAACc,MAAM,CAACH,IAAI,CAAC;EAC9B;EAEA,MAAaI,QAAQA,CAAcC,IAAO,EAAiC;IACvE,KAAK,MAAMC,MAAM,IAAI,IAAI,CAACf,OAAO,EAAE;MAC/B;AACZ;AACA;MACY,IAAIe,MAAM,CAACN,IAAI,IAAI,IAAI,CAACX,QAAQ,CAACkB,GAAG,CAACD,MAAM,CAACN,IAAI,CAAC,EAAE;QAC/C;MACJ;MACA,IAAIM,MAAM,CAACE,WAAW,CAACH,IAAI,CAAC,KAAK,KAAK,EAAE;QACpC;MACJ;MACA,IAAI;QACA,OAAO,MAAMC,MAAM,CAACF,QAAQ,CAACC,IAAI,CAAC;MACtC,CAAC,CAAC,OAAOI,EAAE,EAAE;QACTC,OAAO,CAACC,KAAK,CACT,4EACJ,CAAC;QACDD,OAAO,CAACE,GAAG,CAACH,EAAE,CAAC;MACnB;IACJ;IACA,OAAOJ,IAAI;EACf;EAEA,MAAaQ,UAAUA,CAAcR,IAAgC,EAAc;IAC/E,KAAK,MAAMC,MAAM,IAAI,IAAI,CAACf,OAAO,EAAE;MAC/B,IAAIe,MAAM,CAACQ,aAAa,CAACT,IAAI,CAAC,KAAK,KAAK,EAAE;QACtC;MACJ;MACA,IAAI;QACA,OAAO,MAAMC,MAAM,CAACO,UAAU,CAACR,IAAI,CAAC;MACxC,CAAC,CAAC,OAAOI,EAAE,EAAE;QACTC,OAAO,CAACC,KAAK,CACT,8EACJ,CAAC;QACDD,OAAO,CAACE,GAAG,CAACH,EAAE,CAAC;MACnB;IACJ;IACA,OAAOJ,IAAI;EACf;AACJ;AAEO,MAAMU,uBAAuB,GAAIjB,MAAyB,IAAK;EAClE,MAAM;IAAEP;EAAQ,CAAC,GAAGO,MAAM;EAC1BP,OAAO,CAACyB,QAAQ,CAAC,CAAC,IAAAC,8CAAyB,EAAC,CAAC,EAAE,IAAAC,sCAAqB,EAAC,CAAC,CAAC,CAAC;EACxE,OAAO,IAAI9B,UAAU,CAAC;IAClBG;EACJ,CAAC,CAAC;AACN,CAAC;AAAC4B,OAAA,CAAAJ,uBAAA,GAAAA,uBAAA","ignoreList":[]} | ||
| {"version":3,"names":["CompressionPlugin","createGzipCompression","createJsonpackCompression","Compressor","disabled","Set","plugins","_plugins","byType","type","reverse","constructor","params","disable","name","add","enable","delete","compress","data","plugin","has","canCompress","ex","console","error","log","decompress","canDecompress","createDefaultCompressor","register"],"sources":["Compressor.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport { CompressionPlugin, type ICompressedValue } from \"./CompressionPlugin.js\";\nimport { createGzipCompression } from \"./plugins/GzipCompression.js\";\nimport { createJsonpackCompression } from \"./plugins/JsonpackCompression.js\";\n\nexport interface ICompressorParams {\n plugins: PluginsContainer;\n}\n\nexport interface ICompressor {\n disable(name: string): void;\n enable(name: string): void;\n /**\n * Compresses the given data using the first plugin that can compress it.\n */\n compress<T = unknown>(data: T): Promise<T | ICompressedValue>;\n /**\n * Decompresses the given data using the first plugin that can decompress it.\n */\n decompress<T = unknown>(data: ICompressedValue | unknown): Promise<T>;\n}\n\nclass Compressor implements ICompressor {\n private readonly _plugins: PluginsContainer;\n\n private readonly disabled: Set<string> = new Set();\n\n private get plugins(): CompressionPlugin[] {\n return this._plugins.byType<CompressionPlugin>(CompressionPlugin.type).reverse();\n }\n\n public constructor(params: ICompressorParams) {\n this._plugins = params.plugins;\n }\n\n public disable(name: string): void {\n this.disabled.add(name);\n }\n\n public enable(name: string): void {\n this.disabled.delete(name);\n }\n\n public async compress<T = unknown>(data: T): Promise<T | ICompressedValue> {\n for (const plugin of this.plugins) {\n /**\n * We skip disabled plugins.\n */\n if (plugin.name && this.disabled.has(plugin.name)) {\n continue;\n }\n if (plugin.canCompress(data) === false) {\n continue;\n }\n try {\n return await plugin.compress(data);\n } catch (ex) {\n console.error(\n `Could not compress given data. More info in next line. Trying next plugin.`\n );\n console.log(ex);\n }\n }\n return data;\n }\n\n public async decompress<T = unknown>(data: ICompressedValue | unknown): Promise<T> {\n for (const plugin of this.plugins) {\n if (plugin.canDecompress(data) === false) {\n continue;\n }\n try {\n return await plugin.decompress(data);\n } catch (ex) {\n console.error(\n `Could not decompress given data. More info in next line. Trying next plugin.`\n );\n console.log(ex);\n }\n }\n return data as T;\n }\n}\n\nexport const createDefaultCompressor = (params: ICompressorParams) => {\n const { plugins } = params;\n plugins.register([createJsonpackCompression(), createGzipCompression()]);\n return new Compressor({\n plugins\n });\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AM,CAACQ,aAAa,CAACT,IAAI,CAAC,KAAK,KAAK,EAAE;QACtC;MACJ;MACA,IAAI;QACA,OAAO,MAAMC,MAAM,CAACO,UAAU,CAACR,IAAI,CAAC;MACxC,CAAC,CAAC,OAAOI,EAAE,EAAE;QACTC,OAAO,CAACC,KAAK,CACT,8EACJ,CAAC;QACDD,OAAO,CAACE,GAAG,CAACH,EAAE,CAAC;MACnB;IACJ;IACA,OAAOJ,IAAI;EACf;AACJ;AAEA,OAAO,MAAMU,uBAAuB,GAAIjB,MAAyB,IAAK;EAClE,MAAM;IAAEN;EAAQ,CAAC,GAAGM,MAAM;EAC1BN,OAAO,CAACwB,QAAQ,CAAC,CAAC5B,yBAAyB,CAAC,CAAC,EAAED,qBAAqB,CAAC,CAAC,CAAC,CAAC;EACxE,OAAO,IAAIE,UAAU,CAAC;IAClBG;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]} |
@@ -1,6 +0,3 @@ | ||
| /// <reference types="node" /> | ||
| /// <reference types="node" /> | ||
| /// <reference types="node" /> | ||
| import zlib from "zlib"; | ||
| export declare const compress: (input: zlib.InputType, options?: zlib.ZlibOptions) => Promise<Buffer>; | ||
| export declare const decompress: (input: zlib.InputType, options?: zlib.ZlibOptions) => Promise<Buffer>; |
+5
-14
@@ -1,12 +0,5 @@ | ||
| "use strict"; | ||
| var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.decompress = exports.compress = void 0; | ||
| var _zlib = _interopRequireDefault(require("zlib")); | ||
| const compress = (input, options) => { | ||
| import zlib from "zlib"; | ||
| export const compress = (input, options) => { | ||
| return new Promise(function (resolve, reject) { | ||
| _zlib.default.gzip(input, options || {}, function (error, result) { | ||
| zlib.gzip(input, options || {}, function (error, result) { | ||
| if (!error) { | ||
@@ -20,6 +13,5 @@ resolve(result); | ||
| }; | ||
| exports.compress = compress; | ||
| const decompress = (input, options) => { | ||
| export const decompress = (input, options) => { | ||
| return new Promise(function (resolve, reject) { | ||
| _zlib.default.gunzip(input, options || {}, function (error, result) { | ||
| zlib.gunzip(input, options || {}, function (error, result) { | ||
| if (!error) { | ||
@@ -33,4 +25,3 @@ resolve(result); | ||
| }; | ||
| exports.decompress = decompress; | ||
| //# sourceMappingURL=gzip.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_zlib","_interopRequireDefault","require","compress","input","options","Promise","resolve","reject","zlib","gzip","error","result","exports","decompress","gunzip"],"sources":["gzip.ts"],"sourcesContent":["import zlib from \"zlib\";\n\nexport const compress = (input: zlib.InputType, options?: zlib.ZlibOptions): Promise<Buffer> => {\n return new Promise(function (resolve, reject) {\n zlib.gzip(input, options || {}, function (error, result) {\n if (!error) {\n resolve(result);\n } else {\n reject(error);\n }\n });\n });\n};\nexport const decompress = (input: zlib.InputType, options?: zlib.ZlibOptions): Promise<Buffer> => {\n return new Promise(function (resolve, reject) {\n zlib.gunzip(input, options || {}, function (error, result) {\n if (!error) {\n resolve(result);\n } else {\n reject(error);\n }\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,MAAMC,QAAQ,GAAGA,CAACC,KAAqB,EAAEC,OAA0B,KAAsB;EAC5F,OAAO,IAAIC,OAAO,CAAC,UAAUC,OAAO,EAAEC,MAAM,EAAE;IAC1CC,aAAI,CAACC,IAAI,CAACN,KAAK,EAAEC,OAAO,IAAI,CAAC,CAAC,EAAE,UAAUM,KAAK,EAAEC,MAAM,EAAE;MACrD,IAAI,CAACD,KAAK,EAAE;QACRJ,OAAO,CAACK,MAAM,CAAC;MACnB,CAAC,MAAM;QACHJ,MAAM,CAACG,KAAK,CAAC;MACjB;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAV,QAAA,GAAAA,QAAA;AACK,MAAMW,UAAU,GAAGA,CAACV,KAAqB,EAAEC,OAA0B,KAAsB;EAC9F,OAAO,IAAIC,OAAO,CAAC,UAAUC,OAAO,EAAEC,MAAM,EAAE;IAC1CC,aAAI,CAACM,MAAM,CAACX,KAAK,EAAEC,OAAO,IAAI,CAAC,CAAC,EAAE,UAAUM,KAAK,EAAEC,MAAM,EAAE;MACvD,IAAI,CAACD,KAAK,EAAE;QACRJ,OAAO,CAACK,MAAM,CAAC;MACnB,CAAC,MAAM;QACHJ,MAAM,CAACG,KAAK,CAAC;MACjB;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAC,UAAA,GAAAA,UAAA","ignoreList":[]} | ||
| {"version":3,"names":["zlib","compress","input","options","Promise","resolve","reject","gzip","error","result","decompress","gunzip"],"sources":["gzip.ts"],"sourcesContent":["import zlib from \"zlib\";\n\nexport const compress = (input: zlib.InputType, options?: zlib.ZlibOptions): Promise<Buffer> => {\n return new Promise(function (resolve, reject) {\n zlib.gzip(input, options || {}, function (error, result) {\n if (!error) {\n resolve(result);\n } else {\n reject(error);\n }\n });\n });\n};\nexport const decompress = (input: zlib.InputType, options?: zlib.ZlibOptions): Promise<Buffer> => {\n return new Promise(function (resolve, reject) {\n zlib.gunzip(input, options || {}, function (error, result) {\n if (!error) {\n resolve(result);\n } else {\n reject(error);\n }\n });\n });\n};\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AAEvB,OAAO,MAAMC,QAAQ,GAAGA,CAACC,KAAqB,EAAEC,OAA0B,KAAsB;EAC5F,OAAO,IAAIC,OAAO,CAAC,UAAUC,OAAO,EAAEC,MAAM,EAAE;IAC1CN,IAAI,CAACO,IAAI,CAACL,KAAK,EAAEC,OAAO,IAAI,CAAC,CAAC,EAAE,UAAUK,KAAK,EAAEC,MAAM,EAAE;MACrD,IAAI,CAACD,KAAK,EAAE;QACRH,OAAO,CAACI,MAAM,CAAC;MACnB,CAAC,MAAM;QACHH,MAAM,CAACE,KAAK,CAAC;MACjB;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AACD,OAAO,MAAME,UAAU,GAAGA,CAACR,KAAqB,EAAEC,OAA0B,KAAsB;EAC9F,OAAO,IAAIC,OAAO,CAAC,UAAUC,OAAO,EAAEC,MAAM,EAAE;IAC1CN,IAAI,CAACW,MAAM,CAACT,KAAK,EAAEC,OAAO,IAAI,CAAC,CAAC,EAAE,UAAUK,KAAK,EAAEC,MAAM,EAAE;MACvD,IAAI,CAACD,KAAK,EAAE;QACRH,OAAO,CAACI,MAAM,CAAC;MACnB,CAAC,MAAM;QACHH,MAAM,CAACE,KAAK,CAAC;MACjB;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC","ignoreList":[]} |
@@ -1,4 +0,4 @@ | ||
| export * from "./Compressor"; | ||
| export * from "./CompressionPlugin"; | ||
| export * from "./plugins/GzipCompression"; | ||
| export * from "./plugins/JsonpackCompression"; | ||
| export * from "./Compressor.js"; | ||
| export * from "./CompressionPlugin.js"; | ||
| export * from "./plugins/GzipCompression.js"; | ||
| export * from "./plugins/JsonpackCompression.js"; |
+4
-49
@@ -1,51 +0,6 @@ | ||
| "use strict"; | ||
| export * from "./Compressor.js"; | ||
| export * from "./CompressionPlugin.js"; | ||
| export * from "./plugins/GzipCompression.js"; | ||
| export * from "./plugins/JsonpackCompression.js"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| var _Compressor = require("./Compressor"); | ||
| Object.keys(_Compressor).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (key in exports && exports[key] === _Compressor[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _Compressor[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _CompressionPlugin = require("./CompressionPlugin"); | ||
| Object.keys(_CompressionPlugin).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (key in exports && exports[key] === _CompressionPlugin[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _CompressionPlugin[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _GzipCompression = require("./plugins/GzipCompression"); | ||
| Object.keys(_GzipCompression).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (key in exports && exports[key] === _GzipCompression[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _GzipCompression[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _JsonpackCompression = require("./plugins/JsonpackCompression"); | ||
| Object.keys(_JsonpackCompression).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (key in exports && exports[key] === _JsonpackCompression[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _JsonpackCompression[key]; | ||
| } | ||
| }); | ||
| }); | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_Compressor","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CompressionPlugin","_GzipCompression","_JsonpackCompression"],"sources":["index.ts"],"sourcesContent":["export * from \"./Compressor\";\nexport * from \"./CompressionPlugin\";\nexport * from \"./plugins/GzipCompression\";\nexport * from \"./plugins/JsonpackCompression\";\n"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,kBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,kBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,kBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,kBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,gBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,gBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,gBAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,gBAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,oBAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,oBAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,oBAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,oBAAA,CAAAP,GAAA;IAAA;EAAA;AAAA","ignoreList":[]} | ||
| {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Compressor.js\";\nexport * from \"./CompressionPlugin.js\";\nexport * from \"./plugins/GzipCompression.js\";\nexport * from \"./plugins/JsonpackCompression.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA","ignoreList":[]} |
@@ -1,20 +0,11 @@ | ||
| "use strict"; | ||
| var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.decompress = exports.compress = void 0; | ||
| var _jsonpack = _interopRequireDefault(require("jsonpack")); | ||
| const compress = async value => { | ||
| return _jsonpack.default.pack(value, { | ||
| import jsonpack from "jsonpack"; | ||
| export const compress = async value => { | ||
| return jsonpack.pack(value, { | ||
| verbose: false | ||
| }); | ||
| }; | ||
| exports.compress = compress; | ||
| const decompress = async value => { | ||
| return _jsonpack.default.unpack(value); | ||
| export const decompress = async value => { | ||
| return jsonpack.unpack(value); | ||
| }; | ||
| exports.decompress = decompress; | ||
| //# sourceMappingURL=jsonpack.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_jsonpack","_interopRequireDefault","require","compress","value","jsonpack","pack","verbose","exports","decompress","unpack"],"sources":["jsonpack.ts"],"sourcesContent":["import jsonpack from \"jsonpack\";\n\nexport const compress = async (value: any) => {\n return jsonpack.pack(value, {\n verbose: false\n });\n};\n\nexport const decompress = async (value: string) => {\n return jsonpack.unpack(value);\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,MAAMC,QAAQ,GAAG,MAAOC,KAAU,IAAK;EAC1C,OAAOC,iBAAQ,CAACC,IAAI,CAACF,KAAK,EAAE;IACxBG,OAAO,EAAE;EACb,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAL,QAAA,GAAAA,QAAA;AAEK,MAAMM,UAAU,GAAG,MAAOL,KAAa,IAAK;EAC/C,OAAOC,iBAAQ,CAACK,MAAM,CAACN,KAAK,CAAC;AACjC,CAAC;AAACI,OAAA,CAAAC,UAAA,GAAAA,UAAA","ignoreList":[]} | ||
| {"version":3,"names":["jsonpack","compress","value","pack","verbose","decompress","unpack"],"sources":["jsonpack.ts"],"sourcesContent":["import jsonpack from \"jsonpack\";\n\nexport const compress = async (value: any) => {\n return jsonpack.pack(value, {\n verbose: false\n });\n};\n\nexport const decompress = async (value: string) => {\n return jsonpack.unpack(value);\n};\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,UAAU;AAE/B,OAAO,MAAMC,QAAQ,GAAG,MAAOC,KAAU,IAAK;EAC1C,OAAOF,QAAQ,CAACG,IAAI,CAACD,KAAK,EAAE;IACxBE,OAAO,EAAE;EACb,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMC,UAAU,GAAG,MAAOH,KAAa,IAAK;EAC/C,OAAOF,QAAQ,CAACM,MAAM,CAACJ,KAAK,CAAC;AACjC,CAAC","ignoreList":[]} |
@@ -1,5 +0,3 @@ | ||
| /// <reference types="node" /> | ||
| /// <reference types="node" /> | ||
| import { CompressionPlugin, type ICompressedValue } from "../CompressionPlugin"; | ||
| export declare const convertToBuffer: (value: string | Buffer) => Buffer; | ||
| import { CompressionPlugin, type ICompressedValue } from "../CompressionPlugin.js"; | ||
| export declare const convertToBuffer: (value: string | Buffer) => Buffer<ArrayBufferLike>; | ||
| export declare class GzipCompression extends CompressionPlugin { | ||
@@ -6,0 +4,0 @@ name: string; |
@@ -1,13 +0,7 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.createGzipCompression = exports.convertToBuffer = exports.GzipCompression = void 0; | ||
| var _CompressionPlugin = require("../CompressionPlugin"); | ||
| var _gzip = require("../gzip"); | ||
| import { CompressionPlugin } from "../CompressionPlugin.js"; | ||
| import { compress as gzip, decompress as ungzip } from "../gzip.js"; | ||
| const GZIP = "gzip"; | ||
| const TO_STORAGE_ENCODING = "base64"; | ||
| const FROM_STORAGE_ENCODING = "utf8"; | ||
| const convertToBuffer = value => { | ||
| export const convertToBuffer = value => { | ||
| if (typeof value === "string") { | ||
@@ -18,4 +12,3 @@ return Buffer.from(value, TO_STORAGE_ENCODING); | ||
| }; | ||
| exports.convertToBuffer = convertToBuffer; | ||
| class GzipCompression extends _CompressionPlugin.CompressionPlugin { | ||
| export class GzipCompression extends CompressionPlugin { | ||
| name = "utils.compression.gzip"; | ||
@@ -33,3 +26,3 @@ canCompress(data) { | ||
| // This stringifies both regular strings and JSON objects. | ||
| const value = await (0, _gzip.compress)(JSON.stringify(data)); | ||
| const value = await gzip(JSON.stringify(data)); | ||
| return { | ||
@@ -54,3 +47,3 @@ compression: GZIP, | ||
| try { | ||
| const buf = await (0, _gzip.decompress)(convertToBuffer(data.value)); | ||
| const buf = await ungzip(convertToBuffer(data.value)); | ||
| const value = buf.toString(FROM_STORAGE_ENCODING); | ||
@@ -64,8 +57,6 @@ return JSON.parse(value); | ||
| } | ||
| exports.GzipCompression = GzipCompression; | ||
| const createGzipCompression = () => { | ||
| export const createGzipCompression = () => { | ||
| return new GzipCompression(); | ||
| }; | ||
| exports.createGzipCompression = createGzipCompression; | ||
| //# sourceMappingURL=GzipCompression.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_CompressionPlugin","require","_gzip","GZIP","TO_STORAGE_ENCODING","FROM_STORAGE_ENCODING","convertToBuffer","value","Buffer","from","exports","GzipCompression","CompressionPlugin","name","canCompress","data","compression","compress","undefined","gzip","JSON","stringify","toString","canDecompress","toLowerCase","decompress","buf","ungzip","parse","ex","console","log","message","createGzipCompression"],"sources":["GzipCompression.ts"],"sourcesContent":["import { CompressionPlugin, type ICompressedValue } from \"../CompressionPlugin\";\nimport { compress as gzip, decompress as ungzip } from \"~/compression/gzip\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\nconst FROM_STORAGE_ENCODING = \"utf8\";\n\nexport const convertToBuffer = (value: string | Buffer) => {\n if (typeof value === \"string\") {\n return Buffer.from(value, TO_STORAGE_ENCODING);\n }\n return value;\n};\n\nexport class GzipCompression extends CompressionPlugin {\n public override name = \"utils.compression.gzip\";\n\n public override canCompress(data: any): boolean {\n if (!!data?.compression) {\n return false;\n }\n return true;\n }\n\n public override async compress(data: any): Promise<ICompressedValue> {\n if (data === null || data === undefined) {\n return data;\n }\n // This stringifies both regular strings and JSON objects.\n const value = await gzip(JSON.stringify(data));\n\n return {\n compression: GZIP,\n value: value.toString(TO_STORAGE_ENCODING)\n };\n }\n\n public override canDecompress(data: Partial<ICompressedValue>): boolean {\n if (!data?.compression) {\n return false;\n }\n\n const compression = data.compression as string;\n\n return compression.toLowerCase() === GZIP;\n }\n\n public override async decompress(data: ICompressedValue): Promise<any> {\n if (!data) {\n return data;\n } else if (!data.value) {\n return null;\n }\n try {\n const buf = await ungzip(convertToBuffer(data.value));\n const value = buf.toString(FROM_STORAGE_ENCODING);\n return JSON.parse(value);\n } catch (ex) {\n console.log(`Could not decompress given data.`, ex.message);\n return null;\n }\n }\n}\n\nexport const createGzipCompression = () => {\n return new GzipCompression();\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,MAAME,IAAI,GAAG,MAAM;AACnB,MAAMC,mBAAmB,GAAG,QAAQ;AACpC,MAAMC,qBAAqB,GAAG,MAAM;AAE7B,MAAMC,eAAe,GAAIC,KAAsB,IAAK;EACvD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOC,MAAM,CAACC,IAAI,CAACF,KAAK,EAAEH,mBAAmB,CAAC;EAClD;EACA,OAAOG,KAAK;AAChB,CAAC;AAACG,OAAA,CAAAJ,eAAA,GAAAA,eAAA;AAEK,MAAMK,eAAe,SAASC,oCAAiB,CAAC;EACnCC,IAAI,GAAG,wBAAwB;EAE/BC,WAAWA,CAACC,IAAS,EAAW;IAC5C,IAAI,CAAC,CAACA,IAAI,EAAEC,WAAW,EAAE;MACrB,OAAO,KAAK;IAChB;IACA,OAAO,IAAI;EACf;EAEA,MAAsBC,QAAQA,CAACF,IAAS,EAA6B;IACjE,IAAIA,IAAI,KAAK,IAAI,IAAIA,IAAI,KAAKG,S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GZIP","TO_STORAGE_ENCODING","FROM_STORAGE_ENCODING","convertToBuffer","value","Buffer","from","GzipCompression","name","canCompress","data","compression","undefined","JSON","stringify","toString","canDecompress","toLowerCase","buf","parse","ex","console","log","message","createGzipCompression"],"sources":["GzipCompression.ts"],"sourcesContent":["import { CompressionPlugin, type ICompressedValue } from \"../CompressionPlugin.js\";\nimport { compress as gzip, decompress as ungzip } from \"~/compression/gzip.js\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\nconst FROM_STORAGE_ENCODING = \"utf8\";\n\nexport const convertToBuffer = (value: string | Buffer) => {\n if (typeof value === \"string\") {\n return Buffer.from(value, TO_STORAGE_ENCODING);\n }\n return value;\n};\n\nexport class GzipCompression extends CompressionPlugin {\n public override name = \"utils.compression.gzip\";\n\n public override canCompress(data: any): boolean {\n if (!!data?.compression) {\n return false;\n }\n return true;\n }\n\n public override async compress(data: any): Promise<ICompressedValue> {\n if (data === null || data === undefined) {\n return data;\n }\n // This stringifies both regular strings and JSON objects.\n const value = await gzip(JSON.stringify(data));\n\n return {\n compression: GZIP,\n value: value.toString(TO_STORAGE_ENCODING)\n };\n }\n\n public override canDecompress(data: Partial<ICompressedValue>): boolean {\n if (!data?.compression) {\n return false;\n }\n\n const compression = data.compression as string;\n\n return compression.toLowerCase() === GZIP;\n }\n\n public override async decompress(data: ICompressedValue): Promise<any> {\n if (!data) {\n return data;\n } else if (!data.value) {\n return null;\n }\n try {\n const buf = await ungzip(convertToBuffer(data.value));\n const value = buf.toString(FROM_STORAGE_ENCODING);\n return JSON.parse(value);\n } catch (ex) {\n console.log(`Could not decompress given data.`, ex.message);\n return null;\n }\n }\n}\n\nexport const createGzipCompression = () => {\n return new GzipCompression();\n};\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,QAAQ,IAAIC,IAAI,EAAEC,UAAU,IAAIC,MAAM;AAE/C,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,mBAAmB,GAAG,QA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,CAAC,CAAC;MACrD,MAAMA,KAAK,GAAGc,GAAG,CAACH,QAAQ,CAACb,qBAAqB,CAAC;MACjD,OAAOW,IAAI,CAACM,KAAK,CAACf,KAAK,CAAC;IAC5B,CAAC,CAAC,OAAOgB,EAAE,EAAE;MACTC,OAAO,CAACC,GAAG,CAAC,kCAAkC,EAAEF,EAAE,CAACG,OAAO,CAAC;MAC3D,OAAO,IAAI;IACf;EACJ;AACJ;AAEA,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACvC,OAAO,IAAIjB,eAAe,CAAC,CAAC;AAChC,CAAC","ignoreList":[]} |
@@ -1,2 +0,2 @@ | ||
| import { CompressionPlugin, type ICompressedValue } from "../CompressionPlugin"; | ||
| import { CompressionPlugin, type ICompressedValue } from "../CompressionPlugin.js"; | ||
| export declare class JsonpackCompression extends CompressionPlugin { | ||
@@ -3,0 +3,0 @@ name: string; |
@@ -1,11 +0,5 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.createJsonpackCompression = exports.JsonpackCompression = void 0; | ||
| var _CompressionPlugin = require("../CompressionPlugin"); | ||
| var _jsonpack = require("../jsonpack"); | ||
| import { CompressionPlugin } from "../CompressionPlugin.js"; | ||
| import { compress, decompress } from "../jsonpack.js"; | ||
| const JSONPACK = "jsonpack"; | ||
| class JsonpackCompression extends _CompressionPlugin.CompressionPlugin { | ||
| export class JsonpackCompression extends CompressionPlugin { | ||
| name = "utils.compression.jsonpack"; | ||
@@ -25,3 +19,3 @@ canCompress(data) { | ||
| } | ||
| const value = await (0, _jsonpack.compress)(data); | ||
| const value = await compress(data); | ||
| return { | ||
@@ -48,3 +42,3 @@ compression: JSONPACK, | ||
| try { | ||
| return await (0, _jsonpack.decompress)(data.value); | ||
| return await decompress(data.value); | ||
| } catch (ex) { | ||
@@ -56,8 +50,6 @@ console.log(`Could not decompress given data.`, ex.message); | ||
| } | ||
| exports.JsonpackCompression = JsonpackCompression; | ||
| const createJsonpackCompression = () => { | ||
| export const createJsonpackCompression = () => { | ||
| return new JsonpackCompression(); | ||
| }; | ||
| exports.createJsonpackCompression = createJsonpackCompression; | ||
| //# sourceMappingURL=JsonpackCompression.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_CompressionPlugin","require","_jsonpack","JSONPACK","JsonpackCompression","CompressionPlugin","name","canCompress","data","compression","compress","undefined","value","canDecompress","toLowerCase","decompress","ex","console","log","message","exports","createJsonpackCompression"],"sources":["JsonpackCompression.ts"],"sourcesContent":["import { CompressionPlugin, type ICompressedValue } from \"../CompressionPlugin\";\nimport { compress, decompress } from \"~/compression/jsonpack\";\n\nconst JSONPACK = \"jsonpack\";\n\nexport class JsonpackCompression extends CompressionPlugin {\n public override name = \"utils.compression.jsonpack\";\n\n public override canCompress(data: any): boolean {\n if (typeof data !== \"object\") {\n return false;\n } else if (!!data.compression) {\n return false;\n }\n // TODO Do we want to compress anything with jsonpack anymore? Maybe not...\n return false;\n }\n\n public override async compress(data: any): Promise<ICompressedValue> {\n if (data === null || data === undefined) {\n return data;\n }\n const value = await compress(data);\n\n return {\n compression: JSONPACK,\n value\n };\n }\n\n public override canDecompress(data: Partial<ICompressedValue>): boolean {\n if (typeof data !== \"object\") {\n return false;\n } else if (!data?.compression) {\n return false;\n }\n\n const compression = data.compression as string;\n return compression.toLowerCase() === JSONPACK;\n }\n\n public override async decompress(data: ICompressedValue): Promise<any> {\n if (!data) {\n return data;\n } else if (!data.value) {\n return null;\n }\n try {\n return await decompress(data.value);\n } catch (ex) {\n console.log(`Could not decompress given data.`, ex.message);\n return null;\n }\n }\n}\n\nexport const createJsonpackCompression = () => {\n return new JsonpackCompression();\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,MAAME,QAAQ,GAAG,UAAU;AAEpB,MAAMC,mBAAmB,SAASC,oCAAiB,CAAC;EACvCC,IAAI,GAAG,4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C3C,OAAO,IAAIjB,mBAAmB,CAAC,CAAC;AACpC,CAAC;AAACgB,OAAA,CAAAC,yBAAA,GAAAA,yBAAA","ignoreList":[]} | ||
| {"version":3,"names":["CompressionPlugin","compress","decompress","JSONPACK","JsonpackCompression","name","canCompress","data","compression","undefined","value","canDecompress","toLowerCase","ex","console","log","message","createJsonpackCompression"],"sources":["JsonpackCompression.ts"],"sourcesContent":["import { CompressionPlugin, type ICompressedValue } from \"../CompressionPlugin.js\";\nimport { compress, decompress } from \"~/compression/jsonpack.js\";\n\nconst JSONPACK = \"jsonpack\";\n\nexport class JsonpackCompression extends CompressionPlugin {\n public override name = \"utils.compression.jsonpack\";\n\n public override canCompress(data: any): boolean {\n if (typeof data !== \"object\") {\n return false;\n } else if (!!data.compression) {\n return false;\n }\n // TODO Do we want to compress anything with jsonpack anymore? Maybe not...\n return false;\n }\n\n public override async compress(data: any): Promise<ICompressedValue> {\n if (data === null || data === undefined) {\n return data;\n }\n const value = await compress(data);\n\n return {\n compression: JSONPACK,\n value\n };\n }\n\n public override canDecompress(data: Partial<ICompressedValue>): boolean {\n if (typeof data !== \"object\") {\n return false;\n } else if (!data?.compression) {\n return false;\n }\n\n const compression = data.compression as string;\n return compression.toLowerCase() === JSONPACK;\n }\n\n public override async decompress(data: ICompressedValue): Promise<any> {\n if (!data) {\n return data;\n } else if (!data.value) {\n return null;\n }\n try {\n return await decompress(data.value);\n } catch (ex) {\n console.log(`Could not decompress given data.`, ex.message);\n return null;\n }\n }\n}\n\nexport const createJsonpackCompression = () => {\n return new JsonpackCompression();\n};\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,QAAQ,EAAEC,UAAU;AAE7B,MAAMC,QAAQ,GAAG,UAAU;AAE3B,OAAO,MAAMC,mBAAmB,SAASJ,iBAAiB,CAAC;EACvCK,IAAI,GAAG,4BAA4B;EAEnCC,WAAWA,CAACC,IAAS,EAAW;IAC5C,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MA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import { parseIdentifier } from "./parseIdentifier.js"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.createIdentifier = void 0; | ||
| var _zeroPad = require("./zeroPad"); | ||
| var _parseIdentifier = require("./parseIdentifier"); | ||
| /** | ||
@@ -17,10 +12,9 @@ * Used to create the identifier that is an absolute unique for the record. | ||
| const createIdentifier = values => { | ||
| export const createIdentifier = values => { | ||
| const { | ||
| id | ||
| } = (0, _parseIdentifier.parseIdentifier)(values.id); | ||
| return `${id}#${(0, _zeroPad.zeroPad)(values.version)}`; | ||
| } = parseIdentifier(values.id); | ||
| return `${id}#${zeroPad(values.version)}`; | ||
| }; | ||
| exports.createIdentifier = createIdentifier; | ||
| //# sourceMappingURL=createIdentifier.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_zeroPad","require","_parseIdentifier","createIdentifier","values","id","parseIdentifier","zeroPad","version","exports"],"sources":["createIdentifier.ts"],"sourcesContent":["import { zeroPad } from \"~/zeroPad\";\nimport { parseIdentifier } from \"~/parseIdentifier\";\n\n/**\n * Used to create the identifier that is an absolute unique for the record.\n * It is created out of the generated ID and version of the record.\n *\n *\n * The input ID is being parsed as you might send a full ID instead of only the generated one.\n */\nexport interface CreateIdentifierParams {\n id: string;\n version: number;\n}\n\nexport const createIdentifier = (values: CreateIdentifierParams): string => {\n const { id } = parseIdentifier(values.id);\n\n return `${id}#${zeroPad(values.version)}`;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAME,gBAAgB,GAAIC,MAA8B,IAAa;EACxE,MAAM;IAAEC;EAAG,CAAC,GAAG,IAAAC,gCAAe,EAACF,MAAM,CAACC,EAAE,CAAC;EAEzC,OAAO,GAAGA,EAAE,IAAI,IAAAE,gBAAO,EAACH,MAAM,CAACI,OAAO,CAAC,EAAE;AAC7C,CAAC;AAACC,OAAA,CAAAN,gBAAA,GAAAA,gBAAA","ignoreList":[]} | ||
| {"version":3,"names":["zeroPad","parseIdentifier","createIdentifier","values","id","version"],"sources":["createIdentifier.ts"],"sourcesContent":["import { zeroPad } from \"./zeroPad.js\";\nimport { parseIdentifier } from \"./parseIdentifier.js\";\n\n/**\n * Used to create the identifier that is an absolute unique for the record.\n * It is created out of the generated ID and version of the record.\n *\n *\n * The input ID is being parsed as you might send a full ID instead of only the generated one.\n */\nexport interface CreateIdentifierParams {\n id: string;\n version: number;\n}\n\nexport const createIdentifier = (values: CreateIdentifierParams): string => {\n const { id } = parseIdentifier(values.id);\n\n return `${id}#${zeroPad(values.version)}`;\n};\n"],"mappings":"AAAA,SAASA,OAAO;AAChB,SAASC,eAAe;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,MAAMC,gBAAgB,GAAIC,MAA8B,IAAa;EACxE,MAAM;IAAEC;EAAG,CAAC,GAAGH,eAAe,CAACE,MAAM,CAACC,EAAE,CAAC;EAEzC,OAAO,GAAGA,EAAE,IAAIJ,OAAO,CAACG,MAAM,CAACE,OAAO,CAAC,EAAE;AAC7C,CAAC","ignoreList":[]} |
| import WebinyError from "@webiny/error"; | ||
| import type { ZodError } from "zod/lib/ZodError"; | ||
| import type { ZodError } from "zod"; | ||
| interface OutputError { | ||
@@ -4,0 +4,0 @@ code: string; |
+5
-13
@@ -1,10 +0,3 @@ | ||
| "use strict"; | ||
| var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.createZodError = void 0; | ||
| var _error = _interopRequireDefault(require("@webiny/error")); | ||
| var _generateId = require("./generateId.js"); | ||
| import WebinyError from "@webiny/error"; | ||
| import { generateAlphaNumericId } from "./generateId.js"; | ||
| const createValidationErrorData = error => { | ||
@@ -17,3 +10,3 @@ return { | ||
| } | ||
| const key = name || issue.path.join(".") || issue.message || issue.code || (0, _generateId.generateAlphaNumericId)(); | ||
| const key = name || issue.path.join(".") || issue.message || issue.code || generateAlphaNumericId(); | ||
| collection[key] = { | ||
@@ -31,4 +24,4 @@ code: issue.code, | ||
| }; | ||
| const createZodError = error => { | ||
| return new _error.default({ | ||
| export const createZodError = error => { | ||
| return new WebinyError({ | ||
| message: `Validation failed.`, | ||
@@ -39,4 +32,3 @@ code: "VALIDATION_FAILED_INVALID_FIELDS", | ||
| }; | ||
| exports.createZodError = createZodError; | ||
| //# sourceMappingURL=createZodError.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_error","_interopRequireDefault","require","_generateId","createValidationErrorData","error","invalidFields","issues","reduce","collection","issue","name","path","join","code","key","message","generateAlphaNumericId","data","fatal","createZodError","WebinyError","exports"],"sources":["createZodError.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { ZodError } from \"zod/lib/ZodError\";\nimport { generateAlphaNumericId } from \"~/generateId.js\";\n\ninterface OutputError {\n code: string;\n data: Record<string, any> | null;\n message: string;\n}\n\nexport interface OutputErrors {\n [key: string]: OutputError;\n}\n\nconst createValidationErrorData = (error: ZodError) => {\n return {\n invalidFields: error.issues.reduce<OutputErrors>((collection, issue) => {\n const name = issue.path.join(\".\");\n if (!name && !issue.code) {\n return collection;\n }\n\n const key =\n name ||\n issue.path.join(\".\") ||\n issue.message ||\n issue.code ||\n generateAlphaNumericId();\n collection[key] = {\n code: issue.code,\n message: issue.message,\n data: {\n fatal: issue.fatal,\n path: issue.path\n }\n };\n\n return collection;\n }, {})\n };\n};\n\nexport const createZodError = (error: ZodError) => {\n return new WebinyError({\n message: `Validation failed.`,\n code: \"VALIDATION_FAILED_INVALID_FIELDS\",\n data: createValidationErrorData(error)\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAYA,MAAME,yBAAyB,GAAIC,KAAe,IAAK;EACnD,OAAO;IACHC,aAAa,EAAED,KAAK,CAACE,MAAM,CAACC,MAAM,CAAe,CAACC,UAAU,EAAEC,KAAK,KAAK;MACpE,MAAMC,IAAI,GAAGD,KAAK,CAACE,IAAI,CAACC,IAAI,CAAC,GAAG,CAAC;MACjC,IAAI,CAACF,IAAI,IAAI,CAACD,KAAK,CAACI,IAAI,EAAE;QACtB,OAAOL,UAAU;MACrB;MAEA,MAAMM,GAAG,GACLJ,IAAI,IACJD,KAAK,CAACE,IAAI,CAACC,IAAI,CAAC,GAAG,CAAC,IACpBH,KAAK,CAACM,OAAO,IACbN,KAAK,CAACI,IAAI,IACV,IAAAG,kCAAsB,EAAC,CAAC;MAC5BR,UAAU,CAACM,GAAG,CAAC,GAAG;QACdD,IAAI,EAAEJ,KAAK,CAACI,IAAI;QAChBE,OAAO,EAAEN,KAAK,CAACM,OAAO;QACtBE,IAAI,EAAE;UACFC,KAAK,EAAET,KAAK,CAACS,KAAK;UAClBP,IAAI,EAAEF,KAAK,CAACE;QAChB;MACJ,CAAC;MAED,OAAOH,UAAU;IACrB,CAAC,EAAE,CAAC,CAAC;EACT,CAAC;AACL,CAAC;AAEM,MAAMW,cAAc,GAAIf,KAAe,IAAK;EAC/C,OAAO,IAAIgB,cAAW,CAAC;IACnBL,OAAO,EAAE,oBAAoB;IAC7BF,IAAI,EAAE,kCAAkC;IACxCI,IAAI,EAAEd,yBAAyB,CAACC,KAAK;EACzC,CAAC,CAAC;AACN,CAAC;AAACiB,OAAA,CAAAF,cAAA,GAAAA,cAAA","ignoreList":[]} | ||
| {"version":3,"names":["WebinyError","generateAlphaNumericId","createValidationErrorData","error","invalidFields","issues","reduce","collection","issue","name","path","join","code","key","message","data","fatal","createZodError"],"sources":["createZodError.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { ZodError } from \"zod\";\nimport { generateAlphaNumericId } from \"~/generateId.js\";\n\ninterface OutputError {\n code: string;\n data: Record<string, any> | null;\n message: string;\n}\n\nexport interface OutputErrors {\n [key: string]: OutputError;\n}\n\nconst createValidationErrorData = (error: ZodError) => {\n return {\n invalidFields: error.issues.reduce<OutputErrors>((collection, issue) => {\n const name = issue.path.join(\".\");\n if (!name && !issue.code) {\n return collection;\n }\n\n const key =\n name ||\n issue.path.join(\".\") ||\n issue.message ||\n issue.code ||\n generateAlphaNumericId();\n collection[key] = {\n code: issue.code,\n message: issue.message,\n data: {\n fatal: issue.fatal,\n path: issue.path\n }\n };\n\n return collection;\n }, {})\n };\n};\n\nexport const createZodError = (error: ZodError) => {\n return new WebinyError({\n message: `Validation failed.`,\n code: \"VALIDATION_FAILED_INVALID_FIELDS\",\n data: createValidationErrorData(error)\n });\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SAASC,sBAAsB;AAY/B,MAAMC,yBAAyB,GAAIC,KAAe,IAAK;EACnD,OAAO;IACHC,aAAa,EAAED,KAAK,CAACE,MAAM,CAACC,MAAM,CAAe,CAACC,UAAU,EAAEC,KAAK,KAAK;MACpE,MAAMC,IAAI,GAAGD,KAAK,CAACE,IAAI,CAACC,IAAI,CAAC,GAAG,CAAC;MACjC,IAAI,CAACF,IAAI,IAAI,CAACD,KAAK,CAACI,IAAI,EAAE;QACtB,OAAOL,UAAU;MACrB;MAEA,MAAMM,GAAG,GACLJ,IAAI,IACJD,KAAK,CAACE,IAAI,CAACC,IAAI,CAAC,GAAG,CAAC,IACpBH,KAAK,CAACM,OAAO,IACbN,KAAK,CAACI,IAAI,IACVX,sBAAsB,CAAC,CAAC;MAC5BM,UAAU,CAACM,GAAG,CAAC,GAAG;QACdD,IAAI,EAAEJ,KAAK,CAACI,IAAI;QAChBE,OAAO,EAAEN,KAAK,CAACM,OAAO;QACtBC,IAAI,EAAE;UACFC,KAAK,EAAER,KAAK,CAACQ,KAAK;UAClBN,IAAI,EAAEF,KAAK,CAACE;QAChB;MACJ,CAAC;MAED,OAAOH,UAAU;IACrB,CAAC,EAAE,CAAC,CAAC;EACT,CAAC;AACL,CAAC;AAED,OAAO,MAAMU,cAAc,GAAId,KAAe,IAAK;EAC/C,OAAO,IAAIH,WAAW,CAAC;IACnBc,OAAO,EAAE,oBAAoB;IAC7BF,IAAI,EAAE,kCAAkC;IACxCG,IAAI,EAAEb,yBAAyB,CAACC,KAAK;EACzC,CAAC,CAAC;AACN,CAAC","ignoreList":[]} |
+2
-10
@@ -1,8 +0,2 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.encodeCursor = exports.decodeCursor = void 0; | ||
| const encodeCursor = cursor => { | ||
| export const encodeCursor = cursor => { | ||
| if (!cursor) { | ||
@@ -19,4 +13,3 @@ return null; | ||
| }; | ||
| exports.encodeCursor = encodeCursor; | ||
| const decodeCursor = cursor => { | ||
| export const decodeCursor = cursor => { | ||
| if (!cursor) { | ||
@@ -37,4 +30,3 @@ return null; | ||
| }; | ||
| exports.decodeCursor = decodeCursor; | ||
| //# sourceMappingURL=cursor.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["encodeCursor","cursor","Buffer","from","JSON","stringify","toString","ex","console","log","message","exports","decodeCursor","value","parse"],"sources":["cursor.ts"],"sourcesContent":["export type CursorInput = string | number | (string | number)[] | null;\nexport type CursorOutput = string | null;\n\nexport const encodeCursor = (cursor?: CursorInput): CursorOutput => {\n if (!cursor) {\n return null;\n }\n\n try {\n return Buffer.from(JSON.stringify(cursor)).toString(\"base64\");\n } catch (ex) {\n console.log(\"Utils encode cursor.\");\n console.log(ex.message);\n return null;\n }\n};\n\nexport const decodeCursor = (cursor?: CursorOutput): CursorInput => {\n if (!cursor) {\n return null;\n }\n\n try {\n const value = Buffer.from(cursor, \"base64\").toString(\"ascii\");\n if (!value) {\n return null;\n }\n return JSON.parse(value);\n } catch (ex) {\n console.log(\"Utils decode cursor.\");\n console.log(ex.message);\n return null;\n }\n};\n"],"mappings":";;;;;;AAGO,MAAMA,YAAY,GAAIC,MAAoB,IAAmB;EAChE,IAAI,CAACA,MAAM,EAAE;IACT,OAAO,IAAI;EACf;EAEA,IAAI;IACA,OAAOC,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,SAAS,CAACJ,MAAM,CAAC,CAAC,CAACK,QAAQ,CAAC,QAAQ,CAAC;EACjE,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC;IACnCD,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;IACvB,OAAO,IAAI;EACf;AACJ,CAAC;AAACC,OAAA,CAAAX,YAAA,GAAAA,YAAA;AAEK,MAAMY,YAAY,GAAIX,MAAqB,IAAkB;EAChE,IAAI,CAACA,MAAM,EAAE;IACT,OAAO,IAAI;EACf;EAEA,IAAI;IACA,MAAMY,KAAK,GAAGX,MAAM,CAACC,IAAI,CAACF,MAAM,EAAE,QAAQ,CAAC,CAACK,QAAQ,CAAC,OAAO,CAAC;IAC7D,IAAI,CAACO,KAAK,EAAE;MACR,OAAO,IAAI;IACf;IACA,OAAOT,IAAI,CAACU,KAAK,CAACD,KAAK,CAAC;EAC5B,CAAC,CAAC,OAAON,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC;IACnCD,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;IACvB,OAAO,IAAI;EACf;AACJ,CAAC;AAACC,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]} | ||
| {"version":3,"names":["encodeCursor","cursor","Buffer","from","JSON","stringify","toString","ex","console","log","message","decodeCursor","value","parse"],"sources":["cursor.ts"],"sourcesContent":["export type CursorInput = string | number | (string | number)[] | null;\nexport type CursorOutput = string | null;\n\nexport const encodeCursor = (cursor?: CursorInput): CursorOutput => {\n if (!cursor) {\n return null;\n }\n\n try {\n return Buffer.from(JSON.stringify(cursor)).toString(\"base64\");\n } catch (ex) {\n console.log(\"Utils encode cursor.\");\n console.log(ex.message);\n return null;\n }\n};\n\nexport const decodeCursor = (cursor?: CursorOutput): CursorInput => {\n if (!cursor) {\n return null;\n }\n\n try {\n const value = Buffer.from(cursor, \"base64\").toString(\"ascii\");\n if (!value) {\n return null;\n }\n return JSON.parse(value);\n } catch (ex) {\n console.log(\"Utils decode cursor.\");\n console.log(ex.message);\n return null;\n }\n};\n"],"mappings":"AAGA,OAAO,MAAMA,YAAY,GAAIC,MAAoB,IAAmB;EAChE,IAAI,CAACA,MAAM,EAAE;IACT,OAAO,IAAI;EACf;EAEA,IAAI;IACA,OAAOC,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,SAAS,CAACJ,MAAM,CAAC,CAAC,CAACK,QAAQ,CAAC,QAAQ,CAAC;EACjE,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC;IACnCD,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;IACvB,OAAO,IAAI;EACf;AACJ,CAAC;AAED,OAAO,MAAMC,YAAY,GAAIV,MAAqB,IAAkB;EAChE,IAAI,CAACA,MAAM,EAAE;IACT,OAAO,IAAI;EACf;EAEA,IAAI;IACA,MAAMW,KAAK,GAAGV,MAAM,CAACC,IAAI,CAACF,MAAM,EAAE,QAAQ,CAAC,CAACK,QAAQ,CAAC,OAAO,CAAC;IAC7D,IAAI,CAACM,KAAK,EAAE;MACR,OAAO,IAAI;IACf;IACA,OAAOR,IAAI,CAACS,KAAK,CAACD,KAAK,CAAC;EAC5B,CAAC,CAAC,OAAOL,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC;IACnCD,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;IACvB,OAAO,IAAI;EACf;AACJ,CAAC","ignoreList":[]} |
+1
-8
@@ -1,7 +0,1 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.convertException = void 0; | ||
| /** | ||
@@ -11,3 +5,3 @@ * This will help with output of the error object. | ||
| */ | ||
| const convertException = (error, remove) => { | ||
| export const convertException = (error, remove) => { | ||
| const properties = Object.getOwnPropertyNames(error); | ||
@@ -22,4 +16,3 @@ return properties.reduce((items, property) => { | ||
| }; | ||
| exports.convertException = convertException; | ||
| //# sourceMappingURL=exception.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["convertException","error","remove","properties","Object","getOwnPropertyNames","reduce","items","property","includes","exports"],"sources":["exception.ts"],"sourcesContent":["import type { GenericRecord } from \"~/GenericRecord.js\";\n\n/**\n * This will help with output of the error object.\n * Normally, the error object is not serializable, so we need to convert it to a plain object.\n */\nexport const convertException = (error: Error, remove?: string[]): GenericRecord => {\n const properties = Object.getOwnPropertyNames(error) as (keyof Error)[];\n return properties.reduce<GenericRecord>((items, property) => {\n if (remove && remove.includes(property)) {\n return items;\n }\n items[property] = error[property];\n return items;\n }, {});\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAGA,CAACC,KAAY,EAAEC,MAAiB,KAAoB;EAChF,MAAMC,UAAU,GAAGC,MAAM,CAACC,mBAAmB,CAACJ,KAAK,CAAoB;EACvE,OAAOE,UAAU,CAACG,MAAM,CAAgB,CAACC,KAAK,EAAEC,QAAQ,KAAK;IACzD,IAAIN,MAAM,IAAIA,MAAM,CAACO,QAAQ,CAACD,QAAQ,CAAC,EAAE;MACrC,OAAOD,KAAK;IAChB;IACAA,KAAK,CAACC,QAAQ,CAAC,GAAGP,KAAK,CAACO,QAAQ,CAAC;IACjC,OAAOD,KAAK;EAChB,CAAC,EAAE,CAAC,CAAC,CAAC;AACV,CAAC;AAACG,OAAA,CAAAV,gBAAA,GAAAA,gBAAA","ignoreList":[]} | ||
| {"version":3,"names":["convertException","error","remove","properties","Object","getOwnPropertyNames","reduce","items","property","includes"],"sources":["exception.ts"],"sourcesContent":["import type { GenericRecord } from \"~/GenericRecord.js\";\n\n/**\n * This will help with output of the error object.\n * Normally, the error object is not serializable, so we need to convert it to a plain object.\n */\nexport const convertException = (error: Error, remove?: string[]): GenericRecord => {\n const properties = Object.getOwnPropertyNames(error) as (keyof Error)[];\n return properties.reduce<GenericRecord>((items, property) => {\n if (remove && remove.includes(property)) {\n return items;\n }\n items[property] = error[property];\n return items;\n }, {});\n};\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAGA,CAACC,KAAY,EAAEC,MAAiB,KAAoB;EAChF,MAAMC,UAAU,GAAGC,MAAM,CAACC,mBAAmB,CAACJ,KAAK,CAAoB;EACvE,OAAOE,UAAU,CAACG,MAAM,CAAgB,CAACC,KAAK,EAAEC,QAAQ,KAAK;IACzD,IAAIN,MAAM,IAAIA,MAAM,CAACO,QAAQ,CAACD,QAAQ,CAAC,EAAE;MACrC,OAAOD,KAAK;IAChB;IACAA,KAAK,CAACC,QAAQ,CAAC,GAAGP,KAAK,CAACO,QAAQ,CAAC;IACjC,OAAOD,KAAK;EAChB,CAAC,EAAE,CAAC,CAAC,CAAC;AACV,CAAC","ignoreList":[]} |
+3
-11
@@ -1,12 +0,5 @@ | ||
| "use strict"; | ||
| var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.executeWithRetry = void 0; | ||
| var _pRetry = _interopRequireDefault(require("p-retry")); | ||
| const executeWithRetry = (execute, options) => { | ||
| import pRetry from "p-retry"; | ||
| export const executeWithRetry = (execute, options) => { | ||
| const retries = 20; | ||
| return (0, _pRetry.default)(execute, { | ||
| return pRetry(execute, { | ||
| maxRetryTime: 300000, | ||
@@ -19,4 +12,3 @@ retries, | ||
| }; | ||
| exports.executeWithRetry = executeWithRetry; | ||
| //# sourceMappingURL=executeWithRetry.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_pRetry","_interopRequireDefault","require","executeWithRetry","execute","options","retries","pRetry","maxRetryTime","minTimeout","maxTimeout","exports"],"sources":["executeWithRetry.ts"],"sourcesContent":["import pRetry from \"p-retry\";\n\nexport type ExecuteWithRetryOptions = Parameters<typeof pRetry>[1];\n\nexport const executeWithRetry = <T>(\n execute: () => Promise<T>,\n options?: ExecuteWithRetryOptions\n) => {\n const retries = 20;\n return pRetry(execute, {\n maxRetryTime: 300000,\n retries,\n minTimeout: 1500,\n maxTimeout: 30000,\n ...options\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIO,MAAMC,gBAAgB,GAAGA,CAC5BC,OAAyB,EACzBC,OAAiC,KAChC;EACD,MAAMC,OAAO,GAAG,EAAE;EAClB,OAAO,IAAAC,eAAM,EAACH,OAAO,EAAE;IACnBI,YAAY,EAAE,MAAM;IACpBF,OAAO;IACPG,UAAU,EAAE,IAAI;IAChBC,UAAU,EAAE,KAAK;IACjB,GAAGL;EACP,CAAC,CAAC;AACN,CAAC;AAACM,OAAA,CAAAR,gBAAA,GAAAA,gBAAA","ignoreList":[]} | ||
| {"version":3,"names":["pRetry","executeWithRetry","execute","options","retries","maxRetryTime","minTimeout","maxTimeout"],"sources":["executeWithRetry.ts"],"sourcesContent":["import pRetry from \"p-retry\";\n\nexport type ExecuteWithRetryOptions = Parameters<typeof pRetry>[1];\n\nexport const executeWithRetry = <T>(\n execute: () => Promise<T>,\n options?: ExecuteWithRetryOptions\n) => {\n const retries = 20;\n return pRetry(execute, {\n maxRetryTime: 300000,\n retries,\n minTimeout: 1500,\n maxTimeout: 30000,\n ...options\n });\n};\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,SAAS;AAI5B,OAAO,MAAMC,gBAAgB,GAAGA,CAC5BC,OAAyB,EACzBC,OAAiC,KAChC;EACD,MAAMC,OAAO,GAAG,EAAE;EAClB,OAAOJ,MAAM,CAACE,OAAO,EAAE;IACnBG,YAAY,EAAE,MAAM;IACpBD,OAAO;IACPE,UAAU,EAAE,IAAI;IAChBC,UAAU,EAAE,KAAK;IACjB,GAAGJ;EACP,CAAC,CAAC;AACN,CAAC","ignoreList":[]} |
+5
-5
@@ -1,6 +0,6 @@ | ||
| export declare const generateAlphaNumericId: (size?: number | undefined) => string; | ||
| export declare const generateAlphaNumericLowerCaseId: (size?: number | undefined) => string; | ||
| export declare const generateAlphaId: (size?: number | undefined) => string; | ||
| export declare const generateAlphaLowerCaseId: (size?: number | undefined) => string; | ||
| export declare const generateAlphaUpperCaseId: (size?: number | undefined) => string; | ||
| export declare const generateAlphaNumericId: (size?: number) => string; | ||
| export declare const generateAlphaNumericLowerCaseId: (size?: number) => string; | ||
| export declare const generateAlphaId: (size?: number) => string; | ||
| export declare const generateAlphaLowerCaseId: (size?: number) => string; | ||
| export declare const generateAlphaUpperCaseId: (size?: number) => string; | ||
| export declare const generateId: (size?: number) => string; |
+15
-17
@@ -1,9 +0,2 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.generateId = exports.generateAlphaUpperCaseId = exports.generateAlphaNumericLowerCaseId = exports.generateAlphaNumericId = exports.generateAlphaLowerCaseId = exports.generateAlphaId = void 0; | ||
| var _nanoid = require("nanoid"); | ||
| var _nanoidDictionary = require("nanoid-dictionary"); | ||
| import { nanoid, customAlphabet } from "nanoid"; | ||
| /** | ||
@@ -13,14 +6,19 @@ * Package nanoid-dictionary is missing types | ||
| // @ts-expect-error | ||
| import nanoIdDictionary from "nanoid-dictionary"; | ||
| const { | ||
| lowercase, | ||
| uppercase, | ||
| alphanumeric, | ||
| numbers | ||
| } = nanoIdDictionary; | ||
| const DEFAULT_SIZE = 21; | ||
| const generateAlphaNumericId = exports.generateAlphaNumericId = (0, _nanoid.customAlphabet)(_nanoidDictionary.alphanumeric, DEFAULT_SIZE); | ||
| const generateAlphaNumericLowerCaseId = exports.generateAlphaNumericLowerCaseId = (0, _nanoid.customAlphabet)(`${_nanoidDictionary.lowercase}${_nanoidDictionary.numbers}`, DEFAULT_SIZE); | ||
| const generateAlphaId = exports.generateAlphaId = (0, _nanoid.customAlphabet)(`${_nanoidDictionary.lowercase}${_nanoidDictionary.uppercase}`, DEFAULT_SIZE); | ||
| const generateAlphaLowerCaseId = exports.generateAlphaLowerCaseId = (0, _nanoid.customAlphabet)(_nanoidDictionary.lowercase, DEFAULT_SIZE); | ||
| const generateAlphaUpperCaseId = exports.generateAlphaUpperCaseId = (0, _nanoid.customAlphabet)(_nanoidDictionary.uppercase, DEFAULT_SIZE); | ||
| const generateId = (size = DEFAULT_SIZE) => { | ||
| return (0, _nanoid.nanoid)(size); | ||
| export const generateAlphaNumericId = customAlphabet(alphanumeric, DEFAULT_SIZE); | ||
| export const generateAlphaNumericLowerCaseId = customAlphabet(`${lowercase}${numbers}`, DEFAULT_SIZE); | ||
| export const generateAlphaId = customAlphabet(`${lowercase}${uppercase}`, DEFAULT_SIZE); | ||
| export const generateAlphaLowerCaseId = customAlphabet(lowercase, DEFAULT_SIZE); | ||
| export const generateAlphaUpperCaseId = customAlphabet(uppercase, DEFAULT_SIZE); | ||
| export const generateId = (size = DEFAULT_SIZE) => { | ||
| return nanoid(size); | ||
| }; | ||
| exports.generateId = generateId; | ||
| //# sourceMappingURL=generateId.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_nanoid","require","_nanoidDictionary","DEFAULT_SIZE","generateAlphaNumericId","exports","customAlphabet","alphanumeric","generateAlphaNumericLowerCaseId","lowercase","numbers","generateAlphaId","uppercase","generateAlphaLowerCaseId","generateAlphaUpperCaseId","generateId","size","nanoid"],"sources":["generateId.ts"],"sourcesContent":["import { nanoid, customAlphabet } from \"nanoid\";\n/**\n * Package nanoid-dictionary is missing types\n */\n// @ts-expect-error\nimport { lowercase, uppercase, alphanumeric, numbers } from \"nanoid-dictionary\";\n\nconst DEFAULT_SIZE = 21;\n\nexport const generateAlphaNumericId = customAlphabet(alphanumeric, DEFAULT_SIZE);\n\nexport const generateAlphaNumericLowerCaseId = customAlphabet(\n `${lowercase}${numbers}`,\n DEFAULT_SIZE\n);\n\nexport const generateAlphaId = customAlphabet(`${lowercase}${uppercase}`, DEFAULT_SIZE);\n\nexport const generateAlphaLowerCaseId = customAlphabet(lowercase, DEFAULT_SIZE);\n\nexport const generateAlphaUpperCaseId = customAlphabet(uppercase, DEFAULT_SIZE);\n\nexport const generateId = (size = DEFAULT_SIZE): string => {\n return nanoid(size);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AAJA;AACA;AACA;AACA;;AAGA,MAAME,YAAY,GAAG,EAAE;AAEhB,MAAMC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,IAAAE,sBAAc,EAACC,8BAAY,EAAEJ,YAAY,CAAC;AAEzE,MAAMK,+BAA+B,GAAAH,OAAA,CAAAG,+BAAA,GAAG,IAAAF,sBAAc,EACzD,GAAGG,2BAAS,GAAGC,yBAAO,EAAE,EACxBP,YACJ,CAAC;AAEM,MAAMQ,eAAe,GAAAN,OAAA,CAAAM,eAAA,GAAG,IAAAL,sBAAc,EAAC,GAAGG,2BAAS,GAAGG,2BAAS,EAAE,EAAET,YAAY,CAAC;AAEhF,MAAMU,wBAAwB,GAAAR,OAAA,CAAAQ,wBAAA,GAAG,IAAAP,sBAAc,EAACG,2BAAS,EAAEN,YAAY,CAAC;AAExE,MAAMW,wBAAwB,GAAAT,OAAA,CAAAS,wBAAA,GAAG,IAAAR,sBAAc,EAACM,2BAAS,EAAET,YAAY,CAAC;AAExE,MAAMY,UAAU,GAAGA,CAACC,IAAI,GAAGb,YAAY,KAAa;EACvD,OAAO,IAAAc,cAAM,EAACD,IAAI,CAAC;AACvB,CAAC;AAACX,OAAA,CAAAU,UAAA,GAAAA,UAAA","ignoreList":[]} | ||
| {"version":3,"names":["nanoid","customAlphabet","nanoIdDictionary","lowercase","uppercase","alphanumeric","numbers","DEFAULT_SIZE","generateAlphaNumericId","generateAlphaNumericLowerCaseId","generateAlphaId","generateAlphaLowerCaseId","generateAlphaUpperCaseId","generateId","size"],"sources":["generateId.ts"],"sourcesContent":["import { nanoid, customAlphabet } from \"nanoid\";\n/**\n * Package nanoid-dictionary is missing types\n */\n// @ts-expect-error\nimport nanoIdDictionary from \"nanoid-dictionary\";\n\nconst { lowercase, uppercase, alphanumeric, numbers } = nanoIdDictionary;\n\nconst DEFAULT_SIZE = 21;\n\nexport const generateAlphaNumericId = customAlphabet(alphanumeric, DEFAULT_SIZE);\n\nexport const generateAlphaNumericLowerCaseId = customAlphabet(\n `${lowercase}${numbers}`,\n DEFAULT_SIZE\n);\n\nexport const generateAlphaId = customAlphabet(`${lowercase}${uppercase}`, DEFAULT_SIZE);\n\nexport const generateAlphaLowerCaseId = customAlphabet(lowercase, DEFAULT_SIZE);\n\nexport const generateAlphaUpperCaseId = customAlphabet(uppercase, DEFAULT_SIZE);\n\nexport const generateId = (size = DEFAULT_SIZE): string => {\n return nanoid(size);\n};\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,cAAc,QAAQ,QAAQ;AAC/C;AACA;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,mBAAmB;AAEhD,MAAM;EAAEC,SAAS;EAAEC,SAAS;EAAEC,YAAY;EAAEC;AAAQ,CAAC,GAAGJ,gBAAgB;AAExE,MAAMK,YAAY,GAAG,EAAE;AAEvB,OAAO,MAAMC,sBAAsB,GAAGP,cAAc,CAACI,YAAY,EAAEE,YAAY,CAAC;AAEhF,OAAO,MAAME,+BAA+B,GAAGR,cAAc,CACzD,GAAGE,SAAS,GAAGG,OAAO,EAAE,EACxBC,YACJ,CAAC;AAED,OAAO,MAAMG,eAAe,GAAGT,cAAc,CAAC,GAAGE,SAAS,GAAGC,SAAS,EAAE,EAAEG,YAAY,CAAC;AAEvF,OAAO,MAAMI,wBAAwB,GAAGV,cAAc,CAACE,SAAS,EAAEI,YAAY,CAAC;AAE/E,OAAO,MAAMK,wBAAwB,GAAGX,cAAc,CAACG,SAAS,EAAEG,YAAY,CAAC;AAE/E,OAAO,MAAMM,UAAU,GAAGA,CAACC,IAAI,GAAGP,YAAY,KAAa;EACvD,OAAOP,MAAM,CAACc,IAAI,CAAC;AACvB,CAAC","ignoreList":[]} |
+1
-5
@@ -1,7 +0,3 @@ | ||
| "use strict"; | ||
| export {}; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| //# sourceMappingURL=GenericRecord.js.map |
@@ -1,7 +0,1 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.getObjectProperties = void 0; | ||
| /** | ||
@@ -11,3 +5,3 @@ * Unfortunately we need some casting as we do not know which properties are available on the object. | ||
| const getObjectProperties = input => { | ||
| export const getObjectProperties = input => { | ||
| if (!input || typeof input !== "object") { | ||
@@ -21,4 +15,3 @@ return {}; | ||
| }; | ||
| exports.getObjectProperties = getObjectProperties; | ||
| //# sourceMappingURL=getObjectProperties.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["getObjectProperties","input","Object","getOwnPropertyNames","reduce","acc","key","exports"],"sources":["getObjectProperties.ts"],"sourcesContent":["/**\n * Unfortunately we need some casting as we do not know which properties are available on the object.\n */\ninterface GenericRecord {\n [key: string]: any;\n}\n\nexport const getObjectProperties = <T = GenericRecord>(input: unknown): T => {\n if (!input || typeof input !== \"object\") {\n return {} as unknown as T;\n }\n return Object.getOwnPropertyNames(input).reduce<T>((acc, key) => {\n acc[key as keyof T] = (input as unknown as T)[key as keyof T];\n return acc;\n }, {} as T) as unknown as T;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAKO,MAAMA,mBAAmB,GAAuBC,KAAc,IAAQ;EACzE,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACrC,OAAO,CAAC,CAAC;EACb;EACA,OAAOC,MAAM,CAACC,mBAAmB,CAACF,KAAK,CAAC,CAACG,MAAM,CAAI,CAACC,GAAG,EAAEC,GAAG,KAAK;IAC7DD,GAAG,CAACC,GAAG,CAAY,GAAIL,KAAK,CAAkBK,GAAG,CAAY;IAC7D,OAAOD,GAAG;EACd,CAAC,EAAE,CAAC,CAAM,CAAC;AACf,CAAC;AAACE,OAAA,CAAAP,mBAAA,GAAAA,mBAAA","ignoreList":[]} | ||
| {"version":3,"names":["getObjectProperties","input","Object","getOwnPropertyNames","reduce","acc","key"],"sources":["getObjectProperties.ts"],"sourcesContent":["/**\n * Unfortunately we need some casting as we do not know which properties are available on the object.\n */\ninterface GenericRecord {\n [key: string]: any;\n}\n\nexport const getObjectProperties = <T = GenericRecord>(input: unknown): T => {\n if (!input || typeof input !== \"object\") {\n return {} as unknown as T;\n }\n return Object.getOwnPropertyNames(input).reduce<T>((acc, key) => {\n acc[key as keyof T] = (input as unknown as T)[key as keyof T];\n return acc;\n }, {} as T) as unknown as T;\n};\n"],"mappings":"AAAA;AACA;AACA;;AAKA,OAAO,MAAMA,mBAAmB,GAAuBC,KAAc,IAAQ;EACzE,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACrC,OAAO,CAAC,CAAC;EACb;EACA,OAAOC,MAAM,CAACC,mBAAmB,CAACF,KAAK,CAAC,CAACG,MAAM,CAAI,CAACC,GAAG,EAAEC,GAAG,KAAK;IAC7DD,GAAG,CAACC,GAAG,CAAY,GAAIL,KAAK,CAAkBK,GAAG,CAAY;IAC7D,OAAOD,GAAG;EACd,CAAC,EAAE,CAAC,CAAM,CAAC;AACf,CAAC","ignoreList":[]} |
+2
-9
@@ -1,9 +0,3 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.getWebinyVersionHeaders = exports.WEBINY_VERSION_HEADER = void 0; | ||
| const WEBINY_VERSION_HEADER = exports.WEBINY_VERSION_HEADER = "x-webiny-version"; | ||
| const getWebinyVersionHeaders = () => { | ||
| export const WEBINY_VERSION_HEADER = "x-webiny-version"; | ||
| export const getWebinyVersionHeaders = () => { | ||
| const enable = process.env.WEBINY_ENABLE_VERSION_HEADER; | ||
@@ -21,4 +15,3 @@ const version = process.env.WEBINY_VERSION; | ||
| }; | ||
| exports.getWebinyVersionHeaders = getWebinyVersionHeaders; | ||
| //# sourceMappingURL=headers.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["WEBINY_VERSION_HEADER","exports","getWebinyVersionHeaders","enable","process","env","WEBINY_ENABLE_VERSION_HEADER","version","WEBINY_VERSION"],"sources":["headers.ts"],"sourcesContent":["export const WEBINY_VERSION_HEADER = \"x-webiny-version\";\n\nexport const getWebinyVersionHeaders = () => {\n const enable: string | undefined = process.env.WEBINY_ENABLE_VERSION_HEADER;\n const version: string | undefined = process.env.WEBINY_VERSION;\n /**\n * Disable version headers by default.\n */\n if (enable !== \"true\" || !version) {\n return {};\n }\n return {\n \"x-webiny-version\": version\n };\n};\n"],"mappings":";;;;;;AAAO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,kBAAkB;AAEhD,MAAME,uBAAuB,GAAGA,CAAA,KAAM;EACzC,MAAMC,MAA0B,GAAGC,OAAO,CAACC,GAAG,CAACC,4BAA4B;EAC3E,MAAMC,OAA2B,GAAGH,OAAO,CAACC,GAAG,CAACG,cAAc;EAC9D;AACJ;AACA;EACI,IAAIL,MAAM,KAAK,MAAM,IAAI,CAACI,OAAO,EAAE;IAC/B,OAAO,CAAC,CAAC;EACb;EACA,OAAO;IACH,kBAAkB,EAAEA;EACxB,CAAC;AACL,CAAC;AAACN,OAAA,CAAAC,uBAAA,GAAAA,uBAAA","ignoreList":[]} | ||
| {"version":3,"names":["WEBINY_VERSION_HEADER","getWebinyVersionHeaders","enable","process","env","WEBINY_ENABLE_VERSION_HEADER","version","WEBINY_VERSION"],"sources":["headers.ts"],"sourcesContent":["export const WEBINY_VERSION_HEADER = \"x-webiny-version\";\n\nexport const getWebinyVersionHeaders = () => {\n const enable: string | undefined = process.env.WEBINY_ENABLE_VERSION_HEADER;\n const version: string | undefined = process.env.WEBINY_VERSION;\n /**\n * Disable version headers by default.\n */\n if (enable !== \"true\" || !version) {\n return {};\n }\n return {\n \"x-webiny-version\": version\n };\n};\n"],"mappings":"AAAA,OAAO,MAAMA,qBAAqB,GAAG,kBAAkB;AAEvD,OAAO,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EACzC,MAAMC,MAA0B,GAAGC,OAAO,CAACC,GAAG,CAACC,4BAA4B;EAC3E,MAAMC,OAA2B,GAAGH,OAAO,CAACC,GAAG,CAACG,cAAc;EAC9D;AACJ;AACA;EACI,IAAIL,MAAM,KAAK,MAAM,IAAI,CAACI,OAAO,EAAE;IAC/B,OAAO,CAAC,CAAC;EACb;EACA,OAAO;IACH,kBAAkB,EAAEA;EACxB,CAAC;AACL,CAAC","ignoreList":[]} |
+18
-18
@@ -1,21 +0,21 @@ | ||
| export * from "./parseIdentifier"; | ||
| export * from "./zeroPad"; | ||
| export * from "./parseIdentifier.js"; | ||
| export * from "./zeroPad.js"; | ||
| export * from "./exception.js"; | ||
| export * from "./createIdentifier"; | ||
| export * from "./cursor"; | ||
| export * from "./headers"; | ||
| export * from "./generateId"; | ||
| export * from "./mdbid"; | ||
| export * from "./createZodError"; | ||
| export * from "./executeWithRetry"; | ||
| export * from "./removeUndefinedValues"; | ||
| export * from "./removeNullValues"; | ||
| export * from "./utcTimezones"; | ||
| export * from "./cacheKey"; | ||
| export * from "./getObjectProperties"; | ||
| export * from "./middleware"; | ||
| export type { GenericRecord } from "./GenericRecord"; | ||
| import type { AsyncProcessor, NextAsyncProcessor } from "./compose"; | ||
| import { composeAsync } from "./compose"; | ||
| export * from "./createIdentifier.js"; | ||
| export * from "./cursor.js"; | ||
| export * from "./headers.js"; | ||
| export * from "./generateId.js"; | ||
| export * from "./mdbid.js"; | ||
| export * from "./createZodError.js"; | ||
| export * from "./executeWithRetry.js"; | ||
| export * from "./removeUndefinedValues.js"; | ||
| export * from "./removeNullValues.js"; | ||
| export * from "./utcTimezones.js"; | ||
| export * from "./cacheKey.js"; | ||
| export * from "./getObjectProperties.js"; | ||
| export * from "./middleware.js"; | ||
| export type { GenericRecord } from "./GenericRecord.js"; | ||
| import type { AsyncProcessor, NextAsyncProcessor } from "./compose.js"; | ||
| import { composeAsync } from "./compose.js"; | ||
| export { composeAsync }; | ||
| export type { AsyncProcessor, NextAsyncProcessor }; |
+18
-207
@@ -1,209 +0,20 @@ | ||
| "use strict"; | ||
| export * from "./parseIdentifier.js"; | ||
| export * from "./zeroPad.js"; | ||
| export * from "./exception.js"; | ||
| export * from "./createIdentifier.js"; | ||
| export * from "./cursor.js"; | ||
| export * from "./headers.js"; | ||
| export * from "./generateId.js"; | ||
| export * from "./mdbid.js"; | ||
| export * from "./createZodError.js"; | ||
| export * from "./executeWithRetry.js"; | ||
| export * from "./removeUndefinedValues.js"; | ||
| export * from "./removeNullValues.js"; | ||
| export * from "./utcTimezones.js"; | ||
| export * from "./cacheKey.js"; | ||
| export * from "./getObjectProperties.js"; | ||
| export * from "./middleware.js"; | ||
| import { composeAsync } from "./compose.js"; | ||
| export { composeAsync }; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| var _exportNames = { | ||
| composeAsync: true | ||
| }; | ||
| Object.defineProperty(exports, "composeAsync", { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _compose.composeAsync; | ||
| } | ||
| }); | ||
| var _parseIdentifier = require("./parseIdentifier"); | ||
| Object.keys(_parseIdentifier).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _parseIdentifier[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _parseIdentifier[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _zeroPad = require("./zeroPad"); | ||
| Object.keys(_zeroPad).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _zeroPad[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _zeroPad[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _exception = require("./exception.js"); | ||
| Object.keys(_exception).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _exception[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _exception[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _createIdentifier = require("./createIdentifier"); | ||
| Object.keys(_createIdentifier).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _createIdentifier[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _createIdentifier[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _cursor = require("./cursor"); | ||
| Object.keys(_cursor).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _cursor[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _cursor[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _headers = require("./headers"); | ||
| Object.keys(_headers).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _headers[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _headers[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _generateId = require("./generateId"); | ||
| Object.keys(_generateId).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _generateId[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _generateId[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _mdbid = require("./mdbid"); | ||
| Object.keys(_mdbid).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _mdbid[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _mdbid[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _createZodError = require("./createZodError"); | ||
| Object.keys(_createZodError).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _createZodError[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _createZodError[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _executeWithRetry = require("./executeWithRetry"); | ||
| Object.keys(_executeWithRetry).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _executeWithRetry[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _executeWithRetry[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _removeUndefinedValues = require("./removeUndefinedValues"); | ||
| Object.keys(_removeUndefinedValues).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _removeUndefinedValues[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _removeUndefinedValues[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _removeNullValues = require("./removeNullValues"); | ||
| Object.keys(_removeNullValues).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _removeNullValues[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _removeNullValues[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _utcTimezones = require("./utcTimezones"); | ||
| Object.keys(_utcTimezones).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _utcTimezones[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _utcTimezones[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _cacheKey = require("./cacheKey"); | ||
| Object.keys(_cacheKey).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _cacheKey[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _cacheKey[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _getObjectProperties = require("./getObjectProperties"); | ||
| Object.keys(_getObjectProperties).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _getObjectProperties[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _getObjectProperties[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _middleware = require("./middleware"); | ||
| Object.keys(_middleware).forEach(function (key) { | ||
| if (key === "default" || key === "__esModule") return; | ||
| if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
| if (key in exports && exports[key] === _middleware[key]) return; | ||
| Object.defineProperty(exports, key, { | ||
| enumerable: true, | ||
| get: function () { | ||
| return _middleware[key]; | ||
| } | ||
| }); | ||
| }); | ||
| var _compose = require("./compose"); | ||
| //# sourceMappingURL=index.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_parseIdentifier","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_zeroPad","_exception","_createIdentifier","_cursor","_headers","_generateId","_mdbid","_createZodError","_executeWithRetry","_removeUndefinedValues","_removeNullValues","_utcTimezones","_cacheKey","_getObjectProperties","_middleware","_compose"],"sources":["index.ts"],"sourcesContent":["export * from \"~/parseIdentifier\";\nexport * from \"~/zeroPad\";\nexport * from \"~/exception.js\";\nexport * from \"~/createIdentifier\";\nexport * from \"~/cursor\";\nexport * from \"~/headers\";\nexport * from \"~/generateId\";\nexport * from \"~/mdbid\";\nexport * from \"~/createZodError\";\nexport * from \"~/executeWithRetry\";\nexport * from \"~/removeUndefinedValues\";\nexport * from \"~/removeNullValues\";\nexport * from \"~/utcTimezones\";\nexport * from \"./cacheKey\";\nexport * from \"./getObjectProperties\";\nexport * from \"./middleware\";\nexport type { GenericRecord } from \"./GenericRecord\";\n\nimport type { AsyncProcessor, NextAsyncProcessor } from \"~/compose\";\nimport { composeAsync } from \"~/compose\";\n\nexport { composeAsync };\nexport type { AsyncProcessor, NextAsyncProcessor };\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CA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AA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAsB,oBAAA,CAAAtB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAc,oBAAA,CAAAtB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAuB,WAAA,GAAA3B,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAyB,WAAA,EAAAxB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAuB,WAAA,CAAAvB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAe,WAAA,CAAAvB,GAAA;IAAA;EAAA;AAAA;AAIA,IAAAwB,QAAA,GAAA5B,OAAA","ignoreList":[]} | ||
| {"version":3,"names":["composeAsync"],"sources":["index.ts"],"sourcesContent":["export * from \"~/parseIdentifier.js\";\nexport * from \"~/zeroPad.js\";\nexport * from \"~/exception.js\";\nexport * from \"~/createIdentifier.js\";\nexport * from \"~/cursor.js\";\nexport * from \"~/headers.js\";\nexport * from \"~/generateId.js\";\nexport * from \"~/mdbid.js\";\nexport * from \"~/createZodError.js\";\nexport * from \"~/executeWithRetry.js\";\nexport * from \"~/removeUndefinedValues.js\";\nexport * from \"~/removeNullValues.js\";\nexport * from \"~/utcTimezones.js\";\nexport * from \"./cacheKey.js\";\nexport * from \"./getObjectProperties.js\";\nexport * from \"./middleware.js\";\nexport type { GenericRecord } from \"./GenericRecord.js\";\n\nimport type { AsyncProcessor, NextAsyncProcessor } from \"~/compose.js\";\nimport { composeAsync } from \"~/compose.js\";\n\nexport { composeAsync };\nexport type { AsyncProcessor, NextAsyncProcessor };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,YAAY;AAErB,SAASA,YAAY","ignoreList":[]} |
+4
-12
@@ -1,14 +0,6 @@ | ||
| "use strict"; | ||
| import ObjectID from "bson-objectid"; | ||
| export const mdbid = () => { | ||
| return ObjectID().toHexString(); | ||
| }; | ||
| var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.mdbid = void 0; | ||
| var _mdbid = _interopRequireDefault(require("mdbid")); | ||
| // @ts-expect-error `mdbid` package has no types | ||
| const mdbid = () => (0, _mdbid.default)(); | ||
| exports.mdbid = mdbid; | ||
| //# sourceMappingURL=mdbid.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_mdbid","_interopRequireDefault","require","mdbid","generateId","exports"],"sources":["mdbid.ts"],"sourcesContent":["// @ts-expect-error `mdbid` package has no types\nimport generateId from \"mdbid\";\n\nexport const mdbid = (): string => generateId();\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AADA;;AAGO,MAAMC,KAAK,GAAGA,CAAA,KAAc,IAAAC,cAAU,EAAC,CAAC;AAACC,OAAA,CAAAF,KAAA,GAAAA,KAAA","ignoreList":[]} | ||
| {"version":3,"names":["ObjectID","mdbid","toHexString"],"sources":["mdbid.ts"],"sourcesContent":["import ObjectID from \"bson-objectid\";\n\nexport const mdbid = () => {\n return ObjectID().toHexString();\n};\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,eAAe;AAEpC,OAAO,MAAMC,KAAK,GAAGA,CAAA,KAAM;EACvB,OAAOD,QAAQ,CAAC,CAAC,CAACE,WAAW,CAAC,CAAC;AACnC,CAAC","ignoreList":[]} |
+1
-1
@@ -13,2 +13,2 @@ export interface MiddlewareCallable { | ||
| */ | ||
| export declare const middleware: <Params = any, Response_1 = any>(functions?: MiddlewareCallable[]) => (...args: Params[]) => Promise<Response_1 | undefined>; | ||
| export declare const middleware: <Params = any, Response = any>(functions?: MiddlewareCallable[]) => (...args: Params[]) => Promise<Response | undefined>; |
+1
-8
@@ -1,11 +0,5 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.middleware = void 0; | ||
| /** | ||
| * Compose a single middleware from the array of middleware functions | ||
| */ | ||
| const middleware = (functions = []) => { | ||
| export const middleware = (functions = []) => { | ||
| return (...args) => { | ||
@@ -45,4 +39,3 @@ if (!functions.length) { | ||
| }; | ||
| exports.middleware = middleware; | ||
| //# sourceMappingURL=middleware.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["middleware","functions","args","length","Promise","resolve","undefined","chain","parentResolve","parentReject","next","fn","shift","reject","result","e","then","catch","exports"],"sources":["middleware.ts"],"sourcesContent":["export interface MiddlewareCallable {\n (...args: any[]): Promise<any>;\n}\n\nexport interface MiddlewareResolve {\n (...args: any[]): void;\n}\n\nexport interface MiddlewareReject {\n (error: Error): void;\n}\n/**\n * Compose a single middleware from the array of middleware functions\n */\nexport const middleware = <Params = any, Response = any>(functions: MiddlewareCallable[] = []) => {\n return (...args: Params[]): Promise<Response | undefined> => {\n if (!functions.length) {\n return Promise.resolve<Response | undefined>(undefined);\n }\n\n // Create a clone of function chain to prevent modifying the original array with `shift()`\n const chain = [...functions];\n return new Promise((parentResolve: MiddlewareResolve, parentReject: MiddlewareReject) => {\n const next = async (): Promise<any> => {\n const fn = chain.shift();\n if (!fn) {\n return Promise.resolve();\n }\n\n return new Promise(async (resolve, reject) => {\n try {\n const result = await fn(...args, resolve);\n if (typeof result !== \"undefined\") {\n return parentResolve(result);\n }\n } catch (e) {\n reject(e);\n }\n })\n .then(() => {\n return next();\n })\n .then(() => {\n parentResolve(...args);\n })\n .catch(e => {\n parentReject(e);\n });\n };\n\n return next();\n });\n };\n};\n"],"mappings":";;;;;;AAWA;AACA;AACA;AACO,MAAMA,UAAU,GAAGA,CAA+BC,SAA+B,GAAG,EAAE,KAAK;EAC9F,OAAO,CAAC,GAAGC,IAAc,KAAoC;IACzD,IAAI,CAACD,SAAS,CAACE,MAAM,EAAE;MACnB,OAAOC,OAAO,CAACC,OAAO,CAAuBC,SAAS,CAAC;IAC3D;;IAEA;IACA,MAAMC,KAAK,GAAG,CAAC,GAAGN,SAAS,CAAC;IAC5B,OAAO,IAAIG,OAAO,CAAC,CAACI,aAAgC,EAAEC,YAA8B,KAAK;MACrF,MAAMC,IAAI,GAAG,MAAAA,CAAA,KAA0B;QACnC,MAAMC,EAAE,GAAGJ,KAAK,CAACK,KAAK,CAAC,CAAC;QACxB,IAAI,CAACD,EAAE,EAAE;UACL,OAAOP,OAAO,CAACC,OAAO,CAAC,CAAC;QAC5B;QAEA,OAAO,IAAID,OAAO,CAAC,OAAOC,OAAO,EAAEQ,MAAM,KAAK;UAC1C,IAAI;YACA,MAAMC,MAAM,GAAG,MAAMH,EAAE,CAAC,GAAGT,IAAI,EAAEG,OAAO,CAAC;YACzC,IAAI,OAAOS,MAAM,KAAK,WAAW,EAAE;cAC/B,OAAON,aAAa,CAACM,MAAM,CAAC;YAChC;UACJ,CAAC,CAAC,OAAOC,CAAC,EAAE;YACRF,MAAM,CAACE,CAAC,CAAC;UACb;QACJ,CAAC,CAAC,CACGC,IAAI,CAAC,MAAM;UACR,OAAON,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CACDM,IAAI,CAAC,MAAM;UACRR,aAAa,CAAC,GAAGN,IAAI,CAAC;QAC1B,CAAC,CAAC,CACDe,KAAK,CAACF,CAAC,IAAI;UACRN,YAAY,CAACM,CAAC,CAAC;QACnB,CAAC,CAAC;MACV,CAAC;MAED,OAAOL,IAAI,CAAC,CAAC;IACjB,CAAC,CAAC;EACN,CAAC;AACL,CAAC;AAACQ,OAAA,CAAAlB,UAAA,GAAAA,UAAA","ignoreList":[]} | ||
| {"version":3,"names":["middleware","functions","args","length","Promise","resolve","undefined","chain","parentResolve","parentReject","next","fn","shift","reject","result","e","then","catch"],"sources":["middleware.ts"],"sourcesContent":["export interface MiddlewareCallable {\n (...args: any[]): Promise<any>;\n}\n\nexport interface MiddlewareResolve {\n (...args: any[]): void;\n}\n\nexport interface MiddlewareReject {\n (error: Error): void;\n}\n/**\n * Compose a single middleware from the array of middleware functions\n */\nexport const middleware = <Params = any, Response = any>(functions: MiddlewareCallable[] = []) => {\n return (...args: Params[]): Promise<Response | undefined> => {\n if (!functions.length) {\n return Promise.resolve<Response | undefined>(undefined);\n }\n\n // Create a clone of function chain to prevent modifying the original array with `shift()`\n const chain = [...functions];\n return new Promise((parentResolve: MiddlewareResolve, parentReject: MiddlewareReject) => {\n const next = async (): Promise<any> => {\n const fn = chain.shift();\n if (!fn) {\n return Promise.resolve();\n }\n\n return new Promise(async (resolve, reject) => {\n try {\n const result = await fn(...args, resolve);\n if (typeof result !== \"undefined\") {\n return parentResolve(result);\n }\n } catch (e) {\n reject(e);\n }\n })\n .then(() => {\n return next();\n })\n .then(() => {\n parentResolve(...args);\n })\n .catch(e => {\n parentReject(e);\n });\n };\n\n return next();\n });\n };\n};\n"],"mappings":"AAWA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAGA,CAA+BC,SAA+B,GAAG,EAAE,KAAK;EAC9F,OAAO,CAAC,GAAGC,IAAc,KAAoC;IACzD,IAAI,CAACD,SAAS,CAACE,MAAM,EAAE;MACnB,OAAOC,OAAO,CAACC,OAAO,CAAuBC,SAAS,CAAC;IAC3D;;IAEA;IACA,MAAMC,KAAK,GAAG,CAAC,GAAGN,SAAS,CAAC;IAC5B,OAAO,IAAIG,OAAO,CAAC,CAACI,aAAgC,EAAEC,YAA8B,KAAK;MACrF,MAAMC,IAAI,GAAG,MAAAA,CAAA,KAA0B;QACnC,MAAMC,EAAE,GAAGJ,KAAK,CAACK,KAAK,CAAC,CAAC;QACxB,IAAI,CAACD,EAAE,EAAE;UACL,OAAOP,OAAO,CAACC,OAAO,CAAC,CAAC;QAC5B;QAEA,OAAO,IAAID,OAAO,CAAC,OAAOC,OAAO,EAAEQ,MAAM,KAAK;UAC1C,IAAI;YACA,MAAMC,MAAM,GAAG,MAAMH,EAAE,CAAC,GAAGT,IAAI,EAAEG,OAAO,CAAC;YACzC,IAAI,OAAOS,MAAM,KAAK,WAAW,EAAE;cAC/B,OAAON,aAAa,CAACM,MAAM,CAAC;YAChC;UACJ,CAAC,CAAC,OAAOC,CAAC,EAAE;YACRF,MAAM,CAACE,CAAC,CAAC;UACb;QACJ,CAAC,CAAC,CACGC,IAAI,CAAC,MAAM;UACR,OAAON,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CACDM,IAAI,CAAC,MAAM;UACRR,aAAa,CAAC,GAAGN,IAAI,CAAC;QAC1B,CAAC,CAAC,CACDe,KAAK,CAACF,CAAC,IAAI;UACRN,YAAY,CAACM,CAAC,CAAC;QACnB,CAAC,CAAC;MACV,CAAC;MAED,OAAOL,IAAI,CAAC,CAAC;IACjB,CAAC,CAAC;EACN,CAAC;AACL,CAAC","ignoreList":[]} |
+14
-17
| { | ||
| "name": "@webiny/utils", | ||
| "version": "0.0.0-unstable.e53eceafb5", | ||
| "version": "0.0.0-unstable.e622468070", | ||
| "type": "module", | ||
| "main": "index.js", | ||
@@ -18,22 +19,18 @@ "types": "index.d.ts", | ||
| "dependencies": { | ||
| "@webiny/error": "0.0.0-unstable.e53eceafb5", | ||
| "@webiny/plugins": "0.0.0-unstable.e53eceafb5", | ||
| "@noble/hashes": "2.0.1", | ||
| "@webiny/error": "0.0.0-unstable.e622468070", | ||
| "@webiny/plugins": "0.0.0-unstable.e622468070", | ||
| "bson-objectid": "2.0.4", | ||
| "jsonpack": "1.1.5", | ||
| "mdbid": "1.0.0", | ||
| "nanoid": "3.3.8", | ||
| "nanoid": "3.3.11", | ||
| "nanoid-dictionary": "4.3.0", | ||
| "p-retry": "4.6.2" | ||
| "p-retry": "7.1.1", | ||
| "zod": "3.25.76" | ||
| }, | ||
| "devDependencies": { | ||
| "@webiny/project-utils": "0.0.0-unstable.e53eceafb5", | ||
| "rimraf": "6.0.1", | ||
| "typescript": "5.3.3" | ||
| "@webiny/build-tools": "0.0.0-unstable.e622468070", | ||
| "rimraf": "6.1.2", | ||
| "typescript": "5.9.3", | ||
| "vitest": "3.2.4" | ||
| }, | ||
| "peerDependencies": { | ||
| "zod": "^3.23.8" | ||
| }, | ||
| "scripts": { | ||
| "build": "node ../cli/bin.js run build", | ||
| "watch": "node ../cli/bin.js run watch" | ||
| }, | ||
| "adio": { | ||
@@ -46,3 +43,3 @@ "ignore": { | ||
| }, | ||
| "gitHead": "e53eceafb5ce1a3872c9b4548939bb2eae5b1aef" | ||
| "gitHead": "e622468070839dc3f9552c85bf2bbac12d2ef88f" | ||
| } |
@@ -5,2 +5,2 @@ export interface ParseIdentifierResult { | ||
| } | ||
| export declare const parseIdentifier: (value?: string) => ParseIdentifierResult; | ||
| export declare const parseIdentifier: (value: string | undefined) => ParseIdentifierResult; |
+5
-14
@@ -1,9 +0,1 @@ | ||
| "use strict"; | ||
| var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.parseIdentifier = void 0; | ||
| var _error = _interopRequireDefault(require("@webiny/error")); | ||
| /** | ||
@@ -14,10 +6,10 @@ * When you want to extract the generated ID and version out of the identifier string. | ||
| */ | ||
| const parseIdentifier = value => { | ||
| import WebinyError from "@webiny/error"; | ||
| export const parseIdentifier = value => { | ||
| if (!value) { | ||
| throw new _error.default("Missing value to be parsed for the identifier.", "MALFORMED_VALUE"); | ||
| throw new WebinyError("Missing value to be parsed for the identifier.", "MALFORMED_VALUE"); | ||
| } | ||
| const [id, initialVersion] = value.split("#"); | ||
| if (!id) { | ||
| throw new _error.default("Missing ID in given value.", "MALFORMED_VALUE", { | ||
| throw new WebinyError("Missing ID in given value.", "MALFORMED_VALUE", { | ||
| value | ||
@@ -28,3 +20,3 @@ }); | ||
| if (version !== null && version <= 0) { | ||
| throw new _error.default("Version parsed from ID is less or equal to zero.", "MALFORMED_VALUE", { | ||
| throw new WebinyError("Version parsed from ID is less or equal to zero.", "MALFORMED_VALUE", { | ||
| id, | ||
@@ -40,4 +32,3 @@ version, | ||
| }; | ||
| exports.parseIdentifier = parseIdentifier; | ||
| //# sourceMappingURL=parseIdentifier.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["_error","_interopRequireDefault","require","parseIdentifier","value","WebinyError","id","initialVersion","split","version","Number","exports"],"sources":["parseIdentifier.ts"],"sourcesContent":["/**\n * When you want to extract the generated ID and version out of the identifier string.\n * In case there is no version, it's not a problem, possibly only generated ID was sent.\n * It does not cause an error. Write check for that in the code using this fn.\n */\nimport WebinyError from \"@webiny/error\";\n\nexport interface ParseIdentifierResult {\n id: string;\n version: number | null;\n}\n\nexport const parseIdentifier = (value?: string): ParseIdentifierResult => {\n if (!value) {\n throw new WebinyError(\"Missing value to be parsed for the identifier.\", \"MALFORMED_VALUE\");\n }\n const [id, initialVersion] = value.split(\"#\");\n if (!id) {\n throw new WebinyError(\"Missing ID in given value.\", \"MALFORMED_VALUE\", {\n value\n });\n }\n const version = initialVersion ? Number(initialVersion) : null;\n if (version !== null && version <= 0) {\n throw new WebinyError(\n \"Version parsed from ID is less or equal to zero.\",\n \"MALFORMED_VALUE\",\n {\n id,\n version,\n value\n }\n );\n }\n return {\n id,\n version\n };\n};\n"],"mappings":";;;;;;;AAKA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AALA;AACA;AACA;AACA;AACA;;AAQO,MAAMC,eAAe,GAAIC,KAAc,IAA4B;EACtE,IAAI,CAACA,KAAK,EAAE;IACR,MAAM,IAAIC,cAAW,CAAC,gDAAgD,EAAE,iBAAiB,CAAC;EAC9F;EACA,MAAM,CAACC,EAAE,EAAEC,cAAc,CAAC,GAAGH,KAAK,CAACI,KAAK,CAAC,GAAG,CAAC;EAC7C,IAAI,CAACF,EAAE,EAAE;IACL,MAAM,IAAID,cAAW,CAAC,4BAA4B,EAAE,iBAAiB,EAAE;MACnED;IACJ,CAAC,CAAC;EACN;EACA,MAAMK,OAAO,GAAGF,cAAc,GAAGG,MAAM,CAACH,cAAc,CAAC,GAAG,IAAI;EAC9D,IAAIE,OAAO,KAAK,IAAI,IAAIA,OAAO,IAAI,CAAC,EAAE;IAClC,MAAM,IAAIJ,cAAW,CACjB,kDAAkD,EAClD,iBAAiB,EACjB;MACIC,EAAE;MACFG,OAAO;MACPL;IACJ,CACJ,CAAC;EACL;EACA,OAAO;IACHE,EAAE;IACFG;EACJ,CAAC;AACL,CAAC;AAACE,OAAA,CAAAR,eAAA,GAAAA,eAAA","ignoreList":[]} | ||
| {"version":3,"names":["WebinyError","parseIdentifier","value","id","initialVersion","split","version","Number"],"sources":["parseIdentifier.ts"],"sourcesContent":["/**\n * When you want to extract the generated ID and version out of the identifier string.\n * In case there is no version, it's not a problem, possibly only generated ID was sent.\n * It does not cause an error. Write check for that in the code using this fn.\n */\nimport WebinyError from \"@webiny/error\";\n\nexport interface ParseIdentifierResult {\n id: string;\n version: number | null;\n}\n\nexport const parseIdentifier = (value: string | undefined): ParseIdentifierResult => {\n if (!value) {\n throw new WebinyError(\"Missing value to be parsed for the identifier.\", \"MALFORMED_VALUE\");\n }\n const [id, initialVersion] = value.split(\"#\");\n if (!id) {\n throw new WebinyError(\"Missing ID in given value.\", \"MALFORMED_VALUE\", {\n value\n });\n }\n const version = initialVersion ? Number(initialVersion) : null;\n if (version !== null && version <= 0) {\n throw new WebinyError(\n \"Version parsed from ID is less or equal to zero.\",\n \"MALFORMED_VALUE\",\n {\n id,\n version,\n value\n }\n );\n }\n return {\n id,\n version\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAOA,WAAW,MAAM,eAAe;AAOvC,OAAO,MAAMC,eAAe,GAAIC,KAAyB,IAA4B;EACjF,IAAI,CAACA,KAAK,EAAE;IACR,MAAM,IAAIF,WAAW,CAAC,gDAAgD,EAAE,iBAAiB,CAAC;EAC9F;EACA,MAAM,CAACG,EAAE,EAAEC,cAAc,CAAC,GAAGF,KAAK,CAACG,KAAK,CAAC,GAAG,CAAC;EAC7C,IAAI,CAACF,EAAE,EAAE;IACL,MAAM,IAAIH,WAAW,CAAC,4BAA4B,EAAE,iBAAiB,EAAE;MACnEE;IACJ,CAAC,CAAC;EACN;EACA,MAAMI,OAAO,GAAGF,cAAc,GAAGG,MAAM,CAACH,cAAc,CAAC,GAAG,IAAI;EAC9D,IAAIE,OAAO,KAAK,IAAI,IAAIA,OAAO,IAAI,CAAC,EAAE;IAClC,MAAM,IAAIN,WAAW,CACjB,kDAAkD,EAClD,iBAAiB,EACjB;MACIG,EAAE;MACFG,OAAO;MACPJ;IACJ,CACJ,CAAC;EACL;EACA,OAAO;IACHC,EAAE;IACFG;EACJ,CAAC;AACL,CAAC","ignoreList":[]} |
+6
-20
| # @webiny/utils | ||
| [](https://www.npmjs.com/package/@webiny/utils) | ||
| [](https://www.npmjs.com/package/@webiny/utils) | ||
| [](https://github.com/prettier/prettier) | ||
| [](http://makeapullrequest.com) | ||
| > [!NOTE] | ||
| > This package is part of the [Webiny](https://www.webiny.com) monorepo. | ||
| > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package. | ||
| ## About | ||
| 📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs) | ||
| Small package containing the methods that are used throughout our other packages. | ||
| * for example, zeroPad adds zeros to the start of the version number. | ||
| --- | ||
| ## Install | ||
| ``` | ||
| yarn add @webiny/utils | ||
| ``` | ||
| ## Testing | ||
| ### Command | ||
| ```` | ||
| yarn test packages/utils | ||
| ```` | ||
| _This README file is automatically generated during the publish process._ |
@@ -1,8 +0,2 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.removeNullValues = void 0; | ||
| const removeNullValues = target => { | ||
| export const removeNullValues = target => { | ||
| const result = {}; | ||
@@ -17,4 +11,3 @@ for (const key in target) { | ||
| }; | ||
| exports.removeNullValues = removeNullValues; | ||
| //# sourceMappingURL=removeNullValues.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["removeNullValues","target","result","key","exports"],"sources":["removeNullValues.ts"],"sourcesContent":["type WithoutNullableKeys<Type> = {\n [Key in keyof Type]-?: WithoutNullableKeys<NonNullable<Type[Key]>>;\n};\n\nexport const removeNullValues = <T extends Record<string, any>>(target: T) => {\n const result = {} as WithoutNullableKeys<T>;\n for (const key in target) {\n if (target[key] === null) {\n continue;\n }\n\n result[key] = target[key];\n }\n return result;\n};\n"],"mappings":";;;;;;AAIO,MAAMA,gBAAgB,GAAmCC,MAAS,IAAK;EAC1E,MAAMC,MAAM,GAAG,CAAC,CAA2B;EAC3C,KAAK,MAAMC,GAAG,IAAIF,MAAM,EAAE;IACtB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAK,IAAI,EAAE;MACtB;IACJ;IAEAD,MAAM,CAACC,GAAG,CAAC,GAAGF,MAAM,CAACE,GAAG,CAAC;EAC7B;EACA,OAAOD,MAAM;AACjB,CAAC;AAACE,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA","ignoreList":[]} | ||
| {"version":3,"names":["removeNullValues","target","result","key"],"sources":["removeNullValues.ts"],"sourcesContent":["type WithoutNullableKeys<Type> = {\n [Key in keyof Type]-?: WithoutNullableKeys<NonNullable<Type[Key]>>;\n};\n\nexport const removeNullValues = <T extends Record<string, any>>(target: T) => {\n const result = {} as WithoutNullableKeys<T>;\n for (const key in target) {\n if (target[key] === null) {\n continue;\n }\n\n result[key] = target[key];\n }\n return result;\n};\n"],"mappings":"AAIA,OAAO,MAAMA,gBAAgB,GAAmCC,MAAS,IAAK;EAC1E,MAAMC,MAAM,GAAG,CAAC,CAA2B;EAC3C,KAAK,MAAMC,GAAG,IAAIF,MAAM,EAAE;IACtB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAK,IAAI,EAAE;MACtB;IACJ;IAEAD,MAAM,CAACC,GAAG,CAAC,GAAGF,MAAM,CAACE,GAAG,CAAC;EAC7B;EACA,OAAOD,MAAM;AACjB,CAAC","ignoreList":[]} |
@@ -1,8 +0,2 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.removeUndefinedValues = void 0; | ||
| const removeUndefinedValues = target => { | ||
| export const removeUndefinedValues = target => { | ||
| const result = {}; | ||
@@ -17,4 +11,3 @@ for (const key in target) { | ||
| }; | ||
| exports.removeUndefinedValues = removeUndefinedValues; | ||
| //# sourceMappingURL=removeUndefinedValues.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["removeUndefinedValues","target","result","key","undefined","exports"],"sources":["removeUndefinedValues.ts"],"sourcesContent":["export const removeUndefinedValues = <T extends Record<string, any>>(target: T) => {\n const result = {} as T;\n for (const key in target) {\n if (target[key] === undefined) {\n continue;\n }\n\n result[key] = target[key];\n }\n return result;\n};\n"],"mappings":";;;;;;AAAO,MAAMA,qBAAqB,GAAmCC,MAAS,IAAK;EAC/E,MAAMC,MAAM,GAAG,CAAC,CAAM;EACtB,KAAK,MAAMC,GAAG,IAAIF,MAAM,EAAE;IACtB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC3B;IACJ;IAEAF,MAAM,CAACC,GAAG,CAAC,GAAGF,MAAM,CAACE,GAAG,CAAC;EAC7B;EACA,OAAOD,MAAM;AACjB,CAAC;AAACG,OAAA,CAAAL,qBAAA,GAAAA,qBAAA","ignoreList":[]} | ||
| {"version":3,"names":["removeUndefinedValues","target","result","key","undefined"],"sources":["removeUndefinedValues.ts"],"sourcesContent":["export const removeUndefinedValues = <T extends Record<string, any>>(target: T) => {\n const result = {} as T;\n for (const key in target) {\n if (target[key] === undefined) {\n continue;\n }\n\n result[key] = target[key];\n }\n return result;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,qBAAqB,GAAmCC,MAAS,IAAK;EAC/E,MAAMC,MAAM,GAAG,CAAC,CAAM;EACtB,KAAK,MAAMC,GAAG,IAAIF,MAAM,EAAE;IACtB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC3B;IACJ;IAEAF,MAAM,CAACC,GAAG,CAAC,GAAGF,MAAM,CAACE,GAAG,CAAC;EAC7B;EACA,OAAOD,MAAM;AACjB,CAAC","ignoreList":[]} |
+1
-7
@@ -1,8 +0,2 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.UTC_TIMEZONES = void 0; | ||
| const UTC_TIMEZONES = exports.UTC_TIMEZONES = [{ | ||
| export const UTC_TIMEZONES = [{ | ||
| value: "-12:00", | ||
@@ -9,0 +3,0 @@ label: "UTC-12:00" |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["UTC_TIMEZONES","exports","value","label"],"sources":["utcTimezones.ts"],"sourcesContent":["export const UTC_TIMEZONES = [\n {\n value: \"-12:00\",\n label: \"UTC-12:00\"\n },\n {\n value: \"-11:00\",\n label: \"UTC-11:00\"\n },\n {\n value: \"-10:00\",\n label: \"UTC-10:00\"\n },\n {\n value: \"-09:30\",\n label: \"UTC-09:30\"\n },\n {\n value: \"-09:00\",\n label: \"UTC-09:00\"\n },\n {\n value: \"-08:00\",\n label: \"UTC-08:00\"\n },\n {\n value: \"-07:00\",\n label: \"UTC-07:00\"\n },\n {\n value: \"-06:00\",\n label: \"UTC-06:00\"\n },\n {\n value: \"-05:00\",\n label: \"UTC-05:00\"\n },\n {\n value: \"-04:30\",\n label: \"UTC-04:30\"\n },\n {\n value: \"-04:00\",\n label: \"UTC-04:00\"\n },\n {\n value: \"-03:30\",\n label: \"UTC-03:30\"\n },\n {\n value: \"-03:00\",\n label: \"UTC-03:00\"\n },\n {\n value: \"-02:00\",\n label: \"UTC-02:00\"\n },\n {\n value: \"-01:00\",\n label: \"UTC-01:00\"\n },\n {\n value: \"+00:00\",\n label: \"UTC+00:00\"\n },\n {\n value: \"+01:00\",\n label: \"UTC+01:00\"\n },\n {\n value: \"+02:00\",\n label: \"UTC+02:00\"\n },\n {\n value: \"+03:00\",\n label: \"UTC+03:00\"\n },\n {\n value: \"+03:30\",\n label: \"UTC+03:30\"\n },\n {\n value: \"+04:00\",\n label: \"UTC+04:00\"\n },\n {\n value: \"+04:30\",\n label: \"UTC+04:30\"\n },\n {\n value: \"+05:30\",\n label: \"UTC+05:30\"\n },\n {\n value: \"+05:45\",\n label: \"UTC+05:45\"\n },\n {\n value: \"+06:00\",\n label: \"UTC+06:00\"\n },\n {\n value: \"+06:30\",\n label: \"UTC+06:30\"\n },\n {\n value: \"+07:00\",\n label: \"UTC+07:00\"\n },\n {\n value: \"+08:00\",\n label: \"UTC+08:00\"\n },\n {\n value: \"+08:45\",\n label: \"UTC+08:45\"\n },\n {\n value: \"+09:00\",\n label: \"UTC+09:00\"\n },\n {\n value: \"+09:30\",\n label: \"UTC+09:30\"\n },\n {\n value: \"+10:00\",\n label: \"UTC+10:00\"\n },\n {\n value: \"+10:30\",\n label: \"UTC+10:30\"\n },\n {\n value: \"+11:00\",\n label: \"UTC+11:00\"\n },\n {\n value: \"+11:30\",\n label: \"UTC+11:30\"\n },\n {\n value: \"+12:00\",\n label: \"UTC+12:00\"\n },\n {\n value: \"+12:45\",\n label: \"UTC+12:45\"\n },\n {\n value: \"+13:00\",\n label: \"UTC+13:00\"\n },\n {\n value: \"+14:00\",\n label: \"UTC+14:00\"\n }\n];\n"],"mappings":";;;;;;AAAO,MAAMA,aAAa,GAAAC,OAAA,CAAAD,a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ACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,CACJ","ignoreList":[]} | ||
| {"version":3,"names":["UTC_TIMEZONES","value","label"],"sources":["utcTimezones.ts"],"sourcesContent":["export const UTC_TIMEZONES = [\n {\n value: \"-12:00\",\n label: \"UTC-12:00\"\n },\n {\n value: \"-11:00\",\n label: \"UTC-11:00\"\n },\n {\n value: \"-10:00\",\n label: \"UTC-10:00\"\n },\n {\n value: \"-09:30\",\n label: \"UTC-09:30\"\n },\n {\n value: \"-09:00\",\n label: \"UTC-09:00\"\n },\n {\n value: \"-08:00\",\n label: \"UTC-08:00\"\n },\n {\n value: \"-07:00\",\n label: \"UTC-07:00\"\n },\n {\n value: \"-06:00\",\n label: \"UTC-06:00\"\n },\n {\n value: \"-05:00\",\n label: \"UTC-05:00\"\n },\n {\n value: \"-04:30\",\n label: \"UTC-04:30\"\n },\n {\n value: \"-04:00\",\n label: \"UTC-04:00\"\n },\n {\n value: \"-03:30\",\n label: \"UTC-03:30\"\n },\n {\n value: \"-03:00\",\n label: \"UTC-03:00\"\n },\n {\n value: \"-02:00\",\n label: \"UTC-02:00\"\n },\n {\n value: \"-01:00\",\n label: \"UTC-01:00\"\n },\n {\n value: \"+00:00\",\n label: \"UTC+00:00\"\n },\n {\n value: \"+01:00\",\n label: \"UTC+01:00\"\n },\n {\n value: \"+02:00\",\n label: \"UTC+02:00\"\n },\n {\n value: \"+03:00\",\n label: \"UTC+03:00\"\n },\n {\n value: \"+03:30\",\n label: \"UTC+03:30\"\n },\n {\n value: \"+04:00\",\n label: \"UTC+04:00\"\n },\n {\n value: \"+04:30\",\n label: \"UTC+04:30\"\n },\n {\n value: \"+05:30\",\n label: \"UTC+05:30\"\n },\n {\n value: \"+05:45\",\n label: \"UTC+05:45\"\n },\n {\n value: \"+06:00\",\n label: \"UTC+06:00\"\n },\n {\n value: \"+06:30\",\n label: \"UTC+06:30\"\n },\n {\n value: \"+07:00\",\n label: \"UTC+07:00\"\n },\n {\n value: \"+08:00\",\n label: \"UTC+08:00\"\n },\n {\n value: \"+08:45\",\n label: \"UTC+08:45\"\n },\n {\n value: \"+09:00\",\n label: \"UTC+09:00\"\n },\n {\n value: \"+09:30\",\n label: \"UTC+09:30\"\n },\n {\n value: \"+10:00\",\n label: \"UTC+10:00\"\n },\n {\n value: \"+10:30\",\n label: \"UTC+10:30\"\n },\n {\n value: \"+11:00\",\n label: \"UTC+11:00\"\n },\n {\n value: \"+11:30\",\n label: \"UTC+11:30\"\n },\n {\n value: \"+12:00\",\n label: \"UTC+12:00\"\n },\n {\n value: \"+12:45\",\n label: \"UTC+12:45\"\n },\n {\n value: \"+13:00\",\n label: \"UTC+13:00\"\n },\n {\n value: \"+14:00\",\n label: \"UTC+14:00\"\n }\n];\n"],"mappings":"AAAA,OAAO,MAAMA,aAAa,GAAG,CACzB;EACIC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KA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,EACD;EACID,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE;AACX,CAAC,CACJ","ignoreList":[]} |
+1
-8
@@ -1,7 +0,1 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.zeroPad = void 0; | ||
| /** | ||
@@ -11,7 +5,6 @@ * Used when we need to create an ID of some data record. | ||
| */ | ||
| const zeroPad = (version, amount = 4) => { | ||
| export const zeroPad = (version, amount = 4) => { | ||
| return `${version}`.padStart(amount, "0"); | ||
| }; | ||
| exports.zeroPad = zeroPad; | ||
| //# sourceMappingURL=zeroPad.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"names":["zeroPad","version","amount","padStart","exports"],"sources":["zeroPad.ts"],"sourcesContent":["/**\n * Used when we need to create an ID of some data record.\n * Or, for example, when adding the revision record to the DynamoDB table.\n */\nexport const zeroPad = (version: string | number, amount = 4): string => {\n return `${version}`.padStart(amount, \"0\");\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACO,MAAMA,OAAO,GAAGA,CAACC,OAAwB,EAAEC,MAAM,GAAG,CAAC,KAAa;EACrE,OAAO,GAAGD,OAAO,EAAE,CAACE,QAAQ,CAACD,MAAM,EAAE,GAAG,CAAC;AAC7C,CAAC;AAACE,OAAA,CAAAJ,OAAA,GAAAA,OAAA","ignoreList":[]} | ||
| {"version":3,"names":["zeroPad","version","amount","padStart"],"sources":["zeroPad.ts"],"sourcesContent":["/**\n * Used when we need to create an ID of some data record.\n * Or, for example, when adding the revision record to the DynamoDB table.\n */\nexport const zeroPad = (version: string | number, amount = 4): string => {\n return `${version}`.padStart(amount, \"0\");\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,MAAMA,OAAO,GAAGA,CAACC,OAAwB,EAAEC,MAAM,GAAG,CAAC,KAAa;EACrE,OAAO,GAAGD,OAAO,EAAE,CAACE,QAAQ,CAACD,MAAM,EAAE,GAAG,CAAC;AAC7C,CAAC","ignoreList":[]} |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
0
-100%Yes
NaN74013
-24.53%9
12.5%4
33.33%835
-31.73%11
-56%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated