@volter/twin-hubspot 0.1.37 → 1.0.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 (135) hide show
  1. package/README.md +9 -193
  2. package/dist/generated/pack-facts.json +42 -0
  3. package/dist/journeys/coverage.json +60 -0
  4. package/dist/journeys/customer-life.json +7 -0
  5. package/dist/journeys/customer-life.outline.md +6 -0
  6. package/dist/journeys/decisions.json +623 -0
  7. package/dist/journeys/demand.json +171 -0
  8. package/dist/journeys/score.json +82 -0
  9. package/dist/journeys/unreachable.json +12 -0
  10. package/dist/journeys/vendor-examples.json +7 -0
  11. package/dist/spec/SOURCE.md +40 -0
  12. package/dist/spec/openapi/associations.json.gz +0 -0
  13. package/dist/spec/openapi/companies.json.gz +0 -0
  14. package/dist/spec/openapi/contacts.json.gz +0 -0
  15. package/dist/spec/openapi/deals.json.gz +0 -0
  16. package/dist/spec/openapi/meetings.json.gz +0 -0
  17. package/dist/spec/openapi/oauth.json.gz +0 -0
  18. package/dist/spec/openapi/owners.json.gz +0 -0
  19. package/dist/spec/openapi/pipelines.json.gz +0 -0
  20. package/dist/spec/openapi/properties.json.gz +0 -0
  21. package/dist/spec/openapi/tickets.json.gz +0 -0
  22. package/dist/spec/patches.json +235 -0
  23. package/dist/spec/sources.json +32 -0
  24. package/dist/src/cli.js +10 -22
  25. package/dist/src/fetch.d.ts +2 -0
  26. package/dist/src/fetch.js +13 -0
  27. package/dist/src/generated/surface.gen.json +1 -1
  28. package/dist/src/index.d.ts +5 -11
  29. package/dist/src/index.js +10 -94
  30. package/dist/src/manifest.js +32 -66
  31. package/dist/src/semantics/index.d.ts +2 -0
  32. package/dist/src/semantics/index.js +1 -0
  33. package/dist/src/semantics/states.d.ts +1 -0
  34. package/dist/src/semantics/states.js +2 -0
  35. package/dist/src/server.d.ts +7 -0
  36. package/dist/src/server.js +7 -0
  37. package/generated/pack-facts.json +42 -0
  38. package/journeys/coverage.json +60 -0
  39. package/journeys/customer-life.json +7 -0
  40. package/journeys/customer-life.outline.md +6 -0
  41. package/journeys/decisions.json +623 -0
  42. package/journeys/demand.json +171 -0
  43. package/journeys/score.json +82 -0
  44. package/journeys/unreachable.json +12 -0
  45. package/journeys/vendor-examples.json +7 -0
  46. package/package.json +10 -23
  47. package/spec/SOURCE.md +40 -0
  48. package/spec/openapi/associations.json.gz +0 -0
  49. package/spec/openapi/companies.json.gz +0 -0
  50. package/spec/openapi/contacts.json.gz +0 -0
  51. package/spec/openapi/deals.json.gz +0 -0
  52. package/spec/openapi/meetings.json.gz +0 -0
  53. package/spec/openapi/oauth.json.gz +0 -0
  54. package/spec/openapi/owners.json.gz +0 -0
  55. package/spec/openapi/pipelines.json.gz +0 -0
  56. package/spec/openapi/properties.json.gz +0 -0
  57. package/spec/openapi/tickets.json.gz +0 -0
  58. package/spec/patches.json +235 -0
  59. package/spec/sources.json +32 -0
  60. package/src/cli.ts +10 -19
  61. package/src/fetch.ts +14 -0
  62. package/src/generated/surface.gen.json +1 -1
  63. package/src/index.ts +12 -152
  64. package/src/manifest.ts +33 -92
  65. package/src/semantics/index.ts +6 -0
  66. package/src/semantics/states.ts +2 -0
  67. package/src/server.ts +8 -0
  68. package/client/hubspot-mirror.css +0 -43
  69. package/client/hubspot-mirror.tsx +0 -132
  70. package/dist/client/hubspot-mirror.bundle.js +0 -516
  71. package/dist/client/hubspot-mirror.css +0 -43
  72. package/dist/client/hubspot-mirror.d.ts +0 -15
  73. package/dist/client/hubspot-mirror.js +0 -59
  74. package/dist/client/hubspot-mirror.tsx +0 -132
  75. package/dist/src/accounts.d.ts +0 -30
  76. package/dist/src/accounts.js +0 -122
  77. package/dist/src/hubspot-areas.d.ts +0 -10
  78. package/dist/src/hubspot-areas.js +0 -114
  79. package/dist/src/hubspot-budget.d.ts +0 -58
  80. package/dist/src/hubspot-budget.js +0 -176
  81. package/dist/src/hubspot-capabilities.d.ts +0 -3
  82. package/dist/src/hubspot-capabilities.js +0 -1588
  83. package/dist/src/hubspot-conformance.d.ts +0 -16
  84. package/dist/src/hubspot-conformance.js +0 -523
  85. package/dist/src/hubspot-connector.d.ts +0 -125
  86. package/dist/src/hubspot-connector.js +0 -390
  87. package/dist/src/hubspot-deferred-capabilities.d.ts +0 -6
  88. package/dist/src/hubspot-deferred-capabilities.js +0 -64
  89. package/dist/src/hubspot-mirror-ui.d.ts +0 -62
  90. package/dist/src/hubspot-mirror-ui.js +0 -152
  91. package/dist/src/hubspot-oauth.d.ts +0 -8
  92. package/dist/src/hubspot-oauth.js +0 -291
  93. package/dist/src/hubspot-server.d.ts +0 -24
  94. package/dist/src/hubspot-server.js +0 -116
  95. package/dist/src/hubspot-twin.d.ts +0 -65
  96. package/dist/src/hubspot-twin.js +0 -1558
  97. package/dist/src/portal.d.ts +0 -20
  98. package/dist/src/portal.js +0 -30
  99. package/dist/src/screens/account.d.ts +0 -1
  100. package/dist/src/screens/account.js +0 -139
  101. package/dist/src/screens/crm.d.ts +0 -2
  102. package/dist/src/screens/crm.js +0 -153
  103. package/dist/src/screens/developer.d.ts +0 -4
  104. package/dist/src/screens/developer.js +0 -191
  105. package/dist/src/screens/forms.d.ts +0 -5
  106. package/dist/src/screens/forms.js +0 -126
  107. package/dist/src/screens/page.d.ts +0 -21
  108. package/dist/src/screens/page.js +0 -49
  109. package/dist/src/screens/session.d.ts +0 -1
  110. package/dist/src/screens/session.js +0 -32
  111. package/dist/src/semantics/crm.d.ts +0 -8
  112. package/dist/src/semantics/crm.js +0 -101
  113. package/dist/src/webhooks.d.ts +0 -12
  114. package/dist/src/webhooks.js +0 -79
  115. package/src/accounts.ts +0 -127
  116. package/src/hubspot-areas.ts +0 -155
  117. package/src/hubspot-budget.ts +0 -202
  118. package/src/hubspot-capabilities.ts +0 -1523
  119. package/src/hubspot-conformance.ts +0 -537
  120. package/src/hubspot-connector.ts +0 -419
  121. package/src/hubspot-deferred-capabilities.ts +0 -99
  122. package/src/hubspot-journey.uitest.ts +0 -104
  123. package/src/hubspot-mirror-ui.ts +0 -166
  124. package/src/hubspot-oauth.tsx +0 -296
  125. package/src/hubspot-server.ts +0 -115
  126. package/src/hubspot-twin.ts +0 -1534
  127. package/src/portal.ts +0 -40
  128. package/src/screens/account.tsx +0 -129
  129. package/src/screens/crm.tsx +0 -154
  130. package/src/screens/developer.tsx +0 -181
  131. package/src/screens/forms.tsx +0 -117
  132. package/src/screens/page.tsx +0 -55
  133. package/src/screens/session.tsx +0 -36
  134. package/src/semantics/crm.ts +0 -116
  135. package/src/webhooks.ts +0 -82
