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.
Files changed (84) hide show
  1. package/README.md +15 -10
  2. package/dist/{commands-BpQ20pA7.mjs → commands-T4j_GVBD.mjs} +11316 -10354
  3. package/dist/commands.d.mts +5 -1
  4. package/dist/commands.mjs +1 -1
  5. package/dist/{context-D10Syqfd.d.mts → context-C1tH5K0x.d.mts} +84 -7
  6. package/dist/{host-CcBOCkff.mjs → host-CDDeLV5T.mjs} +1 -1
  7. package/dist/host.d.mts +1 -1
  8. package/dist/host.mjs +1 -1
  9. package/dist/index.mjs +1 -1
  10. package/dist/schemas/blueprint-1.schema.json +42 -4
  11. package/dist/schemas/blueprints-lock-1.schema.json +2 -2
  12. package/dist/schemas/ir-1.schema.json +42 -5
  13. package/dist/schemas/plan-1.schema.json +1 -1
  14. package/docs/apply.md +4 -4
  15. package/docs/blueprints.md +3 -3
  16. package/docs/compare.md +1 -1
  17. package/docs/config.md +32 -16
  18. package/docs/errors/E_BAD_CHAIN.md +1 -1
  19. package/docs/errors/E_BIOME_CONFIG.md +2 -2
  20. package/docs/errors/E_BLUEPRINT_ADDED.md +2 -2
  21. package/docs/errors/E_BLUEPRINT_INTEGRITY.md +1 -1
  22. package/docs/errors/E_BLUEPRINT_LOCK.md +3 -3
  23. package/docs/errors/E_BLUEPRINT_ORIGINAL.md +3 -3
  24. package/docs/errors/E_BLUEPRINT_SCHEMA.md +2 -2
  25. package/docs/errors/E_BLUEPRINT_SOURCE.md +1 -1
  26. package/docs/errors/E_BLUEPRINT_UNKNOWN.md +2 -2
  27. package/docs/errors/E_DEFINITION_FIELD.md +29 -0
  28. package/docs/errors/E_DIR_AMBIGUOUS.md +17 -0
  29. package/docs/errors/E_DIR_IN_USE.md +17 -0
  30. package/docs/errors/E_DUPLICATE_ADDRESS.md +1 -1
  31. package/docs/errors/E_DUPLICATE_ALIAS.md +1 -1
  32. package/docs/errors/E_DUPLICATE_KEY.md +1 -1
  33. package/docs/errors/E_DUPLICATE_OPTION.md +1 -1
  34. package/docs/errors/E_HS_PREFIX.md +3 -3
  35. package/docs/errors/E_HTTP.md +1 -1
  36. package/docs/errors/E_KEY_COLLISION.md +1 -1
  37. package/docs/errors/E_LIFECYCLE.md +3 -3
  38. package/docs/errors/E_LOCKED.md +1 -1
  39. package/docs/errors/E_MISSING_EXPORT.md +4 -4
  40. package/docs/errors/E_MISSING_KEY.md +1 -1
  41. package/docs/errors/E_NOT_DATA.md +1 -1
  42. package/docs/errors/E_OVERRIDE_DEFINITION.md +2 -2
  43. package/docs/errors/E_PENDING_TARGET.md +17 -0
  44. package/docs/errors/E_PLAN_DELETE.md +1 -1
  45. package/docs/errors/E_PORTAL_ID.md +2 -2
  46. package/docs/errors/E_PREVENT_DESTROY.md +1 -1
  47. package/docs/errors/E_PROJECT_WRITE.md +1 -1
  48. package/docs/errors/E_PROTECTED_SAVED_PLAN.md +4 -4
  49. package/docs/errors/E_PULL_INVALID.md +2 -2
  50. package/docs/errors/E_REFERENCE_DEFINITION.md +1 -1
  51. package/docs/errors/E_RM_DEPENDENTS.md +1 -1
  52. package/docs/errors/E_SETTING_VALUE.md +3 -1
  53. package/docs/errors/E_STANDARD_OBJECT.md +1 -1
  54. package/docs/errors/E_STRICT_WITHOUT_OPTIONS.md +1 -1
  55. package/docs/errors/E_TARGET_PORTAL_MISMATCH.md +1 -1
  56. package/docs/errors/E_TOMBSTONE_ADDRESS.md +3 -3
  57. package/docs/errors/E_TOMBSTONE_CONFLICT.md +3 -3
  58. package/docs/errors/E_TYPE_FIELDTYPE.md +2 -2
  59. package/docs/errors/E_UNKNOWN_BUILDER.md +2 -2
  60. package/docs/errors/E_UNKNOWN_GROUP.md +1 -1
  61. package/docs/errors/E_UNKNOWN_INCLUDE.md +3 -1
  62. package/docs/errors/E_UNSUPPORTED_FILE.md +4 -4
  63. package/docs/errors/E_USAGE.md +1 -1
  64. package/docs/errors/E_WRITE_IN_READ_MODE.md +1 -1
  65. package/docs/errors/W_CODEC_MISMATCH.md +1 -1
  66. package/docs/errors/W_JSON_FIELDTYPE.md +1 -1
  67. package/docs/errors/W_LARGE_SCOPE.md +5 -5
  68. package/docs/errors/W_LEGACY_DIR.md +17 -0
  69. package/docs/errors/W_LIMIT_UNREADABLE.md +2 -2
  70. package/docs/errors/W_PENDING_TARGET.md +23 -0
  71. package/docs/errors/W_PREFIX.md +1 -1
  72. package/docs/errors/W_RATE_HEADERS.md +1 -1
  73. package/docs/errors/W_RATE_LIMIT.md +1 -1
  74. package/docs/errors/W_STATE_NOT_MOVED.md +17 -0
  75. package/docs/errors/W_UNADDRESSABLE_NAME.md +1 -1
  76. package/docs/errors/W_UNSUPPORTED_TYPE.md +3 -3
  77. package/docs/errors/W_WRITE_SCOPE.md +17 -0
  78. package/docs/plan.md +5 -5
  79. package/docs/pull.md +9 -9
  80. package/docs/rm.md +3 -3
  81. package/docs/state.md +4 -2
  82. package/docs/targets.md +4 -4
  83. package/package.json +3 -9
  84. 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> # check the key's portal, write kalup.config.ts, pull into kalup/objects/
24
- npx kalup plan --out plan.json # edit a file first; review every step
25
- npx kalup apply plan.json # type the target name to confirm
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 pull the first target. |
35
- | `kalup pull` | Read a target and write kalup/objects/*.ts. |
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 to its target, or plan and apply an unprotected target in one run. |
45
- | `kalup rm` | Take a property or group out of config and write its tombstone in kalup/removed.ts. |
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 0.1.0 covers
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; other account types are not verified yet. 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.
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