{"_id":"@bernierllc/publishing-rules","_rev":"9-39f52d0533901fcc016247e7c972cf83","name":"@bernierllc/publishing-rules","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.1":{"name":"@bernierllc/publishing-rules","version":"1.0.1","keywords":["publishing","rules","engine","conditional","platform","atomic","core"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/publishing-rules@1.0.1","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"homepage":"https://github.com/bernierllc/tools/tree/main/packages/core/publishing-rules#readme","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"dist":{"shasum":"81a879d3daf36117f8db27caa7bec713cac54480","tarball":"https://registry.npmjs.org/@bernierllc/publishing-rules/-/publishing-rules-1.0.1.tgz","fileCount":10,"integrity":"sha512-esONHwAxrWakpk9Zn9JNMqwRUlb6Ur2DEa7eh7AaxIaV0dDQpX46nInqjqVU55yXByL3QvHMPGxeSh/+aOebvw==","signatures":[{"sig":"MEUCIQCpQoIU5xvagY4ku8S5rezqmsK/ipDIxl7m6pwHO003ugIgXaEqGibArnh73TlHxEVtQJP/zi3htirdw3OWbVX3eLk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87728},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"911b089db19774c09e925a540b2ea22b9a3e1b1b","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","clean":"rimraf dist","prebuild":"npm run clean","test:run":"jest --passWithNoTests","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"mkbernier","email":"mkbernier@gmail.com"},"repository":{"url":"git+https://github.com/bernierllc/tools.git","type":"git","directory":"packages/core/publishing-rules"},"_npmVersion":"11.4.2","description":"Publishing rule engine with conditional logic and platform-specific configurations","directories":{},"_nodeVersion":"24.4.1","publishConfig":{"access":"restricted"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","rimraf":"^5.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/publishing-rules_1.0.1_1756777947642_0.7663157765817277","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@bernierllc/publishing-rules","version":"1.0.3","keywords":["publishing","rules","engine","conditional","platform","atomic","core"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/publishing-rules@1.0.3","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"homepage":"https://github.com/bernierllc/tools/tree/main/packages/core/publishing-rules#readme","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"dist":{"shasum":"73d693df03aa1a3c082a0134119236a7f9c4d36a","tarball":"https://registry.npmjs.org/@bernierllc/publishing-rules/-/publishing-rules-1.0.3.tgz","fileCount":10,"integrity":"sha512-DDF7wTBeIRUUqcmxnKi+2Ue7Drei/sCrhAurx7ZPOu2jpbbRq6sbLoNpzTa7FRTkF0dXBVnicP7aW1hTmfbPMQ==","signatures":[{"sig":"MEQCIBCeaY7lsKXctSm9VCh/h01cIykhCQ5CjH6g8z6ccr5nAiBojwbViLlEz0oErPQ9QtAtysthThvQxXtN9hkd+sxk+A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87832},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"683786f5b043d9a96c9f49ed1f04f9dccd79eed3","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","clean":"rimraf dist","prebuild":"npm run clean","test:run":"jest --passWithNoTests","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:84476b68-a84f-4893-b572-3c21b71f4b38"}},"repository":{"url":"git+https://github.com/bernierllc/tools.git","type":"git","directory":"packages/core/publishing-rules"},"_npmVersion":"lerna/9.0.3/node@v20.19.6+x64 (linux)","description":"Publishing rule engine with conditional logic and platform-specific configurations","directories":{},"_nodeVersion":"20.19.6","publishConfig":{"access":"restricted","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","rimraf":"^5.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/publishing-rules_1.0.3_1767644245678_0.5600975022330372","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@bernierllc/publishing-rules","version":"1.0.4","keywords":["publishing","rules","engine","conditional","platform","atomic","core"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/publishing-rules@1.0.4","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"homepage":"https://github.com/bernierllc/tools/tree/main/packages/core/publishing-rules#readme","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"dist":{"shasum":"b9d5cac43a795f26f28ca7b1631dd4a6de3dfa26","tarball":"https://registry.npmjs.org/@bernierllc/publishing-rules/-/publishing-rules-1.0.4.tgz","fileCount":10,"integrity":"sha512-GUfY33MulAzMv5zYgg0qLd+HksO3iUP1z6te2xtRiWhzwQqKRM0diEgNKvJF+EydXZKG0duEkonwPy03gf0pjg==","signatures":[{"sig":"MEYCIQDgctg9kLZT/EMSmvROfDPbb+GXD3a3KjkRQ9IYlZWGvAIhAPi0rjnnuGGNGPZTDvU5Pp/i4S8P2ARip3YsEiNqebyE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87770},"main":"dist/index.js","_from":"file:bernierllc-publishing-rules-1.0.4.tgz","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","clean":"rimraf dist","prebuild":"npm run clean","test:run":"jest --passWithNoTests","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:84476b68-a84f-4893-b572-3c21b71f4b38"}},"_resolved":"/tmp/65011bfea1012366d5019294d86cda65/bernierllc-publishing-rules-1.0.4.tgz","_integrity":"sha512-GUfY33MulAzMv5zYgg0qLd+HksO3iUP1z6te2xtRiWhzwQqKRM0diEgNKvJF+EydXZKG0duEkonwPy03gf0pjg==","repository":{"url":"git+https://github.com/bernierllc/tools.git","type":"git","directory":"packages/core/publishing-rules"},"_npmVersion":"11.11.0","description":"Publishing rule engine with conditional logic and platform-specific configurations","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","rimraf":"^5.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/publishing-rules_1.0.4_1773078056930_0.7256948417767928","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@bernierllc/publishing-rules","version":"1.0.5","keywords":["publishing","rules","engine","conditional","platform","atomic","core"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/publishing-rules@1.0.5","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"homepage":"https://github.com/bernierllc/tools/tree/main/packages/core/publishing-rules#readme","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"dist":{"shasum":"17bb243b50bd039a3eca121ae0ecc20154af4bbc","tarball":"https://registry.npmjs.org/@bernierllc/publishing-rules/-/publishing-rules-1.0.5.tgz","fileCount":10,"integrity":"sha512-lODKu/0pYZPudP7P0CJwjUHU+pgHPZL3TZ1YH5YJxICYt541hbrME3X1hTz97RHo235gpleQz9OKa27zetlX/Q==","signatures":[{"sig":"MEYCIQCBV4GocgRhqS2UInwI2a84tUCbMXQQdB+mbQE3mWoPjwIhANQkRz/XTVM6XJ9HGCG9vTuZYg/2bwLxT9ny7KHHZWv7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87770},"main":"dist/index.js","_from":"file:bernierllc-publishing-rules-1.0.5.tgz","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","clean":"rimraf dist","prebuild":"npm run clean","test:run":"jest --passWithNoTests","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:84476b68-a84f-4893-b572-3c21b71f4b38"}},"_resolved":"/tmp/37836a8ec63edca6f8bb1f5afee47fd5/bernierllc-publishing-rules-1.0.5.tgz","_integrity":"sha512-lODKu/0pYZPudP7P0CJwjUHU+pgHPZL3TZ1YH5YJxICYt541hbrME3X1hTz97RHo235gpleQz9OKa27zetlX/Q==","repository":{"url":"git+https://github.com/bernierllc/tools.git","type":"git","directory":"packages/core/publishing-rules"},"_npmVersion":"11.11.0","description":"Publishing rule engine with conditional logic and platform-specific configurations","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","rimraf":"^5.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/publishing-rules_1.0.5_1773081237268_0.49192577788306724","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bernierllc/publishing-rules","version":"1.2.0","keywords":["publishing","rules","engine","conditional","platform","atomic","core"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/publishing-rules@1.2.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"homepage":"https://github.com/bernierllc/tools/tree/main/packages/core/publishing-rules#readme","bugs":{"url":"https://github.com/bernierllc/tools/issues"},"dist":{"shasum":"ed3afcc18637f1f6133086b4c019f6ba038a4125","tarball":"https://registry.npmjs.org/@bernierllc/publishing-rules/-/publishing-rules-1.2.0.tgz","fileCount":12,"integrity":"sha512-BH98Livi8m4RuUGMqT59P2bywsnAxYHSALsqmC5tajUlNIU3tJdqlaT3WVDxETK6yfw5JuLUlFD0TcJJJvtTUA==","signatures":[{"sig":"MEQCIBRtgrIjkRPum2ObCXMe11BjbV/JOdpwNlezdy3mAVztAiAh0CSlk30bOLAZM2hqZnCVpMvb58pkmRMIHxpystx0DA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89540},"main":"dist/index.js","_from":"file:bernierllc-publishing-rules-1.2.0.tgz","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","clean":"rimraf dist","prebuild":"npm run clean","test:run":"jest --passWithNoTests","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:84476b68-a84f-4893-b572-3c21b71f4b38"}},"_resolved":"/home/runner/work/tools/tools/packages/core/publishing-rules/bernierllc-publishing-rules-1.2.0.tgz","_integrity":"sha512-BH98Livi8m4RuUGMqT59P2bywsnAxYHSALsqmC5tajUlNIU3tJdqlaT3WVDxETK6yfw5JuLUlFD0TcJJJvtTUA==","repository":{"url":"git+https://github.com/bernierllc/tools.git","type":"git","directory":"packages/core/publishing-rules"},"_npmVersion":"11.14.1","description":"Publishing rule engine with conditional logic and platform-specific configurations","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","rimraf":"^5.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/publishing-rules_1.2.0_1779241350657_0.3269994036858015","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@bernierllc/publishing-rules","version":"1.3.0","description":"Publishing rule engine with conditional logic and platform-specific configurations","main":"dist/index.js","types":"dist/index.d.ts","keywords":["publishing","rules","engine","conditional","platform","atomic","core"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","devDependencies":{"@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","jest":"^29.0.0","rimraf":"^5.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0"},"repository":{"type":"git","url":"git+https://github.com/bernierllc/tools.git","directory":"packages/core/publishing-rules"},"bugs":{"url":"https://github.com/bernierllc/tools/issues"},"homepage":"https://github.com/bernierllc/tools/tree/main/packages/core/publishing-rules#readme","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"engines":{"node":">=16.0.0"},"scripts":{"build":"tsc","prebuild":"npm run clean","clean":"rimraf dist","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","test:run":"jest --passWithNoTests","lint":"eslint src --ext .ts"},"_id":"@bernierllc/publishing-rules@1.3.0","_integrity":"sha512-oAGh9zDGSbkxCS6Xuwv0AoLAOOEBA7jrL/S9wkv7gwDy5c4WF5gRDnNZbGOSEY/lcpbdaDes41GQizj+ySzUHg==","_resolved":"/home/runner/work/tools/tools/packages/core/publishing-rules/bernierllc-publishing-rules-1.3.0.tgz","_from":"file:bernierllc-publishing-rules-1.3.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"11.14.1","dist":{"integrity":"sha512-oAGh9zDGSbkxCS6Xuwv0AoLAOOEBA7jrL/S9wkv7gwDy5c4WF5gRDnNZbGOSEY/lcpbdaDes41GQizj+ySzUHg==","shasum":"87630623209e49af28852a9864f3cfdfca536566","tarball":"https://registry.npmjs.org/@bernierllc/publishing-rules/-/publishing-rules-1.3.0.tgz","fileCount":12,"unpackedSize":89540,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDE8D2G3Geal+6fOOwQ7rOkZVcON5lWY+osYU34z5dNhgIgdjjQaXq7tPC+UzguR6clmPTgeg/8MkcLFoumIrDeQcI="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:84476b68-a84f-4893-b572-3c21b71f4b38"}},"directories":{},"maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/publishing-rules_1.3.0_1779250099432_0.7425402407569244"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-02T01:52:27.237Z","modified":"2026-05-20T04:08:19.715Z","1.0.1":"2025-09-02T01:52:27.832Z","1.0.3":"2026-01-05T20:17:25.824Z","1.0.4":"2026-03-09T17:40:57.072Z","1.0.5":"2026-03-09T18:33:57.420Z","1.2.0":"2026-05-20T01:42:30.808Z","1.3.0":"2026-05-20T04:08:19.555Z"},"bugs":{"url":"https://github.com/bernierllc/tools/issues"},"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/bernierllc/tools/tree/main/packages/core/publishing-rules#readme","keywords":["publishing","rules","engine","conditional","platform","atomic","core"],"repository":{"type":"git","url":"git+https://github.com/bernierllc/tools.git","directory":"packages/core/publishing-rules"},"description":"Publishing rule engine with conditional logic and platform-specific configurations","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"readme":"# @bernierllc/publishing-rules\n\nPublishing rule engine with conditional logic and platform-specific configurations for content management systems.\n\n## Installation\n\n```bash\nnpm install @bernierllc/publishing-rules\n```\n\n## Usage\n\n### Basic Setup\n\n```typescript\nimport { createRulesEngine, commonRules, ConditionType, ActionType } from '@bernierllc/publishing-rules';\n\n// Create a rules engine\nconst engine = createRulesEngine({\n  maxRules: 100,\n  timeout: 5000,\n  continueOnError: true,\n  enableLogging: true\n});\n\n// Add a common rule\nconst businessHoursRule = commonRules.businessHours('09:00', '17:00');\nengine.addRule(businessHoursRule);\n\n// Evaluate content against rules\nconst context = {\n  content: {\n    id: 'post-123',\n    type: 'blog-post',\n    title: 'My Blog Post',\n    content: 'This is the content of my blog post...',\n    author: 'john-doe',\n    status: 'approved',\n    tags: ['tech', 'javascript'],\n    createdAt: new Date()\n  },\n  user: {\n    id: 'user-456',\n    roles: ['editor'],\n    permissions: ['publish']\n  }\n};\n\nconst result = await engine.evaluateRules(context);\n\nif (result.shouldProceed) {\n  console.log('Content can be published');\n  console.log('Actions to take:', result.actions);\n} else {\n  console.log('Content publishing blocked');\n  console.log('Errors:', result.errors);\n}\n```\n\n### Custom Rules\n\n```typescript\nimport { ConditionType, ConditionOperator, ActionType } from '@bernierllc/publishing-rules';\n\n// Create a custom rule\nconst customRule = {\n  id: 'weekend-hold',\n  name: 'Weekend Publishing Hold',\n  description: 'Hold content publishing during weekends',\n  enabled: true,\n  priority: 300,\n  conditions: [\n    {\n      type: ConditionType.DAY_OF_WEEK,\n      field: 'current-time',\n      operator: ConditionOperator.IN,\n      value: [0, 6] // Sunday and Saturday\n    }\n  ],\n  actions: [\n    {\n      type: ActionType.HOLD,\n      parameters: {\n        reason: 'Weekend publishing policy',\n        resumeOn: 'next-business-day'\n      }\n    },\n    {\n      type: ActionType.NOTIFY,\n      parameters: {\n        recipients: ['editor@company.com'],\n        subject: 'Content held for weekend policy',\n        message: 'Content will be published on the next business day'\n      }\n    }\n  ],\n  createdAt: new Date(),\n  updatedAt: new Date()\n};\n\nengine.addRule(customRule);\n```\n\n### Rule Templates\n\n```typescript\nimport { RuleTemplateLibrary, getBuiltinTemplates, createRuleFromTemplate } from '@bernierllc/publishing-rules';\n\n// Use built-in templates\nconst templates = getBuiltinTemplates();\nconst approvalTemplate = templates.find(t => t.id === 'content-approval-required');\n\nif (approvalTemplate) {\n  const approvalRule = createRuleFromTemplate(\n    approvalTemplate,\n    'my-approval-rule',\n    {\n      requiredStatus: 'approved',\n      notificationEmail: 'manager@company.com'\n    }\n  );\n  \n  engine.addRule(approvalRule);\n}\n\n// Create custom template library\nconst library = new RuleTemplateLibrary();\n\nconst customTemplate = {\n  id: 'tag-based-scheduling',\n  name: 'Tag-Based Scheduling',\n  description: 'Schedule content based on tags',\n  category: 'SCHEDULING_RULES',\n  parameters: [\n    {\n      name: 'requiredTag',\n      type: 'string',\n      description: 'Tag that triggers scheduling',\n      required: true\n    },\n    {\n      name: 'scheduleDelay',\n      type: 'number',\n      description: 'Hours to delay publishing',\n      required: false,\n      defaultValue: 24\n    }\n  ],\n  conditions: [\n    {\n      type: ConditionType.TAG_EXISTS,\n      field: 'tags',\n      operator: ConditionOperator.CONTAINS,\n      value: '{{requiredTag}}'\n    }\n  ],\n  actions: [\n    {\n      type: ActionType.SCHEDULE,\n      parameters: {\n        delay: '{{scheduleDelay}}h'\n      }\n    }\n  ],\n  examples: []\n};\n\nlibrary.registerTemplate(customTemplate);\n```\n\n### Common Rules\n\nThe package provides several built-in common rules:\n\n```typescript\n// Business hours only\nconst businessRule = commonRules.businessHours('08:00', '18:00');\n\n// Content approval required\nconst approvalRule = commonRules.approvalRequired();\n\n// Weekend delay\nconst weekendRule = commonRules.weekendDelay('09:00');\n\n// Content length validation\nconst lengthRule = commonRules.contentLengthValidation(100, 5000);\n\n// Rate limiting\nconst rateLimitRule = commonRules.rateLimit(10); // max 10 posts per hour\n\n// Emergency stop\nconst emergencyRule = commonRules.emergencyStop(['admin@company.com']);\n```\n\n### Advanced Features\n\n#### Custom Condition Evaluators\n\n```typescript\nconst customRule = {\n  id: 'advanced-rule',\n  name: 'Advanced Rule',\n  description: 'Rule with custom evaluator',\n  enabled: true,\n  priority: 100,\n  conditions: [\n    {\n      type: ConditionType.CUSTOM_FIELD,\n      field: 'metadata.sentiment',\n      operator: ConditionOperator.EQUALS,\n      value: 'positive',\n      customEvaluator: async (context, condition) => {\n        // Custom sentiment analysis logic\n        const sentiment = await analyzeSentiment(context.content.content);\n        return {\n          passed: sentiment.score > 0.7,\n          details: `Sentiment score: ${sentiment.score}`\n        };\n      }\n    }\n  ],\n  actions: [\n    {\n      type: ActionType.PUBLISH,\n      parameters: {}\n    }\n  ],\n  createdAt: new Date(),\n  updatedAt: new Date()\n};\n```\n\n#### Event Handling\n\n```typescript\nengine.on('rule-evaluated', (event) => {\n  console.log(`Rule ${event.ruleId} evaluated:`, event.result);\n});\n\nengine.on('action-executed', (event) => {\n  console.log(`Action ${event.actionType} executed:`, event.result);\n});\n\nengine.on('error', (event) => {\n  console.error('Rule engine error:', event.error);\n});\n```\n\n#### Statistics and Monitoring\n\n```typescript\n// Get engine statistics\nconst stats = engine.getStatistics();\nconsole.log('Total evaluations:', stats.totalEvaluations);\nconsole.log('Rule executions:', stats.ruleExecutions);\nconsole.log('Average evaluation time:', stats.averageEvaluationTime);\n\n// Reset statistics\nengine.resetStatistics();\n```\n\n## API Reference\n\n### PublishingRulesEngine\n\nMain rule engine class for managing and evaluating publishing rules.\n\n#### Constructor\n- `new PublishingRulesEngine(config?: RuleEngineConfig)`\n\n#### Methods\n- `addRule(rule: PublishingRule): void`\n- `removeRule(id: string): boolean`\n- `updateRule(id: string, updates: Partial<PublishingRule>): PublishingRule | null`\n- `getRule(id: string): PublishingRule | undefined`\n- `getRules(): PublishingRule[]`\n- `enableRule(id: string): void`\n- `disableRule(id: string): void`\n- `clearAllRules(): void`\n- `evaluateRules(context: RuleEvaluationContext): Promise<RuleEvaluationResult>`\n- `getStatistics(): RuleEngineStatistics`\n- `resetStatistics(): void`\n\n### RuleTemplateLibrary\n\nTemplate system for creating reusable rule patterns.\n\n#### Methods\n- `registerTemplate(template: RuleTemplate): void`\n- `getTemplate(id: string): RuleTemplate | undefined`\n- `listTemplates(): RuleTemplate[]`\n- `getTemplatesByCategory(category: RuleCategory): RuleTemplate[]`\n- `removeTemplate(id: string): boolean`\n- `validateTemplate(template: RuleTemplate): string[]`\n\n### Common Functions\n\n- `createRulesEngine(config?: Partial<RuleEngineConfig>): PublishingRulesEngine`\n- `getBuiltinTemplates(): RuleTemplate[]`\n- `createRuleFromTemplate(template: RuleTemplate, ruleId: string, parameters: Record<string, any>): PublishingRule`\n\n## Configuration\n\n```typescript\ninterface RuleEngineConfig {\n  maxRules: number;              // Maximum number of rules (default: 100)\n  timeout: number;               // Rule evaluation timeout in ms (default: 5000)\n  continueOnError: boolean;      // Continue evaluation on rule errors (default: true)\n  enableCaching: boolean;        // Enable result caching (default: true)\n  cacheTTL: number;             // Cache TTL in ms (default: 300000)\n  enableLogging: boolean;        // Enable logging (default: true)\n  logLevel: LogLevel;           // Log level (default: INFO)\n  parallelEvaluation: boolean;   // Evaluate rules in parallel (default: true)\n  maxConcurrency: number;        // Max parallel evaluations (default: 10)\n}\n```\n\n## Condition Types\n\n- `CONTENT_TYPE` - Match content type\n- `CONTENT_LENGTH` - Validate content length\n- `WORD_COUNT` - Validate word count\n- `TAG_EXISTS` - Check for specific tags\n- `TITLE_MATCHES` - Match title patterns\n- `AUTHOR_IS` - Match content author\n- `CATEGORY_IS` - Match content category\n- `STATUS_IS` - Match content status\n- `TIME_OF_DAY` - Time-based conditions\n- `DAY_OF_WEEK` - Day-based conditions\n- `DATE_RANGE` - Date range conditions\n- `CUSTOM_FIELD` - Custom field evaluation\n- `USER_ROLE` - User role checks\n- `USER_PERMISSION` - User permission checks\n- `RATE_LIMIT` - Publishing rate limits\n\n## Action Types\n\n- `PUBLISH` - Proceed with publishing\n- `HOLD` - Hold content for review\n- `SCHEDULE` - Schedule for later publishing\n- `NOTIFY` - Send notifications\n- `REJECT` - Reject content\n- `REQUIRE_APPROVAL` - Require additional approval\n- `ADD_TAG` - Add tags to content\n- `REMOVE_TAG` - Remove tags from content\n- `UPDATE_METADATA` - Update content metadata\n\n## Error Handling\n\n```typescript\ntry {\n  const result = await engine.evaluateRules(context);\n  if (result.errors.length > 0) {\n    console.warn('Rule evaluation warnings:', result.errors);\n  }\n} catch (error) {\n  console.error('Rule engine failed:', error);\n  // Handle critical failure\n}\n```\n\n## License\n\nCopyright (c) 2025 Bernier LLC. All rights reserved.","readmeFilename":"README.md"}