@syntax-syllogism/warden-core 0.2.0 → 0.3.1
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/README.md +26 -4
- package/conformance/README.md +21 -0
- package/conformance/fixtures/01-single-persona.json +34 -0
- package/conformance/fixtures/02-multi-persona-union.json +32 -0
- package/conformance/fixtures/03-duplicate-grant-dedup.json +24 -0
- package/conformance/fixtures/04-already-present-noop.json +15 -0
- package/conformance/fixtures/05-unresolved-reference.json +17 -0
- package/conformance/fixtures/06-multi-user.json +28 -0
- package/conformance/fixtures/07-deterministic-ordering.json +39 -0
- package/conformance/fixtures/08-category-specific-reference-keys.json +42 -0
- package/lib/commandOptions.d.ts +84 -0
- package/lib/commandOptions.js +71 -0
- package/lib/commandOptions.js.map +1 -0
- package/lib/index.d.ts +10 -3
- package/lib/index.js +6 -3
- package/lib/index.js.map +1 -1
- package/lib/lifecycle/errors.d.ts +1 -1
- package/lib/lifecycle/errors.js.map +1 -1
- package/lib/lifecycle/freezeState.d.ts +0 -16
- package/lib/lifecycle/freezeState.js +0 -73
- package/lib/lifecycle/freezeState.js.map +1 -1
- package/lib/lifecycle/stripPlan.d.ts +2 -13
- package/lib/lifecycle/stripPlan.js +2 -53
- package/lib/lifecycle/stripPlan.js.map +1 -1
- package/lib/matching/index.js +8 -8
- package/lib/matching/index.js.map +1 -1
- package/lib/provisioning/conformancePlan.d.ts +7 -0
- package/lib/provisioning/conformancePlan.js +135 -0
- package/lib/provisioning/conformancePlan.js.map +1 -0
- package/lib/provisioning/provisionUserUseCase.d.ts +0 -1
- package/lib/provisioning/provisionUserUseCase.js +0 -5
- package/lib/provisioning/provisionUserUseCase.js.map +1 -1
- package/lib/provisioning/userPlan.js +2 -2
- package/lib/provisioning/userPlan.js.map +1 -1
- package/lib/provisioning/userSave.d.ts +2 -1
- package/lib/provisioning/userSave.js +10 -6
- package/lib/provisioning/userSave.js.map +1 -1
- package/lib/relatedRecords/apply.d.ts +1 -1
- package/lib/relatedRecords/apply.js +5 -4
- package/lib/relatedRecords/apply.js.map +1 -1
- package/lib/relatedRecords/preflight.d.ts +2 -4
- package/lib/relatedRecords/preflight.js +2 -4
- package/lib/relatedRecords/preflight.js.map +1 -1
- package/lib/spec/conformanceFixture.d.ts +209 -0
- package/lib/spec/conformanceFixture.js +77 -0
- package/lib/spec/conformanceFixture.js.map +1 -0
- package/lib/spec/index.d.ts +3 -1
- package/lib/spec/index.js +2 -1
- package/lib/spec/index.js.map +1 -1
- package/lib/spec/parse.d.ts +4 -0
- package/lib/spec/parse.js +4 -0
- package/lib/spec/parse.js.map +1 -1
- package/lib/useCase.d.ts +45 -0
- package/lib/useCase.js +31 -0
- package/lib/useCase.js.map +1 -0
- package/lib/useCases.d.ts +152 -0
- package/lib/useCases.js +698 -0
- package/lib/useCases.js.map +1 -0
- package/package.json +1 -1
- package/schemas/conformance-fixture.schema.json +444 -0
- package/lib/shared/prompt.d.ts +0 -4
- package/lib/shared/prompt.js +0 -15
- package/lib/shared/prompt.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,9 +9,12 @@ dependency. Call its functions directly from a script, an editor extension, a
|
|
|
9
9
|
CI job, or any other Node codebase.
|
|
10
10
|
|
|
11
11
|
The [domain guides](docs/) describe the implemented workflows and data
|
|
12
|
-
contracts for [
|
|
12
|
+
contracts for [callable command use cases](docs/use-cases.md),
|
|
13
|
+
[access auditing](docs/access.md),
|
|
13
14
|
[lifecycle operations](docs/lifecycle.md), [provisioning](docs/provisioning.md),
|
|
14
|
-
[related records](docs/related-records.md),
|
|
15
|
+
[related records](docs/related-records.md), [user matching](docs/matching.md),
|
|
16
|
+
[file-format schemas](docs/spec-schemas.md), and
|
|
17
|
+
[conformance fixtures](docs/conformance.md).
|
|
15
18
|
|
|
16
19
|
## Install
|
|
17
20
|
|
|
@@ -31,7 +34,11 @@ Requires Node.js 22 or later.
|
|
|
31
34
|
| `LifecycleError` | Typed lifecycle-operation errors. |
|
|
32
35
|
| `ProvisioningError`, `DefinitionError` | Typed provisioning and definition-reading errors. |
|
|
33
36
|
| `RelatedRecordsError` | Typed related-record catalog errors. |
|
|
37
|
+
| `commandDescriptors` | Metadata and Zod option schemas for the eight callable command use cases. `uiHints(schema)` reads the front-end input hints without coupling callers to Zod internals. |
|
|
38
|
+
| `provision`, `freeze`, `unfreeze`, `strip`, `restore` | Write use cases exposing `plan()` and `apply()`. Plans are plain JSON-safe data and carry warnings for the caller to present before confirmation. |
|
|
39
|
+
| `access`, `diff`, `snapshot` | Read use cases exposing `run()`. Diff accepts `verify` for persona conformance results; snapshot returns the file object and the caller owns serialization and filesystem output. |
|
|
34
40
|
| File-format schemas and parsers | Zod schemas, JSON-text validators, and inferred types for persona, users, related-catalog, and snapshot files. |
|
|
41
|
+
| `conformanceFixtureSchema`, `planFromState` | The versioned fixture contract and pure v1 additive reconciliation planner. |
|
|
35
42
|
| Lifecycle, access, provisioning, CSV, snapshot, and rendering functions | Framework-free domain operations used by Warden consumers. |
|
|
36
43
|
|
|
37
44
|
```ts
|
|
@@ -48,6 +55,15 @@ try {
|
|
|
48
55
|
}
|
|
49
56
|
```
|
|
50
57
|
|
|
58
|
+
Write commands keep confirmation in the front end and make the state boundary
|
|
59
|
+
explicit:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
const plan = await freeze.plan(connection, options, { onProgress });
|
|
63
|
+
// Show plan.warnings and plan.users, then confirm in the caller.
|
|
64
|
+
const result = await freeze.apply(connection, JSON.parse(JSON.stringify(plan)));
|
|
65
|
+
```
|
|
66
|
+
|
|
51
67
|
## Errors
|
|
52
68
|
|
|
53
69
|
Errors are reported as `WardenError` instances (or area-specific subclasses).
|
|
@@ -58,14 +74,14 @@ text is not and may be reworded in any release.
|
|
|
58
74
|
| --- | --- |
|
|
59
75
|
| `errorUnsupportedAccessType`, `errorInvalidTarget`, `errorFieldTargetMustBeQualified`, `errorObjectNotFound`, `errorFieldNotFound`, `errorApexClassNotFound`, `errorVisualforcePageNotFound`, `errorCustomPermissionNotFound`, `errorTabNotFound`, `errorRecordTypeTargetMustBeQualified`, `errorMasterRecordTypeUnsupported`, `errorRecordTypeNotFound`, `errorRecordTypeAmbiguous`, `errorRecordTypeInactive`, `errorRecordTypeMetadataReadFailed`, `errorAccessQueryFailed` | Access audit and target resolution. |
|
|
60
76
|
| `errorInvalidCsv`, `errorInvalidJson`, `errorInvalidPersonaDefinition`, `errorMissingUserFieldMap`, `errorPersonasWithoutDefinition` | Definition readers. |
|
|
61
|
-
| `errorInvalidJson`, `errorInvalidUserMatchField`, `errorInvalidUserValue`, `errorInvalidAgainstValue`, `errorInvalidAgainstMatchField`, `errorInvalidSnapshot`, `errorPromptDeclined` | Lifecycle targeting, snapshot validation, and
|
|
77
|
+
| `errorInvalidJson`, `errorInvalidUserMatchField`, `errorInvalidUserValue`, `errorInvalidAgainstValue`, `errorInvalidAgainstMatchField`, `errorInvalidSnapshot`, `errorPromptDeclined`, `errorAccessScopesMutuallyExclusive`, `errorVerifyUserMode` | Lifecycle targeting, snapshot validation, access scope validation, and diff verification. |
|
|
62
78
|
| `errorInvalidRelatedCatalog`, `errorRelationshipInvalidDefinition`, `errorRelationshipInvalidSobject`, `errorRelationshipMissingPhase`, `errorRelationshipInvalidPhase`, `errorPhaseBeforeUnsupported`, `errorLinkUserUnsupported`, `errorRelatedContextUnsupported`, `errorRelationshipInvalidMatch`, `errorRelationshipMatchFromUserId`, `errorRelationshipInvalidFields`, `errorRelationshipInvalidSource`, `errorRelationshipInvalidFrom`, `errorRelationshipUnknownUserField`, `errorRelationshipUnwritableField`, `errorRelationshipInvalidMode`, `errorRelationshipInvalidRecordType` | Related-record catalog validation. |
|
|
63
79
|
| `errorDuplicateExternalIdMatch`, `errorMissingRequiredFields`, `errorMissingSaveId`, `errorPromptDeclined`, `errorInvalidJson`, `errorInvalidPersonaDefinition`, `errorPersonasWithoutDefinition` | Provisioning execution and planning. |
|
|
64
80
|
| `schema-invalid`, `schema-version-unsupported` | Structural file-format validation. `data.issues` contains `{ path, message }` entries. |
|
|
65
81
|
|
|
66
82
|
## File formats and schemas
|
|
67
83
|
|
|
68
|
-
The
|
|
84
|
+
The five JSON file formats are defined by the exported Zod schemas and the
|
|
69
85
|
generated Draft 2020-12 schemas. See the detailed
|
|
70
86
|
[file-format schema guide](docs/spec-schemas.md)
|
|
71
87
|
for the full structural contract, parser results, versioning behavior, and
|
|
@@ -80,6 +96,12 @@ artifact-generation workflow.
|
|
|
80
96
|
`{ relationships: Record<string, RelationshipDef> }`.
|
|
81
97
|
- [snapshot](schemas/snapshot.schema.json): the lifecycle snapshot with
|
|
82
98
|
`snapshotVersion: 1`.
|
|
99
|
+
- [conformance fixture](schemas/conformance-fixture.schema.json): the
|
|
100
|
+
engine-neutral definitions + simulated org state + expected plan contract.
|
|
101
|
+
|
|
102
|
+
The canonical conformance fixtures are published under
|
|
103
|
+
[`conformance/`](conformance/README.md). They are the executable spec shared
|
|
104
|
+
by the TypeScript and Apex planning engines.
|
|
83
105
|
|
|
84
106
|
## Versioning
|
|
85
107
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Warden conformance fixtures
|
|
2
|
+
|
|
3
|
+
This directory contains the canonical, versioned JSON fixtures shipped in the
|
|
4
|
+
`@syntax-syllogism/warden-core` package. The full fixture contract, v1 planner
|
|
5
|
+
semantics, deterministic ordering, and public API are documented in the
|
|
6
|
+
[published conformance guide](https://github.com/Syntax-Syllogism/warden-core/blob/release/docs/conformance.md).
|
|
7
|
+
|
|
8
|
+
The generated structural contract is
|
|
9
|
+
[`schemas/conformance-fixture.schema.json`](../schemas/conformance-fixture.schema.json).
|
|
10
|
+
|
|
11
|
+
## Adding a fixture
|
|
12
|
+
|
|
13
|
+
Use a numbered filename such as `08-new-case.json`. Keep all references and
|
|
14
|
+
IDs deterministic, add the smallest scenario that demonstrates one behavior,
|
|
15
|
+
and calculate `expectedPlan` according to the
|
|
16
|
+
[v1 planner behavior](https://github.com/Syntax-Syllogism/warden-core/blob/release/docs/conformance.md#v1-planner-behavior). Run the
|
|
17
|
+
conformance test and normal package checks before committing.
|
|
18
|
+
|
|
19
|
+
Fixtures contain no imports or executable code. They are shipped in the
|
|
20
|
+
`@syntax-syllogism/warden-core` package for the Apex consumer to load without
|
|
21
|
+
transformation.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"definitions": {
|
|
4
|
+
"personas": {
|
|
5
|
+
"schemaVersion": 1,
|
|
6
|
+
"personas": {
|
|
7
|
+
"support": {
|
|
8
|
+
"permissionSets": ["Support_User"],
|
|
9
|
+
"publicGroups": ["Support_Group"],
|
|
10
|
+
"queues": ["Case_Queue"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"users": {
|
|
15
|
+
"schemaVersion": 1,
|
|
16
|
+
"users": [{ "userKey": "alice", "userId": "005000000000001AAA", "personas": ["support"] }]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"orgState": {
|
|
20
|
+
"permissionSets": [{ "id": "0PS000000000001AAA", "name": "Support_User", "label": "Support User" }],
|
|
21
|
+
"permissionSetGroups": [],
|
|
22
|
+
"groups": [
|
|
23
|
+
{ "id": "00G000000000001AAA", "developerName": "Support_Group", "label": "Support Group", "type": "Regular" },
|
|
24
|
+
{ "id": "00G000000000002AAA", "developerName": "Case_Queue", "label": "Case Queue", "type": "Queue" }
|
|
25
|
+
],
|
|
26
|
+
"permissionSetAssignments": [],
|
|
27
|
+
"groupMembers": []
|
|
28
|
+
},
|
|
29
|
+
"expectedPlan": [
|
|
30
|
+
{ "userKey": "alice", "userId": "005000000000001AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Support User", "error": "" },
|
|
31
|
+
{ "userKey": "alice", "userId": "005000000000001AAA", "category": "PublicGroup", "action": "wouldAssign", "status": "planned", "detail": "Support Group", "error": "" },
|
|
32
|
+
{ "userKey": "alice", "userId": "005000000000001AAA", "category": "Queue", "action": "wouldAssign", "status": "planned", "detail": "Case Queue", "error": "" }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"definitions": {
|
|
4
|
+
"personas": {
|
|
5
|
+
"personas": {
|
|
6
|
+
"support": { "permissionSets": ["Support_User", "Common_Access"], "publicGroups": ["Support_Group"] },
|
|
7
|
+
"service": { "permissionSets": ["Case_Manager", "Common_Access"], "permissionSetGroups": ["Service_Team"] }
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"users": {
|
|
11
|
+
"users": [{ "userKey": "alice", "userId": "005000000000002AAA", "personas": ["support", "service"] }]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"orgState": {
|
|
15
|
+
"permissionSets": [
|
|
16
|
+
{ "id": "0PS000000000002AAA", "name": "Support_User", "label": "Support User" },
|
|
17
|
+
{ "id": "0PS000000000003AAA", "name": "Common_Access", "label": "Common Access" },
|
|
18
|
+
{ "id": "0PS000000000004AAA", "name": "Case_Manager", "label": "Case Manager" }
|
|
19
|
+
],
|
|
20
|
+
"permissionSetGroups": [{ "id": "0PG000000000001AAA", "developerName": "Service_Team", "label": "Service Team" }],
|
|
21
|
+
"groups": [{ "id": "00G000000000003AAA", "developerName": "Support_Group", "label": "Support Group", "type": "Regular" }],
|
|
22
|
+
"permissionSetAssignments": [],
|
|
23
|
+
"groupMembers": []
|
|
24
|
+
},
|
|
25
|
+
"expectedPlan": [
|
|
26
|
+
{ "userKey": "alice", "userId": "005000000000002AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Case Manager", "error": "" },
|
|
27
|
+
{ "userKey": "alice", "userId": "005000000000002AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Common Access", "error": "" },
|
|
28
|
+
{ "userKey": "alice", "userId": "005000000000002AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Support User", "error": "" },
|
|
29
|
+
{ "userKey": "alice", "userId": "005000000000002AAA", "category": "PermissionSetGroup", "action": "wouldAssign", "status": "planned", "detail": "Service Team", "error": "" },
|
|
30
|
+
{ "userKey": "alice", "userId": "005000000000002AAA", "category": "PublicGroup", "action": "wouldAssign", "status": "planned", "detail": "Support Group", "error": "" }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"definitions": {
|
|
4
|
+
"personas": {
|
|
5
|
+
"personas": {
|
|
6
|
+
"one": { "permissionSets": ["Shared_Access"] },
|
|
7
|
+
"two": { "permissionSets": ["Shared_Access", "Shared_Access"] }
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"users": {
|
|
11
|
+
"users": [{ "userKey": "duplicate-user", "userId": "005000000000003AAA", "personas": ["one", "two"] }]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"orgState": {
|
|
15
|
+
"permissionSets": [{ "id": "0PS000000000005AAA", "name": "Shared_Access", "label": "Shared Access" }],
|
|
16
|
+
"permissionSetGroups": [],
|
|
17
|
+
"groups": [],
|
|
18
|
+
"permissionSetAssignments": [],
|
|
19
|
+
"groupMembers": []
|
|
20
|
+
},
|
|
21
|
+
"expectedPlan": [
|
|
22
|
+
{ "userKey": "duplicate-user", "userId": "005000000000003AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Shared Access", "error": "" }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"definitions": {
|
|
4
|
+
"personas": { "personas": { "support": { "permissionSets": ["Support_User"] } } },
|
|
5
|
+
"users": { "users": [{ "userKey": "existing-user", "userId": "005000000000004AAA", "personas": ["support"] }] }
|
|
6
|
+
},
|
|
7
|
+
"orgState": {
|
|
8
|
+
"permissionSets": [{ "id": "0PS000000000006AAA", "name": "Support_User", "label": "Support User" }],
|
|
9
|
+
"permissionSetGroups": [],
|
|
10
|
+
"groups": [],
|
|
11
|
+
"permissionSetAssignments": [{ "id": "0PA000000000001AAA", "userId": "005000000000004AAA", "permissionSetId": "0PS000000000006AAA", "permissionSetGroupId": null }],
|
|
12
|
+
"groupMembers": []
|
|
13
|
+
},
|
|
14
|
+
"expectedPlan": []
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"definitions": {
|
|
4
|
+
"personas": { "personas": { "support": { "permissionSets": ["Missing_Set"] } } },
|
|
5
|
+
"users": { "users": [{ "userKey": "unresolved-user", "userId": "005000000000005AAA", "personas": ["support"] }] }
|
|
6
|
+
},
|
|
7
|
+
"orgState": {
|
|
8
|
+
"permissionSets": [],
|
|
9
|
+
"permissionSetGroups": [],
|
|
10
|
+
"groups": [],
|
|
11
|
+
"permissionSetAssignments": [],
|
|
12
|
+
"groupMembers": []
|
|
13
|
+
},
|
|
14
|
+
"expectedPlan": [
|
|
15
|
+
{ "userKey": "unresolved-user", "userId": "005000000000005AAA", "category": "PermissionSet", "action": "unresolved", "status": "unmanaged", "detail": "Missing_Set", "error": "Unresolved PermissionSet reference \"Missing_Set\"." }
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"definitions": {
|
|
4
|
+
"personas": {
|
|
5
|
+
"personas": {
|
|
6
|
+
"support": { "permissionSets": ["Support_User"] },
|
|
7
|
+
"service": { "permissionSetGroups": ["Service_Team"] }
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"users": {
|
|
11
|
+
"users": [
|
|
12
|
+
{ "userKey": "alice", "userId": "005000000000006AAA", "personas": ["support"] },
|
|
13
|
+
{ "userKey": "bob", "userId": "005000000000007AAA", "personas": ["service"] }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"orgState": {
|
|
18
|
+
"permissionSets": [{ "id": "0PS000000000007AAA", "name": "Support_User", "label": "Support User" }],
|
|
19
|
+
"permissionSetGroups": [{ "id": "0PG000000000002AAA", "developerName": "Service_Team", "label": "Service Team" }],
|
|
20
|
+
"groups": [],
|
|
21
|
+
"permissionSetAssignments": [],
|
|
22
|
+
"groupMembers": []
|
|
23
|
+
},
|
|
24
|
+
"expectedPlan": [
|
|
25
|
+
{ "userKey": "alice", "userId": "005000000000006AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Support User", "error": "" },
|
|
26
|
+
{ "userKey": "bob", "userId": "005000000000007AAA", "category": "PermissionSetGroup", "action": "wouldAssign", "status": "planned", "detail": "Service Team", "error": "" }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"definitions": {
|
|
4
|
+
"personas": {
|
|
5
|
+
"personas": {
|
|
6
|
+
"ops": { "queues": ["Z_Queue"], "permissionSets": ["Zeta_Access", "Alpha_Access"] },
|
|
7
|
+
"sales": { "publicGroups": ["A_Group"] }
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"users": {
|
|
11
|
+
"users": [
|
|
12
|
+
{ "userKey": "zulu", "userId": "005000000000008AAA", "personas": ["ops"] },
|
|
13
|
+
{ "userKey": "alpha", "userId": "005000000000009AAA", "personas": ["sales", "ops"] }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"orgState": {
|
|
18
|
+
"permissionSets": [
|
|
19
|
+
{ "id": "0PS000000000008AAA", "name": "Zeta_Access", "label": "Zeta Access" },
|
|
20
|
+
{ "id": "0PS000000000009AAA", "name": "Alpha_Access", "label": "Alpha Access" }
|
|
21
|
+
],
|
|
22
|
+
"permissionSetGroups": [],
|
|
23
|
+
"groups": [
|
|
24
|
+
{ "id": "00G000000000004AAA", "developerName": "Z_Queue", "label": "Z Queue", "type": "Queue" },
|
|
25
|
+
{ "id": "00G000000000005AAA", "developerName": "A_Group", "label": "A Group", "type": "Regular" }
|
|
26
|
+
],
|
|
27
|
+
"permissionSetAssignments": [],
|
|
28
|
+
"groupMembers": []
|
|
29
|
+
},
|
|
30
|
+
"expectedPlan": [
|
|
31
|
+
{ "userKey": "alpha", "userId": "005000000000009AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Alpha Access", "error": "" },
|
|
32
|
+
{ "userKey": "alpha", "userId": "005000000000009AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Zeta Access", "error": "" },
|
|
33
|
+
{ "userKey": "alpha", "userId": "005000000000009AAA", "category": "PublicGroup", "action": "wouldAssign", "status": "planned", "detail": "A Group", "error": "" },
|
|
34
|
+
{ "userKey": "alpha", "userId": "005000000000009AAA", "category": "Queue", "action": "wouldAssign", "status": "planned", "detail": "Z Queue", "error": "" },
|
|
35
|
+
{ "userKey": "zulu", "userId": "005000000000008AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Alpha Access", "error": "" },
|
|
36
|
+
{ "userKey": "zulu", "userId": "005000000000008AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Zeta Access", "error": "" },
|
|
37
|
+
{ "userKey": "zulu", "userId": "005000000000008AAA", "category": "Queue", "action": "wouldAssign", "status": "planned", "detail": "Z Queue", "error": "" }
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"definitions": {
|
|
4
|
+
"personas": {
|
|
5
|
+
"personas": {
|
|
6
|
+
"category-keys": {
|
|
7
|
+
"permissionSets": ["Perm_Name", "Perm_DeveloperName"],
|
|
8
|
+
"permissionSetGroups": ["Psg_DeveloperName", "Psg_Name"],
|
|
9
|
+
"publicGroups": ["Group_DeveloperName", "Group_Name"],
|
|
10
|
+
"queues": ["Queue_DeveloperName", "Queue_Name"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"users": {
|
|
15
|
+
"users": [{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "personas": ["category-keys"] }]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"orgState": {
|
|
19
|
+
"permissionSets": [
|
|
20
|
+
{ "id": "0PS000000000008AAA", "name": "Perm_Name", "developerName": "Perm_DeveloperName", "label": "Permission Set" }
|
|
21
|
+
],
|
|
22
|
+
"permissionSetGroups": [
|
|
23
|
+
{ "id": "0PG000000000008AAA", "name": "Psg_Name", "developerName": "Psg_DeveloperName", "label": "Permission Set Group" }
|
|
24
|
+
],
|
|
25
|
+
"groups": [
|
|
26
|
+
{ "id": "00G000000000008AAA", "name": "Group_Name", "developerName": "Group_DeveloperName", "label": "Public Group", "type": "Regular" },
|
|
27
|
+
{ "id": "00G000000000009AAA", "name": "Queue_Name", "developerName": "Queue_DeveloperName", "label": "Queue", "type": "Queue" }
|
|
28
|
+
],
|
|
29
|
+
"permissionSetAssignments": [],
|
|
30
|
+
"groupMembers": []
|
|
31
|
+
},
|
|
32
|
+
"expectedPlan": [
|
|
33
|
+
{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "category": "PermissionSet", "action": "unresolved", "status": "unmanaged", "detail": "Perm_DeveloperName", "error": "Unresolved PermissionSet reference \"Perm_DeveloperName\"." },
|
|
34
|
+
{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "category": "PermissionSet", "action": "wouldAssign", "status": "planned", "detail": "Permission Set", "error": "" },
|
|
35
|
+
{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "category": "PermissionSetGroup", "action": "wouldAssign", "status": "planned", "detail": "Permission Set Group", "error": "" },
|
|
36
|
+
{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "category": "PermissionSetGroup", "action": "unresolved", "status": "unmanaged", "detail": "Psg_Name", "error": "Unresolved PermissionSetGroup reference \"Psg_Name\"." },
|
|
37
|
+
{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "category": "PublicGroup", "action": "unresolved", "status": "unmanaged", "detail": "Group_Name", "error": "Unresolved PublicGroup reference \"Group_Name\"." },
|
|
38
|
+
{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "category": "PublicGroup", "action": "wouldAssign", "status": "planned", "detail": "Public Group", "error": "" },
|
|
39
|
+
{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "category": "Queue", "action": "wouldAssign", "status": "planned", "detail": "Queue", "error": "" },
|
|
40
|
+
{ "userKey": "category-keys-user", "userId": "005000000000008AAA", "category": "Queue", "action": "unresolved", "status": "unmanaged", "detail": "Queue_Name", "error": "Unresolved Queue reference \"Queue_Name\"." }
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const provisionOptionsSchema: z.ZodObject<{
|
|
3
|
+
usersPath: z.ZodOptional<z.ZodString>;
|
|
4
|
+
usersDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
5
|
+
personasPath: z.ZodOptional<z.ZodString>;
|
|
6
|
+
personasDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
7
|
+
relatedPath: z.ZodOptional<z.ZodString>;
|
|
8
|
+
relatedDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
9
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
inputFormat: z.ZodOptional<z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>>;
|
|
11
|
+
csvListDelimiter: z.ZodOptional<z.ZodString>;
|
|
12
|
+
fuzzyUsername: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const freezeOptionsSchema: z.ZodObject<{
|
|
15
|
+
user: z.ZodOptional<z.ZodString>;
|
|
16
|
+
usersPath: z.ZodOptional<z.ZodString>;
|
|
17
|
+
usersDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
18
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
inputFormat: z.ZodOptional<z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>>;
|
|
20
|
+
csvListDelimiter: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const unfreezeOptionsSchema: z.ZodObject<{
|
|
23
|
+
user: z.ZodOptional<z.ZodString>;
|
|
24
|
+
usersPath: z.ZodOptional<z.ZodString>;
|
|
25
|
+
usersDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
26
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
27
|
+
inputFormat: z.ZodOptional<z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>>;
|
|
28
|
+
csvListDelimiter: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const stripOptionsSchema: z.ZodObject<{
|
|
31
|
+
noFreeze: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
+
noDeactivate: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
keepPermsets: z.ZodDefault<z.ZodBoolean>;
|
|
34
|
+
keepPermsetGroups: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
+
keepPublicGroups: z.ZodDefault<z.ZodBoolean>;
|
|
36
|
+
keepQueues: z.ZodDefault<z.ZodBoolean>;
|
|
37
|
+
keepLicenses: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
user: z.ZodOptional<z.ZodString>;
|
|
39
|
+
usersPath: z.ZodOptional<z.ZodString>;
|
|
40
|
+
usersDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
41
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
42
|
+
inputFormat: z.ZodOptional<z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>>;
|
|
43
|
+
csvListDelimiter: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const diffOptionsSchema: z.ZodObject<{
|
|
46
|
+
mode: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
47
|
+
verify: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
+
user: z.ZodOptional<z.ZodString>;
|
|
49
|
+
against: z.ZodOptional<z.ZodString>;
|
|
50
|
+
usersPath: z.ZodOptional<z.ZodString>;
|
|
51
|
+
usersDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
52
|
+
personasPath: z.ZodOptional<z.ZodString>;
|
|
53
|
+
personasDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
54
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
55
|
+
inputFormat: z.ZodOptional<z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>>;
|
|
56
|
+
csvListDelimiter: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export declare const accessOptionsSchema: z.ZodObject<{
|
|
59
|
+
type: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
60
|
+
target: z.ZodOptional<z.ZodString>;
|
|
61
|
+
user: z.ZodOptional<z.ZodString>;
|
|
62
|
+
sobject: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export declare const snapshotOptionsSchema: z.ZodObject<{
|
|
65
|
+
org: z.ZodOptional<z.ZodString>;
|
|
66
|
+
user: z.ZodOptional<z.ZodString>;
|
|
67
|
+
usersPath: z.ZodOptional<z.ZodString>;
|
|
68
|
+
usersDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
69
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
inputFormat: z.ZodOptional<z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>>;
|
|
71
|
+
csvListDelimiter: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
export declare const restoreOptionsSchema: z.ZodObject<{
|
|
74
|
+
snapshotPath: z.ZodOptional<z.ZodString>;
|
|
75
|
+
snapshotDoc: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
export type ProvisionOptions = z.infer<typeof provisionOptionsSchema>;
|
|
78
|
+
export type FreezeOptions = z.infer<typeof freezeOptionsSchema>;
|
|
79
|
+
export type UnfreezeOptions = z.infer<typeof unfreezeOptionsSchema>;
|
|
80
|
+
export type StripOptions = z.infer<typeof stripOptionsSchema>;
|
|
81
|
+
export type DiffOptions = z.infer<typeof diffOptionsSchema>;
|
|
82
|
+
export type AccessOptions = z.infer<typeof accessOptionsSchema>;
|
|
83
|
+
export type SnapshotOptions = z.infer<typeof snapshotOptionsSchema>;
|
|
84
|
+
export type RestoreOptions = z.infer<typeof restoreOptionsSchema>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const field = (schema, ui) => schema.meta({ ui });
|
|
3
|
+
const file = (label, fileFilter = 'json') => field(z.string(), { kind: 'file', label, fileFilter });
|
|
4
|
+
const text = (label, extra = {}) => field(z.string(), { kind: 'string', label, ...extra });
|
|
5
|
+
const boolean = (label) => field(z.boolean(), { kind: 'boolean', label });
|
|
6
|
+
const enumValue = (values, label) => field(z.enum(values), { kind: 'enum', label });
|
|
7
|
+
const document = (label) => field(z.record(z.string(), z.unknown()).optional(), { kind: 'string', label });
|
|
8
|
+
const targetFields = {
|
|
9
|
+
user: text('User match (field:value)', { exclusiveGroup: 'user' }).optional(),
|
|
10
|
+
usersPath: file('Users definition file', 'json-or-csv').optional(),
|
|
11
|
+
usersDoc: document('Users definition document').optional(),
|
|
12
|
+
externalId: text('External ID field', { dependsOn: 'usersPath' }).optional(),
|
|
13
|
+
inputFormat: enumValue(['json', 'csv'], 'Input format').optional(),
|
|
14
|
+
csvListDelimiter: text('CSV list delimiter', { dependsOn: 'inputFormat' }).optional(),
|
|
15
|
+
};
|
|
16
|
+
export const provisionOptionsSchema = z.object({
|
|
17
|
+
usersPath: file('Users definition file', 'json-or-csv').optional(),
|
|
18
|
+
usersDoc: document('Users definition document').optional(),
|
|
19
|
+
personasPath: file('Personas definition file').optional(),
|
|
20
|
+
personasDoc: document('Personas definition document').optional(),
|
|
21
|
+
relatedPath: file('Related record definition file').optional(),
|
|
22
|
+
relatedDoc: document('Related record definition document').optional(),
|
|
23
|
+
externalId: text('External ID field', { dependsOn: 'usersPath' }).optional(),
|
|
24
|
+
inputFormat: enumValue(['json', 'csv'], 'Input format').optional(),
|
|
25
|
+
csvListDelimiter: text('CSV list delimiter', { dependsOn: 'inputFormat' }).optional(),
|
|
26
|
+
fuzzyUsername: boolean('Allow fuzzy usernames').default(false),
|
|
27
|
+
});
|
|
28
|
+
export const freezeOptionsSchema = z.object({
|
|
29
|
+
...targetFields,
|
|
30
|
+
});
|
|
31
|
+
export const unfreezeOptionsSchema = z.object({
|
|
32
|
+
...targetFields,
|
|
33
|
+
});
|
|
34
|
+
export const stripOptionsSchema = z.object({
|
|
35
|
+
...targetFields,
|
|
36
|
+
noFreeze: boolean('Do not freeze users').default(false),
|
|
37
|
+
noDeactivate: boolean('Do not deactivate users').default(false),
|
|
38
|
+
keepPermsets: boolean('Keep permission sets').default(false),
|
|
39
|
+
keepPermsetGroups: boolean('Keep permission set groups').default(false),
|
|
40
|
+
keepPublicGroups: boolean('Keep public groups').default(false),
|
|
41
|
+
keepQueues: boolean('Keep queues').default(false),
|
|
42
|
+
keepLicenses: boolean('Keep permission set licenses').default(false),
|
|
43
|
+
});
|
|
44
|
+
export const diffOptionsSchema = z.object({
|
|
45
|
+
mode: enumValue(['persona', 'user'], 'Diff mode'),
|
|
46
|
+
verify: boolean('Verify conformance').default(false),
|
|
47
|
+
user: text('User match (field:value)', { exclusiveGroup: 'user' }).optional(),
|
|
48
|
+
against: text('Reference user match (field:value)', { dependsOn: 'user' }).optional(),
|
|
49
|
+
usersPath: file('Users definition file', 'json-or-csv').optional(),
|
|
50
|
+
usersDoc: document('Users definition document').optional(),
|
|
51
|
+
personasPath: file('Personas definition file').optional(),
|
|
52
|
+
personasDoc: document('Personas definition document').optional(),
|
|
53
|
+
externalId: text('External ID field', { dependsOn: 'usersPath' }).optional(),
|
|
54
|
+
inputFormat: enumValue(['json', 'csv'], 'Input format').optional(),
|
|
55
|
+
csvListDelimiter: text('CSV list delimiter', { dependsOn: 'inputFormat' }).optional(),
|
|
56
|
+
});
|
|
57
|
+
export const accessOptionsSchema = z.object({
|
|
58
|
+
type: enumValue(['field', 'object', 'apex-class', 'vf-page', 'custom-permission', 'tab', 'record-type'], 'Access type'),
|
|
59
|
+
target: text('Access target', { exclusiveGroup: 'target' }).optional(),
|
|
60
|
+
user: text('User match (field:value)', { exclusiveGroup: 'user' }).optional(),
|
|
61
|
+
sobject: text('SObject API name', { dependsOn: 'user' }).optional(),
|
|
62
|
+
});
|
|
63
|
+
export const snapshotOptionsSchema = z.object({
|
|
64
|
+
...targetFields,
|
|
65
|
+
org: text('Org provenance').optional(),
|
|
66
|
+
});
|
|
67
|
+
export const restoreOptionsSchema = z.object({
|
|
68
|
+
snapshotPath: file('Snapshot file').optional(),
|
|
69
|
+
snapshotDoc: document('Snapshot document').optional(),
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=commandOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandOptions.js","sourceRoot":"","sources":["../src/command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C;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,GAAG,YAAY;IACf,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAC9C,WAAW,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;CACtD,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,9 +4,8 @@ export { flattenAccessRow, renderEnabledTable, renderFieldTable, renderObjectTab
|
|
|
4
4
|
export { getResolver } from './access/resolvers/index.js';
|
|
5
5
|
export { resolveReverseAccess, reverseCsvColumns } from './access/reverse.js';
|
|
6
6
|
export { LifecycleError } from './lifecycle/errors.js';
|
|
7
|
-
export {
|
|
7
|
+
export { FREEZE, UNFREEZE } from './lifecycle/freezeState.js';
|
|
8
8
|
export { failedResult, makeNotice, renderLifecycleResult, resolvedTargetResult, summarizeLifecycle, } from './lifecycle/output.js';
|
|
9
|
-
export { executeStrip } from './lifecycle/stripPlan.js';
|
|
10
9
|
export { buildSnapshotFile, readSnapshotFile, writeSnapshotFile } from './lifecycle/snapshotState.js';
|
|
11
10
|
export { buildTargetRequests, parseUserFlag, resolveTargetField, resolveTargets } from './lifecycle/targeting.js';
|
|
12
11
|
export { executePersonaDiff, executeUserToUserDiff } from './lifecycle/userDiff.js';
|
|
@@ -20,12 +19,19 @@ export { readProvisionDefinitions } from './provisioning/definitionReader.js';
|
|
|
20
19
|
export { RelatedRecordsError } from './relatedRecords/errors.js';
|
|
21
20
|
export { personaDefinitionsFileSchema, personaSchema, relatedCatalogSchema, relationshipDefSchema, snapshotFileSchema, userInputSchema, userSnapshotEntrySchema, usersDefinitionFileSchema, USERS_CSV_COLUMNS, } from './spec/index.js';
|
|
22
21
|
export { parsePersonaDefinitions, parseRelatedCatalog, parseSnapshot, parseUsersDefinition, safeParsePersonaDefinitions, safeParseRelatedCatalog, safeParseSnapshot, safeParseUsersDefinition, validatePersonaDefinitionsText, validateRelatedCatalogText, validateSnapshotText, validateUsersDefinitionText, } from './spec/index.js';
|
|
23
|
-
export { confirmWithTimeout } from './shared/prompt.js';
|
|
24
22
|
export { detectInputFormat, serializeCsv } from './shared/csv.js';
|
|
25
23
|
export { describeUserFields } from './shared/userFields.js';
|
|
26
24
|
export { renderLifecycleCsv, renderProvisionCsv, renderRestoreCsv, renderSnapshotCsv, renderStripCsv, } from './shared/output.js';
|
|
27
25
|
export { soqlIn } from './shared/sfUtils.js';
|
|
26
|
+
export { access, commandDescriptors, diff, freeze, provision, restore, snapshot, strip, unfreeze } from './useCases.js';
|
|
27
|
+
export { accessOptionsSchema, diffOptionsSchema, freezeOptionsSchema, provisionOptionsSchema, restoreOptionsSchema, snapshotOptionsSchema, stripOptionsSchema, unfreezeOptionsSchema, } from './commandOptions.js';
|
|
28
|
+
export { uiHints } from './useCase.js';
|
|
29
|
+
export { planFromState } from './provisioning/conformancePlan.js';
|
|
30
|
+
export { conformanceCategorySchema, conformanceDefinitionsSchema, conformanceFixtureSchema, conformanceOrgStateSchema, conformancePlanRowSchema, conformanceUsersDefinitionSchema, parseConformanceFixture, safeParseConformanceFixture, validateConformanceFixtureText, } from './spec/index.js';
|
|
28
31
|
export type { InputFormat } from './shared/csv.js';
|
|
32
|
+
export type { AccessOptions, DiffOptions, FreezeOptions, ProvisionOptions, RestoreOptions, SnapshotOptions, StripOptions, UnfreezeOptions, } from './commandOptions.js';
|
|
33
|
+
export type { CommandDescriptor, ProgressEvent, ReadUseCase, UiHint, UseCase, UseCaseContext, WriteUseCase, } from './useCase.js';
|
|
34
|
+
export type { FreezePlan, ProvisionPlan, RestorePlan, StripPlan } from './useCases.js';
|
|
29
35
|
export type { AccessTargetType, UserAccessResult, UserAccessRow, ValidatedAccessTarget } from './access/types.js';
|
|
30
36
|
export type { AssignmentState } from './lifecycle/assignmentState.js';
|
|
31
37
|
export type { IdentityReview, LabelBundle, LifecycleResult, LifecycleUserResult, ResolvedTargetUser, TargetRequest, } from './lifecycle/types.js';
|
|
@@ -34,4 +40,5 @@ export type { StripFlags } from './lifecycle/stripPlan.js';
|
|
|
34
40
|
export type { UserDiffResult } from './lifecycle/userDiff.js';
|
|
35
41
|
export type { UserConformanceVerdict } from './lifecycle/conformance.js';
|
|
36
42
|
export type { UserSnapshotEntry } from './lifecycle/snapshotState.js';
|
|
43
|
+
export type { ConformanceCategory, ConformanceDefinitions, ConformanceFixture, ConformanceOrgState, ConformancePlanRow, } from './spec/index.js';
|
|
37
44
|
export type { PersonaDefinition, PersonaDefinitionsFile, RelatedCatalog, RelationshipDef, RelationshipMode, RelationshipPhase, SchemaFailure, SchemaIssue, SchemaResult, SchemaSuccess, SourceExpr, UserInput, UserSnapshotFile, UsersDefinitionFile, } from './spec/index.js';
|
package/lib/index.js
CHANGED
|
@@ -9,9 +9,8 @@ export { flattenAccessRow, renderEnabledTable, renderFieldTable, renderObjectTab
|
|
|
9
9
|
export { getResolver } from './access/resolvers/index.js';
|
|
10
10
|
export { resolveReverseAccess, reverseCsvColumns } from './access/reverse.js';
|
|
11
11
|
export { LifecycleError } from './lifecycle/errors.js';
|
|
12
|
-
export {
|
|
12
|
+
export { FREEZE, UNFREEZE } from './lifecycle/freezeState.js';
|
|
13
13
|
export { failedResult, makeNotice, renderLifecycleResult, resolvedTargetResult, summarizeLifecycle, } from './lifecycle/output.js';
|
|
14
|
-
export { executeStrip } from './lifecycle/stripPlan.js';
|
|
15
14
|
export { buildSnapshotFile, readSnapshotFile, writeSnapshotFile } from './lifecycle/snapshotState.js';
|
|
16
15
|
export { buildTargetRequests, parseUserFlag, resolveTargetField, resolveTargets } from './lifecycle/targeting.js';
|
|
17
16
|
export { executePersonaDiff, executeUserToUserDiff } from './lifecycle/userDiff.js';
|
|
@@ -25,9 +24,13 @@ export { readProvisionDefinitions } from './provisioning/definitionReader.js';
|
|
|
25
24
|
export { RelatedRecordsError } from './relatedRecords/errors.js';
|
|
26
25
|
export { personaDefinitionsFileSchema, personaSchema, relatedCatalogSchema, relationshipDefSchema, snapshotFileSchema, userInputSchema, userSnapshotEntrySchema, usersDefinitionFileSchema, USERS_CSV_COLUMNS, } from './spec/index.js';
|
|
27
26
|
export { parsePersonaDefinitions, parseRelatedCatalog, parseSnapshot, parseUsersDefinition, safeParsePersonaDefinitions, safeParseRelatedCatalog, safeParseSnapshot, safeParseUsersDefinition, validatePersonaDefinitionsText, validateRelatedCatalogText, validateSnapshotText, validateUsersDefinitionText, } from './spec/index.js';
|
|
28
|
-
export { confirmWithTimeout } from './shared/prompt.js';
|
|
29
27
|
export { detectInputFormat, serializeCsv } from './shared/csv.js';
|
|
30
28
|
export { describeUserFields } from './shared/userFields.js';
|
|
31
29
|
export { renderLifecycleCsv, renderProvisionCsv, renderRestoreCsv, renderSnapshotCsv, renderStripCsv, } from './shared/output.js';
|
|
32
30
|
export { soqlIn } from './shared/sfUtils.js';
|
|
31
|
+
export { access, commandDescriptors, diff, freeze, provision, restore, snapshot, strip, unfreeze } from './useCases.js';
|
|
32
|
+
export { accessOptionsSchema, diffOptionsSchema, freezeOptionsSchema, provisionOptionsSchema, restoreOptionsSchema, snapshotOptionsSchema, stripOptionsSchema, unfreezeOptionsSchema, } from './commandOptions.js';
|
|
33
|
+
export { uiHints } from './useCase.js';
|
|
34
|
+
export { planFromState } from './provisioning/conformancePlan.js';
|
|
35
|
+
export { conformanceCategorySchema, conformanceDefinitionsSchema, conformanceFixtureSchema, conformanceOrgStateSchema, conformancePlanRowSchema, conformanceUsersDefinitionSchema, parseConformanceFixture, safeParseConformanceFixture, validateConformanceFixtureText, } from './spec/index.js';
|
|
33
36
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,+EAA+E;AAC/E,6DAA6D;AAC7D,2EAA2E;AAC3E,oFAAoF;AAEpF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,+EAA+E;AAC/E,6DAA6D;AAC7D,2EAA2E;AAC3E,oFAAoF;AAEpF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,oBAA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EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WardenError } from '../errors.js';
|
|
2
|
-
export type LifecycleErrorCode = 'errorInvalidJson' | 'errorInvalidUserMatchField' | 'errorInvalidUserValue' | 'errorInvalidAgainstValue' | 'errorInvalidAgainstMatchField' | 'errorInvalidSnapshot' | 'errorPromptDeclined';
|
|
2
|
+
export type LifecycleErrorCode = 'errorInvalidJson' | 'errorInvalidUserMatchField' | 'errorInvalidUserValue' | 'errorInvalidAgainstValue' | 'errorInvalidAgainstMatchField' | 'errorInvalidSnapshot' | 'errorPromptDeclined' | 'errorAccessScopesMutuallyExclusive' | 'errorVerifyUserMode';
|
|
3
3
|
export declare class LifecycleError extends WardenError<LifecycleErrorCode> {
|
|
4
4
|
constructor(code: LifecycleErrorCode, message: string, data?: unknown);
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lifecycle/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lifecycle/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAa3C,MAAM,OAAO,cAAe,SAAQ,WAA+B;IACjE,YAAmB,IAAwB,EAAE,OAAe,EAAE,IAAc;QAC1E,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF"}
|