@@ -0,0 +1,32 @@
1
+ {
2
+ "https://developers.hubspot.com/docs/api-reference/error-handling": {
3
+ "status": 200,
4
+ "checked": "2026-10-03",
5
+ "quotes": {
6
+ "return a JSON formatted response with details about the error": true,
7
+ "Returned when the authentication provided is invalid.": true
8
+ }
9
+ },
10
+ "https://developers.hubspot.com/docs/api-reference/webhooks-webhooks-v3/guide": {
11
+ "status": 200,
12
+ "checked": "2026-10-03",
13
+ "quotes": {
14
+ "404 Not Found : requested resource not found": true,
15
+ "Authorization : Bearer YOUR_ACCESS_TOKEN": true
16
+ }
17
+ },
18
+ "https://developers.hubspot.com/docs/developer-tooling/platform/usage-guidelines": {
19
+ "status": 200,
20
+ "checked": "2026-10-03",
21
+ "quotes": {
22
+ "110 requests every 10 seconds": true
23
+ }
24
+ },
25
+ "https://raw.githubusercontent.com/dubinc/dub/7e0101363b2ab30afc537c1893f159d1dcba513a/apps/web/lib/integrations/hubspot/oauth.ts": {
26
+ "status": 200,
27
+ "checked": "2026-10-03",
28
+ "quotes": {
29
+ "process.env.HUBSPOT_CLIENT_ID": true
30
+ }
31
+ }
32
+ }
package/src/cli.ts CHANGED
@@ -1,29 +1,20 @@
1
1
  #!/usr/bin/env node
