@genesislcap/foundation-filters 9.0.1-alpha-b5c5eb7.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/MODULE_FEDERATION.md +11 -0
- package/README.md +173 -0
- package/dist/1.0.0.remoteEntry.js +1 -0
- package/dist/191.191.64feeeeeb6c4132a6cae.js +2 -0
- package/dist/191.d7c8a7fc5c69e4190ea53a04618e0459.js.map +1 -0
- package/dist/195.195.2c71a4e018ba860ab228.js +3 -0
- package/dist/195.195.2c71a4e018ba860ab228.js.LICENSE.txt +4 -0
- package/dist/195.331a5c4d39a8a3d001d3344cb66ef3b8.js.map +1 -0
- package/dist/259.0acac2573f700ecd1acac239926438a5.js.map +1 -0
- package/dist/259.259.3aa926921ed1388957f1.js +2 -0
- package/dist/338.338.cd6e49db31e7adc808c6.js +3 -0
- package/dist/338.338.cd6e49db31e7adc808c6.js.LICENSE.txt +1 -0
- package/dist/338.7a143cd09921b756e7fe871d338dcb67.js.map +1 -0
- package/dist/410.410.76d9d4b118ba230b93c4.js +2 -0
- package/dist/410.cda4ae21eb38efbf2dbfd913db12d66f.js.map +1 -0
- package/dist/755.755.ec31a791472b4b3fcb0f.js +2 -0
- package/dist/755.c71c3a1801dd2c0461f8b831d09ec90f.js.map +1 -0
- package/dist/dashboard.json +1 -0
- package/dist/dts/clientFilter.d.ts +108 -0
- package/dist/dts/clientFilter.d.ts.map +1 -0
- package/dist/dts/index.d.ts +9 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/logger.d.ts +17 -0
- package/dist/dts/logger.d.ts.map +1 -0
- package/dist/dts/nodeEnv.d.ts +81 -0
- package/dist/dts/nodeEnv.d.ts.map +1 -0
- package/dist/dts/percentage.d.ts +81 -0
- package/dist/dts/percentage.d.ts.map +1 -0
- package/dist/dts/timeWindow.d.ts +91 -0
- package/dist/dts/timeWindow.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/urlTargeting.d.ts +94 -0
- package/dist/dts/urlTargeting.d.ts.map +1 -0
- package/dist/dts/userAgent.d.ts +96 -0
- package/dist/dts/userAgent.d.ts.map +1 -0
- package/dist/dts/userTargeting.d.ts +107 -0
- package/dist/dts/userTargeting.d.ts.map +1 -0
- package/dist/esm/clientFilter.js +84 -0
- package/dist/esm/clientFilter.js.map +1 -0
- package/dist/esm/index.federated.js +2 -0
- package/dist/esm/index.federated.js.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.js +18 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/nodeEnv.js +48 -0
- package/dist/esm/nodeEnv.js.map +1 -0
- package/dist/esm/percentage.js +38 -0
- package/dist/esm/percentage.js.map +1 -0
- package/dist/esm/timeWindow.js +49 -0
- package/dist/esm/timeWindow.js.map +1 -0
- package/dist/esm/urlTargeting.js +68 -0
- package/dist/esm/urlTargeting.js.map +1 -0
- package/dist/esm/userAgent.js +59 -0
- package/dist/esm/userAgent.js.map +1 -0
- package/dist/esm/userTargeting.js +73 -0
- package/dist/esm/userTargeting.js.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/foundation-filters.api.json +3065 -0
- package/dist/foundation-filters.d.ts +707 -0
- package/dist/foundation-filters.iife.min.js +3 -0
- package/dist/foundation-filters.js +8608 -0
- package/dist/foundation-filters.min.js +3 -0
- package/dist/foundationFilters.c0ca375607bf5b49304e9efbcfb9ec0d.js.map +1 -0
- package/dist/index.ejs +23 -0
- package/dist/index.html +16 -0
- package/dist/info.ejs +13 -0
- package/dist/main.479db3c6a61354c4d21c4a52177a4fc9.js.map +1 -0
- package/dist/main.8bf3ac27c0d922605d1f.js +2 -0
- package/dist/npm.analytics.343.d4561facd9660fd45482.js +2 -0
- package/dist/npm.analytics.50acd47759b15e99bc3ad79caad7c672.js.map +1 -0
- package/dist/npm.consola.0f92c98545c00deac8a01e6e5c25e63c.js.map +1 -0
- package/dist/npm.consola.713.4cfd0e26a2fd1e472409.js +2 -0
- package/dist/npm.finos.690.4b909dcccf246b8fb074.js +2 -0
- package/dist/npm.finos.83f8bd7cc8c58aabd1049256a8d005fe.js.map +1 -0
- package/dist/npm.microsoft.127.2934a743e3e0797a43e6.js +1469 -0
- package/dist/npm.microsoft.127.2934a743e3e0797a43e6.js.LICENSE.txt +14 -0
- package/dist/npm.microsoft.e17056c760df168ceb07617558d61f7e.js.map +1 -0
- package/dist/npm.rxjs.271.11caf676e6c2aaf1715a.js +2 -0
- package/dist/npm.rxjs.2d42120c7dd915e4ea92bdec64a19f45.js.map +1 -0
- package/dist/npm.ua-parser-js.809.92491f7cd444ab77d377.js +2 -0
- package/dist/npm.ua-parser-js.b1390f6f6c6080318a30bc73abe8add8.js.map +1 -0
- package/dist/remoteEntry.js +2 -0
- package/dist/serve.json +3 -0
- package/docs/api/foundation-filters.clientfilter.filter.md +24 -0
- package/docs/api/foundation-filters.clientfilter.md +24 -0
- package/docs/api/foundation-filters.clientfiltername.md +19 -0
- package/docs/api/foundation-filters.clientfilterrunner.md +20 -0
- package/docs/api/foundation-filters.clientfilterrunner.run.md +23 -0
- package/docs/api/foundation-filters.clientfilterschema.md +22 -0
- package/docs/api/foundation-filters.clientfilterschemas.md +15 -0
- package/docs/api/foundation-filters.defaultclientfilterrunner.container.md +11 -0
- package/docs/api/foundation-filters.defaultclientfilterrunner.md +27 -0
- package/docs/api/foundation-filters.defaultclientfilterrunner.run.md +23 -0
- package/docs/api/foundation-filters.defaultnodeenv.filter.md +24 -0
- package/docs/api/foundation-filters.defaultnodeenv.isdevelopment.md +16 -0
- package/docs/api/foundation-filters.defaultnodeenv.isproduction.md +16 -0
- package/docs/api/foundation-filters.defaultnodeenv.istesting.md +16 -0
- package/docs/api/foundation-filters.defaultnodeenv.md +29 -0
- package/docs/api/foundation-filters.defaultpercentage.filter.md +24 -0
- package/docs/api/foundation-filters.defaultpercentage.md +21 -0
- package/docs/api/foundation-filters.defaulttimewindow.filter.md +24 -0
- package/docs/api/foundation-filters.defaulttimewindow.md +21 -0
- package/docs/api/foundation-filters.defaulturltargeting.filter.md +24 -0
- package/docs/api/foundation-filters.defaulturltargeting.issecure.md +26 -0
- package/docs/api/foundation-filters.defaulturltargeting.md +22 -0
- package/docs/api/foundation-filters.defaultuseragent.filter.md +24 -0
- package/docs/api/foundation-filters.defaultuseragent.issafari.md +16 -0
- package/docs/api/foundation-filters.defaultuseragent.md +27 -0
- package/docs/api/foundation-filters.defaultusertargeting._constructor_.md +20 -0
- package/docs/api/foundation-filters.defaultusertargeting.auth.md +11 -0
- package/docs/api/foundation-filters.defaultusertargeting.filter.md +24 -0
- package/docs/api/foundation-filters.defaultusertargeting.hasadminprofile.md +16 -0
- package/docs/api/foundation-filters.defaultusertargeting.isloggedin.md +16 -0
- package/docs/api/foundation-filters.defaultusertargeting.md +35 -0
- package/docs/api/foundation-filters.getfilterbyname.md +25 -0
- package/docs/api/foundation-filters.logger.md +27 -0
- package/docs/api/foundation-filters.md +71 -0
- package/docs/api/foundation-filters.nodeenv.isdevelopment.md +16 -0
- package/docs/api/foundation-filters.nodeenv.isproduction.md +16 -0
- package/docs/api/foundation-filters.nodeenv.istesting.md +16 -0
- package/docs/api/foundation-filters.nodeenv.md +23 -0
- package/docs/api/foundation-filters.nodeenvfilter.md +28 -0
- package/docs/api/foundation-filters.nodeenvparams.md +25 -0
- package/docs/api/foundation-filters.nodeenvschema.md +19 -0
- package/docs/api/foundation-filters.percentage.md +19 -0
- package/docs/api/foundation-filters.percentagefilter.md +29 -0
- package/docs/api/foundation-filters.percentageparams.md +41 -0
- package/docs/api/foundation-filters.percentageschema.md +19 -0
- package/docs/api/foundation-filters.runner.md +29 -0
- package/docs/api/foundation-filters.timewindow.md +19 -0
- package/docs/api/foundation-filters.timewindowfilter.md +29 -0
- package/docs/api/foundation-filters.timewindowparams.md +59 -0
- package/docs/api/foundation-filters.timewindowschema.md +19 -0
- package/docs/api/foundation-filters.urltargeting.issecure.md +26 -0
- package/docs/api/foundation-filters.urltargeting.md +21 -0
- package/docs/api/foundation-filters.urltargetingfilter.md +32 -0
- package/docs/api/foundation-filters.urltargetingparams.md +30 -0
- package/docs/api/foundation-filters.urltargetingschema.md +19 -0
- package/docs/api/foundation-filters.useragent.issafari.md +16 -0
- package/docs/api/foundation-filters.useragent.md +25 -0
- package/docs/api/foundation-filters.useragentfilter.md +31 -0
- package/docs/api/foundation-filters.useragentparams.md +30 -0
- package/docs/api/foundation-filters.useragentschema.md +19 -0
- package/docs/api/foundation-filters.usertargeting.hasadminprofile.md +16 -0
- package/docs/api/foundation-filters.usertargeting.isloggedin.md +16 -0
- package/docs/api/foundation-filters.usertargeting.md +26 -0
- package/docs/api/foundation-filters.usertargetingfilter.md +31 -0
- package/docs/api/foundation-filters.usertargetingparams.md +29 -0
- package/docs/api/foundation-filters.usertargetingschema.md +19 -0
- package/docs/api/index.md +12 -0
- package/docs/api-report.md +283 -0
- package/jsdom.setup.ts +1 -0
- package/license.txt +46 -0
- package/package.json +122 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://@genesislcap/foundation-filters/./src/index.federated.ts"],"names":[],"mappings":"wIAAA,6D","file":"755.755.xxxxxxxxxxxxxxxxxxxx.js","sourcesContent":["import('./index');\n"],"sourceRoot":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"dependencies":[{"name":"@microsoft/fast-element","version":"1.11"},{"name":"@microsoft/fast-foundation","version":"2.47"},{"name":"tslib","version":"2.5"},{"name":"ua-parser-js","version":"1.0"}],"devDependencies":[{"name":"@microsoft/api-documenter","version":"7.21"},{"name":"@microsoft/api-extractor","version":"7.34"},{"name":"@module-federation/dashboard-plugin","version":"2.3"},{"name":"@playwright/test","version":"1.31"},{"name":"@rollup/plugin-commonjs","version":"21.1"},{"name":"@rollup/plugin-node-resolve","version":"13.3"},{"name":"@rollup/plugin-typescript","version":"8.5"},{"name":"analytics","version":"0.8"},{"name":"c8","version":"7.13"},{"name":"camel-case","version":"4.1"},{"name":"clean-webpack-plugin","version":"4.0"},{"name":"copyfiles","version":"2.4"},{"name":"cross-env","version":"7.0"},{"name":"csp-html-webpack-plugin","version":"5.1"},{"name":"css-loader","version":"6.7"},{"name":"cssnano","version":"5.1"},{"name":"esm","version":"3.2"},{"name":"file-loader","version":"6.2"},{"name":"html-webpack-plugin","version":"5.5"},{"name":"jsdom","version":"19.0"},{"name":"mini-css-extract-plugin","version":"2.7"},{"name":"playwright-test","version":"7.4"},{"name":"portfinder-sync","version":"0.0"},{"name":"postcss","version":"8.4"},{"name":"postcss-import","version":"14.1"},{"name":"postcss-loader","version":"6.2"},{"name":"postcss-preset-env","version":"7.8"},{"name":"rollup","version":"2.79"},{"name":"rollup-plugin-commonjs","version":"10.1"},{"name":"rollup-plugin-filesize","version":"9.1"},{"name":"rollup-plugin-node-resolve","version":"5.2"},{"name":"rollup-plugin-terser","version":"7.0"},{"name":"rollup-plugin-visualizer","version":"5.9"},{"name":"terser-webpack-plugin","version":"5.3"},{"name":"to-string-loader","version":"1.2"},{"name":"ts-loader","version":"9.3"},{"name":"tsconfig-paths-webpack-plugin","version":"3.5"},{"name":"tsm","version":"2.3"},{"name":"typescript","version":"4.9"},{"name":"uvu","version":"0.5"},{"name":"watchlist","version":"0.3"},{"name":"webpack","version":"5.45"},{"name":"webpack-bundle-analyzer","version":"4.8"},{"name":"webpack-cli","version":"4.10"},{"name":"webpack-dev-server","version":"4.11"},{"name":"webpack-merge","version":"5.8"}],"optionalDependencies":[],"id":"foundationFilters","name":"foundationFilters","remote":"","metadata":{},"overrides":[{"id":"tslib","name":"tslib","version":"2.5","location":"tslib","applicationID":"foundationFilters"},{"id":"@microsoft/fast-foundation","name":"@microsoft/fast-foundation","version":"2.47","location":"@microsoft/fast-foundation","applicationID":"foundationFilters"},{"id":"@genesislcap/foundation-utils","name":"@genesislcap/foundation-utils","version":"","location":"@genesislcap/foundation-utils","applicationID":"foundationFilters"},{"id":"ua-parser-js","name":"ua-parser-js","version":"1.0","location":"ua-parser-js","applicationID":"foundationFilters"},{"id":"@genesislcap/foundation-comms","name":"@genesislcap/foundation-comms","version":"","location":"@genesislcap/foundation-comms","applicationID":"foundationFilters"},{"id":"@microsoft/fast-element","name":"@microsoft/fast-element","version":"1.11","location":"@microsoft/fast-element","applicationID":"foundationFilters"}],"consumes":[],"modules":[{"id":"foundationFilters:index","name":"index","applicationID":"foundationFilters","requires":[],"file":"./src/index.federated.ts"}],"version":"1.0.0"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Container } from '@microsoft/fast-foundation';
|
|
2
|
+
import { NodeEnv, NodeEnvSchema } from './nodeEnv';
|
|
3
|
+
import { Percentage, PercentageSchema } from './percentage';
|
|
4
|
+
import { TimeWindow, TimeWindowSchema } from './timeWindow';
|
|
5
|
+
import { URLTargeting, URLTargetingSchema } from './urlTargeting';
|
|
6
|
+
import { UserAgent, UserAgentSchema } from './userAgent';
|
|
7
|
+
import { UserTargeting, UserTargetingSchema } from './userTargeting';
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare const ClientFilterName: {
|
|
12
|
+
readonly nodeEnv: "nodeEnv";
|
|
13
|
+
readonly percentage: "percentage";
|
|
14
|
+
readonly timeWindow: "timeWindow";
|
|
15
|
+
readonly urlTargeting: "urlTargeting";
|
|
16
|
+
readonly userAgent: "userAgent";
|
|
17
|
+
readonly userTargeting: "userTargeting";
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export type ClientFilterName = (typeof ClientFilterName)[keyof typeof ClientFilterName];
|
|
23
|
+
/**
|
|
24
|
+
* Filer lookup by name.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export declare function getFilterByName(name: ClientFilterName, container: Container): NodeEnv | Percentage | TimeWindow | URLTargeting | UserAgent | UserTargeting;
|
|
29
|
+
/**
|
|
30
|
+
* ClientFilter interface.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Simplifies access to runtime data / state contained within the DI container.
|
|
34
|
+
*
|
|
35
|
+
* @typeParam P - The filter parameter type.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export interface ClientFilter<P = any> {
|
|
40
|
+
/**
|
|
41
|
+
* @param parameters - The filter parameters.
|
|
42
|
+
*
|
|
43
|
+
* @returns The filter outcome.
|
|
44
|
+
*
|
|
45
|
+
* @privateRemarks
|
|
46
|
+
* Not sure if there's a need for an async api here.
|
|
47
|
+
*/
|
|
48
|
+
filter(parameters: P): boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* ClientFilterSchema type.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* JSON schema type.
|
|
55
|
+
*
|
|
56
|
+
* @typeParam N - The filter name type.
|
|
57
|
+
* @typeParam P - The filter parameters type.
|
|
58
|
+
*
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export type ClientFilterSchema<N extends ClientFilterName, P> = {
|
|
62
|
+
readonly name: N;
|
|
63
|
+
readonly parameters: P;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* ClientFilterSchemas type.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
export type ClientFilterSchemas = NodeEnvSchema | PercentageSchema | TimeWindowSchema | URLTargetingSchema | UserAgentSchema | UserTargetingSchema;
|
|
71
|
+
/**
|
|
72
|
+
* Client filter runner function.
|
|
73
|
+
* @remarks
|
|
74
|
+
* This will return true when all the filters in the array pass.
|
|
75
|
+
* @param filters - An array of client filters to run.
|
|
76
|
+
* @param container - The DI container.
|
|
77
|
+
* @public
|
|
78
|
+
* @privateRemarks
|
|
79
|
+
* As a runner working off static input, we can't know or source the runtime dependencies of each filter. As such we use
|
|
80
|
+
* the DI version of each which have those encapsulated.
|
|
81
|
+
*/
|
|
82
|
+
export declare function runner(filters: ClientFilterSchemas[], container: Container): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* ClientFilterRunner DI interface.
|
|
85
|
+
*
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
export interface ClientFilterRunner {
|
|
89
|
+
run(filters: ClientFilterSchemas[], container?: Container): boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Default ClientFilterRunner DI implementation.
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export declare class DefaultClientFilterRunner implements ClientFilterRunner {
|
|
96
|
+
container: Container;
|
|
97
|
+
run(filters: ClientFilterSchemas[], container?: Container): boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* ClientFilterRunner DI key.
|
|
101
|
+
*
|
|
102
|
+
* @privateRemarks
|
|
103
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
104
|
+
*
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export declare const ClientFilterRunner: import("@microsoft/fast-foundation").InterfaceSymbol<ClientFilterRunner>;
|
|
108
|
+
//# sourceMappingURL=clientFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientFilter.d.ts","sourceRoot":"","sources":["../../src/clientFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAM,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;CAOnB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAExF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,gFAe3E;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACnC;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,EAAE,CAAC,IAAI;IAC9D,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,aAAa,GACb,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,mBAAmB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CASpF;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CACrE;AAED;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,kBAAkB;IACvD,SAAS,EAAG,SAAS,CAAC;IACjC,GAAG,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,SAAS,YAAiB;CAG/D;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,0EAE9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './clientFilter';
|
|
2
|
+
export * from './logger';
|
|
3
|
+
export * from './nodeEnv';
|
|
4
|
+
export * from './percentage';
|
|
5
|
+
export * from './timeWindow';
|
|
6
|
+
export * from './urlTargeting';
|
|
7
|
+
export * from './userAgent';
|
|
8
|
+
export * from './userTargeting';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.federated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.federated.d.ts","sourceRoot":"","sources":["../../src/index.federated.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client filter logger
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Exposed so that the logging level within this package can be tailored differently to the default level when needed.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { LogLevel } from '@genesislcap/foundation-utils';
|
|
10
|
+
* import { logger as clientFilterLogger } from '@genesislcap/foundation-filters';
|
|
11
|
+
* clientFilterLogger.level = LogLevel.Error;
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export declare const logger: import("@genesislcap/foundation-utils").Logger;
|
|
17
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,MAAM,gDAAqC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ClientFilter, ClientFilterName, ClientFilterSchema } from './clientFilter';
|
|
2
|
+
/**
|
|
3
|
+
* NodeEnv client filter function.
|
|
4
|
+
* @remarks
|
|
5
|
+
* This will return true when the current node env matches target parameters.
|
|
6
|
+
* @param envs - Environments to target.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare function nodeEnvFilter(envs: string[]): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* NodeEnvParams
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```json
|
|
15
|
+
* {
|
|
16
|
+
* "envs": ["development", "testing"],
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export type NodeEnvParams = {
|
|
23
|
+
/**
|
|
24
|
+
* Envs to target.
|
|
25
|
+
*/
|
|
26
|
+
readonly envs: string[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* NodeEnvSchema type.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* JSON schema type.
|
|
33
|
+
*
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export type NodeEnvSchema = ClientFilterSchema<typeof ClientFilterName.nodeEnv, NodeEnvParams>;
|
|
37
|
+
/**
|
|
38
|
+
* NodeEnv client filter DI interface.
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export interface NodeEnv extends ClientFilter<NodeEnvParams> {
|
|
42
|
+
/**
|
|
43
|
+
* @remarks
|
|
44
|
+
* Running in development mode.
|
|
45
|
+
*/
|
|
46
|
+
readonly isDevelopment: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* @remarks
|
|
49
|
+
* Running in test mode.
|
|
50
|
+
*/
|
|
51
|
+
readonly isTesting: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* @remarks
|
|
54
|
+
* Running in production mode.
|
|
55
|
+
*/
|
|
56
|
+
readonly isProduction: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Default NodeEnv DI implementation.
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export declare class DefaultNodeEnv implements NodeEnv {
|
|
63
|
+
/** {@inheritDoc ClientFilter.filter} */
|
|
64
|
+
filter(params: NodeEnvParams): boolean;
|
|
65
|
+
/** {@inheritDoc NodeEnv.isDevelopment} */
|
|
66
|
+
get isDevelopment(): boolean;
|
|
67
|
+
/** {@inheritDoc NodeEnv.isTesting} */
|
|
68
|
+
get isTesting(): boolean;
|
|
69
|
+
/** {@inheritDoc NodeEnv.isProduction} */
|
|
70
|
+
get isProduction(): boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* NodeEnv DI key.
|
|
74
|
+
*
|
|
75
|
+
* @privateRemarks
|
|
76
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
77
|
+
*
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
export declare const NodeEnv: import("@microsoft/fast-foundation").InterfaceSymbol<NodeEnv>;
|
|
81
|
+
//# sourceMappingURL=nodeEnv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeEnv.d.ts","sourceRoot":"","sources":["../../src/nodeEnv.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAMrD;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAE/F;;;GAGG;AACH,MAAM,WAAW,OAAQ,SAAQ,YAAY,CAAC,aAAa,CAAC;IAC1D;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,cAAe,YAAW,OAAO;IAC5C,wCAAwC;IACxC,MAAM,CAAC,MAAM,EAAE,aAAa;IAI5B,0CAA0C;IAC1C,IAAI,aAAa,YAEhB;IAED,sCAAsC;IACtC,IAAI,SAAS,YAEZ;IAED,yCAAyC;IACzC,IAAI,YAAY,YAEf;CACF;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,+DAAkE,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ClientFilter, ClientFilterName, ClientFilterSchema } from './clientFilter';
|
|
2
|
+
/**
|
|
3
|
+
* Percentage client filter function.
|
|
4
|
+
* @remarks
|
|
5
|
+
* This will return true a certain percentage of the time.
|
|
6
|
+
* @param percent - The percent of the time to pass, a numeric value between 0 and 1.
|
|
7
|
+
* @param random - Math.random() generated floating-point.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare function percentageFilter(percent: number, random?: number): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* PercentageParams
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Percent should be a numeric value between 0 and 1.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```json
|
|
19
|
+
* {
|
|
20
|
+
* "percent": 0.5
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* In a rare case where you need to control the random floating-point creation, you can do so externally and provide it.
|
|
26
|
+
* ```json
|
|
27
|
+
* {
|
|
28
|
+
* "percent": 0.34
|
|
29
|
+
* "random": 0.08901819974272063
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export type PercentageParams = {
|
|
36
|
+
readonly percent: number;
|
|
37
|
+
/**
|
|
38
|
+
* @remarks
|
|
39
|
+
* Provided for fine-grain control over the random floating-point
|
|
40
|
+
*/
|
|
41
|
+
readonly random?: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* PercentageSchema type.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* JSON schema type.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export type PercentageSchema = ClientFilterSchema<typeof ClientFilterName.percentage, PercentageParams>;
|
|
52
|
+
/**
|
|
53
|
+
* Percentage client filter DI interface.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Simplifies access to runtime data / state contained within the DI container.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
* @privateRemarks
|
|
60
|
+
* Created for consistency with other filters that required DI container access.
|
|
61
|
+
*/
|
|
62
|
+
export interface Percentage extends ClientFilter<PercentageParams> {
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Default Percentage DI implementation.
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export declare class DefaultPercentage implements Percentage {
|
|
69
|
+
/** {@inheritDoc ClientFilter.filter} */
|
|
70
|
+
filter(params: PercentageParams): boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Percentage DI key.
|
|
74
|
+
*
|
|
75
|
+
* @privateRemarks
|
|
76
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
77
|
+
*
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
export declare const Percentage: import("@microsoft/fast-foundation").InterfaceSymbol<Percentage>;
|
|
81
|
+
//# sourceMappingURL=percentage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"percentage.d.ts","sourceRoot":"","sources":["../../src/percentage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAgB,GAAG,OAAO,CAOjF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAC/C,OAAO,gBAAgB,CAAC,UAAU,EAClC,gBAAgB,CACjB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAW,SAAQ,YAAY,CAAC,gBAAgB,CAAC;CAAG;AAErE;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,UAAU;IAClD,wCAAwC;IACxC,MAAM,CAAC,MAAM,EAAE,gBAAgB;CAGhC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,kEAAwE,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { ClientFilter, ClientFilterName, ClientFilterSchema } from './clientFilter';
|
|
2
|
+
/**
|
|
3
|
+
* TimeWindow client filter function.
|
|
4
|
+
* @remarks
|
|
5
|
+
* This will return true between a certain time window. Start and end can be provided in any format recognized by the
|
|
6
|
+
* Date.parse() method.
|
|
7
|
+
*
|
|
8
|
+
* @param start - The start of the time window.
|
|
9
|
+
* @param end - The end of the time window.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare function timeWindowFilter(start?: string, end?: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* TimeWindowParams
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Both params can be provided in any format recognized by the Date.parse() method.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```json
|
|
21
|
+
* {
|
|
22
|
+
* "start": "Sun Sep 25 2022 16:51:55 GMT+0000",
|
|
23
|
+
* "end": "Fri Nov 25 2022 17:51:55 GMT+0000"
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```json
|
|
29
|
+
* {
|
|
30
|
+
* "start": "2022-10-01",
|
|
31
|
+
* "end": "2022-12-01"
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```json
|
|
37
|
+
* {
|
|
38
|
+
* "end": "Dec 31, 2022"
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```json
|
|
44
|
+
* {
|
|
45
|
+
* "start": "2023-01-01T00:00:00.000+00:00"
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export type TimeWindowParams = {
|
|
52
|
+
readonly start?: string;
|
|
53
|
+
readonly end?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* TimeWindowSchema type.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* JSON schema type.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export type TimeWindowSchema = ClientFilterSchema<typeof ClientFilterName.timeWindow, TimeWindowParams>;
|
|
64
|
+
/**
|
|
65
|
+
* TimeWindow client filter DI interface.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* Simplifies access to runtime data / state contained within the DI container.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
export interface TimeWindow extends ClientFilter<TimeWindowParams> {
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Default TimeWindow DI implementation.
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
export declare class DefaultTimeWindow implements TimeWindow {
|
|
79
|
+
/** {@inheritDoc ClientFilter.filter} */
|
|
80
|
+
filter(params: TimeWindowParams): boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* TimeWindow DI key.
|
|
84
|
+
*
|
|
85
|
+
* @privateRemarks
|
|
86
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export declare const TimeWindow: import("@microsoft/fast-foundation").InterfaceSymbol<TimeWindow>;
|
|
91
|
+
//# sourceMappingURL=timeWindow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeWindow.d.ts","sourceRoot":"","sources":["../../src/timeWindow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAgBtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAC/C,OAAO,gBAAgB,CAAC,UAAU,EAClC,gBAAgB,CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,UAAW,SAAQ,YAAY,CAAC,gBAAgB,CAAC;CAAG;AAErE;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,UAAU;IAClD,wCAAwC;IACxC,MAAM,CAAC,MAAM,EAAE,gBAAgB;CAGhC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,kEAAwE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.34.4"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { ClientFilter, ClientFilterName, ClientFilterSchema } from './clientFilter';
|
|
2
|
+
/**
|
|
3
|
+
* URLTargeting client filter function.
|
|
4
|
+
* @remarks
|
|
5
|
+
* This will return true when the current URL matches on ANY of the parameters. If you wish to match on multiple
|
|
6
|
+
* parameters, consider chaining an array of urlTargeting filters together.
|
|
7
|
+
* @param url - A url.
|
|
8
|
+
* @param pattern - A regex.
|
|
9
|
+
* @param schemes - Schemes/protocols to target.
|
|
10
|
+
* @param hosts - Hosts to target.
|
|
11
|
+
* @param paths - Paths to target.
|
|
12
|
+
* @public
|
|
13
|
+
* @privateRemarks
|
|
14
|
+
* The pattern regex can cover everything here, but some devs will likely welcome the explicit arguments.
|
|
15
|
+
*/
|
|
16
|
+
export declare function urlTargetingFilter(url: string, pattern?: RegExp, schemes?: string[], hosts?: string[], paths?: string[]): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* URLTargetingParams
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```json
|
|
22
|
+
* {
|
|
23
|
+
* "schemes": ["https"],
|
|
24
|
+
* "hosts": ["neptx.genesislab.global", "neptune-uat2-axes-server2"]
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export type URLTargetingParams = {
|
|
31
|
+
/**
|
|
32
|
+
* A url.
|
|
33
|
+
*/
|
|
34
|
+
readonly url?: string;
|
|
35
|
+
/**
|
|
36
|
+
* A regex.
|
|
37
|
+
*/
|
|
38
|
+
readonly pattern?: RegExp;
|
|
39
|
+
/**
|
|
40
|
+
* Schemes/protocols to target.
|
|
41
|
+
*/
|
|
42
|
+
readonly schemes?: string[];
|
|
43
|
+
/**
|
|
44
|
+
* Hosts to target.
|
|
45
|
+
*/
|
|
46
|
+
readonly hosts?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Paths to target.
|
|
49
|
+
*/
|
|
50
|
+
readonly paths?: string[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* URLTargetingSchema type.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* JSON schema type.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export type URLTargetingSchema = ClientFilterSchema<typeof ClientFilterName.urlTargeting, URLTargetingParams>;
|
|
61
|
+
/**
|
|
62
|
+
* URLTargeting client filter DI interface.
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export interface URLTargeting extends ClientFilter<URLTargetingParams> {
|
|
67
|
+
/**
|
|
68
|
+
* @remarks
|
|
69
|
+
* Check if a url is secure.
|
|
70
|
+
*
|
|
71
|
+
* @param url - A url.
|
|
72
|
+
*/
|
|
73
|
+
isSecure(url: string): boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Default URLTargeting DI implementation.
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export declare class DefaultURLTargeting implements URLTargeting {
|
|
80
|
+
/** {@inheritDoc ClientFilter.filter} */
|
|
81
|
+
filter(params: URLTargetingParams): boolean;
|
|
82
|
+
/** {@inheritDoc URLTargeting.isSecure} */
|
|
83
|
+
isSecure(url: any): boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* URLTargeting DI key.
|
|
87
|
+
*
|
|
88
|
+
* @privateRemarks
|
|
89
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
export declare const URLTargeting: import("@microsoft/fast-foundation").InterfaceSymbol<URLTargeting>;
|
|
94
|
+
//# sourceMappingURL=urlTargeting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlTargeting.d.ts","sourceRoot":"","sources":["../../src/urlTargeting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,OAAO,CAyBT;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,CACjD,OAAO,gBAAgB,CAAC,YAAY,EACpC,kBAAkB,CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,YAAY,CAAC,kBAAkB,CAAC;IACpE;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IACtD,wCAAwC;IACxC,MAAM,CAAC,MAAM,EAAE,kBAAkB;IAUjC,0CAA0C;IAC1C,QAAQ,CAAC,GAAG,KAAA;CAGb;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,oEAExB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { ClientFilter, ClientFilterName, ClientFilterSchema } from './clientFilter';
|
|
2
|
+
/**
|
|
3
|
+
* UserAgent client filter function.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* See {@link https://github.com/faisalman/ua-parser-js} for more information.
|
|
7
|
+
*
|
|
8
|
+
* @param browsers - Browser names to target.
|
|
9
|
+
* @param devices - Device types to target.
|
|
10
|
+
* @param oss - Operating system names to target.
|
|
11
|
+
* @param ua - User-agent string (required in nodejs environment).
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare function userAgentFilter(browsers?: string[], devices?: string[], oss?: string[], ua?: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* UserAgentParams
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```json
|
|
20
|
+
* {
|
|
21
|
+
* "browsers": ["Safari", "Firefox", "Chrome", "Chromium"],
|
|
22
|
+
* "devices": ["mobile", "tablet"],
|
|
23
|
+
* "oss": ["Mac OS", "Linux"]
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export type UserAgentParams = {
|
|
30
|
+
/**
|
|
31
|
+
* Browser names to target.
|
|
32
|
+
*/
|
|
33
|
+
readonly browsers?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Device types to target.
|
|
36
|
+
*/
|
|
37
|
+
readonly devices?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* Operating system names to target.
|
|
40
|
+
*/
|
|
41
|
+
readonly oss?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* @remarks
|
|
44
|
+
* Provided for fine-grain control over the user-agent string in browser, and nodejs usage.
|
|
45
|
+
*/
|
|
46
|
+
readonly ua?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* UserAgentSchema type.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* JSON schema type.
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export type UserAgentSchema = ClientFilterSchema<typeof ClientFilterName.userAgent, UserAgentParams>;
|
|
57
|
+
/**
|
|
58
|
+
* UserAgent client filter DI interface.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* Simplifies access to runtime data / state contained within the DI container.
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
* @privateRemarks
|
|
65
|
+
* Created for consistency with other filters that required DI container access.
|
|
66
|
+
*/
|
|
67
|
+
export interface UserAgent extends ClientFilter<UserAgentParams> {
|
|
68
|
+
/**
|
|
69
|
+
* @remarks
|
|
70
|
+
* Is the user-agent safari.
|
|
71
|
+
*
|
|
72
|
+
* @privateRemarks
|
|
73
|
+
* Added as an example, see comment in implementation.
|
|
74
|
+
*/
|
|
75
|
+
readonly isSafari: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Default UserAgent DI implementation.
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export declare class DefaultUserAgent implements UserAgent {
|
|
82
|
+
/** {@inheritDoc ClientFilter.filter} */
|
|
83
|
+
filter(params: UserAgentParams): boolean;
|
|
84
|
+
/** {@inheritDoc UserAgent.isSafari} */
|
|
85
|
+
get isSafari(): boolean;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* UserAgent DI key.
|
|
89
|
+
*
|
|
90
|
+
* @privateRemarks
|
|
91
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
92
|
+
*
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
export declare const UserAgent: import("@microsoft/fast-foundation").InterfaceSymbol<UserAgent>;
|
|
96
|
+
//# sourceMappingURL=userAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAgent.d.ts","sourceRoot":"","sources":["../../src/userAgent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzF;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,CAAC,EAAE,MAAM,EAAE,EACnB,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,GAAG,CAAC,EAAE,MAAM,EAAE,EACd,EAAE,CAAC,EAAE,MAAM,GACV,OAAO,CAgBT;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAC9C,OAAO,gBAAgB,CAAC,SAAS,EACjC,eAAe,CAChB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAU,SAAQ,YAAY,CAAC,eAAe,CAAC;IAC9D;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,SAAS;IAChD,wCAAwC;IACxC,MAAM,CAAC,MAAM,EAAE,eAAe;IAI9B,uCAAuC;IACvC,IAAI,QAAQ,YAKX;CACF;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,iEAAsE,CAAC"}
|