kalup 0.1.1 → 0.3.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/README.md +15 -10
- package/dist/{commands-BpQ20pA7.mjs → commands-T4j_GVBD.mjs} +11316 -10354
- package/dist/commands.d.mts +5 -1
- package/dist/commands.mjs +1 -1
- package/dist/{context-D10Syqfd.d.mts → context-C1tH5K0x.d.mts} +84 -7
- package/dist/{host-CcBOCkff.mjs → host-CDDeLV5T.mjs} +1 -1
- package/dist/host.d.mts +1 -1
- package/dist/host.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/schemas/blueprint-1.schema.json +42 -4
- package/dist/schemas/blueprints-lock-1.schema.json +2 -2
- package/dist/schemas/ir-1.schema.json +42 -5
- package/dist/schemas/plan-1.schema.json +1 -1
- package/docs/apply.md +4 -4
- package/docs/blueprints.md +3 -3
- package/docs/compare.md +1 -1
- package/docs/config.md +32 -16
- package/docs/errors/E_BAD_CHAIN.md +1 -1
- package/docs/errors/E_BIOME_CONFIG.md +2 -2
- package/docs/errors/E_BLUEPRINT_ADDED.md +2 -2
- package/docs/errors/E_BLUEPRINT_INTEGRITY.md +1 -1
- package/docs/errors/E_BLUEPRINT_LOCK.md +3 -3
- package/docs/errors/E_BLUEPRINT_ORIGINAL.md +3 -3
- package/docs/errors/E_BLUEPRINT_SCHEMA.md +2 -2
- package/docs/errors/E_BLUEPRINT_SOURCE.md +1 -1
- package/docs/errors/E_BLUEPRINT_UNKNOWN.md +2 -2
- package/docs/errors/E_DEFINITION_FIELD.md +29 -0
- package/docs/errors/E_DIR_AMBIGUOUS.md +17 -0
- package/docs/errors/E_DIR_IN_USE.md +17 -0
- package/docs/errors/E_DUPLICATE_ADDRESS.md +1 -1
- package/docs/errors/E_DUPLICATE_ALIAS.md +1 -1
- package/docs/errors/E_DUPLICATE_KEY.md +1 -1
- package/docs/errors/E_DUPLICATE_OPTION.md +1 -1
- package/docs/errors/E_HS_PREFIX.md +3 -3
- package/docs/errors/E_HTTP.md +1 -1
- package/docs/errors/E_KEY_COLLISION.md +1 -1
- package/docs/errors/E_LIFECYCLE.md +3 -3
- package/docs/errors/E_LOCKED.md +1 -1
- package/docs/errors/E_MISSING_EXPORT.md +4 -4
- package/docs/errors/E_MISSING_KEY.md +1 -1
- package/docs/errors/E_NOT_DATA.md +1 -1
- package/docs/errors/E_OVERRIDE_DEFINITION.md +2 -2
- package/docs/errors/E_PENDING_TARGET.md +17 -0
- package/docs/errors/E_PLAN_DELETE.md +1 -1
- package/docs/errors/E_PORTAL_ID.md +2 -2
- package/docs/errors/E_PREVENT_DESTROY.md +1 -1
- package/docs/errors/E_PROJECT_WRITE.md +1 -1
- package/docs/errors/E_PROTECTED_SAVED_PLAN.md +4 -4
- package/docs/errors/E_PULL_INVALID.md +2 -2
- package/docs/errors/E_REFERENCE_DEFINITION.md +1 -1
- package/docs/errors/E_RM_DEPENDENTS.md +1 -1
- package/docs/errors/E_SETTING_VALUE.md +3 -1
- package/docs/errors/E_STANDARD_OBJECT.md +1 -1
- package/docs/errors/E_STRICT_WITHOUT_OPTIONS.md +1 -1
- package/docs/errors/E_TARGET_PORTAL_MISMATCH.md +1 -1
- package/docs/errors/E_TOMBSTONE_ADDRESS.md +3 -3
- package/docs/errors/E_TOMBSTONE_CONFLICT.md +3 -3
- package/docs/errors/E_TYPE_FIELDTYPE.md +2 -2
- package/docs/errors/E_UNKNOWN_BUILDER.md +2 -2
- package/docs/errors/E_UNKNOWN_GROUP.md +1 -1
- package/docs/errors/E_UNKNOWN_INCLUDE.md +3 -1
- package/docs/errors/E_UNSUPPORTED_FILE.md +4 -4
- package/docs/errors/E_USAGE.md +1 -1
- package/docs/errors/E_WRITE_IN_READ_MODE.md +1 -1
- package/docs/errors/W_CODEC_MISMATCH.md +1 -1
- package/docs/errors/W_JSON_FIELDTYPE.md +1 -1
- package/docs/errors/W_LARGE_SCOPE.md +5 -5
- package/docs/errors/W_LEGACY_DIR.md +17 -0
- package/docs/errors/W_LIMIT_UNREADABLE.md +2 -2
- package/docs/errors/W_PENDING_TARGET.md +23 -0
- package/docs/errors/W_PREFIX.md +1 -1
- package/docs/errors/W_RATE_HEADERS.md +1 -1
- package/docs/errors/W_RATE_LIMIT.md +1 -1
- package/docs/errors/W_STATE_NOT_MOVED.md +17 -0
- package/docs/errors/W_UNADDRESSABLE_NAME.md +1 -1
- package/docs/errors/W_UNSUPPORTED_TYPE.md +3 -3
- package/docs/errors/W_WRITE_SCOPE.md +17 -0
- package/docs/plan.md +5 -5
- package/docs/pull.md +9 -9
- package/docs/rm.md +3 -3
- package/docs/state.md +4 -2
- package/docs/targets.md +4 -4
- package/package.json +3 -9
- package/docs/errors/E_FIRST_PULL.md +0 -18
package/README.md
CHANGED
|
@@ -20,19 +20,22 @@ Node 22.13.1 or later. Your app imports `@kalup/core` at run time (7 kB, no depe
|
|
|
20
20
|
Create a service key in HubSpot under Development > Keys > Service keys, with `crm.schemas.<object>.read` for each object you manage, the matching `.write` scopes to apply changes, and one `crm.objects.<object>.read` so `plan` can check the property limit. Put it in `.env` as `HUBSPOT_SERVICE_KEY`, then:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
npx kalup init --portal <portal-id> #
|
|
24
|
-
npx kalup
|
|
25
|
-
npx kalup
|
|
23
|
+
npx kalup init --portal <portal-id> # offline: write kalup.config.ts, hubspot/ and AGENTS.md
|
|
24
|
+
npx kalup pull # check the key's portal, write hubspot/objects/
|
|
25
|
+
npx kalup plan # edit a file first; review every step
|
|
26
|
+
npx kalup apply # plans again, then you type the target name to confirm
|
|
26
27
|
```
|
|
27
28
|
|
|
28
|
-
`init` prints the exact scopes the key needs. Nothing is written to the portal until `apply`, and `apply` asks for one approval: a person at a terminal, `--yes` for a small safe change on an unprotected target, or `--approve` from a reviewed CI job. Every delete needs the person.
|
|
29
|
+
`init` needs no key and prints the exact scopes the key needs. `--dir lib/config/hubspot` puts the object files elsewhere. Nothing is written to the portal until `apply`, and `apply` asks for one approval: a person at a terminal, `--yes` for a small safe change on an unprotected target, or `--approve` from a reviewed CI job. Every delete needs the person. To review a plan before it runs, or to apply from CI, save it with `kalup plan --out` and apply the file.
|
|
30
|
+
|
|
31
|
+
Commit `kalup.config.ts` and `hubspot/`. Keep `.kalup/`, plan files and `.env` out of git; `init` adds the ignore lines.
|
|
29
32
|
|
|
30
33
|
## Commands
|
|
31
34
|
|
|
32
35
|
| Command | What it does |
|
|
33
36
|
|---|---|
|
|
34
|
-
| `kalup init` | Create kalup.config.ts and
|
|
35
|
-
| `kalup pull` | Read a target and write
|
|
37
|
+
| `kalup init` | Create kalup.config.ts and the project files. Offline: no key, no request. |
|
|
38
|
+
| `kalup pull` | Read a target and write the object files. |
|
|
36
39
|
| `kalup validate` | Check the config files and report every issue. |
|
|
37
40
|
| `kalup ir` | Print the IR document derived from the config files. |
|
|
38
41
|
| `kalup fmt` | Rewrite config files in canonical form. |
|
|
@@ -41,8 +44,8 @@ npx kalup apply plan.json # type the target name to confirm
|
|
|
41
44
|
| `kalup plan` | Show what apply would change on a target. |
|
|
42
45
|
| `kalup snapshot` | Save a read of a target as a snapshot file. |
|
|
43
46
|
| `kalup docs` | Write a Markdown data dictionary of the config or a snapshot. |
|
|
44
|
-
| `kalup apply` | Apply a saved plan
|
|
45
|
-
| `kalup rm` | Take a property or group out of config and write its tombstone in
|
|
47
|
+
| `kalup apply` | Apply a saved plan, or plan a target and apply it in one run after a person at a terminal confirms it. |
|
|
48
|
+
| `kalup rm` | Take a property or group out of config and write its tombstone in removed.ts. |
|
|
46
49
|
| `kalup state rebuild` | Report what a target's portal holds against its state; --write replaces the state file. |
|
|
47
50
|
| `kalup target rebind` | Point a target at a recreated test portal or sandbox. A terminal only. |
|
|
48
51
|
| `kalup add` | Write a blueprint from a JSON file or https URL into the config files. Never touches a portal. |
|
|
@@ -50,13 +53,15 @@ npx kalup apply plan.json # type the target name to confirm
|
|
|
50
53
|
|
|
51
54
|
`kalup <command> --help` lists each command's flags.
|
|
52
55
|
|
|
53
|
-
## What
|
|
56
|
+
## What it covers
|
|
54
57
|
|
|
55
58
|
- Reads and writes properties and property groups on standard and custom objects. Custom object schemas are read and compared, not written.
|
|
59
|
+
- Every property definition field HubSpot lets you write, such as display hints, `hidden`, `displayOrder` and calculation formulas, checked against a live developer test account.
|
|
56
60
|
- Takeover mode, `exclude`, `adopt: 'overwrite'` and `yesLimit` per target, lenient enums, blueprints and per-target overrides.
|
|
61
|
+
- State local to your machine by default, or committed with `state: 'repo'`. Monorepos and git worktrees.
|
|
57
62
|
- Every command takes `--json` and prints one `envelope/1` document with stable issue codes and exit codes. The JSON Schemas ship as `kalup/schemas/<file>`.
|
|
58
63
|
|
|
59
|
-
The pull, plan, apply and drift workflow passed [live runs](https://github.com/scopiousdigital/kalup/blob/main/docs/hubspot.md#live-runs) on a HubSpot developer test account
|
|
64
|
+
The pull, plan, apply and drift workflow passed [live runs](https://github.com/scopiousdigital/kalup/blob/main/docs/hubspot.md#live-runs) on a HubSpot developer test account. Start on a test account or sandbox. Pipelines, custom object schema writes and association labels are next. Before 1.0, a minor release may change the config grammar or the JSON output, and its release notes say so.
|
|
60
65
|
|
|
61
66
|
## Docs
|
|
62
67
|
|