@peac/policy-kit 0.12.13 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/loader.d.ts +22 -0
- package/dist/loader.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
* @packageDocumentation
|
|
30
30
|
*/
|
|
31
31
|
export { POLICY_VERSION, type SubjectType, type ControlPurpose, type ControlLicensingMode, type ControlDecision, type SubjectMatcher, type PolicyRule, type PolicyDefaults, type PolicyDocument, type EvaluationContext, type EvaluationResult, type RateLimitConfig, parseRateLimit, formatRateLimit, type DecisionRequirements, type ProfileParameter, type ProfileDefinition, type PolicyConstraints, type EnforcementProfileId, type EnforcementProfile, SubjectMatcherSchema, PolicyRuleSchema, PolicyDefaultsSchema, PolicyDocumentSchema, RateLimitConfigSchema, DecisionRequirementsSchema, ProfileParameterSchema, ProfileDefinitionSchema, PolicyConstraintsSchema, EnforcementProfileSchema, } from './types';
|
|
32
|
-
export { loadPolicy, parsePolicy, validatePolicy, policyFileExists, createExamplePolicy, serializePolicyYaml, serializePolicyJson, PolicyLoadError, PolicyValidationError, } from './loader';
|
|
32
|
+
export { loadPolicy, parsePolicy, parsePolicyDocument, validatePolicy, policyFileExists, createExamplePolicy, serializePolicyYaml, serializePolicyJson, PolicyLoadError, PolicyValidationError, } from './loader';
|
|
33
|
+
export { parsePolicyDocument as loadPolicyDocument } from './loader';
|
|
33
34
|
export { evaluate, explainMatches, findEffectiveRule, isAllowed, isDenied, requiresReview, evaluateBatch, } from './evaluate';
|
|
34
35
|
export { PEAC_PROTOCOL_VERSION, compilePeacTxt, compileRobotsSnippet, compileAiprefTemplates, renderPolicyMarkdown, type CompileOptions, type AiprefTemplate, } from './compiler';
|
|
35
36
|
export { PROFILES, PROFILE_IDS, type ProfileId } from './generated/profiles';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAErB,KAAK,eAAe,EACpB,cAAc,EACd,eAAe,EAEf,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EAEtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAEvB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,UAAU,EACV,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,GACtB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,c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,EAClB,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAGtB,sBAAsB,EACtB,4BAA4B,EAAE,gDAAgD;AAC9E,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,WAAW,CAAC;AAGnB,OAAO,EAEL,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAE3B,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAE5B,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -177,6 +177,9 @@ var PolicyValidationError = class extends PolicyLoadError {
|
|
|
177
177
|
this.name = "PolicyValidationError";
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
|
+
function parsePolicyDocument(text) {
|
|
181
|
+
return parsePolicy(text);
|
|
182
|
+
}
|
|
180
183
|
function parsePolicy(content, format) {
|
|
181
184
|
let parsed;
|
|
182
185
|
try {
|
|
@@ -1265,6 +1268,6 @@ function getRetryAfter(constraints) {
|
|
|
1265
1268
|
return constraints?.rate_limit?.retry_after_s;
|
|
1266
1269
|
}
|
|
1267
1270
|
|
|
1268
|
-
export { BALANCED_PROFILE, DEFAULT_ENFORCEMENT_PROFILE, DecisionRequirementsSchema, ENFORCEMENT_PROFILES, ENFORCEMENT_PROFILE_IDS, EnforcementProfileSchema, OPEN_PROFILE, PEAC_PROTOCOL_VERSION, POLICY_VERSION, PROFILES, PROFILE_IDS, PolicyConstraintsSchema, PolicyDefaultsSchema, PolicyDocumentSchema, PolicyLoadError, PolicyRuleSchema, PolicyValidationError, ProfileDefinitionSchema, ProfileError, ProfileParameterSchema, RateLimitConfigSchema, STRICT_PROFILE, SubjectMatcherSchema, compileAiprefTemplates, compilePeacTxt, compileRobotsSnippet, createExamplePolicy, customizeProfile, enforceDecision, enforceForHttp, enforcePurposeDecision, evaluate, evaluateBatch, evaluatePurpose, explainMatches, findEffectiveRule, formatRateLimit, getAllProfiles, getChallengeHeader, getDefaultEnforcementProfile, getEnforcementProfile, getProfile, getProfileSummary, getPurposeDecisionStatusCode, getPurposeStatusCode, getRetryAfter, hasProfile, isAllowed, isDenied, isEnforcementProfileId, listProfiles, loadPolicy, loadProfile, parsePolicy, parseRateLimit, policyFileExists, renderPolicyMarkdown, requiresChallenge, requiresReview, serializePolicyJson, serializePolicyYaml, validatePolicy, validateProfileParams };
|
|
1271
|
+
export { BALANCED_PROFILE, DEFAULT_ENFORCEMENT_PROFILE, DecisionRequirementsSchema, ENFORCEMENT_PROFILES, ENFORCEMENT_PROFILE_IDS, EnforcementProfileSchema, OPEN_PROFILE, PEAC_PROTOCOL_VERSION, POLICY_VERSION, PROFILES, PROFILE_IDS, PolicyConstraintsSchema, PolicyDefaultsSchema, PolicyDocumentSchema, PolicyLoadError, PolicyRuleSchema, PolicyValidationError, ProfileDefinitionSchema, ProfileError, ProfileParameterSchema, RateLimitConfigSchema, STRICT_PROFILE, SubjectMatcherSchema, compileAiprefTemplates, compilePeacTxt, compileRobotsSnippet, createExamplePolicy, customizeProfile, enforceDecision, enforceForHttp, enforcePurposeDecision, evaluate, evaluateBatch, evaluatePurpose, explainMatches, findEffectiveRule, formatRateLimit, getAllProfiles, getChallengeHeader, getDefaultEnforcementProfile, getEnforcementProfile, getProfile, getProfileSummary, getPurposeDecisionStatusCode, getPurposeStatusCode, getRetryAfter, hasProfile, isAllowed, isDenied, isEnforcementProfileId, listProfiles, loadPolicy, parsePolicyDocument as loadPolicyDocument, loadProfile, parsePolicy, parsePolicyDocument, parseRateLimit, policyFileExists, renderPolicyMarkdown, requiresChallenge, requiresReview, serializePolicyJson, serializePolicyYaml, validatePolicy, validateProfileParams };
|
|
1269
1272
|
//# sourceMappingURL=index.mjs.map
|
|
1270
1273
|
//# sourceMappingURL=index.mjs.map
|