@punks/backend-core 0.0.64 → 0.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,3 @@
1
1
  import { PortableTextBlock } from "@portabletext/types";
2
2
  export type RichText = PortableTextBlock[];
3
+ export type Optional<T> = T | undefined;
@@ -10,4 +10,5 @@ export * from "./threading";
10
10
  export { buildTree, TreeNodeBuilder } from "./trees";
11
11
  export * from "./mappings";
12
12
  export * from "./uid";
13
+ export { serializeQueryString, buildUrl, deserializeQueryString, getQueryParameter, updateQueryParameters, } from "./urls";
13
14
  export { ExcelSheetDefinition, ExcelKeyTransform, ExcelColumnDefinition as ExcelRowBuilder, ExcelParseOptions, excelBuild, excelParse, } from "./xls";
@@ -1 +1,2 @@
1
1
  export declare function sleep(ms: number): Promise<unknown>;
2
+ export declare const mapAsync: <T, R>(array: T[], callback: (value: T, index: number, array: T[]) => Promise<R>) => Promise<R[]>;
@@ -0,0 +1,13 @@
1
+ export declare function serializeQueryString(obj: {
2
+ [key: string]: any;
3
+ }): string;
4
+ export declare const buildUrl: (path: string, query: {
5
+ [key: string]: any;
6
+ }) => string;
7
+ export declare function deserializeQueryString(queryString: string): {
8
+ [key: string]: any;
9
+ };
10
+ export declare const getQueryParameter: (name: string, location?: Location) => any;
11
+ export declare const updateQueryParameters: (queryString: string, params: {
12
+ [key: string]: any;
13
+ }) => string;
package/dist/index.d.ts CHANGED
@@ -147,6 +147,7 @@ interface ITree<TKey, TValue> {
147
147
  }
148
148
 
149
149
  type RichText = PortableTextBlock[];
150
+ type Optional<T> = T | undefined;
150
151
 
151
152
  declare const range: (start: number, end: number) => number[];
152
153
  declare const indexes: (startIndex: number, count: number) => number[];
@@ -235,6 +236,7 @@ declare const jsonSerialize: (obj: any, options?: {
235
236
  declare const pluralize: (word: string) => string;
236
237
 
237
238
  declare function sleep(ms: number): Promise<unknown>;
239
+ declare const mapAsync: <T, R>(array: T[], callback: (value: T, index: number, array: T[]) => Promise<R>) => Promise<R[]>;
238
240
 
239
241
  type TreeNodeBuilder<TKey, TRecord, TTreeNode extends ITreeNode<TKey, TRecord>> = {
240
242
  idSelector: (record: TRecord) => TKey;
@@ -250,6 +252,20 @@ declare const mapOrThrow: <T>({ mapper, throw: throwFn, }: {
250
252
 
251
253
  declare const newUuid: () => string;
252
254
 
255
+ declare function serializeQueryString(obj: {
256
+ [key: string]: any;
257
+ }): string;
258
+ declare const buildUrl: (path: string, query: {
259
+ [key: string]: any;
260
+ }) => string;
261
+ declare function deserializeQueryString(queryString: string): {
262
+ [key: string]: any;
263
+ };
264
+ declare const getQueryParameter: (name: string, location?: Location) => any;
265
+ declare const updateQueryParameters: (queryString: string, params: {
266
+ [key: string]: any;
267
+ }) => string;
268
+
253
269
  interface ExcelColumnDefinition<T> {
254
270
  value: (row: T) => any;
255
271
  header: string;
@@ -271,4 +287,4 @@ type ExcelParseOptions = {
271
287
  };
272
288
  declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any[];
273
289
 
274
- export { AppServiceReference, CsvColumnDefinition as ColumnDefinition, ConsoleLogger, CsvBuildOptions, DatadogLogger, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, FileLogger, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, LocalizedField, Log, LogLevel, MetaSerializationType, RichText, TimeUnit, TreeNodeBuilder, addTime, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, createDayPath, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, jsonSerialize, last, logMemoryUsage, mapOrThrow, mergeDeep, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, processArrayItemMove, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, subArrays, subtractTime, toArrayDict, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
290
+ export { AppServiceReference, CsvColumnDefinition as ColumnDefinition, ConsoleLogger, CsvBuildOptions, DatadogLogger, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, FileLogger, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, LocalizedField, Log, LogLevel, MetaSerializationType, Optional, RichText, TimeUnit, TreeNodeBuilder, addTime, buildObject, buildTree, buildUrl, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, createDayPath, csvBuild, csvParse, deserializeQueryString, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, getQueryParameter, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, jsonSerialize, last, logMemoryUsage, mapAsync, mapOrThrow, mergeDeep, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, processArrayItemMove, range, removeUndefinedProps, selectMany, serializeQueryString, sleep, sort, splitPath, subArrays, subtractTime, toArrayDict, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart, updateQueryParameters };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/backend-core",
3
- "version": "0.0.64",
3
+ "version": "0.0.66",
4
4
  "description": "WebPunks Backend Core",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",