@uniformdev/redirect 19.179.1-alpha.1 → 19.180.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -37,85 +37,6 @@ declare class TrieData<T> {
37
37
  [key: string]: TrieData<T> | T;
38
38
  }
39
39
 
40
- type RedirectClientCacheOptions = {
41
- prePopulate?: boolean;
42
- refreshRate?: number;
43
- };
44
- declare abstract class RedirectClientCache<RedirectClientCacheOptions> {
45
- options: RedirectClientCacheOptions;
46
- constructor(options: RedirectClientCacheOptions);
47
- abstract get(key: string): Promise<PathTrie<DirectionAwareRedirectDefinition>> | undefined;
48
- abstract set(key: string, data: Promise<PathTrie<DirectionAwareRedirectDefinition>>, refresh: () => Promise<PathTrie<DirectionAwareRedirectDefinition>>): void;
49
- abstract refresh(): Promise<void[]>;
50
- }
51
-
52
- type RedirectClientOptions = ClientOptions & {
53
- /** Caching mechanism used to hold redirect data payload for rapid retrieval */
54
- dataCache?: RedirectClientCache<RedirectClientCacheOptions>;
55
- };
56
- type RedirectOptions = {
57
- /** Reverse flips the direction of the search, instead of redirecting a source to a target you will be finding the source that could have produced a given target */
58
- reverse?: boolean;
59
- /** Includes a label highlighting all wildcard variables with HTML em tags */
60
- label?: boolean;
61
- };
62
- declare class RedirectClient extends ApiClient<RedirectClientOptions> {
63
- constructor(options: RedirectClientOptions);
64
- getRedirect: (options: RedirectClientGetRedirect) => Promise<RedirectDefinition | undefined>;
65
- getRedirects: (options?: RedirectClientGetRedirects) => Promise<RedirectGetResponse>;
66
- getAllRedirects(orderBy?: RedirectClientGetRedirects['orderBy']): AsyncGenerator<{
67
- redirect: {
68
- id?: string | undefined;
69
- sourceUrl: string;
70
- targetUrl: string;
71
- targetStatusCode: number;
72
- sourceProjectMapNodeId?: string | undefined;
73
- targetProjectMapNodeId?: string | undefined;
74
- projectMapId?: string | undefined;
75
- sourceRetainQuerystring?: boolean | undefined;
76
- sourceMustMatchDomain?: boolean | undefined;
77
- targetPreserveIncomingProtocol?: boolean | undefined;
78
- targetPreserveIncomingDomain?: boolean | undefined;
79
- targetMergeQuerystring?: boolean | undefined;
80
- labelAsSystem?: boolean | undefined;
81
- };
82
- metadata: {
83
- updatedAt?: string | undefined;
84
- updatedBy?: string | undefined;
85
- createdAt?: string | undefined;
86
- createdBy?: string | undefined;
87
- createdByName?: string | undefined;
88
- };
89
- total: number | undefined;
90
- }, void, unknown>;
91
- getRedirectTrie: (options?: {
92
- bypassDataCache?: boolean;
93
- }) => Promise<PathTrie<DirectionAwareRedirectDefinition>>;
94
- resetRedirectTrieDataCache: () => Promise<void>;
95
- upsertRedirect: (redirect: RedirectUpsertRequest['redirect']) => Promise<string>;
96
- deleteRedirect: (id: string) => Promise<string>;
97
- static processUrlBestMatch: (url: string, trie: PathTrie<DirectionAwareRedirectDefinition>, options?: RedirectOptions) => Promise<RedirectResult | undefined>;
98
- processUrlBestMatch: (url: string, options?: RedirectOptions, useTrie?: boolean) => Promise<RedirectResult | undefined>;
99
- processUrlAllMatches: (url: string, options?: RedirectOptions, useTrie?: boolean) => Promise<RedirectResult[]>;
100
- private static assembling;
101
- private static assemblingPromise;
102
- private assembleTrie;
103
- private static processHops;
104
- private static processHop;
105
- /**
106
- * Taking the url, found definition and variables and returning a redirect result object
107
- * @param processedUrl - Propertly formatted url input
108
- * @param definition - Redirect definition found to match the processed url
109
- * @param variables - Wildcard variables found during definition discovery
110
- * @param options - Different options available to the redirect engine
111
- */
112
- private static processDefinitionToResults;
113
- static validateRedirect(url: string, redirectDefinition: RedirectDefinition['redirect']): boolean;
114
- }
115
- declare class UncachedRedirectClient extends RedirectClient {
116
- constructor(options: Omit<RedirectClientOptions, 'bypassCache'>);
117
- }
118
-
119
40
  /**
120
41
  * This file was auto-generated by openapi-typescript.
121
42
  * Do not make direct changes to the file.
@@ -359,6 +280,65 @@ interface external {
359
280
  };
360
281
  }
361
282
 
283
+ type RedirectClientCacheOptions = {
284
+ prePopulate?: boolean;
285
+ refreshRate?: number;
286
+ };
287
+ declare abstract class RedirectClientCache<RedirectClientCacheOptions> {
288
+ options: RedirectClientCacheOptions;
289
+ constructor(options: RedirectClientCacheOptions);
290
+ abstract get(key: string): Promise<PathTrie<DirectionAwareRedirectDefinition>> | undefined;
291
+ abstract set(key: string, data: Promise<PathTrie<DirectionAwareRedirectDefinition>>, refresh: () => Promise<PathTrie<DirectionAwareRedirectDefinition>>): void;
292
+ abstract refresh(): Promise<void[]>;
293
+ }
294
+
295
+ type RedirectClientOptions = ClientOptions & {
296
+ /** Caching mechanism used to hold redirect data payload for rapid retrieval */
297
+ dataCache?: RedirectClientCache<RedirectClientCacheOptions>;
298
+ };
299
+ type RedirectOptions = {
300
+ /** Reverse flips the direction of the search, instead of redirecting a source to a target you will be finding the source that could have produced a given target */
301
+ reverse?: boolean;
302
+ /** Includes a label highlighting all wildcard variables with HTML em tags */
303
+ label?: boolean;
304
+ };
305
+ declare class RedirectClient extends ApiClient<RedirectClientOptions> {
306
+ constructor(options: RedirectClientOptions);
307
+ getRedirect: (options: RedirectClientGetRedirect) => Promise<RedirectDefinition | undefined>;
308
+ getRedirects: (options?: RedirectClientGetRedirects) => Promise<RedirectGetResponse>;
309
+ getAllRedirects(orderBy?: RedirectClientGetRedirects['orderBy']): AsyncGenerator<{
310
+ redirect: components["schemas"]["Redirect"];
311
+ metadata: components["schemas"]["RedirectMetadata"];
312
+ total: number | undefined;
313
+ }, void, unknown>;
314
+ getRedirectTrie: (options?: {
315
+ bypassDataCache?: boolean;
316
+ }) => Promise<PathTrie<DirectionAwareRedirectDefinition>>;
317
+ resetRedirectTrieDataCache: () => Promise<void>;
318
+ upsertRedirect: (redirect: RedirectUpsertRequest["redirect"]) => Promise<string>;
319
+ deleteRedirect: (id: string) => Promise<string>;
320
+ static processUrlBestMatch: (url: string, trie: PathTrie<DirectionAwareRedirectDefinition>, options?: RedirectOptions) => Promise<RedirectResult | undefined>;
321
+ processUrlBestMatch: (url: string, options?: RedirectOptions, useTrie?: boolean) => Promise<RedirectResult | undefined>;
322
+ processUrlAllMatches: (url: string, options?: RedirectOptions, useTrie?: boolean) => Promise<RedirectResult[]>;
323
+ private static assembling;
324
+ private static assemblingPromise;
325
+ private assembleTrie;
326
+ private static processHops;
327
+ private static processHop;
328
+ /**
329
+ * Taking the url, found definition and variables and returning a redirect result object
330
+ * @param processedUrl - Propertly formatted url input
331
+ * @param definition - Redirect definition found to match the processed url
332
+ * @param variables - Wildcard variables found during definition discovery
333
+ * @param options - Different options available to the redirect engine
334
+ */
335
+ private static processDefinitionToResults;
336
+ static validateRedirect(url: string, redirectDefinition: RedirectDefinition['redirect']): boolean;
337
+ }
338
+ declare class UncachedRedirectClient extends RedirectClient {
339
+ constructor(options: Omit<RedirectClientOptions, 'bypassCache'>);
340
+ }
341
+
362
342
  type RedirectUpsertRequest = paths['/api/v1/redirect']['put']['requestBody']['content']['application/json'];
