diff --git a/.eslintignore b/.eslintignore index 3c1347e..c40b74a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -25,4 +25,7 @@ node_modules/ build/ dist/ -www/ \ No newline at end of file +www/ +temp +docs/gitbook/api +CHANGELOG.md \ No newline at end of file diff --git a/config/api-extractor.json b/config/api-extractor.json new file mode 100644 index 0000000..5229262 --- /dev/null +++ b/config/api-extractor.json @@ -0,0 +1,361 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/dist/main.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": false + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/dist/iam-policies.d.ts b/dist/iam-policies.d.ts new file mode 100644 index 0000000..3ceb674 --- /dev/null +++ b/dist/iam-policies.d.ts @@ -0,0 +1,286 @@ +export declare class ActionBased extends Statement { + private action?; + private notAction?; + private statement; + constructor(action: ActionBasedType); + getStatement(this: ActionBased): ActionBasedType; + matches(this: ActionBased, { action, context, conditionResolver }: MatchActionBasedInterface): boolean; + private checkAndAssignActions; + private matchActions; + private matchNotActions; +} + +export declare class ActionBasedPolicy extends Policy { + private denyStatements; + private allowStatements; + private statements; + constructor({ statements, conditionResolver, context }: ActionBasedPolicyInterface); + addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void; + getStatements(this: ActionBasedPolicy): ActionBasedType[]; + evaluate(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; + can(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; + whyCan(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): ActionBasedType[]; + cannot(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; + whyCannot(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): ActionBasedType[]; + generateProxy(this: ActionBasedPolicy, obj: U, options?: ProxyOptions): U; +} + +export declare interface ActionBasedPolicyInterface { + statements: ActionBasedType[]; + conditionResolver?: ConditionResolver; + context?: T; +} + +declare type ActionBasedType = StatementInterface & (ActionBlock | NotActionBlock); + +declare interface ActionBlock { + action: Patterns; +} + +/** + * Apply the context value in a string. + * + * @param {string} str Pattern string, containing context path. + * @param {object} context Object to get values from path. + * @returns {string} Returns a string with embedded context values. + * @example + * ```javascript + * const context = { + * user: { id: 456, bestFriends: [123, 532, 987] } + * }; + * applyContext('secrets:${user.id}:*', context) + * // => 'secrets:456:*' + * + * applyContext('secrets:${user.bestFriends}:*', context) + * // => 'secrets:{123,532,987}:*' + * + * applyContext('secrets:${company.address}:account', context) + * // => 'secrets:undefined:account' + * ``` + */ +export declare function applyContext(str: string, context?: T): string; + +declare type ConditionBlock = Record>; + +declare interface ConditionResolver { + [key: string]: Resolver; +} + +declare type EffectBlock = 'allow' | 'deny'; + +declare interface EvaluateActionBasedInterface { + action: string; + context?: T; +} + +declare interface EvaluateIdentityBasedInterface extends EvaluateActionBasedInterface { + resource: string; +} + +declare interface EvaluateResourceBasedInterface extends EvaluateActionBasedInterface { + principal?: string; + principalType?: string; + resource?: string; +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @since 3.1.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * const object = { 'a': [{ 'b': { 'c': 3 } }] } + * + * getValueFromPath(object, 'a[0].b.c') + * // => 3 + * + * getValueFromPath(object, ['a', '0', 'b', 'c']) + * // => 3 + * + * getValueFromPath(object, 'a.b.c', 'default') + * // => 'default' + */ +export declare function getValueFromPath(object: U, path: Array | string, defaultValue?: unknown): any; + +export declare class IdentityBased extends Statement { + private resource?; + private action?; + private notResource?; + private notAction?; + private statement; + constructor(identity: IdentityBasedType); + getStatement(this: IdentityBased): IdentityBasedType; + matches(this: IdentityBased, { action, resource, context, conditionResolver }: MatchIdentityBasedInterface): boolean; + private checkAndAssignActions; + private checkAndAssignResources; + private matchActions; + private matchNotActions; + private matchResources; + private matchNotResources; +} + +export declare class IdentityBasedPolicy extends Policy { + private denyStatements; + private allowStatements; + private statements; + constructor({ statements, conditionResolver, context }: IdentityBasedPolicyInterface); + addStatement(this: IdentityBasedPolicy, statement: IdentityBasedType): void; + getStatements(this: IdentityBasedPolicy): IdentityBasedType[]; + evaluate(this: IdentityBasedPolicy, { action, resource, context }: EvaluateIdentityBasedInterface): boolean; + can(this: IdentityBasedPolicy, { action, resource, context }: EvaluateIdentityBasedInterface): boolean; + cannot(this: IdentityBasedPolicy, { action, resource, context }: EvaluateIdentityBasedInterface): boolean; +} + +declare interface IdentityBasedPolicyInterface { + statements: IdentityBasedType[]; + conditionResolver?: ConditionResolver; + context?: T; +} + +declare type IdentityBasedType = StatementInterface & (ActionBlock | NotActionBlock) & (ResourceBlock | NotResourceBlock); + +declare interface MatchActionBasedInterface extends MatchConditionInterface { + action: string; +} + +declare interface MatchConditionInterface { + context?: T; + conditionResolver?: ConditionResolver; +} + +declare interface MatchIdentityBasedInterface extends MatchActionBasedInterface { + resource: string; +} + +declare interface MatchResourceBasedInterface extends MatchActionBasedInterface { + principal?: string; + principalType?: string; + resource?: string; +} + +declare interface NotActionBlock { + notAction: Patterns; +} + +declare interface NotResourceBlock { + notResource: Patterns; +} + +declare interface OptionalNotPrincipalBlock { + notPrincipal?: PrincipalMap | Patterns; +} + +declare interface OptionalNotResourceBlock { + notResource?: Patterns; +} + +declare interface OptionalPrincipalBlock { + principal?: PrincipalMap | Patterns; +} + +declare interface OptionalResourceBlock { + resource?: Patterns; +} + +declare type Patterns = string[] | string; + +declare abstract class Policy { + protected context?: T; + protected conditionResolver?: ConditionResolver; + constructor({ context, conditionResolver }: MatchConditionInterface); + setContext(this: Policy, context: T): void; + getContext(this: Policy): T | undefined; + setConditionResolver(this: Policy, conditionResolver: ConditionResolver): void; + getConditionResolver(this: Policy): ConditionResolver | undefined; + abstract getStatements(this: Policy): U[]; +} + +declare interface PrincipalMap { + [key: string]: Patterns; +} + +declare interface ProxyOptions { + get?: { + allow?: boolean; + propertyMap?: Record; + }; + set?: { + allow?: boolean; + propertyMap?: Record; + }; +} + +declare type Resolver = (data: any, expected: any) => boolean; + +export declare class ResourceBased extends Statement { + private principal?; + private resource?; + private action?; + private notPrincipal?; + private notResource?; + private notAction?; + private statement; + private hasPrincipals; + private hasResources; + constructor(identity: ResourceBasedType); + getStatement(this: ResourceBased): ResourceBasedType; + matches(this: ResourceBased, { principal, action, resource, principalType, context, conditionResolver }: MatchResourceBasedInterface): boolean; + private matchPrincipalAndNotPrincipal; + private matchResourceAndNotResource; + private checkAndAssignActions; + private checkAndAssignPrincipals; + private checkAndAssignResources; + private matchPrincipals; + private matchNotPrincipals; + private matchActions; + private matchNotActions; + private matchResources; + private matchNotResources; +} + +export declare class ResourceBasedPolicy extends Policy { + private denyStatements; + private allowStatements; + private statements; + constructor({ statements, conditionResolver, context }: ResourceBasedPolicyInterface); + addStatement(this: ResourceBasedPolicy, statement: ResourceBasedType): void; + getStatements(this: ResourceBasedPolicy): ResourceBasedType[]; + evaluate(this: ResourceBasedPolicy, { principal, action, resource, principalType, context }: EvaluateResourceBasedInterface): boolean; + can(this: ResourceBasedPolicy, { principal, action, resource, principalType, context }: EvaluateResourceBasedInterface): boolean; + cannot(this: ResourceBasedPolicy, { principal, action, resource, principalType, context }: EvaluateResourceBasedInterface): boolean; +} + +declare interface ResourceBasedPolicyInterface { + statements: ResourceBasedType[]; + conditionResolver?: ConditionResolver; + context?: T; +} + +declare type ResourceBasedType = StatementInterface & (OptionalPrincipalBlock | OptionalNotPrincipalBlock) & (ActionBlock | NotActionBlock) & (OptionalResourceBlock | OptionalNotResourceBlock); + +declare interface ResourceBlock { + resource: Patterns; +} + +declare abstract class Statement { + protected sid: string; + protected readonly condition?: ConditionBlock; + effect: EffectBlock; + constructor({ sid, effect, condition }: StatementInterface); + matchConditions(this: Statement, { context, conditionResolver }: MatchConditionInterface): boolean; + private evaluateCondition; +} + +declare interface StatementInterface { + sid?: string; + effect?: EffectBlock; + condition?: ConditionBlock; +} + +export { } diff --git a/dist/main.d.ts b/dist/main.d.ts index 858d821..a43c226 100644 --- a/dist/main.d.ts +++ b/dist/main.d.ts @@ -215,7 +215,9 @@ declare class ActionBasedPolicy extends Policy): ActionBasedType[]; evaluate(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; can(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; + whyCan(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): ActionBasedType[]; cannot(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; + whyCannot(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): ActionBasedType[]; generateProxy(this: ActionBasedPolicy, obj: U, options?: ProxyOptions): U; } diff --git a/dist/main.es.js b/dist/main.es.js index 953c618..009f9ec 100644 --- a/dist/main.es.js +++ b/dist/main.es.js @@ -1577,6 +1577,19 @@ class ActionBasedPolicy extends Policy { conditionResolver: this.conditionResolver })); } + whyCan({ action, context }) { + return this.allowStatements.reduce((statements, currentStatement) => { + const matches = currentStatement.matches({ + action, + context: context || this.context, + conditionResolver: this.conditionResolver + }); + if (matches) { + return [...statements, currentStatement.getStatement()]; + } + return statements; + }, []); + } cannot({ action, context }) { return this.denyStatements.some((s) => s.matches({ action, @@ -1584,6 +1597,19 @@ class ActionBasedPolicy extends Policy { conditionResolver: this.conditionResolver })); } + whyCannot({ action, context }) { + return this.denyStatements.reduce((statements, currentStatement) => { + const matches = currentStatement.matches({ + action, + context: context || this.context, + conditionResolver: this.conditionResolver + }); + if (matches) { + return [...statements, currentStatement.getStatement()]; + } + return statements; + }, []); + } generateProxy(obj, options = {}) { const { get = {}, set = {} } = options; const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get; diff --git a/dist/main.es.js.map b/dist/main.es.js.map index a5809e0..b919fb4 100644 --- a/dist/main.es.js.map +++ b/dist/main.es.js.map @@ -1 +1 @@ -{"version":3,"file":"main.es.js","sources":["../src/utils/getTag.ts","../src/utils/isSymbol.ts","../src/utils/toKey.ts","../src/utils/isKey.ts","../src/utils/memoize.ts","../src/utils/memoizeCapped.ts","../src/utils/stringToPath.ts","../src/utils/getValueFromPath.ts","../src/utils/applyContext.ts","../src/utils/decomposeString.ts","../src/utils/braceExpand.ts","../src/Matcher.ts","../src/utils/mersenneTwister.ts","../src/utils/generateUUID.ts","../src/conditionOperators/boolean/bool.ts","../src/conditionOperators/date/convertDate.ts","../src/conditionOperators/date/dateEquals.ts","../src/conditionOperators/date/dateGreaterThan.ts","../src/conditionOperators/date/dateGreaterThanEquals.ts","../src/conditionOperators/date/dateLessThan.ts","../src/conditionOperators/date/dateLessThanEquals.ts","../src/conditionOperators/date/dateNotEquals.ts","../src/conditionOperators/numeric/numericEquals.ts","../src/conditionOperators/numeric/numericGreaterThan.ts","../src/conditionOperators/numeric/numericGreaterThanEquals.ts","../src/conditionOperators/numeric/numericLessThan.ts","../src/conditionOperators/numeric/numericLessThanEquals.ts","../src/conditionOperators/numeric/numericNotEquals.ts","../src/conditionOperators/string/stringEquals.ts","../src/conditionOperators/string/stringEqualsIgnoreCase.ts","../src/conditionOperators/string/stringLike.ts","../src/conditionOperators/string/stringLikeIfExists.ts","../src/conditionOperators/string/stringNotEquals.ts","../src/conditionOperators/string/stringNotEqualsIgnoreCase.ts","../src/conditionOperators/index.ts","../src/Statement.ts","../src/ActionBasedStatement.ts","../src/IdentityBasedStatement.ts","../src/ResourceBasedStatement.ts","../src/Policy.ts","../src/ActionBasedPolicy.ts","../src/IdentityBasedPolicy.ts","../src/ResourceBasedPolicy.ts"],"sourcesContent":["/**\r\n * Gets the `toStringTag` of `value`.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {*} value The value to query.\r\n * @returns {string} Returns the `toStringTag`.\r\n * @example\r\n * ```javascript\r\n * getTag(1)\r\n * // => '[object Number]'\r\n *\r\n * getTag(null)\r\n * // => '[object Null]'\r\n * ```\r\n */\r\nexport function getTag(value: unknown): string {\r\n return Object.prototype.toString.call(value);\r\n}\r\n","import { getTag } from './getTag';\r\n\r\n/**\r\n * Checks if `value` is classified as a `Symbol` primitive or object.\r\n *\r\n * @since 3.1.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\r\n * @example\r\n * ```javascript\r\n * isSymbol(Symbol())\r\n * // => true\r\n *\r\n * isSymbol('abc')\r\n * // => false\r\n * ```\r\n */\r\nexport function isSymbol(value?: unknown): value is symbol {\r\n const type = typeof value;\r\n return (\r\n type === 'symbol' ||\r\n (type === 'object' && value !== null && getTag(value) === '[object Symbol]')\r\n );\r\n}\r\n","import { isSymbol } from './isSymbol';\r\n\r\n/** Used as references for various `Number` constants. */\r\nconst INFINITY = 1 / 0;\r\n\r\n/**\r\n * Converts `value` to a string key if it's not a string or symbol.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {*} value The value to inspect.\r\n * @returns {string|symbol} Returns the key.\r\n * @example\r\n *\r\n * toKey(Symbol.iterator)\r\n * // => true\r\n *\r\n * toKey('abc')\r\n * // => false\r\n */\r\nexport function toKey(value: unknown): string | symbol {\r\n if (typeof value === 'string' || isSymbol(value)) {\r\n return value;\r\n }\r\n\r\n return value === 0 && 1 / value === -INFINITY ? '-0' : `${value}`;\r\n}\r\n","import { isSymbol } from './isSymbol';\r\n\r\n/** Used to match property names within property paths. */\r\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\r\nconst reIsPlainProp = /^\\w*$/; //matches any word character (alphanumeric and underscore)\r\n\r\n/**\r\n * Checks if `value` is a property name and not a property path.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {*} value The value to check.\r\n * @param {Object} [object] The object to query keys on.\r\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\r\n * @example\r\n * ```javascript\r\n * isKey(1)\r\n * // => true\r\n *\r\n * isKey('example[test]')\r\n * // => false\r\n *\r\n * isKey('a.b')\r\n * // => false\r\n *\r\n * const obj = {\r\n * '[a]': 5,\r\n * 'b.c': true\r\n * };\r\n *\r\n * isKey('[a]', obj)\r\n * // => true\r\n *\r\n * isKey('b.c', obj)\r\n * // => true\r\n * ```\r\n */\r\nexport function isKey(value: unknown, object?: T): boolean {\r\n const type = typeof value;\r\n if (\r\n type === 'number' ||\r\n type === 'boolean' ||\r\n value === null ||\r\n value === undefined ||\r\n isSymbol(value)\r\n ) {\r\n return true;\r\n }\r\n if (typeof value === 'string') {\r\n return (\r\n reIsPlainProp.test(value) ||\r\n !reIsDeepProp.test(value) ||\r\n (object !== null && value in Object(object))\r\n );\r\n }\r\n return false;\r\n}\r\n","import { MemoizeInterface } from '../types';\r\n\r\n/**\r\n * Creates a function that memoizes the result of `func`. If `resolver` is\r\n * provided, it determines the cache key for storing the result based on the\r\n * arguments provided to the memoized function. By default, the first argument\r\n * provided to the memoized function is used as the map cache key. The `func`\r\n * is invoked with the `this` binding of the memoized function.\r\n *\r\n * @since 3.1.0\r\n * @category Function\r\n * @param {Function} func The function to have its output memoized.\r\n * @param {Function} [resolver] The function to resolve the cache key.\r\n * @returns {Function} Returns the new memoized function.\r\n * @example\r\n * ```javascript\r\n * const object = { 'a': 1, 'b': 2 }\r\n * const other = { 'c': 3, 'd': 4 }\r\n *\r\n * const values = memoize(values)\r\n * values(object)\r\n * // => [1, 2]\r\n *\r\n * values(other)\r\n * // => [3, 4]\r\n *\r\n * object.a = 2\r\n * values(object)\r\n * // => [1, 2]\r\n *\r\n * // Modify the result cache.\r\n * values.cache.set(object, ['a', 'b'])\r\n * values(object)\r\n * // => ['a', 'b']\r\n * ```\r\n */\r\nexport function memoize(\r\n func: (...args: unknown[]) => any,\r\n resolver?: (...args: unknown[]) => any\r\n): MemoizeInterface {\r\n const memoized = function (\r\n this: (...args: unknown[]) => any,\r\n ...args: unknown[]\r\n ): MemoizeInterface {\r\n const key = resolver ? resolver.apply(this, args) : args[0];\r\n const cache = memoized.cache;\r\n\r\n if (cache.has(key)) {\r\n return cache.get(key);\r\n }\r\n const result = func.apply(this, args);\r\n cache.set(key, result);\r\n return result;\r\n };\r\n memoized.cache = new Map();\r\n return memoized;\r\n}\r\n\r\n/*const memoize = (fn: Function): Function => {\r\n const cache = {};\r\n return (...args): any => {\r\n const stringifiedArgs = JSON.stringify(args);\r\n const result = (cache[stringifiedArgs] =\r\n typeof cache[stringifiedArgs] === 'undefined'\r\n ? fn(...args)\r\n : cache[stringifiedArgs]);\r\n return result;\r\n };\r\n};*/\r\n","import { memoize } from './memoize';\r\nimport { MemoizeInterface } from '../types';\r\n\r\n/** Used as the maximum memoize cache size. */\r\nexport const MAX_MEMOIZE_SIZE = 500;\r\n\r\n/**\r\n * A specialized version of `memoize` which clears the memoized function's\r\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {Function} func The function to have its output memoized.\r\n * @returns {Function} Returns the new memoized function.\r\n */\r\nexport function memoizeCapped(\r\n func: (...args: any) => unknown\r\n): MemoizeInterface {\r\n const result = memoize(func, (key: unknown) => {\r\n const { cache } = result;\r\n if (cache.size === MAX_MEMOIZE_SIZE) {\r\n cache.clear();\r\n }\r\n return key;\r\n });\r\n\r\n return result;\r\n}\r\n","import { memoizeCapped } from './memoizeCapped';\r\n\r\nconst charCodeOfDot = '.'.charCodeAt(0);\r\nconst reEscapeChar = /\\\\(\\\\)?/g;\r\nconst rePropName = RegExp(\r\n // Match anything that isn't a dot or bracket.\r\n '[^.[\\\\]]+' +\r\n '|' +\r\n // Or match property names within brackets.\r\n '\\\\[(?:' +\r\n // Match a non-string expression.\r\n '([^\"\\'][^[]*)' +\r\n '|' +\r\n // Or match strings (supports escaping characters).\r\n '([\"\\'])((?:(?!\\\\x02)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\x02' +\r\n ')\\\\]' +\r\n '|' +\r\n // Or match \"\" as the space between consecutive dots or empty brackets.\r\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\r\n 'g'\r\n);\r\n\r\n/**\r\n * Converts `string` to a property path array.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {string} string The string to convert.\r\n * @returns {Array} Returns the property path array.\r\n */\r\nexport const stringToPath = memoizeCapped((string: string) => {\r\n const result = [];\r\n if (string.charCodeAt(0) === charCodeOfDot) {\r\n result.push('');\r\n }\r\n string.replace(\r\n rePropName,\r\n (\r\n match: string,\r\n expression: string,\r\n quote: string,\r\n subString: string\r\n ): string => {\r\n let key = match;\r\n if (quote) {\r\n key = subString.replace(reEscapeChar, '$1');\r\n } else if (expression) {\r\n key = expression.trim();\r\n }\r\n result.push(key);\r\n return '';\r\n }\r\n );\r\n return result;\r\n});\r\n","import { toKey } from './toKey';\r\nimport { isKey } from './isKey';\r\nimport { stringToPath } from './stringToPath';\r\n\r\n/**\r\n * Casts `value` to a path array if it's not one.\r\n *\r\n * @private\r\n * @param {*} value The value to inspect.\r\n * @param {Object} [object] The object to query keys on.\r\n * @returns {Array} Returns the cast property path array.\r\n */\r\nexport function castPath(\r\n value: unknown,\r\n object: U\r\n): Array {\r\n if (Array.isArray(value)) {\r\n return value;\r\n }\r\n\r\n return isKey(value, object) ? [value] : stringToPath(value);\r\n}\r\n\r\n/**\r\n * The base implementation of `get` without support for default values.\r\n *\r\n * @private\r\n * @param {Object} object The object to query.\r\n * @param {Array|string} path The path of the property to get.\r\n * @returns {*} Returns the resolved value.\r\n */\r\nexport function baseGet(\r\n object: U,\r\n path: Array | string\r\n): any {\r\n const newPath = castPath(path, object);\r\n\r\n let index = 0;\r\n const length = newPath.length;\r\n\r\n let value: any = object;\r\n while (value instanceof Object && index < length) {\r\n value = value[toKey(newPath[index++])];\r\n }\r\n\r\n return index && index === length ? value : undefined;\r\n}\r\n\r\n/**\r\n * Gets the value at `path` of `object`. If the resolved value is\r\n * `undefined`, the `defaultValue` is returned in its place.\r\n *\r\n * @since 3.1.0\r\n * @category Object\r\n * @param {Object} object The object to query.\r\n * @param {Array|string} path The path of the property to get.\r\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\r\n * @returns {*} Returns the resolved value.\r\n * @example\r\n *\r\n * const object = { 'a': [{ 'b': { 'c': 3 } }] }\r\n *\r\n * getValueFromPath(object, 'a[0].b.c')\r\n * // => 3\r\n *\r\n * getValueFromPath(object, ['a', '0', 'b', 'c'])\r\n * // => 3\r\n *\r\n * getValueFromPath(object, 'a.b.c', 'default')\r\n * // => 'default'\r\n */\r\nexport function getValueFromPath(\r\n object: U,\r\n path: Array | string,\r\n defaultValue?: unknown\r\n): any {\r\n const result = object === null ? undefined : baseGet(object, path);\r\n\r\n return result === undefined ? defaultValue : result;\r\n}\r\n","import { getValueFromPath } from './getValueFromPath';\r\n\r\nconst reDelimiters = /\\${([^}]*)}/g;\r\nconst trim = / +(?= )|^\\s+|\\s+$/g;\r\n\r\nconst specialTrim = (str: string): string => str.replace(trim, '');\r\n\r\n/**\r\n * Apply the context value in a string.\r\n *\r\n * @param {string} str Pattern string, containing context path.\r\n * @param {object} context Object to get values from path.\r\n * @returns {string} Returns a string with embedded context values.\r\n * @example\r\n * ```javascript\r\n * const context = {\r\n * user: { id: 456, bestFriends: [123, 532, 987] }\r\n * };\r\n * applyContext('secrets:${user.id}:*', context)\r\n * // => 'secrets:456:*'\r\n *\r\n * applyContext('secrets:${user.bestFriends}:*', context)\r\n * // => 'secrets:{123,532,987}:*'\r\n *\r\n * applyContext('secrets:${company.address}:account', context)\r\n * // => 'secrets:undefined:account'\r\n * ```\r\n */\r\nexport function applyContext(\r\n str: string,\r\n context?: T\r\n): string {\r\n if (!context) return str;\r\n\r\n return specialTrim(\r\n str.replace(reDelimiters, (_, path: string) => {\r\n const value = getValueFromPath(context, path);\r\n if (Array.isArray(value)) return `{${value}}`;\r\n if (value instanceof Object) return 'undefined';\r\n\r\n return String(value);\r\n })\r\n );\r\n}\r\n","import { DecomposeString } from '../types';\r\n\r\n/**\r\n * Get index range where separators are found.\r\n *\r\n * @private\r\n * @since 3.1.1\r\n * @param {string} initialSeparator First string to be found.\r\n * @param {string} finalSeparator Second string to be found.\r\n * @param {string} str String to be decomposed.\r\n * @returns {number[]} Returns the beginning and final index for those matches.\r\n * @example\r\n * ```javascript\r\n * getIndexRange('first', 'Second', 'firstAndSecond')\r\n * // => [0, 8]\r\n *\r\n * getIndexRange('First', 'Second', '++FirstAndSecond**')\r\n * // => [2, 10]\r\n * ```\r\n */\r\nfunction getIndexRange(\r\n initialSeparator: string,\r\n finalSeparator: string,\r\n str: string\r\n): number[] {\r\n const beginningIndex = str.indexOf(initialSeparator);\r\n const finalIndex = str.indexOf(finalSeparator, beginningIndex + 1);\r\n\r\n if (beginningIndex >= 0 && finalIndex > 0) {\r\n return [beginningIndex, finalIndex];\r\n }\r\n\r\n return [-1, -1];\r\n}\r\n\r\n/**\r\n * Object returned by decomposeString function\r\n *\r\n * @typedef {Object} DecomposedString\r\n * @property {number} start Beginning index for first separator match\r\n * @property {number} end Final index for second separator match\r\n * @property {string} pre Substring before first separator\r\n * @property {string} body Substring between separators\r\n * @property {string} post Substring after second separator\r\n */\r\n\r\n/**\r\n * Decompose string in pre, body and post strings by using separators.\r\n *\r\n * @private\r\n * @since 3.1.1\r\n * @param {string} initialSeparator First string to be found.\r\n * @param {string} finalSeparator Second string to be found.\r\n * @param {string} str String to be decomposed.\r\n * @returns {DecomposedString} Returns a decompose string.\r\n * @example\r\n * ```javascript\r\n * decomposeString('first', 'Second', 'firstAndSecond')\r\n * // => { start: 0, end: 8, pre: '', body: 'And', post: '' }\r\n *\r\n * decomposeString('First', 'Second', '++FirstAndSecond**')\r\n * // => { start: 2, end: 10, pre: '++', body: 'And', post: '**' }\r\n * ```\r\n */\r\nexport function decomposeString(\r\n initialSeparator: string,\r\n finalSeparator: string,\r\n str: string\r\n): DecomposeString {\r\n const [beginningIndex, finalIndex] = getIndexRange(\r\n initialSeparator,\r\n finalSeparator,\r\n str\r\n );\r\n\r\n return {\r\n start: beginningIndex,\r\n end: finalIndex,\r\n pre: beginningIndex >= 0 ? str.slice(0, beginningIndex) : '',\r\n body:\r\n beginningIndex >= 0\r\n ? str.slice(beginningIndex + initialSeparator.length, finalIndex)\r\n : '',\r\n post:\r\n beginningIndex >= 0 ? str.slice(finalIndex + finalSeparator.length) : ''\r\n };\r\n}\r\n","import { decomposeString } from './decomposeString';\r\n\r\n/**\r\n * Generate an array of string depending on {} blocks.\r\n *\r\n * @param {string} pattern Pattern string that can contains {} blocks.\r\n * @returns {string[]} Returns an array of string with all the combinations.\r\n * @example\r\n * ```javascript\r\n * braceExpand('${13}')\r\n * // => ['{13}']\r\n *\r\n * braceExpand('a{b,f,m}p')\r\n * // => ['abp','afp','amp']\r\n *\r\n * braceExpand('-v{,,}')\r\n * // => ['-v','-v','-v']\r\n * ```\r\n */\r\nconst braceExpand = (pattern: string): string[] => {\r\n if (!pattern.match(/{.*}/)) {\r\n return [pattern];\r\n }\r\n\r\n return expand(pattern, true);\r\n};\r\n\r\nconst expand = (str: string, isTop?: boolean): string[] => {\r\n const expansions = [] as string[];\r\n const balance = decomposeString('{', '}', str);\r\n if (balance.start < 0) return [str];\r\n\r\n const parts = balance.body.split(',');\r\n // no need to expand pre, since it is guaranteed to be free of brace-sets\r\n const pre = balance.pre;\r\n const postParts = balance.post.length ? expand(balance.post, false) : [''];\r\n\r\n if (/\\$$/.test(balance.pre)) {\r\n postParts.forEach((postPart) => {\r\n const expansion = `${balance.pre.slice(0, -1)}{${\r\n balance.body\r\n }}${postPart}`;\r\n expansions.push(expansion);\r\n });\r\n } else {\r\n parts.forEach((part: string) => {\r\n postParts.forEach((postPart) => {\r\n const expansion = pre + part + postPart;\r\n if (!isTop || expansion) expansions.push(expansion);\r\n });\r\n });\r\n }\r\n\r\n return expansions;\r\n};\r\n\r\nexport { braceExpand };\r\n","import { braceExpand } from './utils/braceExpand';\r\n\r\nexport class Matcher {\r\n private readonly pattern: string;\r\n private readonly maxLength: number;\r\n private readonly set: (string | RegExp)[];\r\n private readonly empty: boolean;\r\n\r\n constructor(pattern: string, maxLength = 1024 * 64) {\r\n this.set = [];\r\n this.pattern = pattern.trim();\r\n this.maxLength = maxLength;\r\n this.empty = !this.pattern ? true : false;\r\n\r\n const set = braceExpand(pattern);\r\n this.set = set.map((val) => this.parse(val));\r\n this.set = this.set.filter((s) => {\r\n return Boolean(s);\r\n });\r\n }\r\n\r\n match(this: Matcher, str: string): boolean {\r\n if (this.empty) return str === '';\r\n\r\n return this.set.some((pattern) => this.matchOne(str, pattern));\r\n }\r\n\r\n private parse(pattern: string): string | RegExp {\r\n if (pattern.length > this.maxLength) {\r\n throw new TypeError('Pattern is too long');\r\n }\r\n let regExp;\r\n let hasSpecialCharacter = false;\r\n if (pattern === '') return '';\r\n\r\n const re = pattern.replace(/\\*/g, () => {\r\n hasSpecialCharacter = true;\r\n return '.+?';\r\n });\r\n\r\n // skip the regexp for non-* patterns\r\n // unescape anything in it, though, so that it'll be\r\n // an exact match.\r\n if (!hasSpecialCharacter) {\r\n return pattern.replace(/\\\\(.)/g, '$1');\r\n }\r\n\r\n try {\r\n regExp = new RegExp('^' + re + '$');\r\n } catch (error) {\r\n // If it was an invalid regular expression, then it can't match\r\n // anything.\r\n return new RegExp('$.');\r\n }\r\n\r\n return regExp;\r\n }\r\n\r\n private matchOne(str: string, pattern: string | RegExp): boolean {\r\n if (typeof pattern === 'string') {\r\n return str === pattern;\r\n }\r\n\r\n return Boolean(str.match(pattern));\r\n }\r\n}\r\n","/*\r\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\r\n so it's better encapsulated. Now you can have multiple random number generators\r\n and they won't stomp all over each other's state.\r\n If you want to use this as a substitute for Math.random(), use the random()\r\n method like so:\r\n var m = new MersenneTwister();\r\n var randomNumber = m.random();\r\n You can also call the other genrand_{foo}() methods on the instance.\r\n If you want to use a specific seed in order to get a repeatable random\r\n sequence, pass an integer into the constructor:\r\n var m = new MersenneTwister(123);\r\n and that will always produce the same random sequence.\r\n Sean McCullough (banksean@gmail.com)\r\n*/\r\n\r\n/*\r\n A C-program for MT19937, with initialization improved 2002/1/26.\r\n Coded by Takuji Nishimura and Makoto Matsumoto.\r\n Before using, initialize the state by using init_seed(seed)\r\n or init_by_array(init_key, key_length).\r\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\r\n All rights reserved.\r\n Redistribution and use in source and binary forms, with or without\r\n modification, are permitted provided that the following conditions\r\n are met:\r\n 1. Redistributions of source code must retain the above copyright\r\n notice, this list of conditions and the following disclaimer.\r\n 2. Redistributions in binary form must reproduce the above copyright\r\n notice, this list of conditions and the following disclaimer in the\r\n documentation and/or other materials provided with the distribution.\r\n 3. The names of its contributors may not be used to endorse or promote\r\n products derived from this software without specific prior written\r\n permission.\r\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\r\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n Any feedback is very welcome.\r\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\r\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\r\n*/\r\n\r\nexport class MersenneTwister {\r\n private readonly N: number;\r\n private readonly M: number;\r\n private readonly MATRIX_A: number;\r\n private readonly UPPER_MASK: number;\r\n private readonly LOWER_MASK: number;\r\n private readonly mt: number[];\r\n private mti: number;\r\n\r\n constructor(seed?: number | number[]) {\r\n /* Period parameters */\r\n this.N = 624;\r\n this.M = 397;\r\n this.MATRIX_A = 0x9908b0df; /* constant vector a */\r\n this.UPPER_MASK = 0x80000000; /* most significant w-r bits */\r\n this.LOWER_MASK = 0x7fffffff; /* least significant r bits */\r\n\r\n this.mt = new Array(this.N); /* the array for the state vector */\r\n this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */\r\n\r\n if (Array.isArray(seed)) {\r\n if (seed.length > 0) this.initByArray(seed, seed.length);\r\n } else {\r\n if (seed === undefined) {\r\n this.initSeed(new Date().getTime());\r\n } else {\r\n this.initSeed(seed);\r\n }\r\n }\r\n }\r\n\r\n /* initializes mt[N] with a seed */\r\n /* origin name init_genrand */\r\n initSeed(seed: number): void {\r\n this.mt[0] = seed >>> 0;\r\n for (this.mti = 1; this.mti < this.N; this.mti++) {\r\n const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);\r\n this.mt[this.mti] =\r\n ((((s & 0xffff0000) >>> 16) * 1812433253) << 16) +\r\n (s & 0x0000ffff) * 1812433253 +\r\n this.mti;\r\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\r\n /* In the previous versions, MSBs of the seed affect */\r\n /* only MSBs of the array mt[]. */\r\n /* 2002/01/09 modified by Makoto Matsumoto */\r\n this.mt[this.mti] >>>= 0;\r\n /* for >32 bit machines */\r\n }\r\n }\r\n\r\n /* initialize by an array with array-length */\r\n /* init_key is the array for initializing keys */\r\n /* key_length is its length */\r\n /* slight change for C++, 2004/2/26 */\r\n initByArray(initKey: number[], keyLength: number): void {\r\n this.initSeed(19650218);\r\n let i = 1;\r\n let j = 0;\r\n let k = this.N > keyLength ? this.N : keyLength;\r\n for (; k; k--) {\r\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\r\n this.mt[i] =\r\n (this.mt[i] ^\r\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\r\n (s & 0x0000ffff) * 1664525)) +\r\n initKey[j] +\r\n j; /* non linear */\r\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\r\n i++;\r\n j++;\r\n if (i >= this.N) {\r\n this.mt[0] = this.mt[this.N - 1];\r\n i = 1;\r\n }\r\n if (j >= keyLength) j = 0;\r\n }\r\n for (k = this.N - 1; k; k--) {\r\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\r\n this.mt[i] =\r\n (this.mt[i] ^\r\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\r\n (s & 0x0000ffff) * 1566083941)) -\r\n i; /* non linear */\r\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\r\n i++;\r\n if (i >= this.N) {\r\n this.mt[0] = this.mt[this.N - 1];\r\n i = 1;\r\n }\r\n }\r\n\r\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\r\n }\r\n\r\n /* generates a random number on [0,0xffffffff]-interval */\r\n /* origin name genrand_int32 */\r\n randomInt32(): number {\r\n let y;\r\n const mag01 = [0x0, this.MATRIX_A];\r\n /* mag01[x] = x * MATRIX_A for x=0,1 */\r\n\r\n if (this.mti >= this.N) {\r\n /* generate N words at one time */\r\n let kk;\r\n\r\n if (this.mti === this.N + 1)\r\n /* if init_seed() has not been called, */\r\n this.initSeed(5489); /* a default initial seed is used */\r\n\r\n for (kk = 0; kk < this.N - this.M; kk++) {\r\n y =\r\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\r\n this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\r\n }\r\n for (; kk < this.N - 1; kk++) {\r\n y =\r\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\r\n this.mt[kk] =\r\n this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\r\n }\r\n y =\r\n (this.mt[this.N - 1] & this.UPPER_MASK) |\r\n (this.mt[0] & this.LOWER_MASK);\r\n this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];\r\n\r\n this.mti = 0;\r\n }\r\n\r\n y = this.mt[this.mti++];\r\n\r\n /* Tempering */\r\n y ^= y >>> 11;\r\n y ^= (y << 7) & 0x9d2c5680;\r\n y ^= (y << 15) & 0xefc60000;\r\n y ^= y >>> 18;\r\n\r\n return y >>> 0;\r\n }\r\n\r\n /* generates a random number on [0,0x7fffffff]-interval */\r\n /* origin name genrand_int31 */\r\n randomInt31(): number {\r\n return this.randomInt32() >>> 1;\r\n }\r\n\r\n /* generates a random number on [0,1]-real-interval */\r\n /* origin name genrand_real1 */\r\n randomReal1(): number {\r\n return this.randomInt32() * (1.0 / 4294967295.0);\r\n /* divided by 2^32-1 */\r\n }\r\n\r\n /* generates a random number on [0,1)-real-interval */\r\n /* origin name genrand_real2 */\r\n randomReal2(): number {\r\n return this.randomInt32() * (1.0 / 4294967296.0);\r\n /* divided by 2^32 */\r\n }\r\n\r\n /* generates a random number on (0,1)-real-interval */\r\n /* origin name genrand_real3 */\r\n randomReal3(): number {\r\n return (this.randomInt32() + 0.5) * (1.0 / 4294967296.0);\r\n /* divided by 2^32 */\r\n }\r\n\r\n /* generates a random number on [0,1) with 53-bit resolution*/\r\n /* origin name genrand_res53 */\r\n randomRes53(): number {\r\n const a = this.randomInt32() >>> 5;\r\n const b = this.randomInt32() >>> 6;\r\n return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);\r\n }\r\n}\r\n\r\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\r\n","import { MersenneTwister } from './mersenneTwister';\r\n\r\nconst replacePlaceholders = (mersenne: MersenneTwister) => (\r\n placeholder: string\r\n): string => {\r\n const random = Math.floor(mersenne.randomReal2() * 16);\r\n\r\n const value = placeholder === 'x' ? random : (random & 0x3) | 0x8;\r\n return value.toString(16);\r\n};\r\n\r\n/**\r\n * Generate a uuid.\r\n *\r\n * @private\r\n * @since 3.5.0\r\n * @returns {string} Returns the generated uuid.\r\n * @example\r\n * ```javascript\r\n * generateUUID()\r\n * // => 49e71c40-9b21-4371-9699-2def33f62e66\r\n *\r\n * generateUUID()\r\n * // => da94f128-4247-48e3-bc73-d0cae46b5093\r\n * ```\r\n */\r\nexport function generateUUID(): string {\r\n const mersenne = new MersenneTwister();\r\n const RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\r\n\r\n return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders(mersenne));\r\n}\r\n","/**\r\n * Boolean matching.\r\n *\r\n * @since 4.7.0\r\n * @category Boolean\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * bool(true, true)\r\n * // => true\r\n *\r\n * bool(true, false)\r\n * // => false\r\n * ```\r\n */\r\nexport function bool(data: boolean, expected: boolean): boolean {\r\n return (\r\n data === expected\r\n );\r\n}\r\n","export type DateType = Date | string;\r\n\r\nexport const convertDate = (date: DateType): number=>{\r\n if(date instanceof Date){\r\n return date.getTime();\r\n }\r\n\r\n return Date.parse(date);\r\n}","import {DateType, convertDate} from './convertDate';\r\n\r\n/**\r\n * Exact date matching.\r\n *\r\n * @since 4.8.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateEquals('December 15, 2000 03:24:00', 'December 10, 2001 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateEquals(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return (\r\n convertedData === convertedExpectation\r\n );\r\n}\r\n","import { DateType, convertDate } from './convertDate';\r\n\r\n/**\r\n * Matching after a specific date and time\r\n *\r\n * @since 4.11.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is after than `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateGreaterThan('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateGreaterThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateGreaterThan(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return convertedData > convertedExpectation;\r\n}\r\n","import { DateType, convertDate } from './convertDate';\r\n\r\n/**\r\n * Matching at or after a specific date and time\r\n *\r\n * @since 4.11.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is after than or equals `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateGreaterThanEquals('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateGreaterThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:25:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateGreaterThanEquals(\r\n data: DateType,\r\n expected: DateType\r\n): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return convertedData >= convertedExpectation;\r\n}\r\n","import {DateType, convertDate} from './convertDate';\r\n\r\n/**\r\n * Matching before a specific date and time\r\n *\r\n * @since 4.10.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is before than `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateLessThan('December 15, 1994 03:24:00', 'December 16, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateLessThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateLessThan(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return (\r\n convertedData < convertedExpectation\r\n );\r\n}\r\n","import {DateType, convertDate} from './convertDate';\r\n\r\n/**\r\n * Matching at or before a specific date and time\r\n *\r\n * @since 4.10.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal or before than `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateLessThanEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateLessThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateLessThanEquals(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return (\r\n convertedData <= convertedExpectation\r\n );\r\n}\r\n","import {DateType, convertDate} from './convertDate';\r\n\r\n/**\r\n * Negated date matching.\r\n *\r\n * @since 4.9.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateNotEquals('December 15, 1994 03:24:00', 'December 16, 1995 03:24:00')\r\n * // => true\r\n *\r\n * dateNotEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateNotEquals(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return (\r\n convertedData !== convertedExpectation\r\n );\r\n}\r\n","/**\r\n * Exact numeric matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericEquals(5, 5)\r\n * // => true\r\n *\r\n * numericEquals(2, 4)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericEquals(data: number, expected: number): boolean {\r\n return (\r\n data === expected\r\n );\r\n}\r\n","/**\r\n * Numeric greater than matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is greater than `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericGreaterThan(6, 5)\r\n * // => true\r\n *\r\n * numericGreaterThan(4, 8)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericGreaterThan(data: number, expected: number): boolean {\r\n return (\r\n data > expected\r\n );\r\n}\r\n","/**\r\n * Numeric greater than or equals matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is greater than or equals `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericGreaterThanEquals(5, 5)\r\n * // => true\r\n *\r\n * numericGreaterThanEquals(4, 8)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericGreaterThanEquals(data: number, expected: number): boolean {\r\n return (\r\n data >= expected\r\n );\r\n}\r\n","/**\r\n * Numeric less than matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is less than `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericLessThan(5, 6)\r\n * // => true\r\n *\r\n * numericLessThan(8, 4)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericLessThan(data: number, expected: number): boolean {\r\n return (\r\n data < expected\r\n );\r\n}\r\n","/**\r\n * Numeric less than or equals matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is less than or equals `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericLessThanEquals(5, 5)\r\n * // => true\r\n *\r\n * numericLessThanEquals(8, 4)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericLessThanEquals(data: number, expected: number): boolean {\r\n return (\r\n data <= expected\r\n );\r\n}\r\n","/**\r\n * Negated numeric matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericNotEquals(2, 4)\r\n * // => true\r\n *\r\n * numericNotEquals(5, 5)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericNotEquals(data: number, expected: number): boolean {\r\n return (\r\n data !== expected\r\n );\r\n}\r\n","/**\r\n * Exact string matching, case sensitive.\r\n *\r\n * @since 4.3.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringEquals('hi', 'hi')\r\n * // => true\r\n *\r\n * stringEquals('hi', 'no')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringEquals(data: string, expected: string): boolean {\r\n return (\r\n data === expected\r\n );\r\n}\r\n","/**\r\n * Exact string matching, ignoring case.\r\n *\r\n * @since 4.4.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringEqualsIgnoreCase('hi', 'Hi')\r\n * // => true\r\n *\r\n * stringEqualsIgnoreCase('hi', 'no')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringEqualsIgnoreCase(data: string, expected: string): boolean {\r\n return (\r\n data.toLowerCase() === expected.toLowerCase()\r\n );\r\n}\r\n","import {Matcher} from '../../Matcher';\r\n\r\n/**\r\n * Case-sensitive matching. The values can include a multi-character match wildcard (*) anywhere in the string.\r\n *\r\n * @since 4.5.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal like `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringLike('newHouse', 'new*')\r\n * // => true\r\n *\r\n * stringLike('House', 'new*')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringLike(data: string, expected: string): boolean {\r\n return (\r\n new Matcher(data).match(expected)\r\n );\r\n}\r\n","import {stringLike} from './stringLike';\r\n\r\n/**\r\n * Case-sensitive matching if exist. The values can include a multi-character match wildcard (*) anywhere in the string.\r\n *\r\n * @since 4.12.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal like `expected value` or if it does not exist.\r\n * @example\r\n * ```javascript\r\n * stringLikeIfExists(undefined, 'new*')\r\n * // => true\r\n *\r\n * stringLikeIfExists('House', 'new*')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringLikeIfExists(data: string | undefined, expected: string): boolean {\r\n return data?(\r\n stringLike(data,expected)\r\n ):true;\r\n}\r\n","/**\r\n * Negated string matching.\r\n *\r\n * @since 4.4.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringNotEquals('hi', 'no')\r\n * // => true\r\n * \r\n * stringNotEquals('hi', 'hi')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringNotEquals(data: string, expected: string): boolean {\r\n return (\r\n data !== expected\r\n );\r\n}\r\n","/**\r\n * Negated string matching, ignoring case.\r\n *\r\n * @since 4.4.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringNotEqualsIgnoreCase('hi', 'no')\r\n * // => true\r\n * \r\n * stringNotEqualsIgnoreCase('hi', 'Hi')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringNotEqualsIgnoreCase(data: string, expected: string): boolean {\r\n return (\r\n data.toLowerCase() !== expected.toLowerCase()\r\n );\r\n}\r\n","import { bool } from './boolean/bool';\r\nimport { dateEquals } from './date/dateEquals';\r\nimport { dateGreaterThan } from './date/dateGreaterThan';\r\nimport { dateGreaterThanEquals } from './date/dateGreaterThanEquals';\r\nimport { dateLessThan } from './date/dateLessThan';\r\nimport { dateLessThanEquals } from './date/dateLessThanEquals';\r\nimport { dateNotEquals } from './date/dateNotEquals';\r\nimport { numericEquals } from './numeric/numericEquals';\r\nimport { numericGreaterThan } from './numeric/numericGreaterThan';\r\nimport { numericGreaterThanEquals } from './numeric/numericGreaterThanEquals';\r\nimport { numericLessThan } from './numeric/numericLessThan';\r\nimport { numericLessThanEquals } from './numeric/numericLessThanEquals';\r\nimport { numericNotEquals } from './numeric/numericNotEquals';\r\nimport { stringEquals } from './string/stringEquals';\r\nimport { stringEqualsIgnoreCase } from './string/stringEqualsIgnoreCase';\r\nimport { stringLike } from './string/stringLike';\r\nimport { stringLikeIfExists } from './string/stringLikeIfExists';\r\nimport { stringNotEquals } from './string/stringNotEquals';\r\nimport { stringNotEqualsIgnoreCase } from './string/stringNotEqualsIgnoreCase';\r\n\r\nexport const operators: Record = {\r\n bool,\r\n dateEquals,\r\n dateGreaterThan,\r\n dateGreaterThanEquals,\r\n dateLessThan,\r\n dateLessThanEquals,\r\n dateNotEquals,\r\n numericEquals,\r\n numericGreaterThan,\r\n numericGreaterThanEquals,\r\n numericLessThan,\r\n numericLessThanEquals,\r\n numericNotEquals,\r\n stringEquals,\r\n stringEqualsIgnoreCase,\r\n stringLike,\r\n stringLikeIfExists,\r\n stringNotEquals,\r\n stringNotEqualsIgnoreCase\r\n};\r\n","import {\r\n EffectBlock,\r\n ConditionBlock,\r\n StatementInterface,\r\n MatchConditionInterface,\r\n MatchConditionResolverInterface\r\n} from './types';\r\nimport { getValueFromPath } from './utils/getValueFromPath';\r\nimport { generateUUID } from './utils/generateUUID';\r\nimport {operators} from './conditionOperators';\r\n\r\nabstract class Statement {\r\n protected sid: string;\r\n protected readonly condition?: ConditionBlock;\r\n effect: EffectBlock;\r\n\r\n constructor({ sid, effect = 'allow', condition }: StatementInterface) {\r\n if (!sid) {\r\n this.sid = generateUUID();\r\n } else {\r\n this.sid = sid;\r\n }\r\n this.effect = effect;\r\n this.condition = condition;\r\n }\r\n\r\n matchConditions(\r\n this: Statement,\r\n { context, conditionResolver }: MatchConditionInterface\r\n ): boolean {\r\n const { condition: conditions } = this;\r\n\r\n if(conditions && context){\r\n return Object.keys(conditions).every((condition) =>\r\n Object.keys(conditions[condition]).every((path) => {\r\n const conditionValues = conditions[condition][path];\r\n if (conditionValues instanceof Array) {\r\n return conditionValues.some((value) =>\r\n this.evaluateCondition({\r\n context,\r\n conditionResolver,\r\n condition,\r\n path,\r\n value\r\n })\r\n );\r\n }\r\n\r\n return this.evaluateCondition({\r\n context,\r\n conditionResolver,\r\n condition,\r\n path,\r\n value: conditionValues\r\n });\r\n })\r\n )\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private evaluateCondition(\r\n this: Statement,\r\n { context, conditionResolver={}, path, value, condition }: MatchConditionResolverInterface\r\n ): boolean {\r\n\r\n const currentResolver= conditionResolver[condition] || operators[condition]\r\n\r\n if(currentResolver){\r\n return currentResolver(\r\n getValueFromPath(context, path),\r\n value\r\n )\r\n }\r\n return false;\r\n }\r\n}\r\n\r\nexport { Statement };\r\n","import { ActionBasedType, MatchActionBasedInterface } from './types';\r\nimport { Matcher } from './Matcher';\r\nimport { Statement } from './Statement';\r\nimport { applyContext } from './utils/applyContext';\r\n\r\nclass ActionBased extends Statement {\r\n private action?: string[];\r\n private notAction?: string[];\r\n private statement: ActionBasedType;\r\n\r\n constructor(action: ActionBasedType) {\r\n super(action);\r\n this.checkAndAssignActions(action);\r\n this.statement = { ...action, sid: this.sid };\r\n }\r\n\r\n getStatement(this: ActionBased): ActionBasedType {\r\n return this.statement;\r\n }\r\n\r\n matches(\r\n this: ActionBased,\r\n { action, context, conditionResolver }: MatchActionBasedInterface\r\n ): boolean {\r\n return (\r\n this.matchActions(action, context) &&\r\n this.matchNotActions(action, context) &&\r\n this.matchConditions({ context, conditionResolver })\r\n );\r\n }\r\n\r\n private checkAndAssignActions(action: ActionBasedType): void {\r\n const hasAction = 'action' in action;\r\n const hasNotAction = 'notAction' in action;\r\n if (hasAction && hasNotAction) {\r\n throw new TypeError(\r\n 'ActionBased statement should have an action or a notAction attribute, no both'\r\n );\r\n }\r\n if ('action' in action) {\r\n this.action =\r\n typeof action.action === 'string' ? [action.action] : action.action;\r\n } else {\r\n this.notAction =\r\n typeof action.notAction === 'string'\r\n ? [action.notAction]\r\n : action.notAction;\r\n }\r\n }\r\n\r\n private matchActions(action: string, context?: T): boolean {\r\n return this.action\r\n ? this.action.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotActions(action: string, context?: T): boolean {\r\n return this.notAction\r\n ? !this.notAction.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n}\r\n\r\nexport { ActionBased };\r\n","import { IdentityBasedType, MatchIdentityBasedInterface } from './types';\r\nimport { Matcher } from './Matcher';\r\nimport { Statement } from './Statement';\r\nimport { applyContext } from './utils/applyContext';\r\n\r\nclass IdentityBased extends Statement {\r\n private resource?: string[];\r\n private action?: string[];\r\n private notResource?: string[];\r\n private notAction?: string[];\r\n private statement: IdentityBasedType;\r\n\r\n constructor(identity: IdentityBasedType) {\r\n super(identity);\r\n this.checkAndAssignActions(identity);\r\n this.checkAndAssignResources(identity);\r\n this.statement = { ...identity, sid: this.sid };\r\n }\r\n\r\n getStatement(this: IdentityBased): IdentityBasedType {\r\n return this.statement;\r\n }\r\n\r\n matches(\r\n this: IdentityBased,\r\n {\r\n action,\r\n resource,\r\n context,\r\n conditionResolver\r\n }: MatchIdentityBasedInterface\r\n ): boolean {\r\n return (\r\n this.matchActions(action, context) &&\r\n this.matchNotActions(action, context) &&\r\n this.matchResources(resource, context) &&\r\n this.matchNotResources(resource, context) &&\r\n this.matchConditions({ context, conditionResolver })\r\n );\r\n }\r\n\r\n private checkAndAssignActions(identity: IdentityBasedType): void {\r\n const hasAction = 'action' in identity;\r\n const hasNotAction = 'notAction' in identity;\r\n if (hasAction && hasNotAction) {\r\n throw new TypeError(\r\n 'IdentityBased statement should have an action or a notAction attribute, no both'\r\n );\r\n }\r\n if ('action' in identity) {\r\n this.action =\r\n typeof identity.action === 'string'\r\n ? [identity.action]\r\n : identity.action;\r\n } else {\r\n this.notAction =\r\n typeof identity.notAction === 'string'\r\n ? [identity.notAction]\r\n : identity.notAction;\r\n }\r\n }\r\n\r\n private checkAndAssignResources(identity: IdentityBasedType): void {\r\n const hasResource = 'resource' in identity;\r\n const hasNotResource = 'notResource' in identity;\r\n if (hasResource && hasNotResource) {\r\n throw new TypeError(\r\n 'IdentityBased statement should have a resource or a notResource attribute, no both'\r\n );\r\n }\r\n if ('resource' in identity) {\r\n this.resource =\r\n typeof identity.resource === 'string'\r\n ? [identity.resource]\r\n : identity.resource;\r\n } else {\r\n this.notResource =\r\n typeof identity.notResource === 'string'\r\n ? [identity.notResource]\r\n : identity.notResource;\r\n }\r\n }\r\n\r\n private matchActions(action: string, context?: T): boolean {\r\n return this.action\r\n ? this.action.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotActions(action: string, context?: T): boolean {\r\n return this.notAction\r\n ? !this.notAction.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchResources(resource: string, context?: T): boolean {\r\n return this.resource\r\n ? this.resource.some((a) =>\r\n new Matcher(applyContext(a, context)).match(resource)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotResources(resource: string, context?: T): boolean {\r\n return this.notResource\r\n ? !this.notResource.some((a) =>\r\n new Matcher(applyContext(a, context)).match(resource)\r\n )\r\n : true;\r\n }\r\n}\r\n\r\nexport { IdentityBased };\r\n","import {\r\n PrincipalMap,\r\n MatchResourceBasedInterface,\r\n ResourceBasedType\r\n} from './types';\r\nimport { Matcher } from './Matcher';\r\nimport { Statement } from './Statement';\r\nimport { applyContext } from './utils/applyContext';\r\n\r\nclass ResourceBased extends Statement {\r\n private principal?: PrincipalMap | string[];\r\n private resource?: string[];\r\n private action?: string[];\r\n private notPrincipal?: PrincipalMap | string[];\r\n private notResource?: string[];\r\n private notAction?: string[];\r\n private statement: ResourceBasedType;\r\n private hasPrincipals: boolean;\r\n private hasResources: boolean;\r\n\r\n constructor(identity: ResourceBasedType) {\r\n super(identity);\r\n this.hasPrincipals = false;\r\n this.hasResources = false;\r\n this.checkAndAssignActions(identity);\r\n this.checkAndAssignPrincipals(identity);\r\n this.checkAndAssignResources(identity);\r\n this.statement = { ...identity, sid: this.sid };\r\n }\r\n\r\n getStatement(this: ResourceBased): ResourceBasedType {\r\n return this.statement;\r\n }\r\n\r\n matches(\r\n this: ResourceBased,\r\n {\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context,\r\n conditionResolver\r\n }: MatchResourceBasedInterface\r\n ): boolean {\r\n return (\r\n this.matchPrincipalAndNotPrincipal(principal, principalType, context) &&\r\n this.matchActions(action, context) &&\r\n this.matchNotActions(action, context) &&\r\n this.matchResourceAndNotResource(resource, context) &&\r\n this.matchConditions({ context, conditionResolver })\r\n );\r\n }\r\n\r\n /*valueComing principal noPrincipal\r\n true false false false\r\n true true false true or false\r\n true false true true or false\r\n false false false true\r\n false true false false\r\n false false true false*/\r\n private matchPrincipalAndNotPrincipal(\r\n principal?: string,\r\n principalType?: string,\r\n context?: T\r\n ): boolean {\r\n if (principal) {\r\n if (this.hasPrincipals)\r\n return (\r\n this.matchPrincipals(principal, principalType, context) &&\r\n this.matchNotPrincipals(principal, principalType, context)\r\n );\r\n return false;\r\n }\r\n if (this.hasPrincipals) return false;\r\n return true;\r\n }\r\n\r\n /*valueComing resource noResource\r\n true false false false\r\n true true false true or false\r\n true false true true or false\r\n false false false true\r\n false true false false\r\n false false true false*/\r\n private matchResourceAndNotResource(resource?: string, context?: T): boolean {\r\n if (resource) {\r\n if (this.hasResources)\r\n return (\r\n this.matchResources(resource, context) &&\r\n this.matchNotResources(resource, context)\r\n );\r\n return false;\r\n }\r\n if (this.hasResources) return false;\r\n return true;\r\n }\r\n\r\n private checkAndAssignActions(identity: ResourceBasedType): void {\r\n const hasAction = 'action' in identity;\r\n const hasNotAction = 'notAction' in identity;\r\n if (hasAction && hasNotAction) {\r\n throw new TypeError(\r\n 'ResourceBased statement should have an action or a notAction attribute, no both'\r\n );\r\n }\r\n if ('action' in identity) {\r\n this.action =\r\n typeof identity.action === 'string'\r\n ? [identity.action]\r\n : identity.action;\r\n } else {\r\n this.notAction =\r\n typeof identity.notAction === 'string'\r\n ? [identity.notAction]\r\n : identity.notAction;\r\n }\r\n }\r\n\r\n private checkAndAssignPrincipals(identity: ResourceBasedType): void {\r\n const hasPrincipal = 'principal' in identity;\r\n const hasNotPrincipal = 'notPrincipal' in identity;\r\n if (hasPrincipal && hasNotPrincipal) {\r\n throw new TypeError(\r\n 'ResourceBased statement could have a principal or a notPrincipal attribute, no both'\r\n );\r\n }\r\n if ('principal' in identity) {\r\n this.principal =\r\n typeof identity.principal === 'string'\r\n ? [identity.principal]\r\n : identity.principal;\r\n this.hasPrincipals = true;\r\n } else if ('notPrincipal' in identity) {\r\n this.notPrincipal =\r\n typeof identity.notPrincipal === 'string'\r\n ? [identity.notPrincipal]\r\n : identity.notPrincipal;\r\n this.hasPrincipals = true;\r\n }\r\n }\r\n\r\n private checkAndAssignResources(identity: ResourceBasedType): void {\r\n const hasResource = 'resource' in identity;\r\n const hasNotResource = 'notResource' in identity;\r\n if (hasResource && hasNotResource) {\r\n throw new TypeError(\r\n 'ResourceBased statement could have a resource or a notResource attribute, no both'\r\n );\r\n }\r\n if ('resource' in identity) {\r\n this.resource =\r\n typeof identity.resource === 'string'\r\n ? [identity.resource]\r\n : identity.resource;\r\n this.hasResources = true;\r\n } else if ('notResource' in identity) {\r\n this.notResource =\r\n typeof identity.notResource === 'string'\r\n ? [identity.notResource]\r\n : identity.notResource;\r\n this.hasResources = true;\r\n }\r\n }\r\n\r\n private matchPrincipals(\r\n principal: string,\r\n principalType?: string,\r\n context?: T\r\n ): boolean {\r\n if (this.principal) {\r\n if (this.principal instanceof Array) {\r\n return principalType\r\n ? false\r\n : this.principal.some((a) =>\r\n new Matcher(applyContext(a, context)).match(principal)\r\n );\r\n } else {\r\n if (principalType) {\r\n const principalValues = this.principal[principalType];\r\n if (principalValues instanceof Array) {\r\n return principalValues.some((a) =>\r\n new Matcher(applyContext(a, context)).match(principal)\r\n );\r\n } else if (principalValues) {\r\n return new Matcher(applyContext(principalValues, context)).match(\r\n principal\r\n );\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n private matchNotPrincipals(\r\n principal: string,\r\n principalType?: string,\r\n context?: T\r\n ): boolean {\r\n if (this.notPrincipal) {\r\n if (this.notPrincipal instanceof Array) {\r\n return principalType\r\n ? true\r\n : !this.notPrincipal.some((a) =>\r\n new Matcher(applyContext(a, context)).match(principal)\r\n );\r\n } else {\r\n if (principalType) {\r\n const principalValues = this.notPrincipal[principalType];\r\n if (principalValues instanceof Array) {\r\n return !principalValues.some((a) =>\r\n new Matcher(applyContext(a, context)).match(principal)\r\n );\r\n } else if (principalValues) {\r\n return !new Matcher(applyContext(principalValues, context)).match(\r\n principal\r\n );\r\n }\r\n return true;\r\n }\r\n return true;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n private matchActions(action: string, context?: T): boolean {\r\n return this.action\r\n ? this.action.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotActions(action: string, context?: T): boolean {\r\n return this.notAction\r\n ? !this.notAction.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchResources(resource: string, context?: T): boolean {\r\n return this.resource\r\n ? this.resource.some((a) =>\r\n new Matcher(applyContext(a, context)).match(resource)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotResources(resource: string, context?: T): boolean {\r\n return this.notResource\r\n ? !this.notResource.some((a) =>\r\n new Matcher(applyContext(a, context)).match(resource)\r\n )\r\n : true;\r\n }\r\n}\r\n\r\nexport { ResourceBased };\r\n","import { MatchConditionInterface, ConditionResolver } from './types';\r\n\r\nabstract class Policy {\r\n protected context?: T;\r\n protected conditionResolver?: ConditionResolver;\r\n\r\n constructor({ context, conditionResolver }: MatchConditionInterface) {\r\n this.context = context;\r\n this.conditionResolver = conditionResolver;\r\n }\r\n\r\n setContext(this: Policy, context: T): void {\r\n this.context = context;\r\n }\r\n\r\n getContext(this: Policy): T | undefined {\r\n return this.context;\r\n }\r\n\r\n setConditionResolver(\r\n this: Policy,\r\n conditionResolver: ConditionResolver\r\n ): void {\r\n this.conditionResolver = conditionResolver;\r\n }\r\n\r\n getConditionResolver(this: Policy): ConditionResolver | undefined {\r\n return this.conditionResolver;\r\n }\r\n\r\n abstract getStatements(this: Policy): U[];\r\n}\r\n\r\nexport { Policy };\r\n","import {\r\n ActionBasedType,\r\n ConditionResolver,\r\n EvaluateActionBasedInterface,\r\n ProxyOptions\r\n} from './types';\r\nimport { ActionBased } from './ActionBasedStatement';\r\nimport { Policy } from './Policy';\r\n\r\nexport interface ActionBasedPolicyInterface {\r\n statements: ActionBasedType[];\r\n conditionResolver?: ConditionResolver;\r\n context?: T;\r\n}\r\n\r\nexport class ActionBasedPolicy extends Policy<\r\n T,\r\n ActionBasedType\r\n> {\r\n private denyStatements: ActionBased[];\r\n private allowStatements: ActionBased[];\r\n private statements: ActionBasedType[];\r\n\r\n constructor({\r\n statements,\r\n conditionResolver,\r\n context\r\n }: ActionBasedPolicyInterface) {\r\n super({ context, conditionResolver });\r\n const statementInstances = statements.map(\r\n (statement) => new ActionBased(statement)\r\n );\r\n this.allowStatements = statementInstances.filter(\r\n (s) => s.effect === 'allow'\r\n );\r\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\r\n this.statements = statementInstances.map((statement) =>\r\n statement.getStatement()\r\n );\r\n }\r\n\r\n addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void {\r\n const statementInstance = new ActionBased(statement);\r\n if (statementInstance.effect === 'allow') {\r\n this.allowStatements.push(statementInstance);\r\n } else {\r\n this.denyStatements.push(statementInstance);\r\n }\r\n this.statements.push(statementInstance.getStatement());\r\n }\r\n\r\n getStatements(this: ActionBasedPolicy): ActionBasedType[] {\r\n return this.statements;\r\n }\r\n\r\n evaluate(\r\n this: ActionBasedPolicy,\r\n { action, context }: EvaluateActionBasedInterface\r\n ): boolean {\r\n const args = { action, context };\r\n return !this.cannot(args) && this.can(args);\r\n }\r\n\r\n can(\r\n this: ActionBasedPolicy,\r\n { action, context }: EvaluateActionBasedInterface\r\n ): boolean {\r\n return this.allowStatements.some((s) =>\r\n s.matches({\r\n action,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n\r\n cannot(\r\n this: ActionBasedPolicy,\r\n { action, context }: EvaluateActionBasedInterface\r\n ): boolean {\r\n return this.denyStatements.some((s) =>\r\n s.matches({\r\n action,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n\r\n generateProxy(\r\n this: ActionBasedPolicy,\r\n obj: U,\r\n options: ProxyOptions = {}\r\n ): U {\r\n const { get = {}, set = {} } = options;\r\n const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get;\r\n const { allow: allowSet = true, propertyMap: propertyMapSet = {} } = set;\r\n const handler = {\r\n ...(allowGet\r\n ? {\r\n get: (target: U, prop: string | symbol): any => {\r\n const property = Reflect.has(propertyMapGet, prop)\r\n ? Reflect.get(propertyMapGet, prop)\r\n : prop;\r\n if (typeof prop === 'string') {\r\n if (this.evaluate({ action: property })) {\r\n return Reflect.get(target, prop);\r\n } else {\r\n throw new Error(`Unauthorize to get ${prop} property`);\r\n } \r\n } else {\r\n return Reflect.get(target, prop);\r\n }\r\n }\r\n }\r\n : {}),\r\n ...(allowSet\r\n ? {\r\n set: (target: U, prop: string | symbol, value: any): boolean => {\r\n const property = Reflect.has(propertyMapSet, prop)\r\n ? Reflect.get(propertyMapSet, prop)\r\n : prop;\r\n if (typeof prop === 'string') {\r\n if (this.evaluate({ action: property })) {\r\n return Reflect.set(target, prop, value);\r\n } else {\r\n throw new Error(`Unauthorize to set ${prop} property`);\r\n } \r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n : {})\r\n };\r\n\r\n return new Proxy(obj, handler);\r\n }\r\n}\r\n","import {\r\n ConditionResolver,\r\n EvaluateIdentityBasedInterface,\r\n IdentityBasedType\r\n} from './types';\r\nimport { IdentityBased } from './IdentityBasedStatement';\r\nimport { Policy } from './Policy';\r\n\r\ninterface IdentityBasedPolicyInterface {\r\n statements: IdentityBasedType[];\r\n conditionResolver?: ConditionResolver;\r\n context?: T;\r\n}\r\n\r\nexport class IdentityBasedPolicy extends Policy<\r\n T,\r\n IdentityBasedType\r\n> {\r\n private denyStatements: IdentityBased[];\r\n private allowStatements: IdentityBased[];\r\n private statements: IdentityBasedType[];\r\n\r\n constructor({\r\n statements,\r\n conditionResolver,\r\n context\r\n }: IdentityBasedPolicyInterface) {\r\n super({ context, conditionResolver });\r\n const statementInstances = statements.map(\r\n (statement) => new IdentityBased(statement)\r\n );\r\n this.allowStatements = statementInstances.filter(\r\n (s) => s.effect === 'allow'\r\n );\r\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\r\n this.statements = statementInstances.map((statement) =>\r\n statement.getStatement()\r\n );\r\n }\r\n\r\n addStatement(\r\n this: IdentityBasedPolicy,\r\n statement: IdentityBasedType\r\n ): void {\r\n const statementInstance = new IdentityBased(statement);\r\n if (statementInstance.effect === 'allow') {\r\n this.allowStatements.push(statementInstance);\r\n } else {\r\n this.denyStatements.push(statementInstance);\r\n }\r\n this.statements.push(statementInstance.getStatement());\r\n }\r\n\r\n getStatements(this: IdentityBasedPolicy): IdentityBasedType[] {\r\n return this.statements;\r\n }\r\n\r\n evaluate(\r\n this: IdentityBasedPolicy,\r\n { action, resource, context }: EvaluateIdentityBasedInterface\r\n ): boolean {\r\n const args = { action, resource, context };\r\n return !this.cannot(args) && this.can(args);\r\n }\r\n\r\n can(\r\n this: IdentityBasedPolicy,\r\n { action, resource, context }: EvaluateIdentityBasedInterface\r\n ): boolean {\r\n return this.allowStatements.some((s) =>\r\n s.matches({\r\n action,\r\n resource,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n\r\n cannot(\r\n this: IdentityBasedPolicy,\r\n { action, resource, context }: EvaluateIdentityBasedInterface\r\n ): boolean {\r\n return this.denyStatements.some((s) =>\r\n s.matches({\r\n action,\r\n resource,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n}\r\n","import {\r\n ConditionResolver,\r\n EvaluateResourceBasedInterface,\r\n ResourceBasedType\r\n} from './types';\r\nimport { ResourceBased } from './ResourceBasedStatement';\r\nimport { Policy } from './Policy';\r\n\r\ninterface ResourceBasedPolicyInterface {\r\n statements: ResourceBasedType[];\r\n conditionResolver?: ConditionResolver;\r\n context?: T;\r\n}\r\n\r\nexport class ResourceBasedPolicy extends Policy<\r\n T,\r\n ResourceBasedType\r\n> {\r\n private denyStatements: ResourceBased[];\r\n private allowStatements: ResourceBased[];\r\n private statements: ResourceBasedType[];\r\n\r\n constructor({\r\n statements,\r\n conditionResolver,\r\n context\r\n }: ResourceBasedPolicyInterface) {\r\n super({ context, conditionResolver });\r\n const statementInstances = statements.map(\r\n (statement) => new ResourceBased(statement)\r\n );\r\n this.allowStatements = statementInstances.filter(\r\n (s) => s.effect === 'allow'\r\n );\r\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\r\n this.statements = statementInstances.map((statement) =>\r\n statement.getStatement()\r\n );\r\n }\r\n\r\n addStatement(\r\n this: ResourceBasedPolicy,\r\n statement: ResourceBasedType\r\n ): void {\r\n const statementInstance = new ResourceBased(statement);\r\n if (statementInstance.effect === 'allow') {\r\n this.allowStatements.push(statementInstance);\r\n } else {\r\n this.denyStatements.push(statementInstance);\r\n }\r\n this.statements.push(statementInstance.getStatement());\r\n }\r\n\r\n getStatements(this: ResourceBasedPolicy): ResourceBasedType[] {\r\n return this.statements;\r\n }\r\n\r\n evaluate(\r\n this: ResourceBasedPolicy,\r\n {\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context\r\n }: EvaluateResourceBasedInterface\r\n ): boolean {\r\n const args = { principal, action, resource, principalType, context };\r\n return !this.cannot(args) && this.can(args);\r\n }\r\n\r\n can(\r\n this: ResourceBasedPolicy,\r\n {\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context\r\n }: EvaluateResourceBasedInterface\r\n ): boolean {\r\n return this.allowStatements.some((s) =>\r\n s.matches({\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n\r\n cannot(\r\n this: ResourceBasedPolicy,\r\n {\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context\r\n }: EvaluateResourceBasedInterface\r\n ): boolean {\r\n return this.denyStatements.some((s) =>\r\n s.matches({\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n}\r\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;SAgBgB,MAAM,CAAC,KAAc;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/C;;AChBA;;;;;;;;;;;;;;;;SAgBgB,QAAQ,CAAC,KAAe;IACtC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,QACE,IAAI,KAAK,QAAQ;SAChB,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,EAC5E;AACJ;;ACtBA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;SAegB,KAAK,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;AACpE;;ACxBA;AACA,MAAM,YAAY,GAAG,kDAAkD,CAAC;AACxE,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA+BgB,K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R,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;;;;;"} \ No newline at end of file +{"version":3,"file":"main.es.js","sources":["../src/utils/getTag.ts","../src/utils/isSymbol.ts","../src/utils/toKey.ts","../src/utils/isKey.ts","../src/utils/memoize.ts","../src/utils/memoizeCapped.ts","../src/utils/stringToPath.ts","../src/utils/getValueFromPath.ts","../src/utils/applyContext.ts","../src/utils/decomposeString.ts","../src/utils/braceExpand.ts","../src/Matcher.ts","../src/utils/mersenneTwister.ts","../src/utils/generateUUID.ts","../src/conditionOperators/boolean/bool.ts","../src/conditionOperators/date/convertDate.ts","../src/conditionOperators/date/dateEquals.ts","../src/conditionOperators/date/dateGreaterThan.ts","../src/conditionOperators/date/dateGreaterThanEquals.ts","../src/conditionOperators/date/dateLessThan.ts","../src/conditionOperators/date/dateLessThanEquals.ts","../src/conditionOperators/date/dateNotEquals.ts","../src/conditionOperators/numeric/numericEquals.ts","../src/conditionOperators/numeric/numericGreaterThan.ts","../src/conditionOperators/numeric/numericGreaterThanEquals.ts","../src/conditionOperators/numeric/numericLessThan.ts","../src/conditionOperators/numeric/numericLessThanEquals.ts","../src/conditionOperators/numeric/numericNotEquals.ts","../src/conditionOperators/string/stringEquals.ts","../src/conditionOperators/string/stringEqualsIgnoreCase.ts","../src/conditionOperators/string/stringLike.ts","../src/conditionOperators/string/stringLikeIfExists.ts","../src/conditionOperators/string/stringNotEquals.ts","../src/conditionOperators/string/stringNotEqualsIgnoreCase.ts","../src/conditionOperators/index.ts","../src/Statement.ts","../src/ActionBasedStatement.ts","../src/IdentityBasedStatement.ts","../src/ResourceBasedStatement.ts","../src/Policy.ts","../src/ActionBasedPolicy.ts","../src/IdentityBasedPolicy.ts","../src/ResourceBasedPolicy.ts"],"sourcesContent":["/**\n * Gets the `toStringTag` of `value`.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n * @example\n * ```javascript\n * getTag(1)\n * // => '[object Number]'\n *\n * getTag(null)\n * // => '[object Null]'\n * ```\n */\nexport function getTag(value: unknown): string {\n return Object.prototype.toString.call(value);\n}\n","import { getTag } from './getTag';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @since 3.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n * ```javascript\n * isSymbol(Symbol())\n * // => true\n *\n * isSymbol('abc')\n * // => false\n * ```\n */\nexport function isSymbol(value?: unknown): value is symbol {\n const type = typeof value;\n return (\n type === 'symbol' ||\n (type === 'object' && value !== null && getTag(value) === '[object Symbol]')\n );\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used as references for various `Number` constants. */\nconst INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n * @example\n *\n * toKey(Symbol.iterator)\n * // => true\n *\n * toKey('abc')\n * // => false\n */\nexport function toKey(value: unknown): string | symbol {\n if (typeof value === 'string' || isSymbol(value)) {\n return value;\n }\n\n return value === 0 && 1 / value === -INFINITY ? '-0' : `${value}`;\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used to match property names within property paths. */\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst reIsPlainProp = /^\\w*$/; //matches any word character (alphanumeric and underscore)\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n * @example\n * ```javascript\n * isKey(1)\n * // => true\n *\n * isKey('example[test]')\n * // => false\n *\n * isKey('a.b')\n * // => false\n *\n * const obj = {\n * '[a]': 5,\n * 'b.c': true\n * };\n *\n * isKey('[a]', obj)\n * // => true\n *\n * isKey('b.c', obj)\n * // => true\n * ```\n */\nexport function isKey(value: unknown, object?: T): boolean {\n const type = typeof value;\n if (\n type === 'number' ||\n type === 'boolean' ||\n value === null ||\n value === undefined ||\n isSymbol(value)\n ) {\n return true;\n }\n if (typeof value === 'string') {\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object !== null && value in Object(object))\n );\n }\n return false;\n}\n","import { MemoizeInterface } from '../types';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * @since 3.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n * ```javascript\n * const object = { 'a': 1, 'b': 2 }\n * const other = { 'c': 3, 'd': 4 }\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(other)\n * // => [3, 4]\n *\n * object.a = 2\n * values(object)\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n * ```\n */\nexport function memoize(\n func: (...args: unknown[]) => any,\n resolver?: (...args: unknown[]) => any\n): MemoizeInterface {\n const memoized = function (\n this: (...args: unknown[]) => any,\n ...args: unknown[]\n ): MemoizeInterface {\n const key = resolver ? resolver.apply(this, args) : args[0];\n const cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n const result = func.apply(this, args);\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n}\n\n/*const memoize = (fn: Function): Function => {\n const cache = {};\n return (...args): any => {\n const stringifiedArgs = JSON.stringify(args);\n const result = (cache[stringifiedArgs] =\n typeof cache[stringifiedArgs] === 'undefined'\n ? fn(...args)\n : cache[stringifiedArgs]);\n return result;\n };\n};*/\n","import { memoize } from './memoize';\nimport { MemoizeInterface } from '../types';\n\n/** Used as the maximum memoize cache size. */\nexport const MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @since 3.1.0\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nexport function memoizeCapped(\n func: (...args: any) => unknown\n): MemoizeInterface {\n const result = memoize(func, (key: unknown) => {\n const { cache } = result;\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n return result;\n}\n","import { memoizeCapped } from './memoizeCapped';\n\nconst charCodeOfDot = '.'.charCodeAt(0);\nconst reEscapeChar = /\\\\(\\\\)?/g;\nconst rePropName = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\x02)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\x02' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n);\n\n/**\n * Converts `string` to a property path array.\n *\n * @since 3.1.0\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nexport const stringToPath = memoizeCapped((string: string) => {\n const result = [];\n if (string.charCodeAt(0) === charCodeOfDot) {\n result.push('');\n }\n string.replace(\n rePropName,\n (\n match: string,\n expression: string,\n quote: string,\n subString: string\n ): string => {\n let key = match;\n if (quote) {\n key = subString.replace(reEscapeChar, '$1');\n } else if (expression) {\n key = expression.trim();\n }\n result.push(key);\n return '';\n }\n );\n return result;\n});\n","import { toKey } from './toKey';\nimport { isKey } from './isKey';\nimport { stringToPath } from './stringToPath';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nexport function castPath(\n value: unknown,\n object: U\n): Array {\n if (Array.isArray(value)) {\n return value;\n }\n\n return isKey(value, object) ? [value] : stringToPath(value);\n}\n\n/**\n * The base implementation of `get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nexport function baseGet(\n object: U,\n path: Array | string\n): any {\n const newPath = castPath(path, object);\n\n let index = 0;\n const length = newPath.length;\n\n let value: any = object;\n while (value instanceof Object && index < length) {\n value = value[toKey(newPath[index++])];\n }\n\n return index && index === length ? value : undefined;\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @since 3.1.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * const object = { 'a': [{ 'b': { 'c': 3 } }] }\n *\n * getValueFromPath(object, 'a[0].b.c')\n * // => 3\n *\n * getValueFromPath(object, ['a', '0', 'b', 'c'])\n * // => 3\n *\n * getValueFromPath(object, 'a.b.c', 'default')\n * // => 'default'\n */\nexport function getValueFromPath(\n object: U,\n path: Array | string,\n defaultValue?: unknown\n): any {\n const result = object === null ? undefined : baseGet(object, path);\n\n return result === undefined ? defaultValue : result;\n}\n","import { getValueFromPath } from './getValueFromPath';\n\nconst reDelimiters = /\\${([^}]*)}/g;\nconst trim = / +(?= )|^\\s+|\\s+$/g;\n\nconst specialTrim = (str: string): string => str.replace(trim, '');\n\n/**\n * Apply the context value in a string.\n *\n * @param {string} str Pattern string, containing context path.\n * @param {object} context Object to get values from path.\n * @returns {string} Returns a string with embedded context values.\n * @example\n * ```javascript\n * const context = {\n * user: { id: 456, bestFriends: [123, 532, 987] }\n * };\n * applyContext('secrets:${user.id}:*', context)\n * // => 'secrets:456:*'\n *\n * applyContext('secrets:${user.bestFriends}:*', context)\n * // => 'secrets:{123,532,987}:*'\n *\n * applyContext('secrets:${company.address}:account', context)\n * // => 'secrets:undefined:account'\n * ```\n */\nexport function applyContext(\n str: string,\n context?: T\n): string {\n if (!context) return str;\n\n return specialTrim(\n str.replace(reDelimiters, (_, path: string) => {\n const value = getValueFromPath(context, path);\n if (Array.isArray(value)) return `{${value}}`;\n if (value instanceof Object) return 'undefined';\n\n return String(value);\n })\n );\n}\n","import { DecomposeString } from '../types';\n\n/**\n * Get index range where separators are found.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {number[]} Returns the beginning and final index for those matches.\n * @example\n * ```javascript\n * getIndexRange('first', 'Second', 'firstAndSecond')\n * // => [0, 8]\n *\n * getIndexRange('First', 'Second', '++FirstAndSecond**')\n * // => [2, 10]\n * ```\n */\nfunction getIndexRange(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): number[] {\n const beginningIndex = str.indexOf(initialSeparator);\n const finalIndex = str.indexOf(finalSeparator, beginningIndex + 1);\n\n if (beginningIndex >= 0 && finalIndex > 0) {\n return [beginningIndex, finalIndex];\n }\n\n return [-1, -1];\n}\n\n/**\n * Object returned by decomposeString function\n *\n * @typedef {Object} DecomposedString\n * @property {number} start Beginning index for first separator match\n * @property {number} end Final index for second separator match\n * @property {string} pre Substring before first separator\n * @property {string} body Substring between separators\n * @property {string} post Substring after second separator\n */\n\n/**\n * Decompose string in pre, body and post strings by using separators.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {DecomposedString} Returns a decompose string.\n * @example\n * ```javascript\n * decomposeString('first', 'Second', 'firstAndSecond')\n * // => { start: 0, end: 8, pre: '', body: 'And', post: '' }\n *\n * decomposeString('First', 'Second', '++FirstAndSecond**')\n * // => { start: 2, end: 10, pre: '++', body: 'And', post: '**' }\n * ```\n */\nexport function decomposeString(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): DecomposeString {\n const [beginningIndex, finalIndex] = getIndexRange(\n initialSeparator,\n finalSeparator,\n str\n );\n\n return {\n start: beginningIndex,\n end: finalIndex,\n pre: beginningIndex >= 0 ? str.slice(0, beginningIndex) : '',\n body:\n beginningIndex >= 0\n ? str.slice(beginningIndex + initialSeparator.length, finalIndex)\n : '',\n post:\n beginningIndex >= 0 ? str.slice(finalIndex + finalSeparator.length) : ''\n };\n}\n","import { decomposeString } from './decomposeString';\n\n/**\n * Generate an array of string depending on {} blocks.\n *\n * @param {string} pattern Pattern string that can contains {} blocks.\n * @returns {string[]} Returns an array of string with all the combinations.\n * @example\n * ```javascript\n * braceExpand('${13}')\n * // => ['{13}']\n *\n * braceExpand('a{b,f,m}p')\n * // => ['abp','afp','amp']\n *\n * braceExpand('-v{,,}')\n * // => ['-v','-v','-v']\n * ```\n */\nconst braceExpand = (pattern: string): string[] => {\n if (!pattern.match(/{.*}/)) {\n return [pattern];\n }\n\n return expand(pattern, true);\n};\n\nconst expand = (str: string, isTop?: boolean): string[] => {\n const expansions = [] as string[];\n const balance = decomposeString('{', '}', str);\n if (balance.start < 0) return [str];\n\n const parts = balance.body.split(',');\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = balance.pre;\n const postParts = balance.post.length ? expand(balance.post, false) : [''];\n\n if (/\\$$/.test(balance.pre)) {\n postParts.forEach((postPart) => {\n const expansion = `${balance.pre.slice(0, -1)}{${\n balance.body\n }}${postPart}`;\n expansions.push(expansion);\n });\n } else {\n parts.forEach((part: string) => {\n postParts.forEach((postPart) => {\n const expansion = pre + part + postPart;\n if (!isTop || expansion) expansions.push(expansion);\n });\n });\n }\n\n return expansions;\n};\n\nexport { braceExpand };\n","import { braceExpand } from './utils/braceExpand';\n\nexport class Matcher {\n private readonly pattern: string;\n private readonly maxLength: number;\n private readonly set: (string | RegExp)[];\n private readonly empty: boolean;\n\n constructor(pattern: string, maxLength = 1024 * 64) {\n this.set = [];\n this.pattern = pattern.trim();\n this.maxLength = maxLength;\n this.empty = !this.pattern ? true : false;\n\n const set = braceExpand(pattern);\n this.set = set.map((val) => this.parse(val));\n this.set = this.set.filter((s) => {\n return Boolean(s);\n });\n }\n\n match(this: Matcher, str: string): boolean {\n if (this.empty) return str === '';\n\n return this.set.some((pattern) => this.matchOne(str, pattern));\n }\n\n private parse(pattern: string): string | RegExp {\n if (pattern.length > this.maxLength) {\n throw new TypeError('Pattern is too long');\n }\n let regExp;\n let hasSpecialCharacter = false;\n if (pattern === '') return '';\n\n const re = pattern.replace(/\\*/g, () => {\n hasSpecialCharacter = true;\n return '.+?';\n });\n\n // skip the regexp for non-* patterns\n // unescape anything in it, though, so that it'll be\n // an exact match.\n if (!hasSpecialCharacter) {\n return pattern.replace(/\\\\(.)/g, '$1');\n }\n\n try {\n regExp = new RegExp('^' + re + '$');\n } catch (error) {\n // If it was an invalid regular expression, then it can't match\n // anything.\n return new RegExp('$.');\n }\n\n return regExp;\n }\n\n private matchOne(str: string, pattern: string | RegExp): boolean {\n if (typeof pattern === 'string') {\n return str === pattern;\n }\n\n return Boolean(str.match(pattern));\n }\n}\n","/*\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n so it's better encapsulated. Now you can have multiple random number generators\n and they won't stomp all over each other's state.\n If you want to use this as a substitute for Math.random(), use the random()\n method like so:\n var m = new MersenneTwister();\n var randomNumber = m.random();\n You can also call the other genrand_{foo}() methods on the instance.\n If you want to use a specific seed in order to get a repeatable random\n sequence, pass an integer into the constructor:\n var m = new MersenneTwister(123);\n and that will always produce the same random sequence.\n Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n Before using, initialize the state by using init_seed(seed)\n or init_by_array(init_key, key_length).\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nexport class MersenneTwister {\n private readonly N: number;\n private readonly M: number;\n private readonly MATRIX_A: number;\n private readonly UPPER_MASK: number;\n private readonly LOWER_MASK: number;\n private readonly mt: number[];\n private mti: number;\n\n constructor(seed?: number | number[]) {\n /* Period parameters */\n this.N = 624;\n this.M = 397;\n this.MATRIX_A = 0x9908b0df; /* constant vector a */\n this.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n this.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n this.mt = new Array(this.N); /* the array for the state vector */\n this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */\n\n if (Array.isArray(seed)) {\n if (seed.length > 0) this.initByArray(seed, seed.length);\n } else {\n if (seed === undefined) {\n this.initSeed(new Date().getTime());\n } else {\n this.initSeed(seed);\n }\n }\n }\n\n /* initializes mt[N] with a seed */\n /* origin name init_genrand */\n initSeed(seed: number): void {\n this.mt[0] = seed >>> 0;\n for (this.mti = 1; this.mti < this.N; this.mti++) {\n const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);\n this.mt[this.mti] =\n ((((s & 0xffff0000) >>> 16) * 1812433253) << 16) +\n (s & 0x0000ffff) * 1812433253 +\n this.mti;\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n /* In the previous versions, MSBs of the seed affect */\n /* only MSBs of the array mt[]. */\n /* 2002/01/09 modified by Makoto Matsumoto */\n this.mt[this.mti] >>>= 0;\n /* for >32 bit machines */\n }\n }\n\n /* initialize by an array with array-length */\n /* init_key is the array for initializing keys */\n /* key_length is its length */\n /* slight change for C++, 2004/2/26 */\n initByArray(initKey: number[], keyLength: number): void {\n this.initSeed(19650218);\n let i = 1;\n let j = 0;\n let k = this.N > keyLength ? this.N : keyLength;\n for (; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\n (s & 0x0000ffff) * 1664525)) +\n initKey[j] +\n j; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n j++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n if (j >= keyLength) j = 0;\n }\n for (k = this.N - 1; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\n (s & 0x0000ffff) * 1566083941)) -\n i; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n }\n\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n }\n\n /* generates a random number on [0,0xffffffff]-interval */\n /* origin name genrand_int32 */\n randomInt32(): number {\n let y;\n const mag01 = [0x0, this.MATRIX_A];\n /* mag01[x] = x * MATRIX_A for x=0,1 */\n\n if (this.mti >= this.N) {\n /* generate N words at one time */\n let kk;\n\n if (this.mti === this.N + 1)\n /* if init_seed() has not been called, */\n this.initSeed(5489); /* a default initial seed is used */\n\n for (kk = 0; kk < this.N - this.M; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n for (; kk < this.N - 1; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] =\n this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n y =\n (this.mt[this.N - 1] & this.UPPER_MASK) |\n (this.mt[0] & this.LOWER_MASK);\n this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n this.mti = 0;\n }\n\n y = this.mt[this.mti++];\n\n /* Tempering */\n y ^= y >>> 11;\n y ^= (y << 7) & 0x9d2c5680;\n y ^= (y << 15) & 0xefc60000;\n y ^= y >>> 18;\n\n return y >>> 0;\n }\n\n /* generates a random number on [0,0x7fffffff]-interval */\n /* origin name genrand_int31 */\n randomInt31(): number {\n return this.randomInt32() >>> 1;\n }\n\n /* generates a random number on [0,1]-real-interval */\n /* origin name genrand_real1 */\n randomReal1(): number {\n return this.randomInt32() * (1.0 / 4294967295.0);\n /* divided by 2^32-1 */\n }\n\n /* generates a random number on [0,1)-real-interval */\n /* origin name genrand_real2 */\n randomReal2(): number {\n return this.randomInt32() * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on (0,1)-real-interval */\n /* origin name genrand_real3 */\n randomReal3(): number {\n return (this.randomInt32() + 0.5) * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on [0,1) with 53-bit resolution*/\n /* origin name genrand_res53 */\n randomRes53(): number {\n const a = this.randomInt32() >>> 5;\n const b = this.randomInt32() >>> 6;\n return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);\n }\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n","import { MersenneTwister } from './mersenneTwister';\n\nconst replacePlaceholders = (mersenne: MersenneTwister) => (\n placeholder: string\n): string => {\n const random = Math.floor(mersenne.randomReal2() * 16);\n\n const value = placeholder === 'x' ? random : (random & 0x3) | 0x8;\n return value.toString(16);\n};\n\n/**\n * Generate a uuid.\n *\n * @private\n * @since 3.5.0\n * @returns {string} Returns the generated uuid.\n * @example\n * ```javascript\n * generateUUID()\n * // => 49e71c40-9b21-4371-9699-2def33f62e66\n *\n * generateUUID()\n * // => da94f128-4247-48e3-bc73-d0cae46b5093\n * ```\n */\nexport function generateUUID(): string {\n const mersenne = new MersenneTwister();\n const RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n\n return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders(mersenne));\n}\n","/**\n * Boolean matching.\n *\n * @since 4.7.0\n * @category Boolean\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * bool(true, true)\n * // => true\n *\n * bool(true, false)\n * // => false\n * ```\n */\nexport function bool(data: boolean, expected: boolean): boolean {\n return (\n data === expected\n );\n}\n","export type DateType = Date | string;\n\nexport const convertDate = (date: DateType): number=>{\n if(date instanceof Date){\n return date.getTime();\n }\n\n return Date.parse(date);\n}","import {DateType, convertDate} from './convertDate';\n\n/**\n * Exact date matching.\n *\n * @since 4.8.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * dateEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateEquals('December 15, 2000 03:24:00', 'December 10, 2001 03:24:00')\n * // => false\n * ```\n */\nexport function dateEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData === convertedExpectation\n );\n}\n","import { DateType, convertDate } from './convertDate';\n\n/**\n * Matching after a specific date and time\n *\n * @since 4.11.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is after than `expected value`.\n * @example\n * ```javascript\n * dateGreaterThan('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateGreaterThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateGreaterThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return convertedData > convertedExpectation;\n}\n","import { DateType, convertDate } from './convertDate';\n\n/**\n * Matching at or after a specific date and time\n *\n * @since 4.11.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is after than or equals `expected value`.\n * @example\n * ```javascript\n * dateGreaterThanEquals('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateGreaterThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:25:00')\n * // => false\n * ```\n */\nexport function dateGreaterThanEquals(\n data: DateType,\n expected: DateType\n): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return convertedData >= convertedExpectation;\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is before than `expected value`.\n * @example\n * ```javascript\n * dateLessThan('December 15, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateLessThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData < convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching at or before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal or before than `expected value`.\n * @example\n * ```javascript\n * dateLessThanEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateLessThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThanEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData <= convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Negated date matching.\n *\n * @since 4.9.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * dateNotEquals('December 15, 1994 03:24:00', 'December 16, 1995 03:24:00')\n * // => true\n *\n * dateNotEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateNotEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData !== convertedExpectation\n );\n}\n","/**\n * Exact numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * numericEquals(5, 5)\n * // => true\n *\n * numericEquals(2, 4)\n * // => false\n * ```\n */\nexport function numericEquals(data: number, expected: number): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Numeric greater than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than `expected value`.\n * @example\n * ```javascript\n * numericGreaterThan(6, 5)\n * // => true\n *\n * numericGreaterThan(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThan(data: number, expected: number): boolean {\n return (\n data > expected\n );\n}\n","/**\n * Numeric greater than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than or equals `expected value`.\n * @example\n * ```javascript\n * numericGreaterThanEquals(5, 5)\n * // => true\n *\n * numericGreaterThanEquals(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThanEquals(data: number, expected: number): boolean {\n return (\n data >= expected\n );\n}\n","/**\n * Numeric less than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than `expected value`.\n * @example\n * ```javascript\n * numericLessThan(5, 6)\n * // => true\n *\n * numericLessThan(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThan(data: number, expected: number): boolean {\n return (\n data < expected\n );\n}\n","/**\n * Numeric less than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than or equals `expected value`.\n * @example\n * ```javascript\n * numericLessThanEquals(5, 5)\n * // => true\n *\n * numericLessThanEquals(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThanEquals(data: number, expected: number): boolean {\n return (\n data <= expected\n );\n}\n","/**\n * Negated numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * numericNotEquals(2, 4)\n * // => true\n *\n * numericNotEquals(5, 5)\n * // => false\n * ```\n */\nexport function numericNotEquals(data: number, expected: number): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Exact string matching, case sensitive.\n *\n * @since 4.3.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEquals('hi', 'hi')\n * // => true\n *\n * stringEquals('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEquals(data: string, expected: string): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Exact string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEqualsIgnoreCase('hi', 'Hi')\n * // => true\n *\n * stringEqualsIgnoreCase('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() === expected.toLowerCase()\n );\n}\n","import {Matcher} from '../../Matcher';\n\n/**\n * Case-sensitive matching. The values can include a multi-character match wildcard (*) anywhere in the string.\n *\n * @since 4.5.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal like `expected value`.\n * @example\n * ```javascript\n * stringLike('newHouse', 'new*')\n * // => true\n *\n * stringLike('House', 'new*')\n * // => false\n * ```\n */\nexport function stringLike(data: string, expected: string): boolean {\n return (\n new Matcher(data).match(expected)\n );\n}\n","import {stringLike} from './stringLike';\n\n/**\n * Case-sensitive matching if exist. The values can include a multi-character match wildcard (*) anywhere in the string.\n *\n * @since 4.12.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal like `expected value` or if it does not exist.\n * @example\n * ```javascript\n * stringLikeIfExists(undefined, 'new*')\n * // => true\n *\n * stringLikeIfExists('House', 'new*')\n * // => false\n * ```\n */\nexport function stringLikeIfExists(data: string | undefined, expected: string): boolean {\n return data?(\n stringLike(data,expected)\n ):true;\n}\n","/**\n * Negated string matching.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEquals('hi', 'no')\n * // => true\n * \n * stringNotEquals('hi', 'hi')\n * // => false\n * ```\n */\nexport function stringNotEquals(data: string, expected: string): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Negated string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEqualsIgnoreCase('hi', 'no')\n * // => true\n * \n * stringNotEqualsIgnoreCase('hi', 'Hi')\n * // => false\n * ```\n */\nexport function stringNotEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() !== expected.toLowerCase()\n );\n}\n","import { bool } from './boolean/bool';\nimport { dateEquals } from './date/dateEquals';\nimport { dateGreaterThan } from './date/dateGreaterThan';\nimport { dateGreaterThanEquals } from './date/dateGreaterThanEquals';\nimport { dateLessThan } from './date/dateLessThan';\nimport { dateLessThanEquals } from './date/dateLessThanEquals';\nimport { dateNotEquals } from './date/dateNotEquals';\nimport { numericEquals } from './numeric/numericEquals';\nimport { numericGreaterThan } from './numeric/numericGreaterThan';\nimport { numericGreaterThanEquals } from './numeric/numericGreaterThanEquals';\nimport { numericLessThan } from './numeric/numericLessThan';\nimport { numericLessThanEquals } from './numeric/numericLessThanEquals';\nimport { numericNotEquals } from './numeric/numericNotEquals';\nimport { stringEquals } from './string/stringEquals';\nimport { stringEqualsIgnoreCase } from './string/stringEqualsIgnoreCase';\nimport { stringLike } from './string/stringLike';\nimport { stringLikeIfExists } from './string/stringLikeIfExists';\nimport { stringNotEquals } from './string/stringNotEquals';\nimport { stringNotEqualsIgnoreCase } from './string/stringNotEqualsIgnoreCase';\n\nexport const operators: Record = {\n bool,\n dateEquals,\n dateGreaterThan,\n dateGreaterThanEquals,\n dateLessThan,\n dateLessThanEquals,\n dateNotEquals,\n numericEquals,\n numericGreaterThan,\n numericGreaterThanEquals,\n numericLessThan,\n numericLessThanEquals,\n numericNotEquals,\n stringEquals,\n stringEqualsIgnoreCase,\n stringLike,\n stringLikeIfExists,\n stringNotEquals,\n stringNotEqualsIgnoreCase\n};\n","import {\n EffectBlock,\n ConditionBlock,\n StatementInterface,\n MatchConditionInterface,\n MatchConditionResolverInterface\n} from './types';\nimport { getValueFromPath } from './utils/getValueFromPath';\nimport { generateUUID } from './utils/generateUUID';\nimport {operators} from './conditionOperators';\n\nabstract class Statement {\n protected sid: string;\n protected readonly condition?: ConditionBlock;\n effect: EffectBlock;\n\n constructor({ sid, effect = 'allow', condition }: StatementInterface) {\n if (!sid) {\n this.sid = generateUUID();\n } else {\n this.sid = sid;\n }\n this.effect = effect;\n this.condition = condition;\n }\n\n matchConditions(\n this: Statement,\n { context, conditionResolver }: MatchConditionInterface\n ): boolean {\n const { condition: conditions } = this;\n\n if(conditions && context){\n return Object.keys(conditions).every((condition) =>\n Object.keys(conditions[condition]).every((path) => {\n const conditionValues = conditions[condition][path];\n if (conditionValues instanceof Array) {\n return conditionValues.some((value) =>\n this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value\n })\n );\n }\n\n return this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value: conditionValues\n });\n })\n )\n }\n\n return true;\n }\n\n private evaluateCondition(\n this: Statement,\n { context, conditionResolver={}, path, value, condition }: MatchConditionResolverInterface\n ): boolean {\n\n const currentResolver= conditionResolver[condition] || operators[condition]\n\n if(currentResolver){\n return currentResolver(\n getValueFromPath(context, path),\n value\n )\n }\n return false;\n }\n}\n\nexport { Statement };\n","import { ActionBasedType, MatchActionBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ActionBased extends Statement {\n private action?: string[];\n private notAction?: string[];\n private statement: ActionBasedType;\n\n constructor(action: ActionBasedType) {\n super(action);\n this.checkAndAssignActions(action);\n this.statement = { ...action, sid: this.sid };\n }\n\n getStatement(this: ActionBased): ActionBasedType {\n return this.statement;\n }\n\n matches(\n this: ActionBased,\n { action, context, conditionResolver }: MatchActionBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(action: ActionBasedType): void {\n const hasAction = 'action' in action;\n const hasNotAction = 'notAction' in action;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ActionBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in action) {\n this.action =\n typeof action.action === 'string' ? [action.action] : action.action;\n } else {\n this.notAction =\n typeof action.notAction === 'string'\n ? [action.notAction]\n : action.notAction;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n}\n\nexport { ActionBased };\n","import { IdentityBasedType, MatchIdentityBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass IdentityBased extends Statement {\n private resource?: string[];\n private action?: string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: IdentityBasedType;\n\n constructor(identity: IdentityBasedType) {\n super(identity);\n this.checkAndAssignActions(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: IdentityBased): IdentityBasedType {\n return this.statement;\n }\n\n matches(\n this: IdentityBased,\n {\n action,\n resource,\n context,\n conditionResolver\n }: MatchIdentityBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(identity: IdentityBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'IdentityBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignResources(identity: IdentityBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'IdentityBased statement should have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n } else {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { IdentityBased };\n","import {\n PrincipalMap,\n MatchResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ResourceBased extends Statement {\n private principal?: PrincipalMap | string[];\n private resource?: string[];\n private action?: string[];\n private notPrincipal?: PrincipalMap | string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: ResourceBasedType;\n private hasPrincipals: boolean;\n private hasResources: boolean;\n\n constructor(identity: ResourceBasedType) {\n super(identity);\n this.hasPrincipals = false;\n this.hasResources = false;\n this.checkAndAssignActions(identity);\n this.checkAndAssignPrincipals(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: ResourceBased): ResourceBasedType {\n return this.statement;\n }\n\n matches(\n this: ResourceBased,\n {\n principal,\n action,\n resource,\n principalType,\n context,\n conditionResolver\n }: MatchResourceBasedInterface\n ): boolean {\n return (\n this.matchPrincipalAndNotPrincipal(principal, principalType, context) &&\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResourceAndNotResource(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n /*valueComing principal noPrincipal\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchPrincipalAndNotPrincipal(\n principal?: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (principal) {\n if (this.hasPrincipals)\n return (\n this.matchPrincipals(principal, principalType, context) &&\n this.matchNotPrincipals(principal, principalType, context)\n );\n return false;\n }\n if (this.hasPrincipals) return false;\n return true;\n }\n\n /*valueComing resource noResource\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchResourceAndNotResource(resource?: string, context?: T): boolean {\n if (resource) {\n if (this.hasResources)\n return (\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context)\n );\n return false;\n }\n if (this.hasResources) return false;\n return true;\n }\n\n private checkAndAssignActions(identity: ResourceBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ResourceBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignPrincipals(identity: ResourceBasedType): void {\n const hasPrincipal = 'principal' in identity;\n const hasNotPrincipal = 'notPrincipal' in identity;\n if (hasPrincipal && hasNotPrincipal) {\n throw new TypeError(\n 'ResourceBased statement could have a principal or a notPrincipal attribute, no both'\n );\n }\n if ('principal' in identity) {\n this.principal =\n typeof identity.principal === 'string'\n ? [identity.principal]\n : identity.principal;\n this.hasPrincipals = true;\n } else if ('notPrincipal' in identity) {\n this.notPrincipal =\n typeof identity.notPrincipal === 'string'\n ? [identity.notPrincipal]\n : identity.notPrincipal;\n this.hasPrincipals = true;\n }\n }\n\n private checkAndAssignResources(identity: ResourceBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'ResourceBased statement could have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n this.hasResources = true;\n } else if ('notResource' in identity) {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n this.hasResources = true;\n }\n }\n\n private matchPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.principal) {\n if (this.principal instanceof Array) {\n return principalType\n ? false\n : this.principal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.principal[principalType];\n if (principalValues instanceof Array) {\n return principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return false;\n }\n return false;\n }\n }\n return true;\n }\n\n private matchNotPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.notPrincipal) {\n if (this.notPrincipal instanceof Array) {\n return principalType\n ? true\n : !this.notPrincipal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.notPrincipal[principalType];\n if (principalValues instanceof Array) {\n return !principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return !new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return true;\n }\n return true;\n }\n }\n return true;\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { ResourceBased };\n","import { MatchConditionInterface, ConditionResolver } from './types';\n\nabstract class Policy {\n protected context?: T;\n protected conditionResolver?: ConditionResolver;\n\n constructor({ context, conditionResolver }: MatchConditionInterface) {\n this.context = context;\n this.conditionResolver = conditionResolver;\n }\n\n setContext(this: Policy, context: T): void {\n this.context = context;\n }\n\n getContext(this: Policy): T | undefined {\n return this.context;\n }\n\n setConditionResolver(\n this: Policy,\n conditionResolver: ConditionResolver\n ): void {\n this.conditionResolver = conditionResolver;\n }\n\n getConditionResolver(this: Policy): ConditionResolver | undefined {\n return this.conditionResolver;\n }\n\n abstract getStatements(this: Policy): U[];\n}\n\nexport { Policy };\n","import {\n ActionBasedType,\n ConditionResolver,\n EvaluateActionBasedInterface,\n ProxyOptions\n} from './types';\nimport { ActionBased } from './ActionBasedStatement';\nimport { Policy } from './Policy';\n\nexport interface ActionBasedPolicyInterface {\n statements: ActionBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ActionBasedPolicy extends Policy<\n T,\n ActionBasedType\n> {\n private denyStatements: ActionBased[];\n private allowStatements: ActionBased[];\n private statements: ActionBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ActionBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ActionBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void {\n const statementInstance = new ActionBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ActionBasedPolicy): ActionBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n const args = { action, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n whyCan(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): ActionBasedType[] {\n return this.allowStatements.reduce((statements, currentStatement) => {\n const matches = currentStatement.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n });\n if (matches) {\n return [...statements, currentStatement.getStatement()];\n }\n return statements;\n }, [] as ActionBasedType[]);\n }\n\n cannot(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n whyCannot(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): ActionBasedType[] {\n return this.denyStatements.reduce((statements, currentStatement) => {\n const matches = currentStatement.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n });\n if (matches) {\n return [...statements, currentStatement.getStatement()];\n }\n return statements;\n }, [] as ActionBasedType[]);\n }\n\n generateProxy(\n this: ActionBasedPolicy,\n obj: U,\n options: ProxyOptions = {}\n ): U {\n const { get = {}, set = {} } = options;\n const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get;\n const { allow: allowSet = true, propertyMap: propertyMapSet = {} } = set;\n const handler = {\n ...(allowGet\n ? {\n get: (target: U, prop: string | symbol): any => {\n const property = Reflect.has(propertyMapGet, prop)\n ? Reflect.get(propertyMapGet, prop)\n : prop;\n if (typeof prop === 'string') {\n if (this.evaluate({ action: property })) {\n return Reflect.get(target, prop);\n } else {\n throw new Error(`Unauthorize to get ${prop} property`);\n }\n } else {\n return Reflect.get(target, prop);\n }\n }\n }\n : {}),\n ...(allowSet\n ? {\n set: (target: U, prop: string | symbol, value: any): boolean => {\n const property = Reflect.has(propertyMapSet, prop)\n ? Reflect.get(propertyMapSet, prop)\n : prop;\n if (typeof prop === 'string') {\n if (this.evaluate({ action: property })) {\n return Reflect.set(target, prop, value);\n } else {\n throw new Error(`Unauthorize to set ${prop} property`);\n }\n } else {\n return false;\n }\n }\n }\n : {})\n };\n\n return new Proxy(obj, handler);\n }\n}\n","import {\n ConditionResolver,\n EvaluateIdentityBasedInterface,\n IdentityBasedType\n} from './types';\nimport { IdentityBased } from './IdentityBasedStatement';\nimport { Policy } from './Policy';\n\ninterface IdentityBasedPolicyInterface {\n statements: IdentityBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class IdentityBasedPolicy extends Policy<\n T,\n IdentityBasedType\n> {\n private denyStatements: IdentityBased[];\n private allowStatements: IdentityBased[];\n private statements: IdentityBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: IdentityBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new IdentityBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: IdentityBasedPolicy,\n statement: IdentityBasedType\n ): void {\n const statementInstance = new IdentityBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: IdentityBasedPolicy): IdentityBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n const args = { action, resource, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n","import {\n ConditionResolver,\n EvaluateResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { ResourceBased } from './ResourceBasedStatement';\nimport { Policy } from './Policy';\n\ninterface ResourceBasedPolicyInterface {\n statements: ResourceBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ResourceBasedPolicy extends Policy<\n T,\n ResourceBasedType\n> {\n private denyStatements: ResourceBased[];\n private allowStatements: ResourceBased[];\n private statements: ResourceBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ResourceBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ResourceBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: ResourceBasedPolicy,\n statement: ResourceBasedType\n ): void {\n const statementInstance = new ResourceBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ResourceBasedPolicy): ResourceBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n const args = { principal, action, resource, principalType, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;SAgBgB,MAAM,CAAC,KAAc;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/C;;AChBA;;;;;;;;;;;;;;;;SAgBgB,QAAQ,CAAC,KAAe;IACtC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,QACE,IAAI,KAAK,QAAQ;SAChB,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,EAC5E;AACJ;;ACtBA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;SAegB,KAAK,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;AACpE;;ACxBA;AACA,MAAM,YAAY,GAAG,kDAAkD,CAAC;AACxE,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA+BgB,KAAK,CAAmB,KAAc,EAAE,MAAU;IAChE,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,IACE,IAAI,KAAK,QAAQ;QACjB,IAAI,KAAK,SAAS;QAClB,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,SAAS;QACnB,QAAQ,CAAC,KAAK,CAAC,EACf;QACA,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,QACE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AAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KAC7C;IAED,GAAG,CAED,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KACjC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;IAED,MAAM,CAEJ,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAChC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;;;;;"} \ No newline at end of file diff --git a/dist/main.js b/dist/main.js index ca13e4c..84f878c 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1581,6 +1581,19 @@ class ActionBasedPolicy extends Policy { conditionResolver: this.conditionResolver })); } + whyCan({ action, context }) { + return this.allowStatements.reduce((statements, currentStatement) => { + const matches = currentStatement.matches({ + action, + context: context || this.context, + conditionResolver: this.conditionResolver + }); + if (matches) { + return [...statements, currentStatement.getStatement()]; + } + return statements; + }, []); + } cannot({ action, context }) { return this.denyStatements.some((s) => s.matches({ action, @@ -1588,6 +1601,19 @@ class ActionBasedPolicy extends Policy { conditionResolver: this.conditionResolver })); } + whyCannot({ action, context }) { + return this.denyStatements.reduce((statements, currentStatement) => { + const matches = currentStatement.matches({ + action, + context: context || this.context, + conditionResolver: this.conditionResolver + }); + if (matches) { + return [...statements, currentStatement.getStatement()]; + } + return statements; + }, []); + } generateProxy(obj, options = {}) { const { get = {}, set = {} } = options; const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get; diff --git a/dist/main.js.map b/dist/main.js.map index f906f6e..ba28146 100644 --- a/dist/main.js.map +++ b/dist/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sources":["../src/utils/getTag.ts","../src/utils/isSymbol.ts","../src/utils/toKey.ts","../src/utils/isKey.ts","../src/utils/memoize.ts","../src/utils/memoizeCapped.ts","../src/utils/stringToPath.ts","../src/utils/getValueFromPath.ts","../src/utils/applyContext.ts","../src/utils/decomposeString.ts","../src/utils/braceExpand.ts","../src/Matcher.ts","../src/utils/mersenneTwister.ts","../src/utils/generateUUID.ts","../src/conditionOperators/boolean/bool.ts","../src/conditionOperators/date/convertDate.ts","../src/conditionOperators/date/dateEquals.ts","../src/conditionOperators/date/dateGreaterThan.ts","../src/conditionOperators/date/dateGreaterThanEquals.ts","../src/conditionOperators/date/dateLessThan.ts","../src/conditionOperators/date/dateLessThanEquals.ts","../src/conditionOperators/date/dateNotEquals.ts","../src/conditionOperators/numeric/numericEquals.ts","../src/conditionOperators/numeric/numericGreaterThan.ts","../src/conditionOperators/numeric/numericGreaterThanEquals.ts","../src/conditionOperators/numeric/numericLessThan.ts","../src/conditionOperators/numeric/numericLessThanEquals.ts","../src/conditionOperators/numeric/numericNotEquals.ts","../src/conditionOperators/string/stringEquals.ts","../src/conditionOperators/string/stringEqualsIgnoreCase.ts","../src/conditionOperators/string/stringLike.ts","../src/conditionOperators/string/stringLikeIfExists.ts","../src/conditionOperators/string/stringNotEquals.ts","../src/conditionOperators/string/stringNotEqualsIgnoreCase.ts","../src/conditionOperators/index.ts","../src/Statement.ts","../src/ActionBasedStatement.ts","../src/IdentityBasedStatement.ts","../src/ResourceBasedStatement.ts","../src/Policy.ts","../src/ActionBasedPolicy.ts","../src/IdentityBasedPolicy.ts","../src/ResourceBasedPolicy.ts"],"sourcesContent":["/**\r\n * Gets the `toStringTag` of `value`.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {*} value The value to query.\r\n * @returns {string} Returns the `toStringTag`.\r\n * @example\r\n * ```javascript\r\n * getTag(1)\r\n * // => '[object Number]'\r\n *\r\n * getTag(null)\r\n * // => '[object Null]'\r\n * ```\r\n */\r\nexport function getTag(value: unknown): string {\r\n return Object.prototype.toString.call(value);\r\n}\r\n","import { getTag } from './getTag';\r\n\r\n/**\r\n * Checks if `value` is classified as a `Symbol` primitive or object.\r\n *\r\n * @since 3.1.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\r\n * @example\r\n * ```javascript\r\n * isSymbol(Symbol())\r\n * // => true\r\n *\r\n * isSymbol('abc')\r\n * // => false\r\n * ```\r\n */\r\nexport function isSymbol(value?: unknown): value is symbol {\r\n const type = typeof value;\r\n return (\r\n type === 'symbol' ||\r\n (type === 'object' && value !== null && getTag(value) === '[object Symbol]')\r\n );\r\n}\r\n","import { isSymbol } from './isSymbol';\r\n\r\n/** Used as references for various `Number` constants. */\r\nconst INFINITY = 1 / 0;\r\n\r\n/**\r\n * Converts `value` to a string key if it's not a string or symbol.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {*} value The value to inspect.\r\n * @returns {string|symbol} Returns the key.\r\n * @example\r\n *\r\n * toKey(Symbol.iterator)\r\n * // => true\r\n *\r\n * toKey('abc')\r\n * // => false\r\n */\r\nexport function toKey(value: unknown): string | symbol {\r\n if (typeof value === 'string' || isSymbol(value)) {\r\n return value;\r\n }\r\n\r\n return value === 0 && 1 / value === -INFINITY ? '-0' : `${value}`;\r\n}\r\n","import { isSymbol } from './isSymbol';\r\n\r\n/** Used to match property names within property paths. */\r\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\r\nconst reIsPlainProp = /^\\w*$/; //matches any word character (alphanumeric and underscore)\r\n\r\n/**\r\n * Checks if `value` is a property name and not a property path.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {*} value The value to check.\r\n * @param {Object} [object] The object to query keys on.\r\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\r\n * @example\r\n * ```javascript\r\n * isKey(1)\r\n * // => true\r\n *\r\n * isKey('example[test]')\r\n * // => false\r\n *\r\n * isKey('a.b')\r\n * // => false\r\n *\r\n * const obj = {\r\n * '[a]': 5,\r\n * 'b.c': true\r\n * };\r\n *\r\n * isKey('[a]', obj)\r\n * // => true\r\n *\r\n * isKey('b.c', obj)\r\n * // => true\r\n * ```\r\n */\r\nexport function isKey(value: unknown, object?: T): boolean {\r\n const type = typeof value;\r\n if (\r\n type === 'number' ||\r\n type === 'boolean' ||\r\n value === null ||\r\n value === undefined ||\r\n isSymbol(value)\r\n ) {\r\n return true;\r\n }\r\n if (typeof value === 'string') {\r\n return (\r\n reIsPlainProp.test(value) ||\r\n !reIsDeepProp.test(value) ||\r\n (object !== null && value in Object(object))\r\n );\r\n }\r\n return false;\r\n}\r\n","import { MemoizeInterface } from '../types';\r\n\r\n/**\r\n * Creates a function that memoizes the result of `func`. If `resolver` is\r\n * provided, it determines the cache key for storing the result based on the\r\n * arguments provided to the memoized function. By default, the first argument\r\n * provided to the memoized function is used as the map cache key. The `func`\r\n * is invoked with the `this` binding of the memoized function.\r\n *\r\n * @since 3.1.0\r\n * @category Function\r\n * @param {Function} func The function to have its output memoized.\r\n * @param {Function} [resolver] The function to resolve the cache key.\r\n * @returns {Function} Returns the new memoized function.\r\n * @example\r\n * ```javascript\r\n * const object = { 'a': 1, 'b': 2 }\r\n * const other = { 'c': 3, 'd': 4 }\r\n *\r\n * const values = memoize(values)\r\n * values(object)\r\n * // => [1, 2]\r\n *\r\n * values(other)\r\n * // => [3, 4]\r\n *\r\n * object.a = 2\r\n * values(object)\r\n * // => [1, 2]\r\n *\r\n * // Modify the result cache.\r\n * values.cache.set(object, ['a', 'b'])\r\n * values(object)\r\n * // => ['a', 'b']\r\n * ```\r\n */\r\nexport function memoize(\r\n func: (...args: unknown[]) => any,\r\n resolver?: (...args: unknown[]) => any\r\n): MemoizeInterface {\r\n const memoized = function (\r\n this: (...args: unknown[]) => any,\r\n ...args: unknown[]\r\n ): MemoizeInterface {\r\n const key = resolver ? resolver.apply(this, args) : args[0];\r\n const cache = memoized.cache;\r\n\r\n if (cache.has(key)) {\r\n return cache.get(key);\r\n }\r\n const result = func.apply(this, args);\r\n cache.set(key, result);\r\n return result;\r\n };\r\n memoized.cache = new Map();\r\n return memoized;\r\n}\r\n\r\n/*const memoize = (fn: Function): Function => {\r\n const cache = {};\r\n return (...args): any => {\r\n const stringifiedArgs = JSON.stringify(args);\r\n const result = (cache[stringifiedArgs] =\r\n typeof cache[stringifiedArgs] === 'undefined'\r\n ? fn(...args)\r\n : cache[stringifiedArgs]);\r\n return result;\r\n };\r\n};*/\r\n","import { memoize } from './memoize';\r\nimport { MemoizeInterface } from '../types';\r\n\r\n/** Used as the maximum memoize cache size. */\r\nexport const MAX_MEMOIZE_SIZE = 500;\r\n\r\n/**\r\n * A specialized version of `memoize` which clears the memoized function's\r\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {Function} func The function to have its output memoized.\r\n * @returns {Function} Returns the new memoized function.\r\n */\r\nexport function memoizeCapped(\r\n func: (...args: any) => unknown\r\n): MemoizeInterface {\r\n const result = memoize(func, (key: unknown) => {\r\n const { cache } = result;\r\n if (cache.size === MAX_MEMOIZE_SIZE) {\r\n cache.clear();\r\n }\r\n return key;\r\n });\r\n\r\n return result;\r\n}\r\n","import { memoizeCapped } from './memoizeCapped';\r\n\r\nconst charCodeOfDot = '.'.charCodeAt(0);\r\nconst reEscapeChar = /\\\\(\\\\)?/g;\r\nconst rePropName = RegExp(\r\n // Match anything that isn't a dot or bracket.\r\n '[^.[\\\\]]+' +\r\n '|' +\r\n // Or match property names within brackets.\r\n '\\\\[(?:' +\r\n // Match a non-string expression.\r\n '([^\"\\'][^[]*)' +\r\n '|' +\r\n // Or match strings (supports escaping characters).\r\n '([\"\\'])((?:(?!\\\\x02)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\x02' +\r\n ')\\\\]' +\r\n '|' +\r\n // Or match \"\" as the space between consecutive dots or empty brackets.\r\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\r\n 'g'\r\n);\r\n\r\n/**\r\n * Converts `string` to a property path array.\r\n *\r\n * @since 3.1.0\r\n * @private\r\n * @param {string} string The string to convert.\r\n * @returns {Array} Returns the property path array.\r\n */\r\nexport const stringToPath = memoizeCapped((string: string) => {\r\n const result = [];\r\n if (string.charCodeAt(0) === charCodeOfDot) {\r\n result.push('');\r\n }\r\n string.replace(\r\n rePropName,\r\n (\r\n match: string,\r\n expression: string,\r\n quote: string,\r\n subString: string\r\n ): string => {\r\n let key = match;\r\n if (quote) {\r\n key = subString.replace(reEscapeChar, '$1');\r\n } else if (expression) {\r\n key = expression.trim();\r\n }\r\n result.push(key);\r\n return '';\r\n }\r\n );\r\n return result;\r\n});\r\n","import { toKey } from './toKey';\r\nimport { isKey } from './isKey';\r\nimport { stringToPath } from './stringToPath';\r\n\r\n/**\r\n * Casts `value` to a path array if it's not one.\r\n *\r\n * @private\r\n * @param {*} value The value to inspect.\r\n * @param {Object} [object] The object to query keys on.\r\n * @returns {Array} Returns the cast property path array.\r\n */\r\nexport function castPath(\r\n value: unknown,\r\n object: U\r\n): Array {\r\n if (Array.isArray(value)) {\r\n return value;\r\n }\r\n\r\n return isKey(value, object) ? [value] : stringToPath(value);\r\n}\r\n\r\n/**\r\n * The base implementation of `get` without support for default values.\r\n *\r\n * @private\r\n * @param {Object} object The object to query.\r\n * @param {Array|string} path The path of the property to get.\r\n * @returns {*} Returns the resolved value.\r\n */\r\nexport function baseGet(\r\n object: U,\r\n path: Array | string\r\n): any {\r\n const newPath = castPath(path, object);\r\n\r\n let index = 0;\r\n const length = newPath.length;\r\n\r\n let value: any = object;\r\n while (value instanceof Object && index < length) {\r\n value = value[toKey(newPath[index++])];\r\n }\r\n\r\n return index && index === length ? value : undefined;\r\n}\r\n\r\n/**\r\n * Gets the value at `path` of `object`. If the resolved value is\r\n * `undefined`, the `defaultValue` is returned in its place.\r\n *\r\n * @since 3.1.0\r\n * @category Object\r\n * @param {Object} object The object to query.\r\n * @param {Array|string} path The path of the property to get.\r\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\r\n * @returns {*} Returns the resolved value.\r\n * @example\r\n *\r\n * const object = { 'a': [{ 'b': { 'c': 3 } }] }\r\n *\r\n * getValueFromPath(object, 'a[0].b.c')\r\n * // => 3\r\n *\r\n * getValueFromPath(object, ['a', '0', 'b', 'c'])\r\n * // => 3\r\n *\r\n * getValueFromPath(object, 'a.b.c', 'default')\r\n * // => 'default'\r\n */\r\nexport function getValueFromPath(\r\n object: U,\r\n path: Array | string,\r\n defaultValue?: unknown\r\n): any {\r\n const result = object === null ? undefined : baseGet(object, path);\r\n\r\n return result === undefined ? defaultValue : result;\r\n}\r\n","import { getValueFromPath } from './getValueFromPath';\r\n\r\nconst reDelimiters = /\\${([^}]*)}/g;\r\nconst trim = / +(?= )|^\\s+|\\s+$/g;\r\n\r\nconst specialTrim = (str: string): string => str.replace(trim, '');\r\n\r\n/**\r\n * Apply the context value in a string.\r\n *\r\n * @param {string} str Pattern string, containing context path.\r\n * @param {object} context Object to get values from path.\r\n * @returns {string} Returns a string with embedded context values.\r\n * @example\r\n * ```javascript\r\n * const context = {\r\n * user: { id: 456, bestFriends: [123, 532, 987] }\r\n * };\r\n * applyContext('secrets:${user.id}:*', context)\r\n * // => 'secrets:456:*'\r\n *\r\n * applyContext('secrets:${user.bestFriends}:*', context)\r\n * // => 'secrets:{123,532,987}:*'\r\n *\r\n * applyContext('secrets:${company.address}:account', context)\r\n * // => 'secrets:undefined:account'\r\n * ```\r\n */\r\nexport function applyContext(\r\n str: string,\r\n context?: T\r\n): string {\r\n if (!context) return str;\r\n\r\n return specialTrim(\r\n str.replace(reDelimiters, (_, path: string) => {\r\n const value = getValueFromPath(context, path);\r\n if (Array.isArray(value)) return `{${value}}`;\r\n if (value instanceof Object) return 'undefined';\r\n\r\n return String(value);\r\n })\r\n );\r\n}\r\n","import { DecomposeString } from '../types';\r\n\r\n/**\r\n * Get index range where separators are found.\r\n *\r\n * @private\r\n * @since 3.1.1\r\n * @param {string} initialSeparator First string to be found.\r\n * @param {string} finalSeparator Second string to be found.\r\n * @param {string} str String to be decomposed.\r\n * @returns {number[]} Returns the beginning and final index for those matches.\r\n * @example\r\n * ```javascript\r\n * getIndexRange('first', 'Second', 'firstAndSecond')\r\n * // => [0, 8]\r\n *\r\n * getIndexRange('First', 'Second', '++FirstAndSecond**')\r\n * // => [2, 10]\r\n * ```\r\n */\r\nfunction getIndexRange(\r\n initialSeparator: string,\r\n finalSeparator: string,\r\n str: string\r\n): number[] {\r\n const beginningIndex = str.indexOf(initialSeparator);\r\n const finalIndex = str.indexOf(finalSeparator, beginningIndex + 1);\r\n\r\n if (beginningIndex >= 0 && finalIndex > 0) {\r\n return [beginningIndex, finalIndex];\r\n }\r\n\r\n return [-1, -1];\r\n}\r\n\r\n/**\r\n * Object returned by decomposeString function\r\n *\r\n * @typedef {Object} DecomposedString\r\n * @property {number} start Beginning index for first separator match\r\n * @property {number} end Final index for second separator match\r\n * @property {string} pre Substring before first separator\r\n * @property {string} body Substring between separators\r\n * @property {string} post Substring after second separator\r\n */\r\n\r\n/**\r\n * Decompose string in pre, body and post strings by using separators.\r\n *\r\n * @private\r\n * @since 3.1.1\r\n * @param {string} initialSeparator First string to be found.\r\n * @param {string} finalSeparator Second string to be found.\r\n * @param {string} str String to be decomposed.\r\n * @returns {DecomposedString} Returns a decompose string.\r\n * @example\r\n * ```javascript\r\n * decomposeString('first', 'Second', 'firstAndSecond')\r\n * // => { start: 0, end: 8, pre: '', body: 'And', post: '' }\r\n *\r\n * decomposeString('First', 'Second', '++FirstAndSecond**')\r\n * // => { start: 2, end: 10, pre: '++', body: 'And', post: '**' }\r\n * ```\r\n */\r\nexport function decomposeString(\r\n initialSeparator: string,\r\n finalSeparator: string,\r\n str: string\r\n): DecomposeString {\r\n const [beginningIndex, finalIndex] = getIndexRange(\r\n initialSeparator,\r\n finalSeparator,\r\n str\r\n );\r\n\r\n return {\r\n start: beginningIndex,\r\n end: finalIndex,\r\n pre: beginningIndex >= 0 ? str.slice(0, beginningIndex) : '',\r\n body:\r\n beginningIndex >= 0\r\n ? str.slice(beginningIndex + initialSeparator.length, finalIndex)\r\n : '',\r\n post:\r\n beginningIndex >= 0 ? str.slice(finalIndex + finalSeparator.length) : ''\r\n };\r\n}\r\n","import { decomposeString } from './decomposeString';\r\n\r\n/**\r\n * Generate an array of string depending on {} blocks.\r\n *\r\n * @param {string} pattern Pattern string that can contains {} blocks.\r\n * @returns {string[]} Returns an array of string with all the combinations.\r\n * @example\r\n * ```javascript\r\n * braceExpand('${13}')\r\n * // => ['{13}']\r\n *\r\n * braceExpand('a{b,f,m}p')\r\n * // => ['abp','afp','amp']\r\n *\r\n * braceExpand('-v{,,}')\r\n * // => ['-v','-v','-v']\r\n * ```\r\n */\r\nconst braceExpand = (pattern: string): string[] => {\r\n if (!pattern.match(/{.*}/)) {\r\n return [pattern];\r\n }\r\n\r\n return expand(pattern, true);\r\n};\r\n\r\nconst expand = (str: string, isTop?: boolean): string[] => {\r\n const expansions = [] as string[];\r\n const balance = decomposeString('{', '}', str);\r\n if (balance.start < 0) return [str];\r\n\r\n const parts = balance.body.split(',');\r\n // no need to expand pre, since it is guaranteed to be free of brace-sets\r\n const pre = balance.pre;\r\n const postParts = balance.post.length ? expand(balance.post, false) : [''];\r\n\r\n if (/\\$$/.test(balance.pre)) {\r\n postParts.forEach((postPart) => {\r\n const expansion = `${balance.pre.slice(0, -1)}{${\r\n balance.body\r\n }}${postPart}`;\r\n expansions.push(expansion);\r\n });\r\n } else {\r\n parts.forEach((part: string) => {\r\n postParts.forEach((postPart) => {\r\n const expansion = pre + part + postPart;\r\n if (!isTop || expansion) expansions.push(expansion);\r\n });\r\n });\r\n }\r\n\r\n return expansions;\r\n};\r\n\r\nexport { braceExpand };\r\n","import { braceExpand } from './utils/braceExpand';\r\n\r\nexport class Matcher {\r\n private readonly pattern: string;\r\n private readonly maxLength: number;\r\n private readonly set: (string | RegExp)[];\r\n private readonly empty: boolean;\r\n\r\n constructor(pattern: string, maxLength = 1024 * 64) {\r\n this.set = [];\r\n this.pattern = pattern.trim();\r\n this.maxLength = maxLength;\r\n this.empty = !this.pattern ? true : false;\r\n\r\n const set = braceExpand(pattern);\r\n this.set = set.map((val) => this.parse(val));\r\n this.set = this.set.filter((s) => {\r\n return Boolean(s);\r\n });\r\n }\r\n\r\n match(this: Matcher, str: string): boolean {\r\n if (this.empty) return str === '';\r\n\r\n return this.set.some((pattern) => this.matchOne(str, pattern));\r\n }\r\n\r\n private parse(pattern: string): string | RegExp {\r\n if (pattern.length > this.maxLength) {\r\n throw new TypeError('Pattern is too long');\r\n }\r\n let regExp;\r\n let hasSpecialCharacter = false;\r\n if (pattern === '') return '';\r\n\r\n const re = pattern.replace(/\\*/g, () => {\r\n hasSpecialCharacter = true;\r\n return '.+?';\r\n });\r\n\r\n // skip the regexp for non-* patterns\r\n // unescape anything in it, though, so that it'll be\r\n // an exact match.\r\n if (!hasSpecialCharacter) {\r\n return pattern.replace(/\\\\(.)/g, '$1');\r\n }\r\n\r\n try {\r\n regExp = new RegExp('^' + re + '$');\r\n } catch (error) {\r\n // If it was an invalid regular expression, then it can't match\r\n // anything.\r\n return new RegExp('$.');\r\n }\r\n\r\n return regExp;\r\n }\r\n\r\n private matchOne(str: string, pattern: string | RegExp): boolean {\r\n if (typeof pattern === 'string') {\r\n return str === pattern;\r\n }\r\n\r\n return Boolean(str.match(pattern));\r\n }\r\n}\r\n","/*\r\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\r\n so it's better encapsulated. Now you can have multiple random number generators\r\n and they won't stomp all over each other's state.\r\n If you want to use this as a substitute for Math.random(), use the random()\r\n method like so:\r\n var m = new MersenneTwister();\r\n var randomNumber = m.random();\r\n You can also call the other genrand_{foo}() methods on the instance.\r\n If you want to use a specific seed in order to get a repeatable random\r\n sequence, pass an integer into the constructor:\r\n var m = new MersenneTwister(123);\r\n and that will always produce the same random sequence.\r\n Sean McCullough (banksean@gmail.com)\r\n*/\r\n\r\n/*\r\n A C-program for MT19937, with initialization improved 2002/1/26.\r\n Coded by Takuji Nishimura and Makoto Matsumoto.\r\n Before using, initialize the state by using init_seed(seed)\r\n or init_by_array(init_key, key_length).\r\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\r\n All rights reserved.\r\n Redistribution and use in source and binary forms, with or without\r\n modification, are permitted provided that the following conditions\r\n are met:\r\n 1. Redistributions of source code must retain the above copyright\r\n notice, this list of conditions and the following disclaimer.\r\n 2. Redistributions in binary form must reproduce the above copyright\r\n notice, this list of conditions and the following disclaimer in the\r\n documentation and/or other materials provided with the distribution.\r\n 3. The names of its contributors may not be used to endorse or promote\r\n products derived from this software without specific prior written\r\n permission.\r\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\r\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n Any feedback is very welcome.\r\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\r\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\r\n*/\r\n\r\nexport class MersenneTwister {\r\n private readonly N: number;\r\n private readonly M: number;\r\n private readonly MATRIX_A: number;\r\n private readonly UPPER_MASK: number;\r\n private readonly LOWER_MASK: number;\r\n private readonly mt: number[];\r\n private mti: number;\r\n\r\n constructor(seed?: number | number[]) {\r\n /* Period parameters */\r\n this.N = 624;\r\n this.M = 397;\r\n this.MATRIX_A = 0x9908b0df; /* constant vector a */\r\n this.UPPER_MASK = 0x80000000; /* most significant w-r bits */\r\n this.LOWER_MASK = 0x7fffffff; /* least significant r bits */\r\n\r\n this.mt = new Array(this.N); /* the array for the state vector */\r\n this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */\r\n\r\n if (Array.isArray(seed)) {\r\n if (seed.length > 0) this.initByArray(seed, seed.length);\r\n } else {\r\n if (seed === undefined) {\r\n this.initSeed(new Date().getTime());\r\n } else {\r\n this.initSeed(seed);\r\n }\r\n }\r\n }\r\n\r\n /* initializes mt[N] with a seed */\r\n /* origin name init_genrand */\r\n initSeed(seed: number): void {\r\n this.mt[0] = seed >>> 0;\r\n for (this.mti = 1; this.mti < this.N; this.mti++) {\r\n const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);\r\n this.mt[this.mti] =\r\n ((((s & 0xffff0000) >>> 16) * 1812433253) << 16) +\r\n (s & 0x0000ffff) * 1812433253 +\r\n this.mti;\r\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\r\n /* In the previous versions, MSBs of the seed affect */\r\n /* only MSBs of the array mt[]. */\r\n /* 2002/01/09 modified by Makoto Matsumoto */\r\n this.mt[this.mti] >>>= 0;\r\n /* for >32 bit machines */\r\n }\r\n }\r\n\r\n /* initialize by an array with array-length */\r\n /* init_key is the array for initializing keys */\r\n /* key_length is its length */\r\n /* slight change for C++, 2004/2/26 */\r\n initByArray(initKey: number[], keyLength: number): void {\r\n this.initSeed(19650218);\r\n let i = 1;\r\n let j = 0;\r\n let k = this.N > keyLength ? this.N : keyLength;\r\n for (; k; k--) {\r\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\r\n this.mt[i] =\r\n (this.mt[i] ^\r\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\r\n (s & 0x0000ffff) * 1664525)) +\r\n initKey[j] +\r\n j; /* non linear */\r\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\r\n i++;\r\n j++;\r\n if (i >= this.N) {\r\n this.mt[0] = this.mt[this.N - 1];\r\n i = 1;\r\n }\r\n if (j >= keyLength) j = 0;\r\n }\r\n for (k = this.N - 1; k; k--) {\r\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\r\n this.mt[i] =\r\n (this.mt[i] ^\r\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\r\n (s & 0x0000ffff) * 1566083941)) -\r\n i; /* non linear */\r\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\r\n i++;\r\n if (i >= this.N) {\r\n this.mt[0] = this.mt[this.N - 1];\r\n i = 1;\r\n }\r\n }\r\n\r\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\r\n }\r\n\r\n /* generates a random number on [0,0xffffffff]-interval */\r\n /* origin name genrand_int32 */\r\n randomInt32(): number {\r\n let y;\r\n const mag01 = [0x0, this.MATRIX_A];\r\n /* mag01[x] = x * MATRIX_A for x=0,1 */\r\n\r\n if (this.mti >= this.N) {\r\n /* generate N words at one time */\r\n let kk;\r\n\r\n if (this.mti === this.N + 1)\r\n /* if init_seed() has not been called, */\r\n this.initSeed(5489); /* a default initial seed is used */\r\n\r\n for (kk = 0; kk < this.N - this.M; kk++) {\r\n y =\r\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\r\n this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\r\n }\r\n for (; kk < this.N - 1; kk++) {\r\n y =\r\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\r\n this.mt[kk] =\r\n this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\r\n }\r\n y =\r\n (this.mt[this.N - 1] & this.UPPER_MASK) |\r\n (this.mt[0] & this.LOWER_MASK);\r\n this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];\r\n\r\n this.mti = 0;\r\n }\r\n\r\n y = this.mt[this.mti++];\r\n\r\n /* Tempering */\r\n y ^= y >>> 11;\r\n y ^= (y << 7) & 0x9d2c5680;\r\n y ^= (y << 15) & 0xefc60000;\r\n y ^= y >>> 18;\r\n\r\n return y >>> 0;\r\n }\r\n\r\n /* generates a random number on [0,0x7fffffff]-interval */\r\n /* origin name genrand_int31 */\r\n randomInt31(): number {\r\n return this.randomInt32() >>> 1;\r\n }\r\n\r\n /* generates a random number on [0,1]-real-interval */\r\n /* origin name genrand_real1 */\r\n randomReal1(): number {\r\n return this.randomInt32() * (1.0 / 4294967295.0);\r\n /* divided by 2^32-1 */\r\n }\r\n\r\n /* generates a random number on [0,1)-real-interval */\r\n /* origin name genrand_real2 */\r\n randomReal2(): number {\r\n return this.randomInt32() * (1.0 / 4294967296.0);\r\n /* divided by 2^32 */\r\n }\r\n\r\n /* generates a random number on (0,1)-real-interval */\r\n /* origin name genrand_real3 */\r\n randomReal3(): number {\r\n return (this.randomInt32() + 0.5) * (1.0 / 4294967296.0);\r\n /* divided by 2^32 */\r\n }\r\n\r\n /* generates a random number on [0,1) with 53-bit resolution*/\r\n /* origin name genrand_res53 */\r\n randomRes53(): number {\r\n const a = this.randomInt32() >>> 5;\r\n const b = this.randomInt32() >>> 6;\r\n return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);\r\n }\r\n}\r\n\r\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\r\n","import { MersenneTwister } from './mersenneTwister';\r\n\r\nconst replacePlaceholders = (mersenne: MersenneTwister) => (\r\n placeholder: string\r\n): string => {\r\n const random = Math.floor(mersenne.randomReal2() * 16);\r\n\r\n const value = placeholder === 'x' ? random : (random & 0x3) | 0x8;\r\n return value.toString(16);\r\n};\r\n\r\n/**\r\n * Generate a uuid.\r\n *\r\n * @private\r\n * @since 3.5.0\r\n * @returns {string} Returns the generated uuid.\r\n * @example\r\n * ```javascript\r\n * generateUUID()\r\n * // => 49e71c40-9b21-4371-9699-2def33f62e66\r\n *\r\n * generateUUID()\r\n * // => da94f128-4247-48e3-bc73-d0cae46b5093\r\n * ```\r\n */\r\nexport function generateUUID(): string {\r\n const mersenne = new MersenneTwister();\r\n const RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\r\n\r\n return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders(mersenne));\r\n}\r\n","/**\r\n * Boolean matching.\r\n *\r\n * @since 4.7.0\r\n * @category Boolean\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * bool(true, true)\r\n * // => true\r\n *\r\n * bool(true, false)\r\n * // => false\r\n * ```\r\n */\r\nexport function bool(data: boolean, expected: boolean): boolean {\r\n return (\r\n data === expected\r\n );\r\n}\r\n","export type DateType = Date | string;\r\n\r\nexport const convertDate = (date: DateType): number=>{\r\n if(date instanceof Date){\r\n return date.getTime();\r\n }\r\n\r\n return Date.parse(date);\r\n}","import {DateType, convertDate} from './convertDate';\r\n\r\n/**\r\n * Exact date matching.\r\n *\r\n * @since 4.8.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateEquals('December 15, 2000 03:24:00', 'December 10, 2001 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateEquals(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return (\r\n convertedData === convertedExpectation\r\n );\r\n}\r\n","import { DateType, convertDate } from './convertDate';\r\n\r\n/**\r\n * Matching after a specific date and time\r\n *\r\n * @since 4.11.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is after than `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateGreaterThan('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateGreaterThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateGreaterThan(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return convertedData > convertedExpectation;\r\n}\r\n","import { DateType, convertDate } from './convertDate';\r\n\r\n/**\r\n * Matching at or after a specific date and time\r\n *\r\n * @since 4.11.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is after than or equals `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateGreaterThanEquals('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateGreaterThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:25:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateGreaterThanEquals(\r\n data: DateType,\r\n expected: DateType\r\n): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return convertedData >= convertedExpectation;\r\n}\r\n","import {DateType, convertDate} from './convertDate';\r\n\r\n/**\r\n * Matching before a specific date and time\r\n *\r\n * @since 4.10.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is before than `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateLessThan('December 15, 1994 03:24:00', 'December 16, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateLessThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateLessThan(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return (\r\n convertedData < convertedExpectation\r\n );\r\n}\r\n","import {DateType, convertDate} from './convertDate';\r\n\r\n/**\r\n * Matching at or before a specific date and time\r\n *\r\n * @since 4.10.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal or before than `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateLessThanEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\r\n * // => true\r\n *\r\n * dateLessThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateLessThanEquals(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return (\r\n convertedData <= convertedExpectation\r\n );\r\n}\r\n","import {DateType, convertDate} from './convertDate';\r\n\r\n/**\r\n * Negated date matching.\r\n *\r\n * @since 4.9.0\r\n * @category Date\r\n * @param {Date} data The value to be compared.\r\n * @param {Date} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * dateNotEquals('December 15, 1994 03:24:00', 'December 16, 1995 03:24:00')\r\n * // => true\r\n *\r\n * dateNotEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\r\n * // => false\r\n * ```\r\n */\r\nexport function dateNotEquals(data: DateType, expected: DateType): boolean {\r\n const convertedData = convertDate(data);\r\n const convertedExpectation = convertDate(expected);\r\n return (\r\n convertedData !== convertedExpectation\r\n );\r\n}\r\n","/**\r\n * Exact numeric matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericEquals(5, 5)\r\n * // => true\r\n *\r\n * numericEquals(2, 4)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericEquals(data: number, expected: number): boolean {\r\n return (\r\n data === expected\r\n );\r\n}\r\n","/**\r\n * Numeric greater than matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is greater than `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericGreaterThan(6, 5)\r\n * // => true\r\n *\r\n * numericGreaterThan(4, 8)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericGreaterThan(data: number, expected: number): boolean {\r\n return (\r\n data > expected\r\n );\r\n}\r\n","/**\r\n * Numeric greater than or equals matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is greater than or equals `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericGreaterThanEquals(5, 5)\r\n * // => true\r\n *\r\n * numericGreaterThanEquals(4, 8)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericGreaterThanEquals(data: number, expected: number): boolean {\r\n return (\r\n data >= expected\r\n );\r\n}\r\n","/**\r\n * Numeric less than matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is less than `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericLessThan(5, 6)\r\n * // => true\r\n *\r\n * numericLessThan(8, 4)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericLessThan(data: number, expected: number): boolean {\r\n return (\r\n data < expected\r\n );\r\n}\r\n","/**\r\n * Numeric less than or equals matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is less than or equals `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericLessThanEquals(5, 5)\r\n * // => true\r\n *\r\n * numericLessThanEquals(8, 4)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericLessThanEquals(data: number, expected: number): boolean {\r\n return (\r\n data <= expected\r\n );\r\n}\r\n","/**\r\n * Negated numeric matching.\r\n *\r\n * @since 4.6.0\r\n * @category Numeric\r\n * @param {number} data The value to be compared.\r\n * @param {number} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * numericNotEquals(2, 4)\r\n * // => true\r\n *\r\n * numericNotEquals(5, 5)\r\n * // => false\r\n * ```\r\n */\r\nexport function numericNotEquals(data: number, expected: number): boolean {\r\n return (\r\n data !== expected\r\n );\r\n}\r\n","/**\r\n * Exact string matching, case sensitive.\r\n *\r\n * @since 4.3.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringEquals('hi', 'hi')\r\n * // => true\r\n *\r\n * stringEquals('hi', 'no')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringEquals(data: string, expected: string): boolean {\r\n return (\r\n data === expected\r\n );\r\n}\r\n","/**\r\n * Exact string matching, ignoring case.\r\n *\r\n * @since 4.4.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringEqualsIgnoreCase('hi', 'Hi')\r\n * // => true\r\n *\r\n * stringEqualsIgnoreCase('hi', 'no')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringEqualsIgnoreCase(data: string, expected: string): boolean {\r\n return (\r\n data.toLowerCase() === expected.toLowerCase()\r\n );\r\n}\r\n","import {Matcher} from '../../Matcher';\r\n\r\n/**\r\n * Case-sensitive matching. The values can include a multi-character match wildcard (*) anywhere in the string.\r\n *\r\n * @since 4.5.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal like `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringLike('newHouse', 'new*')\r\n * // => true\r\n *\r\n * stringLike('House', 'new*')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringLike(data: string, expected: string): boolean {\r\n return (\r\n new Matcher(data).match(expected)\r\n );\r\n}\r\n","import {stringLike} from './stringLike';\r\n\r\n/**\r\n * Case-sensitive matching if exist. The values can include a multi-character match wildcard (*) anywhere in the string.\r\n *\r\n * @since 4.12.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is equal like `expected value` or if it does not exist.\r\n * @example\r\n * ```javascript\r\n * stringLikeIfExists(undefined, 'new*')\r\n * // => true\r\n *\r\n * stringLikeIfExists('House', 'new*')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringLikeIfExists(data: string | undefined, expected: string): boolean {\r\n return data?(\r\n stringLike(data,expected)\r\n ):true;\r\n}\r\n","/**\r\n * Negated string matching.\r\n *\r\n * @since 4.4.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringNotEquals('hi', 'no')\r\n * // => true\r\n * \r\n * stringNotEquals('hi', 'hi')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringNotEquals(data: string, expected: string): boolean {\r\n return (\r\n data !== expected\r\n );\r\n}\r\n","/**\r\n * Negated string matching, ignoring case.\r\n *\r\n * @since 4.4.0\r\n * @category String\r\n * @param {string} data The value to be compared.\r\n * @param {string} expected The expected value.\r\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\r\n * @example\r\n * ```javascript\r\n * stringNotEqualsIgnoreCase('hi', 'no')\r\n * // => true\r\n * \r\n * stringNotEqualsIgnoreCase('hi', 'Hi')\r\n * // => false\r\n * ```\r\n */\r\nexport function stringNotEqualsIgnoreCase(data: string, expected: string): boolean {\r\n return (\r\n data.toLowerCase() !== expected.toLowerCase()\r\n );\r\n}\r\n","import { bool } from './boolean/bool';\r\nimport { dateEquals } from './date/dateEquals';\r\nimport { dateGreaterThan } from './date/dateGreaterThan';\r\nimport { dateGreaterThanEquals } from './date/dateGreaterThanEquals';\r\nimport { dateLessThan } from './date/dateLessThan';\r\nimport { dateLessThanEquals } from './date/dateLessThanEquals';\r\nimport { dateNotEquals } from './date/dateNotEquals';\r\nimport { numericEquals } from './numeric/numericEquals';\r\nimport { numericGreaterThan } from './numeric/numericGreaterThan';\r\nimport { numericGreaterThanEquals } from './numeric/numericGreaterThanEquals';\r\nimport { numericLessThan } from './numeric/numericLessThan';\r\nimport { numericLessThanEquals } from './numeric/numericLessThanEquals';\r\nimport { numericNotEquals } from './numeric/numericNotEquals';\r\nimport { stringEquals } from './string/stringEquals';\r\nimport { stringEqualsIgnoreCase } from './string/stringEqualsIgnoreCase';\r\nimport { stringLike } from './string/stringLike';\r\nimport { stringLikeIfExists } from './string/stringLikeIfExists';\r\nimport { stringNotEquals } from './string/stringNotEquals';\r\nimport { stringNotEqualsIgnoreCase } from './string/stringNotEqualsIgnoreCase';\r\n\r\nexport const operators: Record = {\r\n bool,\r\n dateEquals,\r\n dateGreaterThan,\r\n dateGreaterThanEquals,\r\n dateLessThan,\r\n dateLessThanEquals,\r\n dateNotEquals,\r\n numericEquals,\r\n numericGreaterThan,\r\n numericGreaterThanEquals,\r\n numericLessThan,\r\n numericLessThanEquals,\r\n numericNotEquals,\r\n stringEquals,\r\n stringEqualsIgnoreCase,\r\n stringLike,\r\n stringLikeIfExists,\r\n stringNotEquals,\r\n stringNotEqualsIgnoreCase\r\n};\r\n","import {\r\n EffectBlock,\r\n ConditionBlock,\r\n StatementInterface,\r\n MatchConditionInterface,\r\n MatchConditionResolverInterface\r\n} from './types';\r\nimport { getValueFromPath } from './utils/getValueFromPath';\r\nimport { generateUUID } from './utils/generateUUID';\r\nimport {operators} from './conditionOperators';\r\n\r\nabstract class Statement {\r\n protected sid: string;\r\n protected readonly condition?: ConditionBlock;\r\n effect: EffectBlock;\r\n\r\n constructor({ sid, effect = 'allow', condition }: StatementInterface) {\r\n if (!sid) {\r\n this.sid = generateUUID();\r\n } else {\r\n this.sid = sid;\r\n }\r\n this.effect = effect;\r\n this.condition = condition;\r\n }\r\n\r\n matchConditions(\r\n this: Statement,\r\n { context, conditionResolver }: MatchConditionInterface\r\n ): boolean {\r\n const { condition: conditions } = this;\r\n\r\n if(conditions && context){\r\n return Object.keys(conditions).every((condition) =>\r\n Object.keys(conditions[condition]).every((path) => {\r\n const conditionValues = conditions[condition][path];\r\n if (conditionValues instanceof Array) {\r\n return conditionValues.some((value) =>\r\n this.evaluateCondition({\r\n context,\r\n conditionResolver,\r\n condition,\r\n path,\r\n value\r\n })\r\n );\r\n }\r\n\r\n return this.evaluateCondition({\r\n context,\r\n conditionResolver,\r\n condition,\r\n path,\r\n value: conditionValues\r\n });\r\n })\r\n )\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private evaluateCondition(\r\n this: Statement,\r\n { context, conditionResolver={}, path, value, condition }: MatchConditionResolverInterface\r\n ): boolean {\r\n\r\n const currentResolver= conditionResolver[condition] || operators[condition]\r\n\r\n if(currentResolver){\r\n return currentResolver(\r\n getValueFromPath(context, path),\r\n value\r\n )\r\n }\r\n return false;\r\n }\r\n}\r\n\r\nexport { Statement };\r\n","import { ActionBasedType, MatchActionBasedInterface } from './types';\r\nimport { Matcher } from './Matcher';\r\nimport { Statement } from './Statement';\r\nimport { applyContext } from './utils/applyContext';\r\n\r\nclass ActionBased extends Statement {\r\n private action?: string[];\r\n private notAction?: string[];\r\n private statement: ActionBasedType;\r\n\r\n constructor(action: ActionBasedType) {\r\n super(action);\r\n this.checkAndAssignActions(action);\r\n this.statement = { ...action, sid: this.sid };\r\n }\r\n\r\n getStatement(this: ActionBased): ActionBasedType {\r\n return this.statement;\r\n }\r\n\r\n matches(\r\n this: ActionBased,\r\n { action, context, conditionResolver }: MatchActionBasedInterface\r\n ): boolean {\r\n return (\r\n this.matchActions(action, context) &&\r\n this.matchNotActions(action, context) &&\r\n this.matchConditions({ context, conditionResolver })\r\n );\r\n }\r\n\r\n private checkAndAssignActions(action: ActionBasedType): void {\r\n const hasAction = 'action' in action;\r\n const hasNotAction = 'notAction' in action;\r\n if (hasAction && hasNotAction) {\r\n throw new TypeError(\r\n 'ActionBased statement should have an action or a notAction attribute, no both'\r\n );\r\n }\r\n if ('action' in action) {\r\n this.action =\r\n typeof action.action === 'string' ? [action.action] : action.action;\r\n } else {\r\n this.notAction =\r\n typeof action.notAction === 'string'\r\n ? [action.notAction]\r\n : action.notAction;\r\n }\r\n }\r\n\r\n private matchActions(action: string, context?: T): boolean {\r\n return this.action\r\n ? this.action.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotActions(action: string, context?: T): boolean {\r\n return this.notAction\r\n ? !this.notAction.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n}\r\n\r\nexport { ActionBased };\r\n","import { IdentityBasedType, MatchIdentityBasedInterface } from './types';\r\nimport { Matcher } from './Matcher';\r\nimport { Statement } from './Statement';\r\nimport { applyContext } from './utils/applyContext';\r\n\r\nclass IdentityBased extends Statement {\r\n private resource?: string[];\r\n private action?: string[];\r\n private notResource?: string[];\r\n private notAction?: string[];\r\n private statement: IdentityBasedType;\r\n\r\n constructor(identity: IdentityBasedType) {\r\n super(identity);\r\n this.checkAndAssignActions(identity);\r\n this.checkAndAssignResources(identity);\r\n this.statement = { ...identity, sid: this.sid };\r\n }\r\n\r\n getStatement(this: IdentityBased): IdentityBasedType {\r\n return this.statement;\r\n }\r\n\r\n matches(\r\n this: IdentityBased,\r\n {\r\n action,\r\n resource,\r\n context,\r\n conditionResolver\r\n }: MatchIdentityBasedInterface\r\n ): boolean {\r\n return (\r\n this.matchActions(action, context) &&\r\n this.matchNotActions(action, context) &&\r\n this.matchResources(resource, context) &&\r\n this.matchNotResources(resource, context) &&\r\n this.matchConditions({ context, conditionResolver })\r\n );\r\n }\r\n\r\n private checkAndAssignActions(identity: IdentityBasedType): void {\r\n const hasAction = 'action' in identity;\r\n const hasNotAction = 'notAction' in identity;\r\n if (hasAction && hasNotAction) {\r\n throw new TypeError(\r\n 'IdentityBased statement should have an action or a notAction attribute, no both'\r\n );\r\n }\r\n if ('action' in identity) {\r\n this.action =\r\n typeof identity.action === 'string'\r\n ? [identity.action]\r\n : identity.action;\r\n } else {\r\n this.notAction =\r\n typeof identity.notAction === 'string'\r\n ? [identity.notAction]\r\n : identity.notAction;\r\n }\r\n }\r\n\r\n private checkAndAssignResources(identity: IdentityBasedType): void {\r\n const hasResource = 'resource' in identity;\r\n const hasNotResource = 'notResource' in identity;\r\n if (hasResource && hasNotResource) {\r\n throw new TypeError(\r\n 'IdentityBased statement should have a resource or a notResource attribute, no both'\r\n );\r\n }\r\n if ('resource' in identity) {\r\n this.resource =\r\n typeof identity.resource === 'string'\r\n ? [identity.resource]\r\n : identity.resource;\r\n } else {\r\n this.notResource =\r\n typeof identity.notResource === 'string'\r\n ? [identity.notResource]\r\n : identity.notResource;\r\n }\r\n }\r\n\r\n private matchActions(action: string, context?: T): boolean {\r\n return this.action\r\n ? this.action.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotActions(action: string, context?: T): boolean {\r\n return this.notAction\r\n ? !this.notAction.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchResources(resource: string, context?: T): boolean {\r\n return this.resource\r\n ? this.resource.some((a) =>\r\n new Matcher(applyContext(a, context)).match(resource)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotResources(resource: string, context?: T): boolean {\r\n return this.notResource\r\n ? !this.notResource.some((a) =>\r\n new Matcher(applyContext(a, context)).match(resource)\r\n )\r\n : true;\r\n }\r\n}\r\n\r\nexport { IdentityBased };\r\n","import {\r\n PrincipalMap,\r\n MatchResourceBasedInterface,\r\n ResourceBasedType\r\n} from './types';\r\nimport { Matcher } from './Matcher';\r\nimport { Statement } from './Statement';\r\nimport { applyContext } from './utils/applyContext';\r\n\r\nclass ResourceBased extends Statement {\r\n private principal?: PrincipalMap | string[];\r\n private resource?: string[];\r\n private action?: string[];\r\n private notPrincipal?: PrincipalMap | string[];\r\n private notResource?: string[];\r\n private notAction?: string[];\r\n private statement: ResourceBasedType;\r\n private hasPrincipals: boolean;\r\n private hasResources: boolean;\r\n\r\n constructor(identity: ResourceBasedType) {\r\n super(identity);\r\n this.hasPrincipals = false;\r\n this.hasResources = false;\r\n this.checkAndAssignActions(identity);\r\n this.checkAndAssignPrincipals(identity);\r\n this.checkAndAssignResources(identity);\r\n this.statement = { ...identity, sid: this.sid };\r\n }\r\n\r\n getStatement(this: ResourceBased): ResourceBasedType {\r\n return this.statement;\r\n }\r\n\r\n matches(\r\n this: ResourceBased,\r\n {\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context,\r\n conditionResolver\r\n }: MatchResourceBasedInterface\r\n ): boolean {\r\n return (\r\n this.matchPrincipalAndNotPrincipal(principal, principalType, context) &&\r\n this.matchActions(action, context) &&\r\n this.matchNotActions(action, context) &&\r\n this.matchResourceAndNotResource(resource, context) &&\r\n this.matchConditions({ context, conditionResolver })\r\n );\r\n }\r\n\r\n /*valueComing principal noPrincipal\r\n true false false false\r\n true true false true or false\r\n true false true true or false\r\n false false false true\r\n false true false false\r\n false false true false*/\r\n private matchPrincipalAndNotPrincipal(\r\n principal?: string,\r\n principalType?: string,\r\n context?: T\r\n ): boolean {\r\n if (principal) {\r\n if (this.hasPrincipals)\r\n return (\r\n this.matchPrincipals(principal, principalType, context) &&\r\n this.matchNotPrincipals(principal, principalType, context)\r\n );\r\n return false;\r\n }\r\n if (this.hasPrincipals) return false;\r\n return true;\r\n }\r\n\r\n /*valueComing resource noResource\r\n true false false false\r\n true true false true or false\r\n true false true true or false\r\n false false false true\r\n false true false false\r\n false false true false*/\r\n private matchResourceAndNotResource(resource?: string, context?: T): boolean {\r\n if (resource) {\r\n if (this.hasResources)\r\n return (\r\n this.matchResources(resource, context) &&\r\n this.matchNotResources(resource, context)\r\n );\r\n return false;\r\n }\r\n if (this.hasResources) return false;\r\n return true;\r\n }\r\n\r\n private checkAndAssignActions(identity: ResourceBasedType): void {\r\n const hasAction = 'action' in identity;\r\n const hasNotAction = 'notAction' in identity;\r\n if (hasAction && hasNotAction) {\r\n throw new TypeError(\r\n 'ResourceBased statement should have an action or a notAction attribute, no both'\r\n );\r\n }\r\n if ('action' in identity) {\r\n this.action =\r\n typeof identity.action === 'string'\r\n ? [identity.action]\r\n : identity.action;\r\n } else {\r\n this.notAction =\r\n typeof identity.notAction === 'string'\r\n ? [identity.notAction]\r\n : identity.notAction;\r\n }\r\n }\r\n\r\n private checkAndAssignPrincipals(identity: ResourceBasedType): void {\r\n const hasPrincipal = 'principal' in identity;\r\n const hasNotPrincipal = 'notPrincipal' in identity;\r\n if (hasPrincipal && hasNotPrincipal) {\r\n throw new TypeError(\r\n 'ResourceBased statement could have a principal or a notPrincipal attribute, no both'\r\n );\r\n }\r\n if ('principal' in identity) {\r\n this.principal =\r\n typeof identity.principal === 'string'\r\n ? [identity.principal]\r\n : identity.principal;\r\n this.hasPrincipals = true;\r\n } else if ('notPrincipal' in identity) {\r\n this.notPrincipal =\r\n typeof identity.notPrincipal === 'string'\r\n ? [identity.notPrincipal]\r\n : identity.notPrincipal;\r\n this.hasPrincipals = true;\r\n }\r\n }\r\n\r\n private checkAndAssignResources(identity: ResourceBasedType): void {\r\n const hasResource = 'resource' in identity;\r\n const hasNotResource = 'notResource' in identity;\r\n if (hasResource && hasNotResource) {\r\n throw new TypeError(\r\n 'ResourceBased statement could have a resource or a notResource attribute, no both'\r\n );\r\n }\r\n if ('resource' in identity) {\r\n this.resource =\r\n typeof identity.resource === 'string'\r\n ? [identity.resource]\r\n : identity.resource;\r\n this.hasResources = true;\r\n } else if ('notResource' in identity) {\r\n this.notResource =\r\n typeof identity.notResource === 'string'\r\n ? [identity.notResource]\r\n : identity.notResource;\r\n this.hasResources = true;\r\n }\r\n }\r\n\r\n private matchPrincipals(\r\n principal: string,\r\n principalType?: string,\r\n context?: T\r\n ): boolean {\r\n if (this.principal) {\r\n if (this.principal instanceof Array) {\r\n return principalType\r\n ? false\r\n : this.principal.some((a) =>\r\n new Matcher(applyContext(a, context)).match(principal)\r\n );\r\n } else {\r\n if (principalType) {\r\n const principalValues = this.principal[principalType];\r\n if (principalValues instanceof Array) {\r\n return principalValues.some((a) =>\r\n new Matcher(applyContext(a, context)).match(principal)\r\n );\r\n } else if (principalValues) {\r\n return new Matcher(applyContext(principalValues, context)).match(\r\n principal\r\n );\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n private matchNotPrincipals(\r\n principal: string,\r\n principalType?: string,\r\n context?: T\r\n ): boolean {\r\n if (this.notPrincipal) {\r\n if (this.notPrincipal instanceof Array) {\r\n return principalType\r\n ? true\r\n : !this.notPrincipal.some((a) =>\r\n new Matcher(applyContext(a, context)).match(principal)\r\n );\r\n } else {\r\n if (principalType) {\r\n const principalValues = this.notPrincipal[principalType];\r\n if (principalValues instanceof Array) {\r\n return !principalValues.some((a) =>\r\n new Matcher(applyContext(a, context)).match(principal)\r\n );\r\n } else if (principalValues) {\r\n return !new Matcher(applyContext(principalValues, context)).match(\r\n principal\r\n );\r\n }\r\n return true;\r\n }\r\n return true;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n private matchActions(action: string, context?: T): boolean {\r\n return this.action\r\n ? this.action.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotActions(action: string, context?: T): boolean {\r\n return this.notAction\r\n ? !this.notAction.some((a) =>\r\n new Matcher(applyContext(a, context)).match(action)\r\n )\r\n : true;\r\n }\r\n\r\n private matchResources(resource: string, context?: T): boolean {\r\n return this.resource\r\n ? this.resource.some((a) =>\r\n new Matcher(applyContext(a, context)).match(resource)\r\n )\r\n : true;\r\n }\r\n\r\n private matchNotResources(resource: string, context?: T): boolean {\r\n return this.notResource\r\n ? !this.notResource.some((a) =>\r\n new Matcher(applyContext(a, context)).match(resource)\r\n )\r\n : true;\r\n }\r\n}\r\n\r\nexport { ResourceBased };\r\n","import { MatchConditionInterface, ConditionResolver } from './types';\r\n\r\nabstract class Policy {\r\n protected context?: T;\r\n protected conditionResolver?: ConditionResolver;\r\n\r\n constructor({ context, conditionResolver }: MatchConditionInterface) {\r\n this.context = context;\r\n this.conditionResolver = conditionResolver;\r\n }\r\n\r\n setContext(this: Policy, context: T): void {\r\n this.context = context;\r\n }\r\n\r\n getContext(this: Policy): T | undefined {\r\n return this.context;\r\n }\r\n\r\n setConditionResolver(\r\n this: Policy,\r\n conditionResolver: ConditionResolver\r\n ): void {\r\n this.conditionResolver = conditionResolver;\r\n }\r\n\r\n getConditionResolver(this: Policy): ConditionResolver | undefined {\r\n return this.conditionResolver;\r\n }\r\n\r\n abstract getStatements(this: Policy): U[];\r\n}\r\n\r\nexport { Policy };\r\n","import {\r\n ActionBasedType,\r\n ConditionResolver,\r\n EvaluateActionBasedInterface,\r\n ProxyOptions\r\n} from './types';\r\nimport { ActionBased } from './ActionBasedStatement';\r\nimport { Policy } from './Policy';\r\n\r\nexport interface ActionBasedPolicyInterface {\r\n statements: ActionBasedType[];\r\n conditionResolver?: ConditionResolver;\r\n context?: T;\r\n}\r\n\r\nexport class ActionBasedPolicy extends Policy<\r\n T,\r\n ActionBasedType\r\n> {\r\n private denyStatements: ActionBased[];\r\n private allowStatements: ActionBased[];\r\n private statements: ActionBasedType[];\r\n\r\n constructor({\r\n statements,\r\n conditionResolver,\r\n context\r\n }: ActionBasedPolicyInterface) {\r\n super({ context, conditionResolver });\r\n const statementInstances = statements.map(\r\n (statement) => new ActionBased(statement)\r\n );\r\n this.allowStatements = statementInstances.filter(\r\n (s) => s.effect === 'allow'\r\n );\r\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\r\n this.statements = statementInstances.map((statement) =>\r\n statement.getStatement()\r\n );\r\n }\r\n\r\n addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void {\r\n const statementInstance = new ActionBased(statement);\r\n if (statementInstance.effect === 'allow') {\r\n this.allowStatements.push(statementInstance);\r\n } else {\r\n this.denyStatements.push(statementInstance);\r\n }\r\n this.statements.push(statementInstance.getStatement());\r\n }\r\n\r\n getStatements(this: ActionBasedPolicy): ActionBasedType[] {\r\n return this.statements;\r\n }\r\n\r\n evaluate(\r\n this: ActionBasedPolicy,\r\n { action, context }: EvaluateActionBasedInterface\r\n ): boolean {\r\n const args = { action, context };\r\n return !this.cannot(args) && this.can(args);\r\n }\r\n\r\n can(\r\n this: ActionBasedPolicy,\r\n { action, context }: EvaluateActionBasedInterface\r\n ): boolean {\r\n return this.allowStatements.some((s) =>\r\n s.matches({\r\n action,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n\r\n cannot(\r\n this: ActionBasedPolicy,\r\n { action, context }: EvaluateActionBasedInterface\r\n ): boolean {\r\n return this.denyStatements.some((s) =>\r\n s.matches({\r\n action,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n\r\n generateProxy(\r\n this: ActionBasedPolicy,\r\n obj: U,\r\n options: ProxyOptions = {}\r\n ): U {\r\n const { get = {}, set = {} } = options;\r\n const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get;\r\n const { allow: allowSet = true, propertyMap: propertyMapSet = {} } = set;\r\n const handler = {\r\n ...(allowGet\r\n ? {\r\n get: (target: U, prop: string | symbol): any => {\r\n const property = Reflect.has(propertyMapGet, prop)\r\n ? Reflect.get(propertyMapGet, prop)\r\n : prop;\r\n if (typeof prop === 'string') {\r\n if (this.evaluate({ action: property })) {\r\n return Reflect.get(target, prop);\r\n } else {\r\n throw new Error(`Unauthorize to get ${prop} property`);\r\n } \r\n } else {\r\n return Reflect.get(target, prop);\r\n }\r\n }\r\n }\r\n : {}),\r\n ...(allowSet\r\n ? {\r\n set: (target: U, prop: string | symbol, value: any): boolean => {\r\n const property = Reflect.has(propertyMapSet, prop)\r\n ? Reflect.get(propertyMapSet, prop)\r\n : prop;\r\n if (typeof prop === 'string') {\r\n if (this.evaluate({ action: property })) {\r\n return Reflect.set(target, prop, value);\r\n } else {\r\n throw new Error(`Unauthorize to set ${prop} property`);\r\n } \r\n } else {\r\n return false;\r\n }\r\n }\r\n }\r\n : {})\r\n };\r\n\r\n return new Proxy(obj, handler);\r\n }\r\n}\r\n","import {\r\n ConditionResolver,\r\n EvaluateIdentityBasedInterface,\r\n IdentityBasedType\r\n} from './types';\r\nimport { IdentityBased } from './IdentityBasedStatement';\r\nimport { Policy } from './Policy';\r\n\r\ninterface IdentityBasedPolicyInterface {\r\n statements: IdentityBasedType[];\r\n conditionResolver?: ConditionResolver;\r\n context?: T;\r\n}\r\n\r\nexport class IdentityBasedPolicy extends Policy<\r\n T,\r\n IdentityBasedType\r\n> {\r\n private denyStatements: IdentityBased[];\r\n private allowStatements: IdentityBased[];\r\n private statements: IdentityBasedType[];\r\n\r\n constructor({\r\n statements,\r\n conditionResolver,\r\n context\r\n }: IdentityBasedPolicyInterface) {\r\n super({ context, conditionResolver });\r\n const statementInstances = statements.map(\r\n (statement) => new IdentityBased(statement)\r\n );\r\n this.allowStatements = statementInstances.filter(\r\n (s) => s.effect === 'allow'\r\n );\r\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\r\n this.statements = statementInstances.map((statement) =>\r\n statement.getStatement()\r\n );\r\n }\r\n\r\n addStatement(\r\n this: IdentityBasedPolicy,\r\n statement: IdentityBasedType\r\n ): void {\r\n const statementInstance = new IdentityBased(statement);\r\n if (statementInstance.effect === 'allow') {\r\n this.allowStatements.push(statementInstance);\r\n } else {\r\n this.denyStatements.push(statementInstance);\r\n }\r\n this.statements.push(statementInstance.getStatement());\r\n }\r\n\r\n getStatements(this: IdentityBasedPolicy): IdentityBasedType[] {\r\n return this.statements;\r\n }\r\n\r\n evaluate(\r\n this: IdentityBasedPolicy,\r\n { action, resource, context }: EvaluateIdentityBasedInterface\r\n ): boolean {\r\n const args = { action, resource, context };\r\n return !this.cannot(args) && this.can(args);\r\n }\r\n\r\n can(\r\n this: IdentityBasedPolicy,\r\n { action, resource, context }: EvaluateIdentityBasedInterface\r\n ): boolean {\r\n return this.allowStatements.some((s) =>\r\n s.matches({\r\n action,\r\n resource,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n\r\n cannot(\r\n this: IdentityBasedPolicy,\r\n { action, resource, context }: EvaluateIdentityBasedInterface\r\n ): boolean {\r\n return this.denyStatements.some((s) =>\r\n s.matches({\r\n action,\r\n resource,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n}\r\n","import {\r\n ConditionResolver,\r\n EvaluateResourceBasedInterface,\r\n ResourceBasedType\r\n} from './types';\r\nimport { ResourceBased } from './ResourceBasedStatement';\r\nimport { Policy } from './Policy';\r\n\r\ninterface ResourceBasedPolicyInterface {\r\n statements: ResourceBasedType[];\r\n conditionResolver?: ConditionResolver;\r\n context?: T;\r\n}\r\n\r\nexport class ResourceBasedPolicy extends Policy<\r\n T,\r\n ResourceBasedType\r\n> {\r\n private denyStatements: ResourceBased[];\r\n private allowStatements: ResourceBased[];\r\n private statements: ResourceBasedType[];\r\n\r\n constructor({\r\n statements,\r\n conditionResolver,\r\n context\r\n }: ResourceBasedPolicyInterface) {\r\n super({ context, conditionResolver });\r\n const statementInstances = statements.map(\r\n (statement) => new ResourceBased(statement)\r\n );\r\n this.allowStatements = statementInstances.filter(\r\n (s) => s.effect === 'allow'\r\n );\r\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\r\n this.statements = statementInstances.map((statement) =>\r\n statement.getStatement()\r\n );\r\n }\r\n\r\n addStatement(\r\n this: ResourceBasedPolicy,\r\n statement: ResourceBasedType\r\n ): void {\r\n const statementInstance = new ResourceBased(statement);\r\n if (statementInstance.effect === 'allow') {\r\n this.allowStatements.push(statementInstance);\r\n } else {\r\n this.denyStatements.push(statementInstance);\r\n }\r\n this.statements.push(statementInstance.getStatement());\r\n }\r\n\r\n getStatements(this: ResourceBasedPolicy): ResourceBasedType[] {\r\n return this.statements;\r\n }\r\n\r\n evaluate(\r\n this: ResourceBasedPolicy,\r\n {\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context\r\n }: EvaluateResourceBasedInterface\r\n ): boolean {\r\n const args = { principal, action, resource, principalType, context };\r\n return !this.cannot(args) && this.can(args);\r\n }\r\n\r\n can(\r\n this: ResourceBasedPolicy,\r\n {\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context\r\n }: EvaluateResourceBasedInterface\r\n ): boolean {\r\n return this.allowStatements.some((s) =>\r\n s.matches({\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n\r\n cannot(\r\n this: ResourceBasedPolicy,\r\n {\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context\r\n }: EvaluateResourceBasedInterface\r\n ): boolean {\r\n return this.denyStatements.some((s) =>\r\n s.matches({\r\n principal,\r\n action,\r\n resource,\r\n principalType,\r\n context: context || this.context,\r\n conditionResolver: this.conditionResolver\r\n })\r\n );\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;SAgBgB,MAAM,CAAC,KAAc;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/C;;AChBA;;;;;;;;;;;;;;;;SAgBgB,QAAQ,CAAC,KAAe;IACtC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,QACE,IAAI,KAAK,QAAQ;SAChB,IAAI,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,EAC5E;AACJ;;ACtBA;AACA,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;SAegB,KAAK,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;AACpE;;ACxBA;AACA,MAAM,YAAY,GAAG,kDAAkD,CAAC;AACxE,MAAM,aAAa,GAAG,OAAO,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA+BgB,KAAK,CAAmB,KAAc,EAAE,MAAU;IAChE,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,IACE,IAAI,KAAK,Q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AC1C,CAAC,CACH,CAAC;KACH;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"main.js","sources":["../src/utils/getTag.ts","../src/utils/isSymbol.ts","../src/utils/toKey.ts","../src/utils/isKey.ts","../src/utils/memoize.ts","../src/utils/memoizeCapped.ts","../src/utils/stringToPath.ts","../src/utils/getValueFromPath.ts","../src/utils/applyContext.ts","../src/utils/decomposeString.ts","../src/utils/braceExpand.ts","../src/Matcher.ts","../src/utils/mersenneTwister.ts","../src/utils/generateUUID.ts","../src/conditionOperators/boolean/bool.ts","../src/conditionOperators/date/convertDate.ts","../src/conditionOperators/date/dateEquals.ts","../src/conditionOperators/date/dateGreaterThan.ts","../src/conditionOperators/date/dateGreaterThanEquals.ts","../src/conditionOperators/date/dateLessThan.ts","../src/conditionOperators/date/dateLessThanEquals.ts","../src/conditionOperators/date/dateNotEquals.ts","../src/conditionOperators/numeric/numericEquals.ts","../src/conditionOperators/numeric/numericGreaterThan.ts","../src/conditionOperators/numeric/numericGreaterThanEquals.ts","../src/conditionOperators/numeric/numericLessThan.ts","../src/conditionOperators/numeric/numericLessThanEquals.ts","../src/conditionOperators/numeric/numericNotEquals.ts","../src/conditionOperators/string/stringEquals.ts","../src/conditionOperators/string/stringEqualsIgnoreCase.ts","../src/conditionOperators/string/stringLike.ts","../src/conditionOperators/string/stringLikeIfExists.ts","../src/conditionOperators/string/stringNotEquals.ts","../src/conditionOperators/string/stringNotEqualsIgnoreCase.ts","../src/conditionOperators/index.ts","../src/Statement.ts","../src/ActionBasedStatement.ts","../src/IdentityBasedStatement.ts","../src/ResourceBasedStatement.ts","../src/Policy.ts","../src/ActionBasedPolicy.ts","../src/IdentityBasedPolicy.ts","../src/ResourceBasedPolicy.ts"],"sourcesContent":["/**\n * Gets the `toStringTag` of `value`.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n * @example\n * ```javascript\n * getTag(1)\n * // => '[object Number]'\n *\n * getTag(null)\n * // => '[object Null]'\n * ```\n */\nexport function getTag(value: unknown): string {\n return Object.prototype.toString.call(value);\n}\n","import { getTag } from './getTag';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @since 3.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n * ```javascript\n * isSymbol(Symbol())\n * // => true\n *\n * isSymbol('abc')\n * // => false\n * ```\n */\nexport function isSymbol(value?: unknown): value is symbol {\n const type = typeof value;\n return (\n type === 'symbol' ||\n (type === 'object' && value !== null && getTag(value) === '[object Symbol]')\n );\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used as references for various `Number` constants. */\nconst INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n * @example\n *\n * toKey(Symbol.iterator)\n * // => true\n *\n * toKey('abc')\n * // => false\n */\nexport function toKey(value: unknown): string | symbol {\n if (typeof value === 'string' || isSymbol(value)) {\n return value;\n }\n\n return value === 0 && 1 / value === -INFINITY ? '-0' : `${value}`;\n}\n","import { isSymbol } from './isSymbol';\n\n/** Used to match property names within property paths. */\nconst reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst reIsPlainProp = /^\\w*$/; //matches any word character (alphanumeric and underscore)\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @since 3.1.0\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n * @example\n * ```javascript\n * isKey(1)\n * // => true\n *\n * isKey('example[test]')\n * // => false\n *\n * isKey('a.b')\n * // => false\n *\n * const obj = {\n * '[a]': 5,\n * 'b.c': true\n * };\n *\n * isKey('[a]', obj)\n * // => true\n *\n * isKey('b.c', obj)\n * // => true\n * ```\n */\nexport function isKey(value: unknown, object?: T): boolean {\n const type = typeof value;\n if (\n type === 'number' ||\n type === 'boolean' ||\n value === null ||\n value === undefined ||\n isSymbol(value)\n ) {\n return true;\n }\n if (typeof value === 'string') {\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object !== null && value in Object(object))\n );\n }\n return false;\n}\n","import { MemoizeInterface } from '../types';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * @since 3.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n * ```javascript\n * const object = { 'a': 1, 'b': 2 }\n * const other = { 'c': 3, 'd': 4 }\n *\n * const values = memoize(values)\n * values(object)\n * // => [1, 2]\n *\n * values(other)\n * // => [3, 4]\n *\n * object.a = 2\n * values(object)\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b'])\n * values(object)\n * // => ['a', 'b']\n * ```\n */\nexport function memoize(\n func: (...args: unknown[]) => any,\n resolver?: (...args: unknown[]) => any\n): MemoizeInterface {\n const memoized = function (\n this: (...args: unknown[]) => any,\n ...args: unknown[]\n ): MemoizeInterface {\n const key = resolver ? resolver.apply(this, args) : args[0];\n const cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n const result = func.apply(this, args);\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n}\n\n/*const memoize = (fn: Function): Function => {\n const cache = {};\n return (...args): any => {\n const stringifiedArgs = JSON.stringify(args);\n const result = (cache[stringifiedArgs] =\n typeof cache[stringifiedArgs] === 'undefined'\n ? fn(...args)\n : cache[stringifiedArgs]);\n return result;\n };\n};*/\n","import { memoize } from './memoize';\nimport { MemoizeInterface } from '../types';\n\n/** Used as the maximum memoize cache size. */\nexport const MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @since 3.1.0\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nexport function memoizeCapped(\n func: (...args: any) => unknown\n): MemoizeInterface {\n const result = memoize(func, (key: unknown) => {\n const { cache } = result;\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n return result;\n}\n","import { memoizeCapped } from './memoizeCapped';\n\nconst charCodeOfDot = '.'.charCodeAt(0);\nconst reEscapeChar = /\\\\(\\\\)?/g;\nconst rePropName = RegExp(\n // Match anything that isn't a dot or bracket.\n '[^.[\\\\]]+' +\n '|' +\n // Or match property names within brackets.\n '\\\\[(?:' +\n // Match a non-string expression.\n '([^\"\\'][^[]*)' +\n '|' +\n // Or match strings (supports escaping characters).\n '([\"\\'])((?:(?!\\\\x02)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\x02' +\n ')\\\\]' +\n '|' +\n // Or match \"\" as the space between consecutive dots or empty brackets.\n '(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|$))',\n 'g'\n);\n\n/**\n * Converts `string` to a property path array.\n *\n * @since 3.1.0\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nexport const stringToPath = memoizeCapped((string: string) => {\n const result = [];\n if (string.charCodeAt(0) === charCodeOfDot) {\n result.push('');\n }\n string.replace(\n rePropName,\n (\n match: string,\n expression: string,\n quote: string,\n subString: string\n ): string => {\n let key = match;\n if (quote) {\n key = subString.replace(reEscapeChar, '$1');\n } else if (expression) {\n key = expression.trim();\n }\n result.push(key);\n return '';\n }\n );\n return result;\n});\n","import { toKey } from './toKey';\nimport { isKey } from './isKey';\nimport { stringToPath } from './stringToPath';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nexport function castPath(\n value: unknown,\n object: U\n): Array {\n if (Array.isArray(value)) {\n return value;\n }\n\n return isKey(value, object) ? [value] : stringToPath(value);\n}\n\n/**\n * The base implementation of `get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nexport function baseGet(\n object: U,\n path: Array | string\n): any {\n const newPath = castPath(path, object);\n\n let index = 0;\n const length = newPath.length;\n\n let value: any = object;\n while (value instanceof Object && index < length) {\n value = value[toKey(newPath[index++])];\n }\n\n return index && index === length ? value : undefined;\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @since 3.1.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * const object = { 'a': [{ 'b': { 'c': 3 } }] }\n *\n * getValueFromPath(object, 'a[0].b.c')\n * // => 3\n *\n * getValueFromPath(object, ['a', '0', 'b', 'c'])\n * // => 3\n *\n * getValueFromPath(object, 'a.b.c', 'default')\n * // => 'default'\n */\nexport function getValueFromPath(\n object: U,\n path: Array | string,\n defaultValue?: unknown\n): any {\n const result = object === null ? undefined : baseGet(object, path);\n\n return result === undefined ? defaultValue : result;\n}\n","import { getValueFromPath } from './getValueFromPath';\n\nconst reDelimiters = /\\${([^}]*)}/g;\nconst trim = / +(?= )|^\\s+|\\s+$/g;\n\nconst specialTrim = (str: string): string => str.replace(trim, '');\n\n/**\n * Apply the context value in a string.\n *\n * @param {string} str Pattern string, containing context path.\n * @param {object} context Object to get values from path.\n * @returns {string} Returns a string with embedded context values.\n * @example\n * ```javascript\n * const context = {\n * user: { id: 456, bestFriends: [123, 532, 987] }\n * };\n * applyContext('secrets:${user.id}:*', context)\n * // => 'secrets:456:*'\n *\n * applyContext('secrets:${user.bestFriends}:*', context)\n * // => 'secrets:{123,532,987}:*'\n *\n * applyContext('secrets:${company.address}:account', context)\n * // => 'secrets:undefined:account'\n * ```\n */\nexport function applyContext(\n str: string,\n context?: T\n): string {\n if (!context) return str;\n\n return specialTrim(\n str.replace(reDelimiters, (_, path: string) => {\n const value = getValueFromPath(context, path);\n if (Array.isArray(value)) return `{${value}}`;\n if (value instanceof Object) return 'undefined';\n\n return String(value);\n })\n );\n}\n","import { DecomposeString } from '../types';\n\n/**\n * Get index range where separators are found.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {number[]} Returns the beginning and final index for those matches.\n * @example\n * ```javascript\n * getIndexRange('first', 'Second', 'firstAndSecond')\n * // => [0, 8]\n *\n * getIndexRange('First', 'Second', '++FirstAndSecond**')\n * // => [2, 10]\n * ```\n */\nfunction getIndexRange(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): number[] {\n const beginningIndex = str.indexOf(initialSeparator);\n const finalIndex = str.indexOf(finalSeparator, beginningIndex + 1);\n\n if (beginningIndex >= 0 && finalIndex > 0) {\n return [beginningIndex, finalIndex];\n }\n\n return [-1, -1];\n}\n\n/**\n * Object returned by decomposeString function\n *\n * @typedef {Object} DecomposedString\n * @property {number} start Beginning index for first separator match\n * @property {number} end Final index for second separator match\n * @property {string} pre Substring before first separator\n * @property {string} body Substring between separators\n * @property {string} post Substring after second separator\n */\n\n/**\n * Decompose string in pre, body and post strings by using separators.\n *\n * @private\n * @since 3.1.1\n * @param {string} initialSeparator First string to be found.\n * @param {string} finalSeparator Second string to be found.\n * @param {string} str String to be decomposed.\n * @returns {DecomposedString} Returns a decompose string.\n * @example\n * ```javascript\n * decomposeString('first', 'Second', 'firstAndSecond')\n * // => { start: 0, end: 8, pre: '', body: 'And', post: '' }\n *\n * decomposeString('First', 'Second', '++FirstAndSecond**')\n * // => { start: 2, end: 10, pre: '++', body: 'And', post: '**' }\n * ```\n */\nexport function decomposeString(\n initialSeparator: string,\n finalSeparator: string,\n str: string\n): DecomposeString {\n const [beginningIndex, finalIndex] = getIndexRange(\n initialSeparator,\n finalSeparator,\n str\n );\n\n return {\n start: beginningIndex,\n end: finalIndex,\n pre: beginningIndex >= 0 ? str.slice(0, beginningIndex) : '',\n body:\n beginningIndex >= 0\n ? str.slice(beginningIndex + initialSeparator.length, finalIndex)\n : '',\n post:\n beginningIndex >= 0 ? str.slice(finalIndex + finalSeparator.length) : ''\n };\n}\n","import { decomposeString } from './decomposeString';\n\n/**\n * Generate an array of string depending on {} blocks.\n *\n * @param {string} pattern Pattern string that can contains {} blocks.\n * @returns {string[]} Returns an array of string with all the combinations.\n * @example\n * ```javascript\n * braceExpand('${13}')\n * // => ['{13}']\n *\n * braceExpand('a{b,f,m}p')\n * // => ['abp','afp','amp']\n *\n * braceExpand('-v{,,}')\n * // => ['-v','-v','-v']\n * ```\n */\nconst braceExpand = (pattern: string): string[] => {\n if (!pattern.match(/{.*}/)) {\n return [pattern];\n }\n\n return expand(pattern, true);\n};\n\nconst expand = (str: string, isTop?: boolean): string[] => {\n const expansions = [] as string[];\n const balance = decomposeString('{', '}', str);\n if (balance.start < 0) return [str];\n\n const parts = balance.body.split(',');\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = balance.pre;\n const postParts = balance.post.length ? expand(balance.post, false) : [''];\n\n if (/\\$$/.test(balance.pre)) {\n postParts.forEach((postPart) => {\n const expansion = `${balance.pre.slice(0, -1)}{${\n balance.body\n }}${postPart}`;\n expansions.push(expansion);\n });\n } else {\n parts.forEach((part: string) => {\n postParts.forEach((postPart) => {\n const expansion = pre + part + postPart;\n if (!isTop || expansion) expansions.push(expansion);\n });\n });\n }\n\n return expansions;\n};\n\nexport { braceExpand };\n","import { braceExpand } from './utils/braceExpand';\n\nexport class Matcher {\n private readonly pattern: string;\n private readonly maxLength: number;\n private readonly set: (string | RegExp)[];\n private readonly empty: boolean;\n\n constructor(pattern: string, maxLength = 1024 * 64) {\n this.set = [];\n this.pattern = pattern.trim();\n this.maxLength = maxLength;\n this.empty = !this.pattern ? true : false;\n\n const set = braceExpand(pattern);\n this.set = set.map((val) => this.parse(val));\n this.set = this.set.filter((s) => {\n return Boolean(s);\n });\n }\n\n match(this: Matcher, str: string): boolean {\n if (this.empty) return str === '';\n\n return this.set.some((pattern) => this.matchOne(str, pattern));\n }\n\n private parse(pattern: string): string | RegExp {\n if (pattern.length > this.maxLength) {\n throw new TypeError('Pattern is too long');\n }\n let regExp;\n let hasSpecialCharacter = false;\n if (pattern === '') return '';\n\n const re = pattern.replace(/\\*/g, () => {\n hasSpecialCharacter = true;\n return '.+?';\n });\n\n // skip the regexp for non-* patterns\n // unescape anything in it, though, so that it'll be\n // an exact match.\n if (!hasSpecialCharacter) {\n return pattern.replace(/\\\\(.)/g, '$1');\n }\n\n try {\n regExp = new RegExp('^' + re + '$');\n } catch (error) {\n // If it was an invalid regular expression, then it can't match\n // anything.\n return new RegExp('$.');\n }\n\n return regExp;\n }\n\n private matchOne(str: string, pattern: string | RegExp): boolean {\n if (typeof pattern === 'string') {\n return str === pattern;\n }\n\n return Boolean(str.match(pattern));\n }\n}\n","/*\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n so it's better encapsulated. Now you can have multiple random number generators\n and they won't stomp all over each other's state.\n If you want to use this as a substitute for Math.random(), use the random()\n method like so:\n var m = new MersenneTwister();\n var randomNumber = m.random();\n You can also call the other genrand_{foo}() methods on the instance.\n If you want to use a specific seed in order to get a repeatable random\n sequence, pass an integer into the constructor:\n var m = new MersenneTwister(123);\n and that will always produce the same random sequence.\n Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n Before using, initialize the state by using init_seed(seed)\n or init_by_array(init_key, key_length).\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nexport class MersenneTwister {\n private readonly N: number;\n private readonly M: number;\n private readonly MATRIX_A: number;\n private readonly UPPER_MASK: number;\n private readonly LOWER_MASK: number;\n private readonly mt: number[];\n private mti: number;\n\n constructor(seed?: number | number[]) {\n /* Period parameters */\n this.N = 624;\n this.M = 397;\n this.MATRIX_A = 0x9908b0df; /* constant vector a */\n this.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n this.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n this.mt = new Array(this.N); /* the array for the state vector */\n this.mti = this.N + 1; /* mti==N+1 means mt[N] is not initialized */\n\n if (Array.isArray(seed)) {\n if (seed.length > 0) this.initByArray(seed, seed.length);\n } else {\n if (seed === undefined) {\n this.initSeed(new Date().getTime());\n } else {\n this.initSeed(seed);\n }\n }\n }\n\n /* initializes mt[N] with a seed */\n /* origin name init_genrand */\n initSeed(seed: number): void {\n this.mt[0] = seed >>> 0;\n for (this.mti = 1; this.mti < this.N; this.mti++) {\n const s = this.mt[this.mti - 1] ^ (this.mt[this.mti - 1] >>> 30);\n this.mt[this.mti] =\n ((((s & 0xffff0000) >>> 16) * 1812433253) << 16) +\n (s & 0x0000ffff) * 1812433253 +\n this.mti;\n /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n /* In the previous versions, MSBs of the seed affect */\n /* only MSBs of the array mt[]. */\n /* 2002/01/09 modified by Makoto Matsumoto */\n this.mt[this.mti] >>>= 0;\n /* for >32 bit machines */\n }\n }\n\n /* initialize by an array with array-length */\n /* init_key is the array for initializing keys */\n /* key_length is its length */\n /* slight change for C++, 2004/2/26 */\n initByArray(initKey: number[], keyLength: number): void {\n this.initSeed(19650218);\n let i = 1;\n let j = 0;\n let k = this.N > keyLength ? this.N : keyLength;\n for (; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\n (s & 0x0000ffff) * 1664525)) +\n initKey[j] +\n j; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n j++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n if (j >= keyLength) j = 0;\n }\n for (k = this.N - 1; k; k--) {\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\n this.mt[i] =\n (this.mt[i] ^\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\n (s & 0x0000ffff) * 1566083941)) -\n i; /* non linear */\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n i++;\n if (i >= this.N) {\n this.mt[0] = this.mt[this.N - 1];\n i = 1;\n }\n }\n\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n }\n\n /* generates a random number on [0,0xffffffff]-interval */\n /* origin name genrand_int32 */\n randomInt32(): number {\n let y;\n const mag01 = [0x0, this.MATRIX_A];\n /* mag01[x] = x * MATRIX_A for x=0,1 */\n\n if (this.mti >= this.N) {\n /* generate N words at one time */\n let kk;\n\n if (this.mti === this.N + 1)\n /* if init_seed() has not been called, */\n this.initSeed(5489); /* a default initial seed is used */\n\n for (kk = 0; kk < this.N - this.M; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] = this.mt[kk + this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n for (; kk < this.N - 1; kk++) {\n y =\n (this.mt[kk] & this.UPPER_MASK) | (this.mt[kk + 1] & this.LOWER_MASK);\n this.mt[kk] =\n this.mt[kk + (this.M - this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\n }\n y =\n (this.mt[this.N - 1] & this.UPPER_MASK) |\n (this.mt[0] & this.LOWER_MASK);\n this.mt[this.N - 1] = this.mt[this.M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n this.mti = 0;\n }\n\n y = this.mt[this.mti++];\n\n /* Tempering */\n y ^= y >>> 11;\n y ^= (y << 7) & 0x9d2c5680;\n y ^= (y << 15) & 0xefc60000;\n y ^= y >>> 18;\n\n return y >>> 0;\n }\n\n /* generates a random number on [0,0x7fffffff]-interval */\n /* origin name genrand_int31 */\n randomInt31(): number {\n return this.randomInt32() >>> 1;\n }\n\n /* generates a random number on [0,1]-real-interval */\n /* origin name genrand_real1 */\n randomReal1(): number {\n return this.randomInt32() * (1.0 / 4294967295.0);\n /* divided by 2^32-1 */\n }\n\n /* generates a random number on [0,1)-real-interval */\n /* origin name genrand_real2 */\n randomReal2(): number {\n return this.randomInt32() * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on (0,1)-real-interval */\n /* origin name genrand_real3 */\n randomReal3(): number {\n return (this.randomInt32() + 0.5) * (1.0 / 4294967296.0);\n /* divided by 2^32 */\n }\n\n /* generates a random number on [0,1) with 53-bit resolution*/\n /* origin name genrand_res53 */\n randomRes53(): number {\n const a = this.randomInt32() >>> 5;\n const b = this.randomInt32() >>> 6;\n return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);\n }\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n","import { MersenneTwister } from './mersenneTwister';\n\nconst replacePlaceholders = (mersenne: MersenneTwister) => (\n placeholder: string\n): string => {\n const random = Math.floor(mersenne.randomReal2() * 16);\n\n const value = placeholder === 'x' ? random : (random & 0x3) | 0x8;\n return value.toString(16);\n};\n\n/**\n * Generate a uuid.\n *\n * @private\n * @since 3.5.0\n * @returns {string} Returns the generated uuid.\n * @example\n * ```javascript\n * generateUUID()\n * // => 49e71c40-9b21-4371-9699-2def33f62e66\n *\n * generateUUID()\n * // => da94f128-4247-48e3-bc73-d0cae46b5093\n * ```\n */\nexport function generateUUID(): string {\n const mersenne = new MersenneTwister();\n const RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n\n return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders(mersenne));\n}\n","/**\n * Boolean matching.\n *\n * @since 4.7.0\n * @category Boolean\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * bool(true, true)\n * // => true\n *\n * bool(true, false)\n * // => false\n * ```\n */\nexport function bool(data: boolean, expected: boolean): boolean {\n return (\n data === expected\n );\n}\n","export type DateType = Date | string;\n\nexport const convertDate = (date: DateType): number=>{\n if(date instanceof Date){\n return date.getTime();\n }\n\n return Date.parse(date);\n}","import {DateType, convertDate} from './convertDate';\n\n/**\n * Exact date matching.\n *\n * @since 4.8.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * dateEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateEquals('December 15, 2000 03:24:00', 'December 10, 2001 03:24:00')\n * // => false\n * ```\n */\nexport function dateEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData === convertedExpectation\n );\n}\n","import { DateType, convertDate } from './convertDate';\n\n/**\n * Matching after a specific date and time\n *\n * @since 4.11.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is after than `expected value`.\n * @example\n * ```javascript\n * dateGreaterThan('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateGreaterThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateGreaterThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return convertedData > convertedExpectation;\n}\n","import { DateType, convertDate } from './convertDate';\n\n/**\n * Matching at or after a specific date and time\n *\n * @since 4.11.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is after than or equals `expected value`.\n * @example\n * ```javascript\n * dateGreaterThanEquals('December 17, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateGreaterThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:25:00')\n * // => false\n * ```\n */\nexport function dateGreaterThanEquals(\n data: DateType,\n expected: DateType\n): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return convertedData >= convertedExpectation;\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is before than `expected value`.\n * @example\n * ```javascript\n * dateLessThan('December 15, 1994 03:24:00', 'December 16, 1994 03:24:00')\n * // => true\n *\n * dateLessThan('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThan(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData < convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Matching at or before a specific date and time\n *\n * @since 4.10.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal or before than `expected value`.\n * @example\n * ```javascript\n * dateLessThanEquals('December 15, 1994 03:24:00', 'December 15, 1994 03:24:00')\n * // => true\n *\n * dateLessThanEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateLessThanEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData <= convertedExpectation\n );\n}\n","import {DateType, convertDate} from './convertDate';\n\n/**\n * Negated date matching.\n *\n * @since 4.9.0\n * @category Date\n * @param {Date} data The value to be compared.\n * @param {Date} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * dateNotEquals('December 15, 1994 03:24:00', 'December 16, 1995 03:24:00')\n * // => true\n *\n * dateNotEquals('December 15, 2000 03:24:00', 'December 15, 2000 03:24:00')\n * // => false\n * ```\n */\nexport function dateNotEquals(data: DateType, expected: DateType): boolean {\n const convertedData = convertDate(data);\n const convertedExpectation = convertDate(expected);\n return (\n convertedData !== convertedExpectation\n );\n}\n","/**\n * Exact numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * numericEquals(5, 5)\n * // => true\n *\n * numericEquals(2, 4)\n * // => false\n * ```\n */\nexport function numericEquals(data: number, expected: number): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Numeric greater than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than `expected value`.\n * @example\n * ```javascript\n * numericGreaterThan(6, 5)\n * // => true\n *\n * numericGreaterThan(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThan(data: number, expected: number): boolean {\n return (\n data > expected\n );\n}\n","/**\n * Numeric greater than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is greater than or equals `expected value`.\n * @example\n * ```javascript\n * numericGreaterThanEquals(5, 5)\n * // => true\n *\n * numericGreaterThanEquals(4, 8)\n * // => false\n * ```\n */\nexport function numericGreaterThanEquals(data: number, expected: number): boolean {\n return (\n data >= expected\n );\n}\n","/**\n * Numeric less than matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than `expected value`.\n * @example\n * ```javascript\n * numericLessThan(5, 6)\n * // => true\n *\n * numericLessThan(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThan(data: number, expected: number): boolean {\n return (\n data < expected\n );\n}\n","/**\n * Numeric less than or equals matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is less than or equals `expected value`.\n * @example\n * ```javascript\n * numericLessThanEquals(5, 5)\n * // => true\n *\n * numericLessThanEquals(8, 4)\n * // => false\n * ```\n */\nexport function numericLessThanEquals(data: number, expected: number): boolean {\n return (\n data <= expected\n );\n}\n","/**\n * Negated numeric matching.\n *\n * @since 4.6.0\n * @category Numeric\n * @param {number} data The value to be compared.\n * @param {number} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * numericNotEquals(2, 4)\n * // => true\n *\n * numericNotEquals(5, 5)\n * // => false\n * ```\n */\nexport function numericNotEquals(data: number, expected: number): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Exact string matching, case sensitive.\n *\n * @since 4.3.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEquals('hi', 'hi')\n * // => true\n *\n * stringEquals('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEquals(data: string, expected: string): boolean {\n return (\n data === expected\n );\n}\n","/**\n * Exact string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal to `expected value`.\n * @example\n * ```javascript\n * stringEqualsIgnoreCase('hi', 'Hi')\n * // => true\n *\n * stringEqualsIgnoreCase('hi', 'no')\n * // => false\n * ```\n */\nexport function stringEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() === expected.toLowerCase()\n );\n}\n","import {Matcher} from '../../Matcher';\n\n/**\n * Case-sensitive matching. The values can include a multi-character match wildcard (*) anywhere in the string.\n *\n * @since 4.5.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal like `expected value`.\n * @example\n * ```javascript\n * stringLike('newHouse', 'new*')\n * // => true\n *\n * stringLike('House', 'new*')\n * // => false\n * ```\n */\nexport function stringLike(data: string, expected: string): boolean {\n return (\n new Matcher(data).match(expected)\n );\n}\n","import {stringLike} from './stringLike';\n\n/**\n * Case-sensitive matching if exist. The values can include a multi-character match wildcard (*) anywhere in the string.\n *\n * @since 4.12.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is equal like `expected value` or if it does not exist.\n * @example\n * ```javascript\n * stringLikeIfExists(undefined, 'new*')\n * // => true\n *\n * stringLikeIfExists('House', 'new*')\n * // => false\n * ```\n */\nexport function stringLikeIfExists(data: string | undefined, expected: string): boolean {\n return data?(\n stringLike(data,expected)\n ):true;\n}\n","/**\n * Negated string matching.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEquals('hi', 'no')\n * // => true\n * \n * stringNotEquals('hi', 'hi')\n * // => false\n * ```\n */\nexport function stringNotEquals(data: string, expected: string): boolean {\n return (\n data !== expected\n );\n}\n","/**\n * Negated string matching, ignoring case.\n *\n * @since 4.4.0\n * @category String\n * @param {string} data The value to be compared.\n * @param {string} expected The expected value.\n * @returns {boolean} Returns `true` if `value` is not equal to `expected value`.\n * @example\n * ```javascript\n * stringNotEqualsIgnoreCase('hi', 'no')\n * // => true\n * \n * stringNotEqualsIgnoreCase('hi', 'Hi')\n * // => false\n * ```\n */\nexport function stringNotEqualsIgnoreCase(data: string, expected: string): boolean {\n return (\n data.toLowerCase() !== expected.toLowerCase()\n );\n}\n","import { bool } from './boolean/bool';\nimport { dateEquals } from './date/dateEquals';\nimport { dateGreaterThan } from './date/dateGreaterThan';\nimport { dateGreaterThanEquals } from './date/dateGreaterThanEquals';\nimport { dateLessThan } from './date/dateLessThan';\nimport { dateLessThanEquals } from './date/dateLessThanEquals';\nimport { dateNotEquals } from './date/dateNotEquals';\nimport { numericEquals } from './numeric/numericEquals';\nimport { numericGreaterThan } from './numeric/numericGreaterThan';\nimport { numericGreaterThanEquals } from './numeric/numericGreaterThanEquals';\nimport { numericLessThan } from './numeric/numericLessThan';\nimport { numericLessThanEquals } from './numeric/numericLessThanEquals';\nimport { numericNotEquals } from './numeric/numericNotEquals';\nimport { stringEquals } from './string/stringEquals';\nimport { stringEqualsIgnoreCase } from './string/stringEqualsIgnoreCase';\nimport { stringLike } from './string/stringLike';\nimport { stringLikeIfExists } from './string/stringLikeIfExists';\nimport { stringNotEquals } from './string/stringNotEquals';\nimport { stringNotEqualsIgnoreCase } from './string/stringNotEqualsIgnoreCase';\n\nexport const operators: Record = {\n bool,\n dateEquals,\n dateGreaterThan,\n dateGreaterThanEquals,\n dateLessThan,\n dateLessThanEquals,\n dateNotEquals,\n numericEquals,\n numericGreaterThan,\n numericGreaterThanEquals,\n numericLessThan,\n numericLessThanEquals,\n numericNotEquals,\n stringEquals,\n stringEqualsIgnoreCase,\n stringLike,\n stringLikeIfExists,\n stringNotEquals,\n stringNotEqualsIgnoreCase\n};\n","import {\n EffectBlock,\n ConditionBlock,\n StatementInterface,\n MatchConditionInterface,\n MatchConditionResolverInterface\n} from './types';\nimport { getValueFromPath } from './utils/getValueFromPath';\nimport { generateUUID } from './utils/generateUUID';\nimport {operators} from './conditionOperators';\n\nabstract class Statement {\n protected sid: string;\n protected readonly condition?: ConditionBlock;\n effect: EffectBlock;\n\n constructor({ sid, effect = 'allow', condition }: StatementInterface) {\n if (!sid) {\n this.sid = generateUUID();\n } else {\n this.sid = sid;\n }\n this.effect = effect;\n this.condition = condition;\n }\n\n matchConditions(\n this: Statement,\n { context, conditionResolver }: MatchConditionInterface\n ): boolean {\n const { condition: conditions } = this;\n\n if(conditions && context){\n return Object.keys(conditions).every((condition) =>\n Object.keys(conditions[condition]).every((path) => {\n const conditionValues = conditions[condition][path];\n if (conditionValues instanceof Array) {\n return conditionValues.some((value) =>\n this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value\n })\n );\n }\n\n return this.evaluateCondition({\n context,\n conditionResolver,\n condition,\n path,\n value: conditionValues\n });\n })\n )\n }\n\n return true;\n }\n\n private evaluateCondition(\n this: Statement,\n { context, conditionResolver={}, path, value, condition }: MatchConditionResolverInterface\n ): boolean {\n\n const currentResolver= conditionResolver[condition] || operators[condition]\n\n if(currentResolver){\n return currentResolver(\n getValueFromPath(context, path),\n value\n )\n }\n return false;\n }\n}\n\nexport { Statement };\n","import { ActionBasedType, MatchActionBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ActionBased extends Statement {\n private action?: string[];\n private notAction?: string[];\n private statement: ActionBasedType;\n\n constructor(action: ActionBasedType) {\n super(action);\n this.checkAndAssignActions(action);\n this.statement = { ...action, sid: this.sid };\n }\n\n getStatement(this: ActionBased): ActionBasedType {\n return this.statement;\n }\n\n matches(\n this: ActionBased,\n { action, context, conditionResolver }: MatchActionBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(action: ActionBasedType): void {\n const hasAction = 'action' in action;\n const hasNotAction = 'notAction' in action;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ActionBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in action) {\n this.action =\n typeof action.action === 'string' ? [action.action] : action.action;\n } else {\n this.notAction =\n typeof action.notAction === 'string'\n ? [action.notAction]\n : action.notAction;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n}\n\nexport { ActionBased };\n","import { IdentityBasedType, MatchIdentityBasedInterface } from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass IdentityBased extends Statement {\n private resource?: string[];\n private action?: string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: IdentityBasedType;\n\n constructor(identity: IdentityBasedType) {\n super(identity);\n this.checkAndAssignActions(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: IdentityBased): IdentityBasedType {\n return this.statement;\n }\n\n matches(\n this: IdentityBased,\n {\n action,\n resource,\n context,\n conditionResolver\n }: MatchIdentityBasedInterface\n ): boolean {\n return (\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n private checkAndAssignActions(identity: IdentityBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'IdentityBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignResources(identity: IdentityBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'IdentityBased statement should have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n } else {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n }\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { IdentityBased };\n","import {\n PrincipalMap,\n MatchResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { Matcher } from './Matcher';\nimport { Statement } from './Statement';\nimport { applyContext } from './utils/applyContext';\n\nclass ResourceBased extends Statement {\n private principal?: PrincipalMap | string[];\n private resource?: string[];\n private action?: string[];\n private notPrincipal?: PrincipalMap | string[];\n private notResource?: string[];\n private notAction?: string[];\n private statement: ResourceBasedType;\n private hasPrincipals: boolean;\n private hasResources: boolean;\n\n constructor(identity: ResourceBasedType) {\n super(identity);\n this.hasPrincipals = false;\n this.hasResources = false;\n this.checkAndAssignActions(identity);\n this.checkAndAssignPrincipals(identity);\n this.checkAndAssignResources(identity);\n this.statement = { ...identity, sid: this.sid };\n }\n\n getStatement(this: ResourceBased): ResourceBasedType {\n return this.statement;\n }\n\n matches(\n this: ResourceBased,\n {\n principal,\n action,\n resource,\n principalType,\n context,\n conditionResolver\n }: MatchResourceBasedInterface\n ): boolean {\n return (\n this.matchPrincipalAndNotPrincipal(principal, principalType, context) &&\n this.matchActions(action, context) &&\n this.matchNotActions(action, context) &&\n this.matchResourceAndNotResource(resource, context) &&\n this.matchConditions({ context, conditionResolver })\n );\n }\n\n /*valueComing principal noPrincipal\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchPrincipalAndNotPrincipal(\n principal?: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (principal) {\n if (this.hasPrincipals)\n return (\n this.matchPrincipals(principal, principalType, context) &&\n this.matchNotPrincipals(principal, principalType, context)\n );\n return false;\n }\n if (this.hasPrincipals) return false;\n return true;\n }\n\n /*valueComing resource noResource\n true false false false\n true true false true or false\n true false true true or false\n false false false true\n false true false false\n false false true false*/\n private matchResourceAndNotResource(resource?: string, context?: T): boolean {\n if (resource) {\n if (this.hasResources)\n return (\n this.matchResources(resource, context) &&\n this.matchNotResources(resource, context)\n );\n return false;\n }\n if (this.hasResources) return false;\n return true;\n }\n\n private checkAndAssignActions(identity: ResourceBasedType): void {\n const hasAction = 'action' in identity;\n const hasNotAction = 'notAction' in identity;\n if (hasAction && hasNotAction) {\n throw new TypeError(\n 'ResourceBased statement should have an action or a notAction attribute, no both'\n );\n }\n if ('action' in identity) {\n this.action =\n typeof identity.action === 'string'\n ? [identity.action]\n : identity.action;\n } else {\n this.notAction =\n typeof identity.notAction === 'string'\n ? [identity.notAction]\n : identity.notAction;\n }\n }\n\n private checkAndAssignPrincipals(identity: ResourceBasedType): void {\n const hasPrincipal = 'principal' in identity;\n const hasNotPrincipal = 'notPrincipal' in identity;\n if (hasPrincipal && hasNotPrincipal) {\n throw new TypeError(\n 'ResourceBased statement could have a principal or a notPrincipal attribute, no both'\n );\n }\n if ('principal' in identity) {\n this.principal =\n typeof identity.principal === 'string'\n ? [identity.principal]\n : identity.principal;\n this.hasPrincipals = true;\n } else if ('notPrincipal' in identity) {\n this.notPrincipal =\n typeof identity.notPrincipal === 'string'\n ? [identity.notPrincipal]\n : identity.notPrincipal;\n this.hasPrincipals = true;\n }\n }\n\n private checkAndAssignResources(identity: ResourceBasedType): void {\n const hasResource = 'resource' in identity;\n const hasNotResource = 'notResource' in identity;\n if (hasResource && hasNotResource) {\n throw new TypeError(\n 'ResourceBased statement could have a resource or a notResource attribute, no both'\n );\n }\n if ('resource' in identity) {\n this.resource =\n typeof identity.resource === 'string'\n ? [identity.resource]\n : identity.resource;\n this.hasResources = true;\n } else if ('notResource' in identity) {\n this.notResource =\n typeof identity.notResource === 'string'\n ? [identity.notResource]\n : identity.notResource;\n this.hasResources = true;\n }\n }\n\n private matchPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.principal) {\n if (this.principal instanceof Array) {\n return principalType\n ? false\n : this.principal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.principal[principalType];\n if (principalValues instanceof Array) {\n return principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return false;\n }\n return false;\n }\n }\n return true;\n }\n\n private matchNotPrincipals(\n principal: string,\n principalType?: string,\n context?: T\n ): boolean {\n if (this.notPrincipal) {\n if (this.notPrincipal instanceof Array) {\n return principalType\n ? true\n : !this.notPrincipal.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else {\n if (principalType) {\n const principalValues = this.notPrincipal[principalType];\n if (principalValues instanceof Array) {\n return !principalValues.some((a) =>\n new Matcher(applyContext(a, context)).match(principal)\n );\n } else if (principalValues) {\n return !new Matcher(applyContext(principalValues, context)).match(\n principal\n );\n }\n return true;\n }\n return true;\n }\n }\n return true;\n }\n\n private matchActions(action: string, context?: T): boolean {\n return this.action\n ? this.action.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchNotActions(action: string, context?: T): boolean {\n return this.notAction\n ? !this.notAction.some((a) =>\n new Matcher(applyContext(a, context)).match(action)\n )\n : true;\n }\n\n private matchResources(resource: string, context?: T): boolean {\n return this.resource\n ? this.resource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n\n private matchNotResources(resource: string, context?: T): boolean {\n return this.notResource\n ? !this.notResource.some((a) =>\n new Matcher(applyContext(a, context)).match(resource)\n )\n : true;\n }\n}\n\nexport { ResourceBased };\n","import { MatchConditionInterface, ConditionResolver } from './types';\n\nabstract class Policy {\n protected context?: T;\n protected conditionResolver?: ConditionResolver;\n\n constructor({ context, conditionResolver }: MatchConditionInterface) {\n this.context = context;\n this.conditionResolver = conditionResolver;\n }\n\n setContext(this: Policy, context: T): void {\n this.context = context;\n }\n\n getContext(this: Policy): T | undefined {\n return this.context;\n }\n\n setConditionResolver(\n this: Policy,\n conditionResolver: ConditionResolver\n ): void {\n this.conditionResolver = conditionResolver;\n }\n\n getConditionResolver(this: Policy): ConditionResolver | undefined {\n return this.conditionResolver;\n }\n\n abstract getStatements(this: Policy): U[];\n}\n\nexport { Policy };\n","import {\n ActionBasedType,\n ConditionResolver,\n EvaluateActionBasedInterface,\n ProxyOptions\n} from './types';\nimport { ActionBased } from './ActionBasedStatement';\nimport { Policy } from './Policy';\n\nexport interface ActionBasedPolicyInterface {\n statements: ActionBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ActionBasedPolicy extends Policy<\n T,\n ActionBasedType\n> {\n private denyStatements: ActionBased[];\n private allowStatements: ActionBased[];\n private statements: ActionBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ActionBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ActionBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void {\n const statementInstance = new ActionBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ActionBasedPolicy): ActionBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n const args = { action, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n whyCan(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): ActionBasedType[] {\n return this.allowStatements.reduce((statements, currentStatement) => {\n const matches = currentStatement.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n });\n if (matches) {\n return [...statements, currentStatement.getStatement()];\n }\n return statements;\n }, [] as ActionBasedType[]);\n }\n\n cannot(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n whyCannot(\n this: ActionBasedPolicy,\n { action, context }: EvaluateActionBasedInterface\n ): ActionBasedType[] {\n return this.denyStatements.reduce((statements, currentStatement) => {\n const matches = currentStatement.matches({\n action,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n });\n if (matches) {\n return [...statements, currentStatement.getStatement()];\n }\n return statements;\n }, [] as ActionBasedType[]);\n }\n\n generateProxy(\n this: ActionBasedPolicy,\n obj: U,\n options: ProxyOptions = {}\n ): U {\n const { get = {}, set = {} } = options;\n const { allow: allowGet = true, propertyMap: propertyMapGet = {} } = get;\n const { allow: allowSet = true, propertyMap: propertyMapSet = {} } = set;\n const handler = {\n ...(allowGet\n ? {\n get: (target: U, prop: string | symbol): any => {\n const property = Reflect.has(propertyMapGet, prop)\n ? Reflect.get(propertyMapGet, prop)\n : prop;\n if (typeof prop === 'string') {\n if (this.evaluate({ action: property })) {\n return Reflect.get(target, prop);\n } else {\n throw new Error(`Unauthorize to get ${prop} property`);\n }\n } else {\n return Reflect.get(target, prop);\n }\n }\n }\n : {}),\n ...(allowSet\n ? {\n set: (target: U, prop: string | symbol, value: any): boolean => {\n const property = Reflect.has(propertyMapSet, prop)\n ? Reflect.get(propertyMapSet, prop)\n : prop;\n if (typeof prop === 'string') {\n if (this.evaluate({ action: property })) {\n return Reflect.set(target, prop, value);\n } else {\n throw new Error(`Unauthorize to set ${prop} property`);\n }\n } else {\n return false;\n }\n }\n }\n : {})\n };\n\n return new Proxy(obj, handler);\n }\n}\n","import {\n ConditionResolver,\n EvaluateIdentityBasedInterface,\n IdentityBasedType\n} from './types';\nimport { IdentityBased } from './IdentityBasedStatement';\nimport { Policy } from './Policy';\n\ninterface IdentityBasedPolicyInterface {\n statements: IdentityBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class IdentityBasedPolicy extends Policy<\n T,\n IdentityBasedType\n> {\n private denyStatements: IdentityBased[];\n private allowStatements: IdentityBased[];\n private statements: IdentityBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: IdentityBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new IdentityBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: IdentityBasedPolicy,\n statement: IdentityBasedType\n ): void {\n const statementInstance = new IdentityBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: IdentityBasedPolicy): IdentityBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n const args = { action, resource, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: IdentityBasedPolicy,\n { action, resource, context }: EvaluateIdentityBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n action,\n resource,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n","import {\n ConditionResolver,\n EvaluateResourceBasedInterface,\n ResourceBasedType\n} from './types';\nimport { ResourceBased } from './ResourceBasedStatement';\nimport { Policy } from './Policy';\n\ninterface ResourceBasedPolicyInterface {\n statements: ResourceBasedType[];\n conditionResolver?: ConditionResolver;\n context?: T;\n}\n\nexport class ResourceBasedPolicy extends Policy<\n T,\n ResourceBasedType\n> {\n private denyStatements: ResourceBased[];\n private allowStatements: ResourceBased[];\n private statements: ResourceBasedType[];\n\n constructor({\n statements,\n conditionResolver,\n context\n }: ResourceBasedPolicyInterface) {\n super({ context, conditionResolver });\n const statementInstances = statements.map(\n (statement) => new ResourceBased(statement)\n );\n this.allowStatements = statementInstances.filter(\n (s) => s.effect === 'allow'\n );\n this.denyStatements = statementInstances.filter((s) => s.effect === 'deny');\n this.statements = statementInstances.map((statement) =>\n statement.getStatement()\n );\n }\n\n addStatement(\n this: ResourceBasedPolicy,\n statement: ResourceBasedType\n ): void {\n const statementInstance = new ResourceBased(statement);\n if (statementInstance.effect === 'allow') {\n this.allowStatements.push(statementInstance);\n } else {\n this.denyStatements.push(statementInstance);\n }\n this.statements.push(statementInstance.getStatement());\n }\n\n getStatements(this: ResourceBasedPolicy): ResourceBasedType[] {\n return this.statements;\n }\n\n evaluate(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n const args = { principal, action, resource, principalType, context };\n return !this.cannot(args) && this.can(args);\n }\n\n can(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.allowStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n\n cannot(\n this: ResourceBasedPolicy,\n {\n principal,\n action,\n resource,\n principalType,\n context\n }: EvaluateResourceBasedInterface\n ): boolean {\n return this.denyStatements.some((s) =>\n s.matches({\n principal,\n action,\n resource,\n principalType,\n context: context || this.context,\n conditionResolver: this.conditionResolver\n })\n );\n }\n}\n"],"names":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;KAC7C;IAED,GAAG,CAED,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KACjC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;IAED,MAAM,CAEJ,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,EACb,OAAO,EAC2B;QAEpC,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAChC,CAAC,CAAC,OAAO,CAAC;YACR,SAAS;YACT,MAAM;YACN,QAAQ;YACR,aAAa;YACb,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO;YAChC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC,CACH,CAAC;KACH;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/tsdoc-metadata.json b/dist/tsdoc-metadata.json new file mode 100644 index 0000000..5e804b3 --- /dev/null +++ b/dist/tsdoc-metadata.json @@ -0,0 +1,11 @@ +// This file is read by tools that parse documentation comments conforming to the TSDoc standard. +// It should be published with your NPM package. It should not be tracked by Git. +{ + "tsdocVersion": "0.12", + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", + "packageVersion": "7.18.19" + } + ] +} diff --git a/docs/gitbook/api/iam-policies.actionbased._constructor_.md b/docs/gitbook/api/iam-policies.actionbased._constructor_.md new file mode 100644 index 0000000..9658bba --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbased._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBased](./iam-policies.actionbased.md) > [(constructor)](./iam-policies.actionbased._constructor_.md) + +## ActionBased.(constructor) + +Constructs a new instance of the `ActionBased` class + +Signature: + +```typescript +constructor(action: ActionBasedType); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| action | ActionBasedType | | + diff --git a/docs/gitbook/api/iam-policies.actionbased.getstatement.md b/docs/gitbook/api/iam-policies.actionbased.getstatement.md new file mode 100644 index 0000000..ec769ec --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbased.getstatement.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBased](./iam-policies.actionbased.md) > [getStatement](./iam-policies.actionbased.getstatement.md) + +## ActionBased.getStatement() method + +Signature: + +```typescript +getStatement(this: ActionBased): ActionBasedType; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBased<T> | | + +Returns: + +ActionBasedType + diff --git a/docs/gitbook/api/iam-policies.actionbased.matches.md b/docs/gitbook/api/iam-policies.actionbased.matches.md new file mode 100644 index 0000000..fcc77e0 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbased.matches.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBased](./iam-policies.actionbased.md) > [matches](./iam-policies.actionbased.matches.md) + +## ActionBased.matches() method + +Signature: + +```typescript +matches(this: ActionBased, { action, context, conditionResolver }: MatchActionBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBased<T> | | +| { action, context, conditionResolver } | MatchActionBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.actionbased.md b/docs/gitbook/api/iam-policies.actionbased.md new file mode 100644 index 0000000..0bf4d5f --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbased.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBased](./iam-policies.actionbased.md) + +## ActionBased class + +Signature: + +```typescript +declare class ActionBased extends Statement +``` +Extends: Statement<T> + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(action)](./iam-policies.actionbased._constructor_.md) | | Constructs a new instance of the ActionBased class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [getStatement(this)](./iam-policies.actionbased.getstatement.md) | | | +| [matches(this, { action, context, conditionResolver })](./iam-policies.actionbased.matches.md) | | | + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy._constructor_.md b/docs/gitbook/api/iam-policies.actionbasedpolicy._constructor_.md new file mode 100644 index 0000000..1999b71 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [(constructor)](./iam-policies.actionbasedpolicy._constructor_.md) + +## ActionBasedPolicy.(constructor) + +Constructs a new instance of the `ActionBasedPolicy` class + +Signature: + +```typescript +constructor({ statements, conditionResolver, context }: ActionBasedPolicyInterface); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { statements, conditionResolver, context } | ActionBasedPolicyInterface<T> | | + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.addstatement.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.addstatement.md new file mode 100644 index 0000000..5fd4549 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.addstatement.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [addStatement](./iam-policies.actionbasedpolicy.addstatement.md) + +## ActionBasedPolicy.addStatement() method + +Signature: + +```typescript +addStatement(this: ActionBasedPolicy, statement: ActionBasedType): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBasedPolicy<T> | | +| statement | ActionBasedType | | + +Returns: + +void + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.can.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.can.md new file mode 100644 index 0000000..95a3341 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.can.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [can](./iam-policies.actionbasedpolicy.can.md) + +## ActionBasedPolicy.can() method + +Signature: + +```typescript +can(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBasedPolicy<T> | | +| { action, context } | EvaluateActionBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.cannot.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.cannot.md new file mode 100644 index 0000000..37f82e6 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.cannot.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [cannot](./iam-policies.actionbasedpolicy.cannot.md) + +## ActionBasedPolicy.cannot() method + +Signature: + +```typescript +cannot(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBasedPolicy<T> | | +| { action, context } | EvaluateActionBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.evaluate.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.evaluate.md new file mode 100644 index 0000000..3858751 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.evaluate.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [evaluate](./iam-policies.actionbasedpolicy.evaluate.md) + +## ActionBasedPolicy.evaluate() method + +Signature: + +```typescript +evaluate(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBasedPolicy<T> | | +| { action, context } | EvaluateActionBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.generateproxy.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.generateproxy.md new file mode 100644 index 0000000..f7e0fe9 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.generateproxy.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [generateProxy](./iam-policies.actionbasedpolicy.generateproxy.md) + +## ActionBasedPolicy.generateProxy() method + +Signature: + +```typescript +generateProxy(this: ActionBasedPolicy, obj: U, options?: ProxyOptions): U; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBasedPolicy<T> | | +| obj | U | | +| options | ProxyOptions | | + +Returns: + +U + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.getstatements.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.getstatements.md new file mode 100644 index 0000000..ce520fc --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.getstatements.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [getStatements](./iam-policies.actionbasedpolicy.getstatements.md) + +## ActionBasedPolicy.getStatements() method + +Signature: + +```typescript +getStatements(this: ActionBasedPolicy): ActionBasedType[]; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBasedPolicy<T> | | + +Returns: + +ActionBasedType\[\] + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.md new file mode 100644 index 0000000..46d1cb3 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.md @@ -0,0 +1,32 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) + +## ActionBasedPolicy class + +Signature: + +```typescript +declare class ActionBasedPolicy extends Policy +``` +Extends: Policy<T, ActionBasedType> + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)({ statements, conditionResolver, context })](./iam-policies.actionbasedpolicy._constructor_.md) | | Constructs a new instance of the ActionBasedPolicy class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addStatement(this, statement)](./iam-policies.actionbasedpolicy.addstatement.md) | | | +| [can(this, { action, context })](./iam-policies.actionbasedpolicy.can.md) | | | +| [cannot(this, { action, context })](./iam-policies.actionbasedpolicy.cannot.md) | | | +| [evaluate(this, { action, context })](./iam-policies.actionbasedpolicy.evaluate.md) | | | +| [generateProxy(this, obj, options)](./iam-policies.actionbasedpolicy.generateproxy.md) | | | +| [getStatements(this)](./iam-policies.actionbasedpolicy.getstatements.md) | | | +| [whyCan(this, { action, context })](./iam-policies.actionbasedpolicy.whycan.md) | | | +| [whyCannot(this, { action, context })](./iam-policies.actionbasedpolicy.whycannot.md) | | | + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.whycan.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.whycan.md new file mode 100644 index 0000000..25fb87b --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.whycan.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [whyCan](./iam-policies.actionbasedpolicy.whycan.md) + +## ActionBasedPolicy.whyCan() method + +Signature: + +```typescript +whyCan(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): ActionBasedType[]; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBasedPolicy<T> | | +| { action, context } | EvaluateActionBasedInterface<T> | | + +Returns: + +ActionBasedType\[\] + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicy.whycannot.md b/docs/gitbook/api/iam-policies.actionbasedpolicy.whycannot.md new file mode 100644 index 0000000..d270cc8 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicy.whycannot.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) > [whyCannot](./iam-policies.actionbasedpolicy.whycannot.md) + +## ActionBasedPolicy.whyCannot() method + +Signature: + +```typescript +whyCannot(this: ActionBasedPolicy, { action, context }: EvaluateActionBasedInterface): ActionBasedType[]; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ActionBasedPolicy<T> | | +| { action, context } | EvaluateActionBasedInterface<T> | | + +Returns: + +ActionBasedType\[\] + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.conditionresolver.md b/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.conditionresolver.md new file mode 100644 index 0000000..45871b9 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.conditionresolver.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicyInterface](./iam-policies.actionbasedpolicyinterface.md) > [conditionResolver](./iam-policies.actionbasedpolicyinterface.conditionresolver.md) + +## ActionBasedPolicyInterface.conditionResolver property + +Signature: + +```typescript +conditionResolver?: ConditionResolver; +``` diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.context.md b/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.context.md new file mode 100644 index 0000000..e5328dd --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.context.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicyInterface](./iam-policies.actionbasedpolicyinterface.md) > [context](./iam-policies.actionbasedpolicyinterface.context.md) + +## ActionBasedPolicyInterface.context property + +Signature: + +```typescript +context?: T; +``` diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.md b/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.md new file mode 100644 index 0000000..6efcb32 --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicyInterface](./iam-policies.actionbasedpolicyinterface.md) + +## ActionBasedPolicyInterface interface + +Signature: + +```typescript +interface ActionBasedPolicyInterface +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [conditionResolver?](./iam-policies.actionbasedpolicyinterface.conditionresolver.md) | ConditionResolver | (Optional) | +| [context?](./iam-policies.actionbasedpolicyinterface.context.md) | T | (Optional) | +| [statements](./iam-policies.actionbasedpolicyinterface.statements.md) | ActionBasedType\[\] | | + diff --git a/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.statements.md b/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.statements.md new file mode 100644 index 0000000..0795aad --- /dev/null +++ b/docs/gitbook/api/iam-policies.actionbasedpolicyinterface.statements.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ActionBasedPolicyInterface](./iam-policies.actionbasedpolicyinterface.md) > [statements](./iam-policies.actionbasedpolicyinterface.statements.md) + +## ActionBasedPolicyInterface.statements property + +Signature: + +```typescript +statements: ActionBasedType[]; +``` diff --git a/docs/gitbook/api/iam-policies.applycontext.md b/docs/gitbook/api/iam-policies.applycontext.md new file mode 100644 index 0000000..e625443 --- /dev/null +++ b/docs/gitbook/api/iam-policies.applycontext.md @@ -0,0 +1,44 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [applyContext](./iam-policies.applycontext.md) + +## applyContext() function + +Apply the context value in a string. + +Signature: + +```typescript +declare function applyContext(str: string, context?: T): string; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| str | string | Pattern string, containing context path. | +| context | T | Object to get values from path. | + +Returns: + +string + +{string} Returns a string with embedded context values. + +## Example + + +```javascript +const context = { + user: { id: 456, bestFriends: [123, 532, 987] } +}; +applyContext('secrets:${user.id}:*', context) +// => 'secrets:456:*' + +applyContext('secrets:${user.bestFriends}:*', context) +// => 'secrets:{123,532,987}:*' + +applyContext('secrets:${company.address}:account', context) +// => 'secrets:undefined:account' +``` + diff --git a/docs/gitbook/api/iam-policies.getvaluefrompath.md b/docs/gitbook/api/iam-policies.getvaluefrompath.md new file mode 100644 index 0000000..561e899 --- /dev/null +++ b/docs/gitbook/api/iam-policies.getvaluefrompath.md @@ -0,0 +1,40 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [getValueFromPath](./iam-policies.getvaluefrompath.md) + +## getValueFromPath() function + +Gets the value at `path` of `object`. If the resolved value is `undefined`, the `defaultValue` is returned in its place. + + 3.1.0 Object + +Signature: + +```typescript +declare function getValueFromPath(object: U, path: Array | string, defaultValue?: unknown): any; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| object | U | The object to query. | +| path | Array<T> \| string | The path of the property to get. | +| defaultValue | unknown | The value returned for undefined resolved values. | + +Returns: + +any + +{\*} Returns the resolved value. + +## Example + +const object = { 'a': \[{ 'b': { 'c': 3 } }\] } + +getValueFromPath(object, 'a\[0\].b.c') // => 3 + +getValueFromPath(object, \['a', '0', 'b', 'c'\]) // => 3 + +getValueFromPath(object, 'a.b.c', 'default') // => 'default' + diff --git a/docs/gitbook/api/iam-policies.identitybased._constructor_.md b/docs/gitbook/api/iam-policies.identitybased._constructor_.md new file mode 100644 index 0000000..4fed73e --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybased._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBased](./iam-policies.identitybased.md) > [(constructor)](./iam-policies.identitybased._constructor_.md) + +## IdentityBased.(constructor) + +Constructs a new instance of the `IdentityBased` class + +Signature: + +```typescript +constructor(identity: IdentityBasedType); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| identity | IdentityBasedType | | + diff --git a/docs/gitbook/api/iam-policies.identitybased.getstatement.md b/docs/gitbook/api/iam-policies.identitybased.getstatement.md new file mode 100644 index 0000000..ec19fb5 --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybased.getstatement.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBased](./iam-policies.identitybased.md) > [getStatement](./iam-policies.identitybased.getstatement.md) + +## IdentityBased.getStatement() method + +Signature: + +```typescript +getStatement(this: IdentityBased): IdentityBasedType; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | IdentityBased<T> | | + +Returns: + +IdentityBasedType + diff --git a/docs/gitbook/api/iam-policies.identitybased.matches.md b/docs/gitbook/api/iam-policies.identitybased.matches.md new file mode 100644 index 0000000..d6ce1d9 --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybased.matches.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBased](./iam-policies.identitybased.md) > [matches](./iam-policies.identitybased.matches.md) + +## IdentityBased.matches() method + +Signature: + +```typescript +matches(this: IdentityBased, { action, resource, context, conditionResolver }: MatchIdentityBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | IdentityBased<T> | | +| { action, resource, context, conditionResolver } | MatchIdentityBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.identitybased.md b/docs/gitbook/api/iam-policies.identitybased.md new file mode 100644 index 0000000..25143a5 --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybased.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBased](./iam-policies.identitybased.md) + +## IdentityBased class + +Signature: + +```typescript +declare class IdentityBased extends Statement +``` +Extends: Statement<T> + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(identity)](./iam-policies.identitybased._constructor_.md) | | Constructs a new instance of the IdentityBased class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [getStatement(this)](./iam-policies.identitybased.getstatement.md) | | | +| [matches(this, { action, resource, context, conditionResolver })](./iam-policies.identitybased.matches.md) | | | + diff --git a/docs/gitbook/api/iam-policies.identitybasedpolicy._constructor_.md b/docs/gitbook/api/iam-policies.identitybasedpolicy._constructor_.md new file mode 100644 index 0000000..5d297a4 --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybasedpolicy._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBasedPolicy](./iam-policies.identitybasedpolicy.md) > [(constructor)](./iam-policies.identitybasedpolicy._constructor_.md) + +## IdentityBasedPolicy.(constructor) + +Constructs a new instance of the `IdentityBasedPolicy` class + +Signature: + +```typescript +constructor({ statements, conditionResolver, context }: IdentityBasedPolicyInterface); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { statements, conditionResolver, context } | IdentityBasedPolicyInterface<T> | | + diff --git a/docs/gitbook/api/iam-policies.identitybasedpolicy.addstatement.md b/docs/gitbook/api/iam-policies.identitybasedpolicy.addstatement.md new file mode 100644 index 0000000..bdf2283 --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybasedpolicy.addstatement.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBasedPolicy](./iam-policies.identitybasedpolicy.md) > [addStatement](./iam-policies.identitybasedpolicy.addstatement.md) + +## IdentityBasedPolicy.addStatement() method + +Signature: + +```typescript +addStatement(this: IdentityBasedPolicy, statement: IdentityBasedType): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | IdentityBasedPolicy<T> | | +| statement | IdentityBasedType | | + +Returns: + +void + diff --git a/docs/gitbook/api/iam-policies.identitybasedpolicy.can.md b/docs/gitbook/api/iam-policies.identitybasedpolicy.can.md new file mode 100644 index 0000000..d410436 --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybasedpolicy.can.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBasedPolicy](./iam-policies.identitybasedpolicy.md) > [can](./iam-policies.identitybasedpolicy.can.md) + +## IdentityBasedPolicy.can() method + +Signature: + +```typescript +can(this: IdentityBasedPolicy, { action, resource, context }: EvaluateIdentityBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | IdentityBasedPolicy<T> | | +| { action, resource, context } | EvaluateIdentityBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.identitybasedpolicy.cannot.md b/docs/gitbook/api/iam-policies.identitybasedpolicy.cannot.md new file mode 100644 index 0000000..3665b7a --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybasedpolicy.cannot.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBasedPolicy](./iam-policies.identitybasedpolicy.md) > [cannot](./iam-policies.identitybasedpolicy.cannot.md) + +## IdentityBasedPolicy.cannot() method + +Signature: + +```typescript +cannot(this: IdentityBasedPolicy, { action, resource, context }: EvaluateIdentityBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | IdentityBasedPolicy<T> | | +| { action, resource, context } | EvaluateIdentityBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.identitybasedpolicy.evaluate.md b/docs/gitbook/api/iam-policies.identitybasedpolicy.evaluate.md new file mode 100644 index 0000000..3441dac --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybasedpolicy.evaluate.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBasedPolicy](./iam-policies.identitybasedpolicy.md) > [evaluate](./iam-policies.identitybasedpolicy.evaluate.md) + +## IdentityBasedPolicy.evaluate() method + +Signature: + +```typescript +evaluate(this: IdentityBasedPolicy, { action, resource, context }: EvaluateIdentityBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | IdentityBasedPolicy<T> | | +| { action, resource, context } | EvaluateIdentityBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.identitybasedpolicy.getstatements.md b/docs/gitbook/api/iam-policies.identitybasedpolicy.getstatements.md new file mode 100644 index 0000000..5ee5d32 --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybasedpolicy.getstatements.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBasedPolicy](./iam-policies.identitybasedpolicy.md) > [getStatements](./iam-policies.identitybasedpolicy.getstatements.md) + +## IdentityBasedPolicy.getStatements() method + +Signature: + +```typescript +getStatements(this: IdentityBasedPolicy): IdentityBasedType[]; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | IdentityBasedPolicy<T> | | + +Returns: + +IdentityBasedType\[\] + diff --git a/docs/gitbook/api/iam-policies.identitybasedpolicy.md b/docs/gitbook/api/iam-policies.identitybasedpolicy.md new file mode 100644 index 0000000..650a136 --- /dev/null +++ b/docs/gitbook/api/iam-policies.identitybasedpolicy.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [IdentityBasedPolicy](./iam-policies.identitybasedpolicy.md) + +## IdentityBasedPolicy class + +Signature: + +```typescript +declare class IdentityBasedPolicy extends Policy +``` +Extends: Policy<T, IdentityBasedType> + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)({ statements, conditionResolver, context })](./iam-policies.identitybasedpolicy._constructor_.md) | | Constructs a new instance of the IdentityBasedPolicy class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addStatement(this, statement)](./iam-policies.identitybasedpolicy.addstatement.md) | | | +| [can(this, { action, resource, context })](./iam-policies.identitybasedpolicy.can.md) | | | +| [cannot(this, { action, resource, context })](./iam-policies.identitybasedpolicy.cannot.md) | | | +| [evaluate(this, { action, resource, context })](./iam-policies.identitybasedpolicy.evaluate.md) | | | +| [getStatements(this)](./iam-policies.identitybasedpolicy.getstatements.md) | | | + diff --git a/docs/gitbook/api/iam-policies.md b/docs/gitbook/api/iam-policies.md new file mode 100644 index 0000000..37c4291 --- /dev/null +++ b/docs/gitbook/api/iam-policies.md @@ -0,0 +1,30 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) + +## iam-policies package + +## Classes + +| Class | Description | +| --- | --- | +| [ActionBased](./iam-policies.actionbased.md) | | +| [ActionBasedPolicy](./iam-policies.actionbasedpolicy.md) | | +| [IdentityBased](./iam-policies.identitybased.md) | | +| [IdentityBasedPolicy](./iam-policies.identitybasedpolicy.md) | | +| [ResourceBased](./iam-policies.resourcebased.md) | | +| [ResourceBasedPolicy](./iam-policies.resourcebasedpolicy.md) | | + +## Functions + +| Function | Description | +| --- | --- | +| [applyContext(str, context)](./iam-policies.applycontext.md) | Apply the context value in a string. | +| [getValueFromPath(object, path, defaultValue)](./iam-policies.getvaluefrompath.md) | Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place. 3.1.0 Object | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [ActionBasedPolicyInterface](./iam-policies.actionbasedpolicyinterface.md) | | + diff --git a/docs/gitbook/api/iam-policies.resourcebased._constructor_.md b/docs/gitbook/api/iam-policies.resourcebased._constructor_.md new file mode 100644 index 0000000..0ac7b4e --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebased._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBased](./iam-policies.resourcebased.md) > [(constructor)](./iam-policies.resourcebased._constructor_.md) + +## ResourceBased.(constructor) + +Constructs a new instance of the `ResourceBased` class + +Signature: + +```typescript +constructor(identity: ResourceBasedType); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| identity | ResourceBasedType | | + diff --git a/docs/gitbook/api/iam-policies.resourcebased.getstatement.md b/docs/gitbook/api/iam-policies.resourcebased.getstatement.md new file mode 100644 index 0000000..139f211 --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebased.getstatement.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBased](./iam-policies.resourcebased.md) > [getStatement](./iam-policies.resourcebased.getstatement.md) + +## ResourceBased.getStatement() method + +Signature: + +```typescript +getStatement(this: ResourceBased): ResourceBasedType; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ResourceBased<T> | | + +Returns: + +ResourceBasedType + diff --git a/docs/gitbook/api/iam-policies.resourcebased.matches.md b/docs/gitbook/api/iam-policies.resourcebased.matches.md new file mode 100644 index 0000000..6935d18 --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebased.matches.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBased](./iam-policies.resourcebased.md) > [matches](./iam-policies.resourcebased.matches.md) + +## ResourceBased.matches() method + +Signature: + +```typescript +matches(this: ResourceBased, { principal, action, resource, principalType, context, conditionResolver }: MatchResourceBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ResourceBased<T> | | +| { principal, action, resource, principalType, context, conditionResolver } | MatchResourceBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.resourcebased.md b/docs/gitbook/api/iam-policies.resourcebased.md new file mode 100644 index 0000000..137bb77 --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebased.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBased](./iam-policies.resourcebased.md) + +## ResourceBased class + +Signature: + +```typescript +declare class ResourceBased extends Statement +``` +Extends: Statement<T> + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(identity)](./iam-policies.resourcebased._constructor_.md) | | Constructs a new instance of the ResourceBased class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [getStatement(this)](./iam-policies.resourcebased.getstatement.md) | | | +| [matches(this, { principal, action, resource, principalType, context, conditionResolver })](./iam-policies.resourcebased.matches.md) | | | + diff --git a/docs/gitbook/api/iam-policies.resourcebasedpolicy._constructor_.md b/docs/gitbook/api/iam-policies.resourcebasedpolicy._constructor_.md new file mode 100644 index 0000000..3321941 --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebasedpolicy._constructor_.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBasedPolicy](./iam-policies.resourcebasedpolicy.md) > [(constructor)](./iam-policies.resourcebasedpolicy._constructor_.md) + +## ResourceBasedPolicy.(constructor) + +Constructs a new instance of the `ResourceBasedPolicy` class + +Signature: + +```typescript +constructor({ statements, conditionResolver, context }: ResourceBasedPolicyInterface); +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { statements, conditionResolver, context } | ResourceBasedPolicyInterface<T> | | + diff --git a/docs/gitbook/api/iam-policies.resourcebasedpolicy.addstatement.md b/docs/gitbook/api/iam-policies.resourcebasedpolicy.addstatement.md new file mode 100644 index 0000000..2a23421 --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebasedpolicy.addstatement.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBasedPolicy](./iam-policies.resourcebasedpolicy.md) > [addStatement](./iam-policies.resourcebasedpolicy.addstatement.md) + +## ResourceBasedPolicy.addStatement() method + +Signature: + +```typescript +addStatement(this: ResourceBasedPolicy, statement: ResourceBasedType): void; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ResourceBasedPolicy<T> | | +| statement | ResourceBasedType | | + +Returns: + +void + diff --git a/docs/gitbook/api/iam-policies.resourcebasedpolicy.can.md b/docs/gitbook/api/iam-policies.resourcebasedpolicy.can.md new file mode 100644 index 0000000..05104ea --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebasedpolicy.can.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBasedPolicy](./iam-policies.resourcebasedpolicy.md) > [can](./iam-policies.resourcebasedpolicy.can.md) + +## ResourceBasedPolicy.can() method + +Signature: + +```typescript +can(this: ResourceBasedPolicy, { principal, action, resource, principalType, context }: EvaluateResourceBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ResourceBasedPolicy<T> | | +| { principal, action, resource, principalType, context } | EvaluateResourceBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.resourcebasedpolicy.cannot.md b/docs/gitbook/api/iam-policies.resourcebasedpolicy.cannot.md new file mode 100644 index 0000000..0d0b242 --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebasedpolicy.cannot.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBasedPolicy](./iam-policies.resourcebasedpolicy.md) > [cannot](./iam-policies.resourcebasedpolicy.cannot.md) + +## ResourceBasedPolicy.cannot() method + +Signature: + +```typescript +cannot(this: ResourceBasedPolicy, { principal, action, resource, principalType, context }: EvaluateResourceBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ResourceBasedPolicy<T> | | +| { principal, action, resource, principalType, context } | EvaluateResourceBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.resourcebasedpolicy.evaluate.md b/docs/gitbook/api/iam-policies.resourcebasedpolicy.evaluate.md new file mode 100644 index 0000000..62f01a1 --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebasedpolicy.evaluate.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBasedPolicy](./iam-policies.resourcebasedpolicy.md) > [evaluate](./iam-policies.resourcebasedpolicy.evaluate.md) + +## ResourceBasedPolicy.evaluate() method + +Signature: + +```typescript +evaluate(this: ResourceBasedPolicy, { principal, action, resource, principalType, context }: EvaluateResourceBasedInterface): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ResourceBasedPolicy<T> | | +| { principal, action, resource, principalType, context } | EvaluateResourceBasedInterface<T> | | + +Returns: + +boolean + diff --git a/docs/gitbook/api/iam-policies.resourcebasedpolicy.getstatements.md b/docs/gitbook/api/iam-policies.resourcebasedpolicy.getstatements.md new file mode 100644 index 0000000..e05d03c --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebasedpolicy.getstatements.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBasedPolicy](./iam-policies.resourcebasedpolicy.md) > [getStatements](./iam-policies.resourcebasedpolicy.getstatements.md) + +## ResourceBasedPolicy.getStatements() method + +Signature: + +```typescript +getStatements(this: ResourceBasedPolicy): ResourceBasedType[]; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| this | ResourceBasedPolicy<T> | | + +Returns: + +ResourceBasedType\[\] + diff --git a/docs/gitbook/api/iam-policies.resourcebasedpolicy.md b/docs/gitbook/api/iam-policies.resourcebasedpolicy.md new file mode 100644 index 0000000..440d4fc --- /dev/null +++ b/docs/gitbook/api/iam-policies.resourcebasedpolicy.md @@ -0,0 +1,29 @@ + + +[Home](./index.md) > [iam-policies](./iam-policies.md) > [ResourceBasedPolicy](./iam-policies.resourcebasedpolicy.md) + +## ResourceBasedPolicy class + +Signature: + +```typescript +declare class ResourceBasedPolicy extends Policy +``` +Extends: Policy<T, ResourceBasedType> + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)({ statements, conditionResolver, context })](./iam-policies.resourcebasedpolicy._constructor_.md) | | Constructs a new instance of the ResourceBasedPolicy class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addStatement(this, statement)](./iam-policies.resourcebasedpolicy.addstatement.md) | | | +| [can(this, { principal, action, resource, principalType, context })](./iam-policies.resourcebasedpolicy.can.md) | | | +| [cannot(this, { principal, action, resource, principalType, context })](./iam-policies.resourcebasedpolicy.cannot.md) | | | +| [evaluate(this, { principal, action, resource, principalType, context })](./iam-policies.resourcebasedpolicy.evaluate.md) | | | +| [getStatements(this)](./iam-policies.resourcebasedpolicy.getstatements.md) | | | + diff --git a/docs/gitbook/api/index.md b/docs/gitbook/api/index.md new file mode 100644 index 0000000..a6cacf7 --- /dev/null +++ b/docs/gitbook/api/index.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) + +## API Reference + +## Packages + +| Package | Description | +| --- | --- | +| [iam-policies](./iam-policies.md) | | + diff --git a/package.json b/package.json index fbecc45..710fe30 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ }, "homepage": "https://github.com/roggervalf/iam-policies#readme", "scripts": { + "docs": "(api-extractor run || true) && api-documenter markdown -i ./temp -o docs/gitbook/api", "pretest": "npm-run-all pretty:quick lint:staged", "prettier:format": "./node_modules/.bin/prettier **/*.{ts,js,json,yml} -l --ignore-path ./.eslintignore", "prettier:fix": "./node_modules/.bin/prettier **/*.{ts,js,json,yml} --write --ignore-path ./.eslintignore", @@ -57,7 +58,7 @@ "main": "dist/main.js", "module": "dist/main.es.js", "jsnext:main": "dist/main.es.js", - "typings": "dist/main.d.ts", + "types": "dist/main.d.ts", "devDependencies": { "@babel/core": "7.7.2", "@babel/preset-env": "7.7.1", @@ -65,6 +66,8 @@ "@commitlint/cli": "8.3.5", "@commitlint/config-conventional": "8.3.4", "@commitlint/travis-cli": "10.0.0", + "@microsoft/api-documenter": "^7.13.50", + "@microsoft/api-extractor": "^7.18.9", "@rollup/plugin-babel": "5.0.0", "@rollup/plugin-commonjs": "16.0.0", "@rollup/plugin-node-resolve": "10.0.0", diff --git a/yarn.lock b/yarn.lock index 9c3f6cb..f1d10f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1299,6 +1299,61 @@ mkdirp "^0.5.1" rimraf "^2.5.2" +"@microsoft/api-documenter@^7.13.50": + version "7.13.68" + resolved "https://registry.yarnpkg.com/@microsoft/api-documenter/-/api-documenter-7.13.68.tgz#c1e144764cac0684adefe78fd848d78c3f374681" + integrity sha512-cRjwK1TDyGxFGgCsRG8G0Yi3Z4akvfWgw1pWAxKFbm7ajlQQGZcHPnb+n4lKlSeQ5g/cxc7hcdw54Mvisne9Bg== + dependencies: + "@microsoft/api-extractor-model" "7.13.16" + "@microsoft/tsdoc" "0.13.2" + "@rushstack/node-core-library" "3.43.2" + "@rushstack/ts-command-line" "4.10.4" + colors "~1.2.1" + js-yaml "~3.13.1" + resolve "~1.17.0" + +"@microsoft/api-extractor-model@7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.13.16.tgz#1d67541ebbcea32672c5fdd9392dc1579b2fc23a" + integrity sha512-ttdxVXsTWL5dd26W1YNLe3LgDsE0EE273aZlcLe58W0opymBybCYU1Mn+OHQM8BuErrdvdN8LdpWAAbkiOEN/Q== + dependencies: + "@microsoft/tsdoc" "0.13.2" + "@microsoft/tsdoc-config" "~0.15.2" + "@rushstack/node-core-library" "3.43.2" + +"@microsoft/api-extractor@^7.18.9": + version "7.18.19" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.18.19.tgz#f09afc1c210aa67e2f3f34b0a68281a12f144541" + integrity sha512-aY+/XR7PtQXtnqNPFRs3/+iVRlQJpo6uLTjO2g7PqmnMywl3GBU3bCgAlV/khZtAQbIs6Le57XxmSE6rOqbcfg== + dependencies: + "@microsoft/api-extractor-model" "7.13.16" + "@microsoft/tsdoc" "0.13.2" + "@microsoft/tsdoc-config" "~0.15.2" + "@rushstack/node-core-library" "3.43.2" + "@rushstack/rig-package" "0.3.5" + "@rushstack/ts-command-line" "4.10.4" + colors "~1.2.1" + lodash "~4.17.15" + resolve "~1.17.0" + semver "~7.3.0" + source-map "~0.6.1" + typescript "~4.4.2" + +"@microsoft/tsdoc-config@~0.15.2": + version "0.15.2" + resolved "https://registry.yarnpkg.com/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz#eb353c93f3b62ab74bdc9ab6f4a82bcf80140f14" + integrity sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA== + dependencies: + "@microsoft/tsdoc" "0.13.2" + ajv "~6.12.6" + jju "~1.4.0" + resolve "~1.19.0" + +"@microsoft/tsdoc@0.13.2": + version "0.13.2" + resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz#3b0efb6d3903bd49edb073696f60e90df08efb26" + integrity sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1615,6 +1670,39 @@ estree-walker "^1.0.1" picomatch "^2.2.2" +"@rushstack/node-core-library@3.43.2": + version "3.43.2" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.43.2.tgz#f067371a94fd92ed8f9d9aa8201c5e9e17a19f0f" + integrity sha512-b7AEhSf6CvZgvuDcWMFDeKx2mQSn9AVnMQVyxNxFeHCtLz3gJicqCOlw2GOXM8HKh6PInLdil/NVCDcstwSrIw== + dependencies: + "@types/node" "12.20.24" + colors "~1.2.1" + fs-extra "~7.0.1" + import-lazy "~4.0.0" + jju "~1.4.0" + resolve "~1.17.0" + semver "~7.3.0" + timsort "~0.3.0" + z-schema "~3.18.3" + +"@rushstack/rig-package@0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.5.tgz#7ddab0994647837bab8fdef26f990f1774d82e78" + integrity sha512-CvqWw+E81U5lRBN/lUj7Ngr/XQa/PPb2jAS5QcLP7WL+IMUl+3+Cc2qYrsDoB4zke81kz+usWGmBQpBzGMLmAA== + dependencies: + resolve "~1.17.0" + strip-json-comments "~3.1.1" + +"@rushstack/ts-command-line@4.10.4": + version "4.10.4" + resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.10.4.tgz#05142b74e5cb207d3dd9b935c82f80d7fcb68042" + integrity sha512-4T5ao4UgDb6LmiRj4GumvG3VT/p6RSMgl7TN7S58ifaAGN2GeTNBajFCDdJs9QQP0d/4tA5p0SFzT7Ps5Byirg== + dependencies: + "@types/argparse" "1.0.38" + argparse "~1.0.9" + colors "~1.2.1" + string-argv "~0.3.1" + "@semantic-release/changelog@5.0.0": version "5.0.0" resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-5.0.0.tgz#3db43fc15d78267c5b3f3f9dd311ddb2a0f8596b" @@ -1733,6 +1821,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@types/argparse@1.0.38": + version "1.0.38" + resolved "https://registry.yarnpkg.com/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9" + integrity sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA== + "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": version "7.1.16" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" @@ -1830,6 +1923,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.3.tgz#7a8f2838603ea314d1d22bb3171d899e15c57bd5" integrity sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ== +"@types/node@12.20.24": + version "12.20.24" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.24.tgz#c37ac69cb2948afb4cef95f424fa0037971a9a5c" + integrity sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ== + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -2014,7 +2112,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3: +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@~6.12.6: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -2137,7 +2235,7 @@ arg@^4.1.0: resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== -argparse@^1.0.7: +argparse@^1.0.7, argparse@~1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== @@ -2844,6 +2942,11 @@ colors@^1.1.2: resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== +colors@~1.2.1: + version "1.2.5" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.5.tgz#89c7ad9a374bc030df8013241f68136ed8835afc" + integrity sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg== + columnify@~1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -2859,6 +2962,11 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +commander@^2.7.1: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + commander@^6.2.0: version "6.2.1" resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" @@ -4093,6 +4201,15 @@ fs-extra@^9.0.0: jsonfile "^6.0.1" universalify "^2.0.0" +fs-extra@~7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -4614,6 +4731,11 @@ import-from@^3.0.0: dependencies: resolve-from "^5.0.0" +import-lazy@~4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153" + integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw== + import-local@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" @@ -4832,6 +4954,13 @@ is-cidr@^4.0.2: dependencies: cidr-regex "^3.1.1" +is-core-module@^2.1.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" + integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== + dependencies: + has "^1.0.3" + is-core-module@^2.2.0, is-core-module@^2.5.0: version "2.7.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" @@ -5557,6 +5686,11 @@ jest@26.6.3: import-local "^3.0.2" jest-cli "^26.6.3" +jju@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a" + integrity sha1-o6vicYryQaKykE+EpiWXDzia4yo= + js-levenshtein@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" @@ -5575,6 +5709,14 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@~3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -5951,11 +6093,16 @@ lodash.escaperegexp@^4.1.2: resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" integrity sha1-ZHYsSGGAglGKw99Mz11YhtriA0c= -lodash.get@^4: +lodash.get@^4, lodash.get@^4.0.0: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= +lodash.isequal@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + lodash.ismatch@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" @@ -5986,7 +6133,7 @@ lodash@4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.7.0: +lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.7.0, lodash@~4.17.15: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -7649,6 +7796,21 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.17.0, resolve@^1.18 is-core-module "^2.2.0" path-parse "^1.0.6" +resolve@~1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@~1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" + integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== + dependencies: + is-core-module "^2.1.0" + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -7899,7 +8061,7 @@ semver@7.3.2: resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== -semver@^7.1.1, semver@^7.1.2, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@^7.1.1, semver@^7.1.2, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@~7.3.0: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -8229,7 +8391,7 @@ stream-combiner2@~1.1.1: duplexer2 "~0.1.0" readable-stream "^2.0.2" -string-argv@0.3.1: +string-argv@0.3.1, string-argv@~0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== @@ -8395,7 +8557,7 @@ strip-json-comments@3.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== -strip-json-comments@^3.0.1: +strip-json-comments@^3.0.1, strip-json-comments@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -8522,6 +8684,11 @@ through@2, "through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +timsort@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" + integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= + tiny-relative-date@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" @@ -8720,6 +8887,11 @@ typescript@4.0.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5" integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg== +typescript@~4.4.2: + version "4.4.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" + integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== + uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" @@ -8883,6 +9055,11 @@ validate-npm-package-name@^3.0.0, validate-npm-package-name@~3.0.0: dependencies: builtins "^1.0.3" +validator@^8.0.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-8.2.0.tgz#3c1237290e37092355344fef78c231249dab77b9" + integrity sha512-Yw5wW34fSv5spzTXNkokD6S6/Oq92d8q/t14TqsS3fAiA1RYnxSFSIZ+CY3n6PGGRCq5HhJTSepQvFUS2QUDxA== + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -9155,3 +9332,14 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +z-schema@~3.18.3: + version "3.18.4" + resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-3.18.4.tgz#ea8132b279533ee60be2485a02f7e3e42541a9a2" + integrity sha512-DUOKC/IhbkdLKKiV89gw9DUauTV8U/8yJl1sjf6MtDmzevLKOF2duNJ495S3MFVjqZarr+qNGCPbkg4mu4PpLw== + dependencies: + lodash.get "^4.0.0" + lodash.isequal "^4.0.0" + validator "^8.0.0" + optionalDependencies: + commander "^2.7.1"