2
- import { keepProcessAlive } from '@volter/world-core/lifecycle';
3
- // world-hubspot CLI: serve the HubSpot CRM API twin, the CRM mirror UI, or run conformance.
2
+ // world-hubspot: serve the hubspot twin.
4
3
  import { hasFlag, optionValue } from '@volter/world-core/args';
5
- import { createHubspotTwinServer } from './hubspot-server.ts';
6
- import { createHubspotMirrorServer } from './hubspot-mirror-ui.ts';
4
+ import { keepProcessAlive } from '@volter/world-core/lifecycle';
5
+ import { createHubspotTwinServer } from './server.ts';
7
6
 
8
7
  const [cmd, ...rest] = process.argv.slice(2);
9
8
  const port = Number(optionValue(rest, '--port', '0')) || undefined;
10
9
  const root = optionValue(rest, '--root') || undefined;
11
- const readOnly = hasFlag(rest, '--read-only'); // a twin accepts writes unless started read-only
10
+ const readOnly = hasFlag(rest, '--read-only');
11
+ // the World's managed Postgres, which the runtime binds a pack declaring managedDatabase to
12
+ const database = optionValue(rest, '--database') || undefined;
12
13
 
13
- if (cmd === 'serve') {
14
- const s = await createHubspotTwinServer({ readOnly, ...(root ? { root } : {}), ...(port ? { port } : {}) });
15
- process.stdout.write(`hubspot twin (CRM v3/v4)${readOnly ? ' [read-only]' : ''} at ${s.url}\n`);
16
- await keepProcessAlive();
17
- } else if (cmd === 'mirror') {
18
- const s = await createHubspotMirrorServer({ ...(root ? { root } : {}), ...(port ? { port } : {}) });
19
- process.stdout.write(`hubspot mirror UI (CRM) at ${s.url}\n`);
14
+ if (cmd === 'serve' || cmd === undefined) {
15
+ const s = await createHubspotTwinServer({ readOnly, ...(root ? { root } : {}), ...(port ? { port } : {}), ...(database ? { database } : {}) });
16
+ process.stdout.write(`hubspot twin${readOnly ? ' [read-only]' : ''} at http://127.0.0.1:${s.port}\n`);
20
17
  await keepProcessAlive();
21
- } else if (cmd === 'conformance') {
22
- // dev-only; lazy so the bin runs without @volter/world-tooling in the runtime graph
23
- const { checkHubspotConformance } = await import('./hubspot-conformance.ts');
24
- const report = await checkHubspotConformance({ ...(root ? { root } : {}) });
25
- process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
26
- if (!report.ok) process.exitCode = 1;
27
18
  } else {
28
- process.stdout.write('Usage: world-hubspot serve|mirror|conformance [--port N] [--root DIR] [--read-only]\n');
19
+ process.stdout.write('Usage: world-hubspot serve [--port N] [--root DIR] [--read-only] [--database URL]\n');
29
20
  }
package/src/fetch.ts ADDED
@@ -0,0 +1,14 @@
1
+ // GENERATED by scripts/create-pack.ts (--init, --index): a fixed file. The kernel serves the discovery door, the clock,
2
+ // the World's doors, the vendor's screens and the API from the pack's parts (architecture, "The pack contract").
3
+ import { createPackFetch, type DerivedFetch, type DerivedSurface, type PackFetchOptions } from '@volter/world-core';
4
+ import surface from './generated/surface.gen.json' with { type: 'json' };
5
+ import { manifest } from './manifest.ts';
6
+ import { hubspotSemantics } from './semantics/index.ts';
7
+
8
+ export function createHubspotFetch(options: PackFetchOptions = {}): DerivedFetch {
9
+ return createPackFetch({
10
+ manifest,
11
+ surface: surface as DerivedSurface,
12
+ handlers: hubspotSemantics,
13
+ }, options);
14
+ }