363
343
  type RedirectDeleteRequest = paths['/api/v1/redirect']['delete']['requestBody']['content']['application/json'];
364
344
  type RedirectGetRequest = paths['/api/v1/redirect']['get']['parameters']['query'];
package/dist/index.d.ts CHANGED
@@ -37,85 +37,6 @@ declare class TrieData<T> {
37
37
  [key: string]: TrieData<T> | T;
38
38
  }
39
39
 
40
- type RedirectClientCacheOptions = {
41
- prePopulate?: boolean;
42
- refreshRate?: number;
43
- };
44
- declare abstract class RedirectClientCache<RedirectClientCacheOptions> {
45
- options: RedirectClientCacheOptions;
46
- constructor(options: RedirectClientCacheOptions);
47
- abstract get(key: string): Promise<PathTrie<DirectionAwareRedirectDefinition>> | undefined;
48
- abstract set(key: string, data: Promise<PathTrie<DirectionAwareRedirectDefinition>>, refresh: () => Promise<PathTrie<DirectionAwareRedirectDefinition>>): void;
49
- abstract refresh(): Promise<void[]>;
50
- }
51
-
52
- type RedirectClientOptions = ClientOptions & {
53
- /** Caching mechanism used to hold redirect data payload for rapid retrieval */
54
- dataCache?: RedirectClientCache<RedirectClientCacheOptions>;
55
- };
56
- type RedirectOptions = {
57
- /** Reverse flips the direction of the search, instead of redirecting a source to a target you will be finding the source that could have produced a given target */
58
- reverse?: boolean;
59
- /** Includes a label highlighting all wildcard variables with HTML em tags */
60
- label?: boolean;
61
- };
62
- declare class RedirectClient extends ApiClient<RedirectClientOptions> {
63
- constructor(options: RedirectClientOptions);
64
- getRedirect: (options: RedirectClientGetRedirect) => Promise<RedirectDefinition | undefined>;
65
- getRedirects: (options?: RedirectClientGetRedirects) => Promise<RedirectGetResponse>;
66
- getAllRedirects(orderBy?: RedirectClientGetRedirects['orderBy']): AsyncGenerator<{
67
- redirect: {
68
- id?: string | undefined;
69
- sourceUrl: string;
70
- targetUrl: string;
71
- targetStatusCode: number;
72
- sourceProjectMapNodeId?: string | undefined;
73
- targetProjectMapNodeId?: string | undefined;
74
- projectMapId?: string | undefined;
75
- sourceRetainQuerystring?: boolean | undefined;
76
- sourceMustMatchDomain?: boolean | undefined;
77
- targetPreserveIncomingProtocol?: boolean | undefined;
78
- targetPreserveIncomingDomain?: boolean | undefined;
79
- targetMergeQuerystring?: boolean | undefined;
80
- labelAsSystem?: boolean | undefined;
81
- };
82
- metadata: {
83
- updatedAt?: string | undefined;
84
- updatedBy?: string | undefined;
85
- createdAt?: string | undefined;
86
- createdBy?: string | undefined;
87
- createdByName?: string | undefined;
88
- };
89
- total: number | undefined;
90
- }, void, unknown>;
91
- getRedirectTrie: (options?: {
92
- bypassDataCache?: boolean;
93
- }) => Promise<PathTrie<DirectionAwareRedirectDefinition>>;
94
- resetRedirectTrieDataCache: () => Promise<void>;
95
- upsertRedirect: (redirect: RedirectUpsertRequest['redirect']) => Promise<string>;
96
- deleteRedirect: (id: string) => Promise<string>;
97
- static processUrlBestMatch: (url: string, trie: PathTrie<DirectionAwareRedirectDefinition>, options?: RedirectOptions) => Promise<RedirectResult | undefined>;
98
- processUrlBestMatch: (url: string, options?: RedirectOptions, useTrie?: boolean) => Promise<RedirectResult | undefined>;
99
- processUrlAllMatches: (url: string, options?: RedirectOptions, useTrie?: boolean) => Promise<RedirectResult[]>;
100
- private static assembling;
101
- private static assemblingPromise;
102
- private assembleTrie;
103
- private static processHops;
104
- private static processHop;
105
- /**
106
- * Taking the url, found definition and variables and returning a redirect result object
107
- * @param processedUrl - Propertly formatted url input
108
- * @param definition - Redirect definition found to match the processed url
109
- * @param variables - Wildcard variables found during definition discovery
110
- * @param options - Different options available to the redirect engine
111
- */
112
- private static processDefinitionToResults;
113
- static validateRedirect(url: string, redirectDefinition: RedirectDefinition['redirect']): boolean;
114
- }
115
- declare class UncachedRedirectClient extends RedirectClient {
116
- constructor(options: Omit<RedirectClientOptions, 'bypassCache'>);
117
- }
118
-
119
40
  /**
120
41
  * This file was auto-generated by openapi-typescript.
121
42
  * Do not make direct changes to the file.
@@ -359,6 +280,65 @@ interface external {
359
280
  };
360
281
  }
361
282
 
283
+ type RedirectClientCacheOptions = {
284
+ prePopulate?: boolean;
285
+ refreshRate?: number;
286
+ };
287
+ declare abstract class RedirectClientCache<RedirectClientCacheOptions> {
288
+ options: RedirectClientCacheOptions;
289
+ constructor(options: RedirectClientCacheOptions);
290
+ abstract get(key: string): Promise<PathTrie<DirectionAwareRedirectDefinition>> | undefined;
291
+ abstract set(key: string, data: Promise<PathTrie<DirectionAwareRedirectDefinition>>, refresh: () => Promise<PathTrie<DirectionAwareRedirectDefinition>>): void;
292
+ abstract refresh(): Promise<void[]>;
293
+ }
294
+
295
+ type RedirectClientOptions = ClientOptions & {
296
+ /** Caching mechanism used to hold redirect data payload for rapid retrieval */
297
+ dataCache?: RedirectClientCache<RedirectClientCacheOptions>;
298
+ };
299
+ type RedirectOptions = {
300
+ /** Reverse flips the direction of the search, instead of redirecting a source to a target you will be finding the source that could have produced a given target */
301
+ reverse?: boolean;
302
+ /** Includes a label highlighting all wildcard variables with HTML em tags */
303
+ label?: boolean;
304
+ };
305
+ declare class RedirectClient extends ApiClient<RedirectClientOptions> {
306
+ constructor(options: RedirectClientOptions);
307
+ getRedirect: (options: RedirectClientGetRedirect) => Promise<RedirectDefinition | undefined>;
308
+ getRedirects: (options?: RedirectClientGetRedirects) => Promise<RedirectGetResponse>;
309
+ getAllRedirects(orderBy?: RedirectClientGetRedirects['orderBy']): AsyncGenerator<{
310
+ redirect: components["schemas"]["Redirect"];
311
+ metadata: components["schemas"]["RedirectMetadata"];
312
+ total: number | undefined;
313
+ }, void, unknown>;
314
+ getRedirectTrie: (options?: {
315
+ bypassDataCache?: boolean;
316
+ }) => Promise<PathTrie<DirectionAwareRedirectDefinition>>;
317
+ resetRedirectTrieDataCache: () => Promise<void>;
318
+ upsertRedirect: (redirect: RedirectUpsertRequest["redirect"]) => Promise<string>;
319
+ deleteRedirect: (id: string) => Promise<string>;
320
+ static processUrlBestMatch: (url: string, trie: PathTrie<DirectionAwareRedirectDefinition>, options?: RedirectOptions) => Promise<RedirectResult | undefined>;
321
+ processUrlBestMatch: (url: string, options?: RedirectOptions, useTrie?: boolean) => Promise<RedirectResult | undefined>;
322
+ processUrlAllMatches: (url: string, options?: RedirectOptions, useTrie?: boolean) => Promise<RedirectResult[]>;
323
+ private static assembling;
324
+ private static assemblingPromise;
325
+ private assembleTrie;
326
+ private static processHops;
327
+ private static processHop;
328
+ /**
329
+ * Taking the url, found definition and variables and returning a redirect result object
330
+ * @param processedUrl - Propertly formatted url input
331
+ * @param definition - Redirect definition found to match the processed url
332
+ * @param variables - Wildcard variables found during definition discovery
333
+ * @param options - Different options available to the redirect engine
334
+ */
335
+ private static processDefinitionToResults;
336
+ static validateRedirect(url: string, redirectDefinition: RedirectDefinition['redirect']): boolean;
337
+ }
338
+ declare class UncachedRedirectClient extends RedirectClient {
339
+ constructor(options: Omit<RedirectClientOptions, 'bypassCache'>);
340
+ }
341
+
362
342
  type RedirectUpsertRequest = paths['/api/v1/redirect']['put']['requestBody']['content']['application/json'];
363
343
  type RedirectDeleteRequest = paths['/api/v1/redirect']['delete']['requestBody']['content']['application/json'];
364
344
  type RedirectGetRequest = paths['/api/v1/redirect']['get']['parameters']['query'];
package/dist/index.esm.js CHANGED
@@ -162,10 +162,13 @@ var PathTrie = class {
162
162
  const splats = [];
163
163
  const processed = /* @__PURE__ */ new Set();
164
164
  const getVariables = () => {
165
- return wildcards.filter((wildcard) => Boolean(wildcard) && wildcard.active).reduce((variables, wildcard) => {
166
- variables[wildcard.name] = segments[wildcard.start];
167
- return variables;
168
- }, new Object());
165
+ return wildcards.filter((wildcard) => Boolean(wildcard) && wildcard.active).reduce(
166
+ (variables, wildcard) => {
167
+ variables[wildcard.name] = segments[wildcard.start];
168
+ return variables;
169
+ },
170
+ new Object()
171
+ );
169
172
  };
170
173
  const getPropsStartingWithColon = (obj) => {
171
174
  const result = [];
package/dist/index.js CHANGED
@@ -208,10 +208,13 @@ var PathTrie = class {
208
208
  const splats = [];
209
209
  const processed = /* @__PURE__ */ new Set();
210
210
  const getVariables = () => {
211
- return wildcards.filter((wildcard) => Boolean(wildcard) && wildcard.active).reduce((variables, wildcard) => {
212
- variables[wildcard.name] = segments[wildcard.start];
213
- return variables;
214
- }, new Object());
211
+ return wildcards.filter((wildcard) => Boolean(wildcard) && wildcard.active).reduce(
212
+ (variables, wildcard) => {
213
+ variables[wildcard.name] = segments[wildcard.start];
214
+ return variables;
215
+ },
216
+ new Object()
217
+ );
215
218
  };
216
219
  const getPropsStartingWithColon = (obj) => {
217
220
  const result = [];
package/dist/index.mjs CHANGED
@@ -162,10 +162,13 @@ var PathTrie = class {
162
162
  const splats = [];
163
163
  const processed = /* @__PURE__ */ new Set();
164
164
  const getVariables = () => {
165
- return wildcards.filter((wildcard) => Boolean(wildcard) && wildcard.active).reduce((variables, wildcard) => {
166
- variables[wildcard.name] = segments[wildcard.start];
167
- return variables;
168
- }, new Object());
165
+ return wildcards.filter((wildcard) => Boolean(wildcard) && wildcard.active).reduce(
166
+ (variables, wildcard) => {
167
+ variables[wildcard.name] = segments[wildcard.start];
168
+ return variables;
169
+ },
170
+ new Object()
171
+ );
169
172
  };
170
173
  const getPropsStartingWithColon = (obj) => {
171
174
  const result = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/redirect",
3
- "version": "19.179.1-alpha.1+3adc08c00a",
3
+ "version": "19.180.0",
4
4
  "description": "Uniform redirect client",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -33,12 +33,12 @@
33
33
  "/dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@uniformdev/context": "19.179.1-alpha.1+3adc08c00a",
36
+ "@uniformdev/context": "19.180.0",
37
37
  "p-limit": "^3.1.0",
38
38
  "rfdc": "^1.3.0"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "3adc08c00a0d3932b6b767faaa6157f8b71ef0a0"
43
+ "gitHead": "309600b88571d0ffb2b80d7d2c27b7aa3e5ae72b"
44
44
  }