@hs-x/codegen 0.1.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.d.ts +131 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +981 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { AccountId, AppEventDeclaration, AppObjectAssociationDeclaration, AppObjectDeclaration, DeployId, ProjectId, ProjectManifest, WorkerManifest } from '@hs-x/types';
|
|
2
|
+
export declare const CODEGEN_VERSION = "0.1.0";
|
|
3
|
+
export type { CapabilityManifest, ProjectManifest, WorkerManifest } from '@hs-x/types';
|
|
4
|
+
export interface GenerateProjectArtifactsOptions {
|
|
5
|
+
readonly root: string;
|
|
6
|
+
readonly workers: readonly WorkerManifest[];
|
|
7
|
+
readonly appObjects?: readonly AppObjectDeclaration[];
|
|
8
|
+
readonly appObjectAssociations?: readonly AppObjectAssociationDeclaration[];
|
|
9
|
+
readonly appEvents?: readonly AppEventDeclaration[];
|
|
10
|
+
readonly resourceScope?: CloudflareResourceScope;
|
|
11
|
+
}
|
|
12
|
+
export interface CloudflareResourceScope {
|
|
13
|
+
readonly hsXAccountId: AccountId;
|
|
14
|
+
readonly projectId: ProjectId;
|
|
15
|
+
readonly deployId: DeployId;
|
|
16
|
+
}
|
|
17
|
+
export interface CloudflareWorkerEntrypointOptions {
|
|
18
|
+
readonly workerImportPath: string;
|
|
19
|
+
readonly heartbeat?: CloudflareWorkerHeartbeatOptions;
|
|
20
|
+
readonly billing?: CloudflareWorkerBillingOptions;
|
|
21
|
+
}
|
|
22
|
+
export interface CloudflareWorkerBillingOptions {
|
|
23
|
+
readonly controlPlaneUrl: string;
|
|
24
|
+
readonly accountId: string;
|
|
25
|
+
readonly projectId: string;
|
|
26
|
+
readonly environment: string;
|
|
27
|
+
readonly runtimeTokenBinding?: string;
|
|
28
|
+
}
|
|
29
|
+
export type CloudflareWorkerHeartbeatOptions = {
|
|
30
|
+
readonly mode: 'linked';
|
|
31
|
+
readonly controlPlaneUrl: string;
|
|
32
|
+
readonly accountId: string;
|
|
33
|
+
readonly hsXAccountId: string;
|
|
34
|
+
readonly projectId: string;
|
|
35
|
+
readonly deployId: string;
|
|
36
|
+
readonly environment: string;
|
|
37
|
+
readonly manifestHash: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly mode: 'anonymous';
|
|
40
|
+
readonly controlPlaneUrl: string;
|
|
41
|
+
readonly machineId: string;
|
|
42
|
+
readonly projectId: string;
|
|
43
|
+
readonly deployId: string;
|
|
44
|
+
readonly environment: string;
|
|
45
|
+
readonly manifestHash: string;
|
|
46
|
+
};
|
|
47
|
+
export interface LegacyCardMigrationInput {
|
|
48
|
+
readonly legacyApp: {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
};
|
|
51
|
+
readonly legacyCard: {
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly title: string;
|
|
54
|
+
readonly objectTypes: readonly string[];
|
|
55
|
+
readonly fetchUrl: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface GeneratedProjectSource {
|
|
59
|
+
readonly files: Readonly<Record<string, string>>;
|
|
60
|
+
}
|
|
61
|
+
export interface HubSpotRuntimeProjectOptions {
|
|
62
|
+
readonly appName: string;
|
|
63
|
+
readonly distribution: string;
|
|
64
|
+
readonly auth: string;
|
|
65
|
+
readonly platformVersion?: string;
|
|
66
|
+
readonly scopes: readonly string[];
|
|
67
|
+
readonly workers: readonly WorkerManifest[];
|
|
68
|
+
readonly appObjects?: readonly AppObjectDeclaration[];
|
|
69
|
+
readonly appObjectAssociations?: readonly AppObjectAssociationDeclaration[];
|
|
70
|
+
readonly appEvents?: readonly AppEventDeclaration[];
|
|
71
|
+
readonly runtimeBaseUrl: string;
|
|
72
|
+
readonly redirectUrls?: readonly string[];
|
|
73
|
+
}
|
|
74
|
+
export interface PortalSchemaProperty {
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly type: string;
|
|
77
|
+
readonly fieldType?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface PortalSchemaObject {
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly properties: readonly PortalSchemaProperty[];
|
|
82
|
+
}
|
|
83
|
+
export interface ObservedPortalSchema {
|
|
84
|
+
readonly objects: readonly PortalSchemaObject[];
|
|
85
|
+
}
|
|
86
|
+
export type PortalSchemaPlanItemKind = 'warning' | 'will-create-property' | 'will-alter-property' | 'will-create-object' | 'error';
|
|
87
|
+
export interface PortalSchemaPlanItem {
|
|
88
|
+
readonly kind: PortalSchemaPlanItemKind;
|
|
89
|
+
readonly capabilityId: string;
|
|
90
|
+
readonly objectType: string;
|
|
91
|
+
readonly propertyName?: string;
|
|
92
|
+
readonly declaredType?: string;
|
|
93
|
+
readonly observedType?: string;
|
|
94
|
+
readonly manageSchema: false | 'properties' | 'full';
|
|
95
|
+
readonly message: string;
|
|
96
|
+
}
|
|
97
|
+
export interface PortalSchemaPlan {
|
|
98
|
+
readonly items: readonly PortalSchemaPlanItem[];
|
|
99
|
+
readonly warnings: readonly PortalSchemaPlanItem[];
|
|
100
|
+
readonly actions: readonly PortalSchemaPlanItem[];
|
|
101
|
+
readonly errors: readonly PortalSchemaPlanItem[];
|
|
102
|
+
}
|
|
103
|
+
export declare function generateProjectArtifacts(options: GenerateProjectArtifactsOptions): Promise<ProjectManifest>;
|
|
104
|
+
export declare function renderAlchemyProgram(options: CloudflareResourceScope & {
|
|
105
|
+
readonly workers: readonly WorkerManifest[];
|
|
106
|
+
}): string;
|
|
107
|
+
export declare function workerCloudflareResourcePlan(scope: CloudflareResourceScope, worker: WorkerManifest): {
|
|
108
|
+
readonly workerName: string;
|
|
109
|
+
readonly durableObjectNamespaces: readonly string[];
|
|
110
|
+
readonly kvNamespaces: readonly string[];
|
|
111
|
+
readonly d1Databases: readonly string[];
|
|
112
|
+
readonly queues: readonly string[];
|
|
113
|
+
readonly cronTriggers: readonly string[];
|
|
114
|
+
};
|
|
115
|
+
export declare function cloudflareResourceName(scope: CloudflareResourceScope, resource: string): string;
|
|
116
|
+
export declare function renderCloudflareWorkerEntrypoint(options: CloudflareWorkerEntrypointOptions): string;
|
|
117
|
+
export declare function planPortalSchemaManagement(input: {
|
|
118
|
+
readonly workers: readonly WorkerManifest[];
|
|
119
|
+
readonly observed: ObservedPortalSchema;
|
|
120
|
+
}): PortalSchemaPlan;
|
|
121
|
+
export declare function generateLegacyCardProject(input: LegacyCardMigrationInput): GeneratedProjectSource;
|
|
122
|
+
export declare function generateHubSpotRuntimeProject(options: HubSpotRuntimeProjectOptions): GeneratedProjectSource;
|
|
123
|
+
export declare function renderRefsTypes(workers: readonly WorkerManifest[], declarations?: {
|
|
124
|
+
readonly appObjects?: readonly AppObjectDeclaration[];
|
|
125
|
+
readonly appEvents?: readonly AppEventDeclaration[];
|
|
126
|
+
}): string;
|
|
127
|
+
export declare function renderRefsModule(workers: readonly WorkerManifest[], declarations?: {
|
|
128
|
+
readonly appObjects?: readonly AppObjectDeclaration[];
|
|
129
|
+
readonly appEvents?: readonly AppEventDeclaration[];
|
|
130
|
+
}): string;
|
|
131
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,+BAA+B,EAC/B,oBAAoB,EAEpB,QAAQ,EACR,SAAS,EACT,eAAe,EAEf,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,eAAe,UAAU,CAAC;AAEvC,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEvF,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,cA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BAAgB,6BAA6B,CAC3C,OAAO,EAAE,4BAA4B,GACpC,sBAAsB,CAmCxB;AAoXD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,YAAY,GAAE;IACZ,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAChD,GACL,MAAM,CAyBR;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,YAAY,GAAE;IACZ,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAChD,GACL,MAAM,CAyBR"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
export const CODEGEN_VERSION = '0.1.0';
|
|
4
|
+
export async function generateProjectArtifacts(options) {
|
|
5
|
+
const manifest = {
|
|
6
|
+
generatedAt: new Date().toISOString(),
|
|
7
|
+
workers: options.workers,
|
|
8
|
+
...(options.appObjects?.length ? { appObjects: [...options.appObjects] } : {}),
|
|
9
|
+
...(options.appObjectAssociations?.length
|
|
10
|
+
? { appObjectAssociations: [...options.appObjectAssociations] }
|
|
11
|
+
: {}),
|
|
12
|
+
...(options.appEvents?.length ? { appEvents: [...options.appEvents] } : {}),
|
|
13
|
+
};
|
|
14
|
+
const outDir = join(options.root, '.hs-x');
|
|
15
|
+
await mkdir(outDir, { recursive: true });
|
|
16
|
+
await writeFile(join(outDir, 'manifest.json'), `${JSON.stringify(manifest, null, 2)}\n`);
|
|
17
|
+
await writeFile(join(outDir, 'refs.d.ts'), renderRefsTypes(options.workers, options));
|
|
18
|
+
await writeFile(join(outDir, 'refs.js'), renderRefsModule(options.workers, options));
|
|
19
|
+
if (options.resourceScope) {
|
|
20
|
+
await writeFile(join(outDir, 'alchemy.run.ts'), renderAlchemyProgram({ ...options.resourceScope, workers: options.workers }));
|
|
21
|
+
}
|
|
22
|
+
return manifest;
|
|
23
|
+
}
|
|
24
|
+
export function renderAlchemyProgram(options) {
|
|
25
|
+
const plans = options.workers.map((worker) => workerCloudflareResourcePlan(options, worker));
|
|
26
|
+
return `// Generated by hs-x. Do not edit by hand.
|
|
27
|
+
// This file is checked in as the Cloudflare leaveability artifact.
|
|
28
|
+
|
|
29
|
+
export const hsXAccountId = ${JSON.stringify(options.hsXAccountId)};
|
|
30
|
+
export const projectId = ${JSON.stringify(options.projectId)};
|
|
31
|
+
export const deployId = ${JSON.stringify(options.deployId)};
|
|
32
|
+
|
|
33
|
+
export const resources = ${JSON.stringify(plans, null, 2)} as const;
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
export function workerCloudflareResourcePlan(scope, worker) {
|
|
37
|
+
const prefix = `${scope.projectId}-${worker.name}`;
|
|
38
|
+
return {
|
|
39
|
+
workerName: cloudflareResourceName(scope, prefix),
|
|
40
|
+
durableObjectNamespaces: needs(worker, 'durable-object')
|
|
41
|
+
? [cloudflareResourceName(scope, `${prefix}-do`)]
|
|
42
|
+
: [],
|
|
43
|
+
kvNamespaces: needs(worker, 'kv') ? [cloudflareResourceName(scope, `${prefix}-kv`)] : [],
|
|
44
|
+
d1Databases: needs(worker, 'durable-object')
|
|
45
|
+
? [cloudflareResourceName(scope, `${prefix}-d1`)]
|
|
46
|
+
: [],
|
|
47
|
+
queues: needs(worker, 'queue') ? [cloudflareResourceName(scope, `${prefix}-queue`)] : [],
|
|
48
|
+
cronTriggers: needs(worker, 'queue') ? [cloudflareResourceName(scope, `${prefix}-cron`)] : [],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export function cloudflareResourceName(scope, resource) {
|
|
52
|
+
return `hsx-${toResourceSlug(scope.hsXAccountId)}-${toResourceSlug(resource)}`;
|
|
53
|
+
}
|
|
54
|
+
export function renderCloudflareWorkerEntrypoint(options) {
|
|
55
|
+
return `// Generated by hs-x. Do not edit by hand.
|
|
56
|
+
import {
|
|
57
|
+
createEncryptedRuntimeTokenBlobStore,
|
|
58
|
+
createHostedRuntimeBilling,
|
|
59
|
+
createHubSpotTokenRefresh,
|
|
60
|
+
createKvRuntimeSealedTokenBlobStore,
|
|
61
|
+
createKvRuntimeTokenStateOwnerStore,
|
|
62
|
+
createRuntimeTokenService,
|
|
63
|
+
createSingleBucketRuntimeRateLimiter,
|
|
64
|
+
RUNTIME_VERSION,
|
|
65
|
+
createRuntime,
|
|
66
|
+
createSignedRuntimeOAuthStateStore,
|
|
67
|
+
} from "@hs-x/runtime";
|
|
68
|
+
${renderTenantDataPlaneImports(options.heartbeat)}import worker from ${JSON.stringify(options.workerImportPath)};
|
|
69
|
+
|
|
70
|
+
let runtime: ReturnType<typeof createRuntime> | undefined;
|
|
71
|
+
let anonymousHeartbeatSent = false;
|
|
72
|
+
|
|
73
|
+
function getRuntime(env: Record<string, unknown>) {
|
|
74
|
+
const hostedBilling = ${renderHostedBilling(options.billing)};
|
|
75
|
+
runtime ??= createRuntime({
|
|
76
|
+
worker,
|
|
77
|
+
env,
|
|
78
|
+
${renderLinkedHeartbeat(options.heartbeat)}
|
|
79
|
+
...(hostedBilling ? { billing: hostedBilling.billing } : {}),
|
|
80
|
+
...(isInstallOAuthConfigured(env)
|
|
81
|
+
? {
|
|
82
|
+
installOAuth: {
|
|
83
|
+
tokenBlobStore: createEncryptedRuntimeTokenBlobStore({
|
|
84
|
+
sealedStore: createKvRuntimeSealedTokenBlobStore(env.INSTALL_KV),
|
|
85
|
+
keySecret: env.HSX_TOKEN_KEY,
|
|
86
|
+
}),
|
|
87
|
+
tokenStateOwnerStore: createKvRuntimeTokenStateOwnerStore(env.INSTALL_KV),
|
|
88
|
+
// OAuth state is signed (stateless). KV-backed state would race against
|
|
89
|
+
// Cloudflare's eventually-consistent reads across edges right after mint.
|
|
90
|
+
stateStore: createSignedRuntimeOAuthStateStore({ keySecret: env.HSX_TOKEN_KEY }),
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
: {}),
|
|
94
|
+
// Lets handlers call HubSpot on behalf of an install (ctx.hubspot): resolves
|
|
95
|
+
// and refreshes the sealed install token. Without this, ctx.hubspot is an
|
|
96
|
+
// unscoped client and authenticated calls 401.
|
|
97
|
+
...(isManagedHubSpotConfigured(env)
|
|
98
|
+
? {
|
|
99
|
+
managedHubSpot: {
|
|
100
|
+
tokenService: createRuntimeTokenService({
|
|
101
|
+
blobStore: createEncryptedRuntimeTokenBlobStore({
|
|
102
|
+
sealedStore: createKvRuntimeSealedTokenBlobStore(env.INSTALL_KV),
|
|
103
|
+
keySecret: env.HSX_TOKEN_KEY,
|
|
104
|
+
}),
|
|
105
|
+
stateOwnerStore: createKvRuntimeTokenStateOwnerStore(env.INSTALL_KV),
|
|
106
|
+
refresh: createHubSpotTokenRefresh({
|
|
107
|
+
clientId: env.HSX_HUBSPOT_CLIENT_ID,
|
|
108
|
+
clientSecret: env.HSX_HUBSPOT_CLIENT_SECRET,
|
|
109
|
+
}),
|
|
110
|
+
}),
|
|
111
|
+
rateLimiter: createSingleBucketRuntimeRateLimiter({
|
|
112
|
+
capacity: 100,
|
|
113
|
+
refillPerSecond: 10,
|
|
114
|
+
}),
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
: {}),
|
|
118
|
+
${renderTenantDataPlaneOptions(options.heartbeat)} });
|
|
119
|
+
return runtime;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
${renderAnonymousHeartbeat(options.heartbeat)}
|
|
123
|
+
|
|
124
|
+
function anonymousBindingFingerprint(env: Record<string, unknown>): string {
|
|
125
|
+
return Object.keys(env).sort().join("|") || "none";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function anonymousTaggedResourceCount(env: Record<string, unknown>): number {
|
|
129
|
+
return Object.keys(env).filter((key) => key.startsWith("HSX_") || key.endsWith("_KV")).length;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function isInstallOAuthConfigured(
|
|
133
|
+
env: Record<string, unknown>,
|
|
134
|
+
): env is Record<string, unknown> & {
|
|
135
|
+
INSTALL_KV: Parameters<typeof createKvRuntimeSealedTokenBlobStore>[0];
|
|
136
|
+
HSX_TOKEN_KEY: string;
|
|
137
|
+
} {
|
|
138
|
+
return typeof env.HSX_TOKEN_KEY === "string" && Boolean(env.INSTALL_KV);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function isManagedHubSpotConfigured(
|
|
142
|
+
env: Record<string, unknown>,
|
|
143
|
+
): env is Record<string, unknown> & {
|
|
144
|
+
INSTALL_KV: Parameters<typeof createKvRuntimeSealedTokenBlobStore>[0];
|
|
145
|
+
HSX_TOKEN_KEY: string;
|
|
146
|
+
HSX_HUBSPOT_CLIENT_ID: string;
|
|
147
|
+
HSX_HUBSPOT_CLIENT_SECRET: string;
|
|
148
|
+
} {
|
|
149
|
+
return (
|
|
150
|
+
isInstallOAuthConfigured(env) &&
|
|
151
|
+
typeof env.HSX_HUBSPOT_CLIENT_ID === "string" &&
|
|
152
|
+
typeof env.HSX_HUBSPOT_CLIENT_SECRET === "string"
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function readRuntimeBillingToken(env: Record<string, unknown>, binding: string): string | undefined {
|
|
157
|
+
const value = env[binding];
|
|
158
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
159
|
+
}
|
|
160
|
+
${renderTenantDataPlaneHelpers(options.heartbeat)}
|
|
161
|
+
export default {
|
|
162
|
+
fetch(request: Request, env: Record<string, unknown>) {
|
|
163
|
+
${options.heartbeat?.mode === 'anonymous' ? 'void emitAnonymousHeartbeat(env);' : ''}
|
|
164
|
+
return getRuntime(env).fetch(request);
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
`;
|
|
168
|
+
}
|
|
169
|
+
function renderLinkedHeartbeat(heartbeat) {
|
|
170
|
+
if (heartbeat?.mode !== 'linked')
|
|
171
|
+
return '';
|
|
172
|
+
return ` attestation: {
|
|
173
|
+
controlPlaneUrl: ${JSON.stringify(heartbeat.controlPlaneUrl)},
|
|
174
|
+
accountId: ${JSON.stringify(heartbeat.accountId)},
|
|
175
|
+
hsXAccountId: ${JSON.stringify(heartbeat.hsXAccountId)},
|
|
176
|
+
projectId: ${JSON.stringify(heartbeat.projectId)},
|
|
177
|
+
deployId: ${JSON.stringify(heartbeat.deployId)},
|
|
178
|
+
environment: ${JSON.stringify(heartbeat.environment)},
|
|
179
|
+
manifestHash: ${JSON.stringify(heartbeat.manifestHash)},
|
|
180
|
+
env,
|
|
181
|
+
},`;
|
|
182
|
+
}
|
|
183
|
+
function renderHostedBilling(billing) {
|
|
184
|
+
if (!billing)
|
|
185
|
+
return 'undefined';
|
|
186
|
+
const runtimeTokenBinding = billing.runtimeTokenBinding ?? 'HSX_RUNTIME_TOKEN';
|
|
187
|
+
return `createHostedRuntimeBilling({
|
|
188
|
+
accountId: ${JSON.stringify(billing.accountId)},
|
|
189
|
+
projectId: ${JSON.stringify(billing.projectId)},
|
|
190
|
+
controlPlaneUrl: ${JSON.stringify(billing.controlPlaneUrl)},
|
|
191
|
+
environment: ${JSON.stringify(billing.environment)},
|
|
192
|
+
runtimeToken: readRuntimeBillingToken(env, ${JSON.stringify(runtimeTokenBinding)}),
|
|
193
|
+
})`;
|
|
194
|
+
}
|
|
195
|
+
// ADR-015/ADR-014 tenant data plane. Emitted ONLY for linked workers (the
|
|
196
|
+
// optional platform); an unlinked direct-to-HubSpot Worker gets none of this.
|
|
197
|
+
// Each option then activates at runtime only when its bindings are present, so
|
|
198
|
+
// a linked Worker whose deploy has not yet provisioned the tenant D1 / flags KV
|
|
199
|
+
// / grant secret simply runs without them (ctx.flags fails safe to defaults).
|
|
200
|
+
// The InstallationKey scope is project-scoped (account/project/env baked from
|
|
201
|
+
// the linked attestation); hubSpotAppId comes from the HSX_APP_ID var the
|
|
202
|
+
// deploy already sets.
|
|
203
|
+
function renderTenantDataPlaneImports(heartbeat) {
|
|
204
|
+
if (heartbeat?.mode !== 'linked')
|
|
205
|
+
return '';
|
|
206
|
+
return `import {
|
|
207
|
+
createD1RuntimeFlagConfigStore,
|
|
208
|
+
createD1RuntimeInstalledPortalUserStore,
|
|
209
|
+
createD1RuntimePlatformEventOccurrenceStore,
|
|
210
|
+
createKvRuntimeFlagSnapshotStore,
|
|
211
|
+
} from "@hs-x/runtime";
|
|
212
|
+
`;
|
|
213
|
+
}
|
|
214
|
+
function renderTenantDataPlaneOptions(heartbeat) {
|
|
215
|
+
if (heartbeat?.mode !== 'linked')
|
|
216
|
+
return '';
|
|
217
|
+
return ` // ADR-015 ctx.flags + Path-B evaluate endpoint (KV snapshot read).
|
|
218
|
+
...(isHsxFlagsKvConfigured(env)
|
|
219
|
+
? { flags: { snapshotStore: createKvRuntimeFlagSnapshotStore(env.FLAGS_KV), ...hsxTenantScope(env) } }
|
|
220
|
+
: {}),
|
|
221
|
+
// ADR-015 §5 signed flag-authoring write surface (D1 config + KV sync).
|
|
222
|
+
...(isHsxTenantDataConfigured(env) && isHsxFlagsKvConfigured(env)
|
|
223
|
+
? {
|
|
224
|
+
flagsAuthoring: {
|
|
225
|
+
configStore: createD1RuntimeFlagConfigStore(env.TENANT_DB),
|
|
226
|
+
snapshotStore: createKvRuntimeFlagSnapshotStore(env.FLAGS_KV),
|
|
227
|
+
grantSecret: env.HSX_SYNC_GRANT_KEY,
|
|
228
|
+
scope: hsxTenantScope(env),
|
|
229
|
+
},
|
|
230
|
+
}
|
|
231
|
+
: {}),
|
|
232
|
+
// ADR-014 §9 signed tenant-D1 read API for the control-plane sync worker.
|
|
233
|
+
...(isHsxTenantDataConfigured(env)
|
|
234
|
+
? {
|
|
235
|
+
tenantSyncRead: {
|
|
236
|
+
installedPortalUsers: createD1RuntimeInstalledPortalUserStore(env.TENANT_DB),
|
|
237
|
+
platformEvents: createD1RuntimePlatformEventOccurrenceStore(env.TENANT_DB),
|
|
238
|
+
grantSecret: env.HSX_SYNC_GRANT_KEY,
|
|
239
|
+
scope: hsxTenantScope(env),
|
|
240
|
+
},
|
|
241
|
+
}
|
|
242
|
+
: {}),
|
|
243
|
+
`;
|
|
244
|
+
}
|
|
245
|
+
function renderTenantDataPlaneHelpers(heartbeat) {
|
|
246
|
+
if (heartbeat?.mode !== 'linked')
|
|
247
|
+
return '';
|
|
248
|
+
return `
|
|
249
|
+
function hsxTenantScope(env: Record<string, unknown>) {
|
|
250
|
+
return {
|
|
251
|
+
accountId: ${JSON.stringify(heartbeat.accountId)},
|
|
252
|
+
projectId: ${JSON.stringify(heartbeat.projectId)},
|
|
253
|
+
environment: ${JSON.stringify(heartbeat.environment)},
|
|
254
|
+
...(env.HSX_APP_ID === undefined ? {} : { hubSpotAppId: Number(env.HSX_APP_ID) }),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function isHsxFlagsKvConfigured(
|
|
259
|
+
env: Record<string, unknown>,
|
|
260
|
+
): env is Record<string, unknown> & {
|
|
261
|
+
FLAGS_KV: Parameters<typeof createKvRuntimeFlagSnapshotStore>[0];
|
|
262
|
+
} {
|
|
263
|
+
return Boolean(env.FLAGS_KV);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function isHsxTenantDataConfigured(
|
|
267
|
+
env: Record<string, unknown>,
|
|
268
|
+
): env is Record<string, unknown> & {
|
|
269
|
+
TENANT_DB: Parameters<typeof createD1RuntimeFlagConfigStore>[0];
|
|
270
|
+
HSX_SYNC_GRANT_KEY: string;
|
|
271
|
+
} {
|
|
272
|
+
return (
|
|
273
|
+
Boolean(env.TENANT_DB) &&
|
|
274
|
+
typeof env.HSX_SYNC_GRANT_KEY === "string" &&
|
|
275
|
+
env.HSX_APP_ID !== undefined
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
`;
|
|
279
|
+
}
|
|
280
|
+
function renderAnonymousHeartbeat(heartbeat) {
|
|
281
|
+
if (heartbeat?.mode !== 'anonymous') {
|
|
282
|
+
return 'async function emitAnonymousHeartbeat(_env: Record<string, unknown>) {}';
|
|
283
|
+
}
|
|
284
|
+
return `async function emitAnonymousHeartbeat(env: Record<string, unknown>) {
|
|
285
|
+
if (anonymousHeartbeatSent) return;
|
|
286
|
+
anonymousHeartbeatSent = true;
|
|
287
|
+
const body = {
|
|
288
|
+
schema_version: 1,
|
|
289
|
+
event: "heartbeat.observed",
|
|
290
|
+
cli_version: RUNTIME_VERSION,
|
|
291
|
+
project_id: ${JSON.stringify(heartbeat.projectId)},
|
|
292
|
+
deploy_id: ${JSON.stringify(heartbeat.deployId)},
|
|
293
|
+
environment: ${JSON.stringify(heartbeat.environment)},
|
|
294
|
+
manifest_hash: ${JSON.stringify(heartbeat.manifestHash)},
|
|
295
|
+
binding_fingerprint: anonymousBindingFingerprint(env),
|
|
296
|
+
sdk_version: RUNTIME_VERSION,
|
|
297
|
+
tagged_resource_count: anonymousTaggedResourceCount(env),
|
|
298
|
+
timestamp: new Date().toISOString(),
|
|
299
|
+
};
|
|
300
|
+
try {
|
|
301
|
+
await fetch(new URL("/v1/machines/${encodeURIComponent(heartbeat.machineId)}/events", ${JSON.stringify(heartbeat.controlPlaneUrl)}), {
|
|
302
|
+
method: "POST",
|
|
303
|
+
headers: { "content-type": "application/json" },
|
|
304
|
+
body: JSON.stringify(body),
|
|
305
|
+
});
|
|
306
|
+
} catch {
|
|
307
|
+
anonymousHeartbeatSent = false;
|
|
308
|
+
}
|
|
309
|
+
}`;
|
|
310
|
+
}
|
|
311
|
+
export function planPortalSchemaManagement(input) {
|
|
312
|
+
const observedByName = new Map(input.observed.objects.map((object) => [object.name, object]));
|
|
313
|
+
const items = [];
|
|
314
|
+
for (const worker of input.workers) {
|
|
315
|
+
for (const capability of worker.capabilities) {
|
|
316
|
+
if (capability.kind !== 'sync' || !capability.into || !capability.schema) {
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
const manageSchema = capability.manageSchema ?? false;
|
|
320
|
+
const observedObject = observedByName.get(capability.into);
|
|
321
|
+
const declaredProperties = declaredSchemaProperties(capability.schema);
|
|
322
|
+
if (!observedObject) {
|
|
323
|
+
if (manageSchema === 'full') {
|
|
324
|
+
items.push({
|
|
325
|
+
kind: 'will-create-object',
|
|
326
|
+
capabilityId: capability.id,
|
|
327
|
+
objectType: capability.into,
|
|
328
|
+
manageSchema,
|
|
329
|
+
message: `WILL CREATE ${capability.into} custom object for ${capability.id}.`,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
items.push({
|
|
334
|
+
kind: manageSchema === false ? 'warning' : 'error',
|
|
335
|
+
capabilityId: capability.id,
|
|
336
|
+
objectType: capability.into,
|
|
337
|
+
manageSchema,
|
|
338
|
+
message: manageSchema === false
|
|
339
|
+
? `${capability.into} is not present in the observed portal schema; this sync does not manage portal schema.`
|
|
340
|
+
: `${capability.into} is missing, but manageSchema: "properties" cannot create custom objects. Use manageSchema: "full" if HS-X should create it.`,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
const observedProperties = new Map(observedObject.properties.map((property) => [property.name, property]));
|
|
346
|
+
for (const declared of declaredProperties) {
|
|
347
|
+
const observed = observedProperties.get(declared.propertyName);
|
|
348
|
+
if (!observed) {
|
|
349
|
+
items.push(missingPropertyPlanItem({
|
|
350
|
+
capabilityId: capability.id,
|
|
351
|
+
objectType: capability.into,
|
|
352
|
+
propertyName: declared.propertyName,
|
|
353
|
+
declaredType: declared.type,
|
|
354
|
+
manageSchema,
|
|
355
|
+
}));
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
if (observed.type !== declared.type) {
|
|
359
|
+
items.push(mismatchedPropertyPlanItem({
|
|
360
|
+
capabilityId: capability.id,
|
|
361
|
+
objectType: capability.into,
|
|
362
|
+
propertyName: declared.propertyName,
|
|
363
|
+
declaredType: declared.type,
|
|
364
|
+
observedType: observed.type,
|
|
365
|
+
manageSchema,
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return {
|
|
372
|
+
items,
|
|
373
|
+
warnings: items.filter((item) => item.kind === 'warning'),
|
|
374
|
+
actions: items.filter((item) => item.kind.startsWith('will-')),
|
|
375
|
+
errors: items.filter((item) => item.kind === 'error'),
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
export function generateLegacyCardProject(input) {
|
|
379
|
+
const cardSlug = toKebabCase(input.legacyCard.title || input.legacyCard.id);
|
|
380
|
+
const componentName = `${toPascalCase(input.legacyCard.title || input.legacyCard.id)}Card`;
|
|
381
|
+
const fetchOrigin = new URL(input.legacyCard.fetchUrl).origin;
|
|
382
|
+
const objectTypes = input.legacyCard.objectTypes.length
|
|
383
|
+
? input.legacyCard.objectTypes
|
|
384
|
+
: ['deals'];
|
|
385
|
+
return {
|
|
386
|
+
files: {
|
|
387
|
+
'hsproject.json': renderHubSpotProjectConfig(input.legacyApp.name),
|
|
388
|
+
'hsx.config.ts': renderMigratedAppConfig(input.legacyApp.name, fetchOrigin),
|
|
389
|
+
'src/app/app-hsmeta.json': renderMigratedAppMetadata(input.legacyApp.name, fetchOrigin),
|
|
390
|
+
'src/app/cards/package.json': renderMigratedCardsPackage(),
|
|
391
|
+
[`src/app/cards/${componentName}.tsx`]: renderMigratedCardComponent(componentName, input.legacyCard.fetchUrl),
|
|
392
|
+
[`src/app/cards/${cardSlug}-hsmeta.json`]: renderMigratedCardMetadata({
|
|
393
|
+
uid: cardSlug,
|
|
394
|
+
title: input.legacyCard.title,
|
|
395
|
+
objectTypes,
|
|
396
|
+
componentName,
|
|
397
|
+
}),
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
export function generateHubSpotRuntimeProject(options) {
|
|
402
|
+
const files = {
|
|
403
|
+
'hsproject.json': renderHubSpotProjectConfig(options.appName),
|
|
404
|
+
'src/app/app-hsmeta.json': renderRuntimeAppMetadata(options),
|
|
405
|
+
};
|
|
406
|
+
for (const worker of options.workers) {
|
|
407
|
+
for (const capability of worker.capabilities) {
|
|
408
|
+
if (capability.kind !== 'tool') {
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
const slug = toKebabCase(capability.id);
|
|
412
|
+
files[`src/app/workflow-actions/${slug}-hsmeta.json`] = renderWorkflowActionMetadata({
|
|
413
|
+
capability,
|
|
414
|
+
runtimeBaseUrl: options.runtimeBaseUrl,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
for (const object of options.appObjects ?? []) {
|
|
419
|
+
files[`src/app/app-objects/${toKebabCase(object.id)}-hsmeta.json`] =
|
|
420
|
+
renderAppObjectMetadata(object);
|
|
421
|
+
}
|
|
422
|
+
for (const association of options.appObjectAssociations ?? []) {
|
|
423
|
+
files[`src/app/app-object-associations/${toKebabCase(association.id)}-hsmeta.json`] =
|
|
424
|
+
renderAppObjectAssociationMetadata(association);
|
|
425
|
+
}
|
|
426
|
+
for (const event of options.appEvents ?? []) {
|
|
427
|
+
files[`src/app/app-events/${toKebabCase(event.id)}-hsmeta.json`] =
|
|
428
|
+
renderAppEventMetadata(event);
|
|
429
|
+
}
|
|
430
|
+
return { files };
|
|
431
|
+
}
|
|
432
|
+
// HubSpot project names become part of URLs and must agree with the scaffolded
|
|
433
|
+
// package.json name and the deploy's project identity. Slugify to a lowercase,
|
|
434
|
+
// url-safe form so e.g. "HSX E2E 006" -> "hsx-e2e-006" rather than a spaced name
|
|
435
|
+
// that needs URL-encoding and disagrees with package.json.
|
|
436
|
+
function slugifyProjectName(appName) {
|
|
437
|
+
const slug = appName
|
|
438
|
+
.replace(/\s+Legacy$/i, '')
|
|
439
|
+
.toLowerCase()
|
|
440
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
441
|
+
.replace(/^[-_.]+|[-_.]+$/g, '');
|
|
442
|
+
return slug.length > 0 ? slug : 'hsx-app';
|
|
443
|
+
}
|
|
444
|
+
function renderHubSpotProjectConfig(appName) {
|
|
445
|
+
return `${JSON.stringify({
|
|
446
|
+
name: slugifyProjectName(appName),
|
|
447
|
+
srcDir: 'src',
|
|
448
|
+
platformVersion: '2026.03',
|
|
449
|
+
}, null, 2)}\n`;
|
|
450
|
+
}
|
|
451
|
+
function renderRuntimeAppMetadata(options) {
|
|
452
|
+
const isOAuth = options.auth === 'oauth';
|
|
453
|
+
const redirectUrls = options.redirectUrls ?? [];
|
|
454
|
+
const requiredScopes = normalizedRequiredAppScopes(options);
|
|
455
|
+
if (isOAuth && redirectUrls.length === 0) {
|
|
456
|
+
throw new Error(`OAuth app "${options.appName}" requires at least one redirect URL. The control plane stamps the OAuth callback path in deploy plan runtimeBindings; the CLI composes the redirect URL from the deployed Worker URL + runtimeBindings.oauthCallbackPath. Pass redirectUrls to generateHubSpotRuntimeProject().`);
|
|
457
|
+
}
|
|
458
|
+
return `${JSON.stringify({
|
|
459
|
+
uid: toKebabCase(options.appName),
|
|
460
|
+
type: 'app',
|
|
461
|
+
config: {
|
|
462
|
+
description: `HS-X generated app project for ${options.appName}.`,
|
|
463
|
+
name: options.appName,
|
|
464
|
+
distribution: options.distribution,
|
|
465
|
+
auth: {
|
|
466
|
+
type: options.auth,
|
|
467
|
+
...(isOAuth ? { redirectUrls: [...redirectUrls] } : {}),
|
|
468
|
+
requiredScopes,
|
|
469
|
+
optionalScopes: [],
|
|
470
|
+
conditionallyRequiredScopes: [],
|
|
471
|
+
},
|
|
472
|
+
permittedUrls: {
|
|
473
|
+
fetch: [options.runtimeBaseUrl],
|
|
474
|
+
iframe: [],
|
|
475
|
+
img: [],
|
|
476
|
+
},
|
|
477
|
+
support: {
|
|
478
|
+
supportEmail: 'support@example.com',
|
|
479
|
+
documentationUrl: 'https://example.com/docs',
|
|
480
|
+
supportUrl: 'https://example.com/support',
|
|
481
|
+
supportPhone: '+18005555555',
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
}, null, 2)}\n`;
|
|
485
|
+
}
|
|
486
|
+
function renderWorkflowActionMetadata(options) {
|
|
487
|
+
const label = options.capability.label ?? options.capability.id;
|
|
488
|
+
const inputFields = hubSpotWorkflowInputFields(options.capability.input);
|
|
489
|
+
const outputFields = hubSpotWorkflowOutputFields(options.capability.output);
|
|
490
|
+
const inputFieldLabels = {};
|
|
491
|
+
const inputFieldDescriptions = {};
|
|
492
|
+
const outputFieldLabels = {};
|
|
493
|
+
for (const meta of inputFieldMeta(options.capability.input)) {
|
|
494
|
+
inputFieldLabels[meta.name] = meta.label;
|
|
495
|
+
inputFieldDescriptions[meta.name] = meta.description;
|
|
496
|
+
}
|
|
497
|
+
for (const meta of outputFieldMeta(options.capability.output)) {
|
|
498
|
+
outputFieldLabels[meta.name] = meta.label;
|
|
499
|
+
}
|
|
500
|
+
return `${JSON.stringify({
|
|
501
|
+
uid: toKebabCase(options.capability.id),
|
|
502
|
+
type: 'workflow-action',
|
|
503
|
+
config: {
|
|
504
|
+
actionUrl: `${options.runtimeBaseUrl.replace(/\/$/, '')}/workflow-actions/${encodeURIComponent(options.capability.id)}/invoke`,
|
|
505
|
+
isPublished: true,
|
|
506
|
+
supportedClients: [{ client: 'WORKFLOWS' }],
|
|
507
|
+
inputFields,
|
|
508
|
+
outputFields,
|
|
509
|
+
objectTypes: [toHubSpotObjectType(options.capability.objectType ?? 'deals')],
|
|
510
|
+
labels: {
|
|
511
|
+
en: {
|
|
512
|
+
actionName: label,
|
|
513
|
+
actionDescription: label,
|
|
514
|
+
appDisplayName: 'HS-X',
|
|
515
|
+
actionCardContent: label,
|
|
516
|
+
inputFieldLabels,
|
|
517
|
+
inputFieldDescriptions,
|
|
518
|
+
outputFieldLabels,
|
|
519
|
+
},
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
}, null, 2)}\n`;
|
|
523
|
+
}
|
|
524
|
+
function normalizedRequiredAppScopes(options) {
|
|
525
|
+
const scopes = new Set();
|
|
526
|
+
scopes.add('oauth');
|
|
527
|
+
for (const scope of options.scopes) {
|
|
528
|
+
if (scope)
|
|
529
|
+
scopes.add(scope);
|
|
530
|
+
}
|
|
531
|
+
if ((options.appEvents?.length ?? 0) > 0) {
|
|
532
|
+
scopes.add('timeline');
|
|
533
|
+
}
|
|
534
|
+
return [...scopes];
|
|
535
|
+
}
|
|
536
|
+
function renderAppObjectMetadata(object) {
|
|
537
|
+
return `${JSON.stringify({
|
|
538
|
+
uid: object.uid,
|
|
539
|
+
type: 'app-object',
|
|
540
|
+
config: {
|
|
541
|
+
name: object.name,
|
|
542
|
+
label: object.label,
|
|
543
|
+
singularForm: object.singularForm,
|
|
544
|
+
pluralForm: object.pluralForm,
|
|
545
|
+
...(object.description ? { description: object.description } : {}),
|
|
546
|
+
...(object.appPrefix ? { appPrefix: object.appPrefix } : {}),
|
|
547
|
+
primaryDisplayLabelPropertyName: object.primaryDisplayLabelPropertyName,
|
|
548
|
+
...(object.secondaryDisplayLabelPropertyNames
|
|
549
|
+
? { secondaryDisplayLabelPropertyNames: object.secondaryDisplayLabelPropertyNames }
|
|
550
|
+
: {}),
|
|
551
|
+
...(object.requiredProperties ? { requiredProperties: object.requiredProperties } : {}),
|
|
552
|
+
...(object.searchableProperties
|
|
553
|
+
? { searchableProperties: object.searchableProperties }
|
|
554
|
+
: {}),
|
|
555
|
+
...(object.defaultCreateFormFields
|
|
556
|
+
? { defaultCreateFormFields: object.defaultCreateFormFields }
|
|
557
|
+
: {}),
|
|
558
|
+
...(object.propertyGroups ? { propertyGroups: object.propertyGroups } : {}),
|
|
559
|
+
properties: appObjectProperties(object.properties),
|
|
560
|
+
...(object.settings ? { settings: object.settings } : {}),
|
|
561
|
+
},
|
|
562
|
+
}, null, 2)}\n`;
|
|
563
|
+
}
|
|
564
|
+
function renderAppObjectAssociationMetadata(association) {
|
|
565
|
+
return `${JSON.stringify({
|
|
566
|
+
uid: association.uid,
|
|
567
|
+
type: 'app-object-association',
|
|
568
|
+
config: {
|
|
569
|
+
fromObjectType: association.fromObjectType,
|
|
570
|
+
toObjectType: association.toObjectType,
|
|
571
|
+
...(association.name ? { name: association.name } : {}),
|
|
572
|
+
...(association.label ? { label: association.label } : {}),
|
|
573
|
+
...(association.inverseLabel ? { inverseLabel: association.inverseLabel } : {}),
|
|
574
|
+
...(association.cardinality ? { cardinality: association.cardinality } : {}),
|
|
575
|
+
},
|
|
576
|
+
}, null, 2)}\n`;
|
|
577
|
+
}
|
|
578
|
+
function renderAppEventMetadata(event) {
|
|
579
|
+
return `${JSON.stringify({
|
|
580
|
+
uid: event.uid,
|
|
581
|
+
type: 'app-event',
|
|
582
|
+
config: {
|
|
583
|
+
name: event.name,
|
|
584
|
+
label: event.label,
|
|
585
|
+
objectType: event.objectType,
|
|
586
|
+
...(event.description ? { description: event.description } : {}),
|
|
587
|
+
...(event.supportsCustomObject === undefined
|
|
588
|
+
? {}
|
|
589
|
+
: { supportsCustomObject: event.supportsCustomObject }),
|
|
590
|
+
...(event.headerTemplate ? { headerTemplate: event.headerTemplate } : {}),
|
|
591
|
+
...(event.detailTemplate ? { detailTemplate: event.detailTemplate } : {}),
|
|
592
|
+
properties: appEventProperties(event.properties),
|
|
593
|
+
},
|
|
594
|
+
}, null, 2)}\n`;
|
|
595
|
+
}
|
|
596
|
+
function appObjectProperties(properties) {
|
|
597
|
+
return Object.entries(properties).map(([name, property]) => {
|
|
598
|
+
const type = normalizeHubSpotType(property.type);
|
|
599
|
+
return compactRecord({
|
|
600
|
+
...property,
|
|
601
|
+
name: property.name ?? name,
|
|
602
|
+
type,
|
|
603
|
+
fieldType: property.fieldType ?? defaultHubSpotFieldType(type),
|
|
604
|
+
options: normalizeFieldOptions(property.options),
|
|
605
|
+
});
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
function appEventProperties(properties) {
|
|
609
|
+
return Object.entries(properties).map(([name, property]) => {
|
|
610
|
+
const type = normalizeHubSpotType(property.type);
|
|
611
|
+
return compactRecord({
|
|
612
|
+
...property,
|
|
613
|
+
name: property.name ?? name,
|
|
614
|
+
type,
|
|
615
|
+
fieldType: property.fieldType ?? defaultHubSpotFieldType(type),
|
|
616
|
+
options: normalizeFieldOptions(property.options),
|
|
617
|
+
});
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
function compactRecord(record) {
|
|
621
|
+
return Object.fromEntries(Object.entries(record).filter(([, value]) => value !== undefined));
|
|
622
|
+
}
|
|
623
|
+
const HUBSPOT_TYPE_TOKENS = Object.freeze({
|
|
624
|
+
string: 'string',
|
|
625
|
+
STRING: 'string',
|
|
626
|
+
number: 'number',
|
|
627
|
+
NUMBER: 'number',
|
|
628
|
+
bool: 'bool',
|
|
629
|
+
boolean: 'bool',
|
|
630
|
+
BOOLEAN: 'bool',
|
|
631
|
+
BOOL: 'bool',
|
|
632
|
+
enumeration: 'enumeration',
|
|
633
|
+
ENUMERATION: 'enumeration',
|
|
634
|
+
datetime: 'datetime',
|
|
635
|
+
DATETIME: 'datetime',
|
|
636
|
+
json: 'string',
|
|
637
|
+
JSON: 'string',
|
|
638
|
+
});
|
|
639
|
+
function normalizeHubSpotType(value) {
|
|
640
|
+
if (typeof value !== 'string')
|
|
641
|
+
return 'string';
|
|
642
|
+
return HUBSPOT_TYPE_TOKENS[value] ?? value.toLowerCase();
|
|
643
|
+
}
|
|
644
|
+
function defaultHubSpotFieldType(type) {
|
|
645
|
+
switch (type) {
|
|
646
|
+
case 'number':
|
|
647
|
+
return 'number';
|
|
648
|
+
case 'bool':
|
|
649
|
+
return 'booleancheckbox';
|
|
650
|
+
case 'enumeration':
|
|
651
|
+
return 'select';
|
|
652
|
+
case 'datetime':
|
|
653
|
+
return 'date';
|
|
654
|
+
default:
|
|
655
|
+
return 'text';
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function fieldEntries(fields) {
|
|
659
|
+
if (!fields || typeof fields !== 'object' || Array.isArray(fields)) {
|
|
660
|
+
return [];
|
|
661
|
+
}
|
|
662
|
+
return Object.entries(fields).map(([name, value]) => {
|
|
663
|
+
const record = value && typeof value === 'object' && !Array.isArray(value)
|
|
664
|
+
? value
|
|
665
|
+
: {};
|
|
666
|
+
return [name, record];
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
function normalizeFieldOptions(options) {
|
|
670
|
+
if (!Array.isArray(options))
|
|
671
|
+
return undefined;
|
|
672
|
+
const normalized = options
|
|
673
|
+
.map((option) => {
|
|
674
|
+
if (typeof option === 'string')
|
|
675
|
+
return { value: option, label: option };
|
|
676
|
+
if (option && typeof option === 'object') {
|
|
677
|
+
const record = option;
|
|
678
|
+
if (typeof record.value === 'string') {
|
|
679
|
+
return {
|
|
680
|
+
value: record.value,
|
|
681
|
+
label: typeof record.label === 'string' ? record.label : record.value,
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
return undefined;
|
|
686
|
+
})
|
|
687
|
+
.filter((entry) => entry !== undefined);
|
|
688
|
+
return normalized.length ? normalized : undefined;
|
|
689
|
+
}
|
|
690
|
+
function hubSpotWorkflowInputFields(fields) {
|
|
691
|
+
return fieldEntries(fields).map(([name, record]) => {
|
|
692
|
+
const type = normalizeHubSpotType(record.type);
|
|
693
|
+
const fieldType = typeof record.fieldType === 'string' ? record.fieldType : defaultHubSpotFieldType(type);
|
|
694
|
+
const options = normalizeFieldOptions(record.options);
|
|
695
|
+
const typeDefinition = { name, type, fieldType };
|
|
696
|
+
if (type === 'enumeration') {
|
|
697
|
+
if (!options || options.length === 0) {
|
|
698
|
+
throw new Error(`Workflow action input field "${name}" declares type "enumeration" but no options. Add { options: [{ value, label }, ...] } to the SDK input definition.`);
|
|
699
|
+
}
|
|
700
|
+
typeDefinition.options = options;
|
|
701
|
+
}
|
|
702
|
+
else if (options) {
|
|
703
|
+
typeDefinition.options = options;
|
|
704
|
+
}
|
|
705
|
+
const supportedValueTypes = Array.isArray(record.supportedValueTypes)
|
|
706
|
+
? record.supportedValueTypes.filter((value) => typeof value === 'string')
|
|
707
|
+
: ['STATIC_VALUE'];
|
|
708
|
+
const isRequired = typeof record.isRequired === 'boolean'
|
|
709
|
+
? record.isRequired
|
|
710
|
+
: typeof record.required === 'boolean'
|
|
711
|
+
? record.required
|
|
712
|
+
: true;
|
|
713
|
+
return {
|
|
714
|
+
typeDefinition,
|
|
715
|
+
supportedValueTypes,
|
|
716
|
+
isRequired,
|
|
717
|
+
};
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
function hubSpotWorkflowOutputFields(fields) {
|
|
721
|
+
return fieldEntries(fields).map(([name, record]) => {
|
|
722
|
+
const type = normalizeHubSpotType(record.type);
|
|
723
|
+
const fieldType = typeof record.fieldType === 'string' ? record.fieldType : defaultHubSpotFieldType(type);
|
|
724
|
+
return {
|
|
725
|
+
typeDefinition: { name, type, fieldType },
|
|
726
|
+
};
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
function inputFieldMeta(fields) {
|
|
730
|
+
return fieldEntries(fields).map(([name, record]) => {
|
|
731
|
+
const label = typeof record.label === 'string' ? record.label : name;
|
|
732
|
+
const description = typeof record.description === 'string' ? record.description : label;
|
|
733
|
+
return { name, label, description };
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
function outputFieldMeta(fields) {
|
|
737
|
+
return fieldEntries(fields).map(([name, record]) => {
|
|
738
|
+
const label = typeof record.label === 'string' ? record.label : name;
|
|
739
|
+
return { name, label };
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
export function renderRefsTypes(workers, declarations = {}) {
|
|
743
|
+
const cardExports = cardBackendCapabilities(workers)
|
|
744
|
+
.map((capability) => {
|
|
745
|
+
const id = JSON.stringify(capability.id);
|
|
746
|
+
const path = JSON.stringify(cardBackendDispatchPath(capability.id));
|
|
747
|
+
return `export declare const ${toIdentifier(capability.id)}: { readonly id: ${id}; readonly kind: "card-backend"; readonly dispatch: { readonly method: "POST"; readonly path: ${path} } };\n`;
|
|
748
|
+
})
|
|
749
|
+
.join('');
|
|
750
|
+
const objectExports = (declarations.appObjects ?? [])
|
|
751
|
+
.map((object) => {
|
|
752
|
+
const id = JSON.stringify(object.id);
|
|
753
|
+
const name = JSON.stringify(object.name);
|
|
754
|
+
return `export declare const ${toIdentifier(object.id)}: { readonly id: ${id}; readonly kind: "app-object"; readonly name: ${name} };\n`;
|
|
755
|
+
})
|
|
756
|
+
.join('');
|
|
757
|
+
const eventExports = (declarations.appEvents ?? [])
|
|
758
|
+
.map((event) => {
|
|
759
|
+
const id = JSON.stringify(event.id);
|
|
760
|
+
const name = JSON.stringify(event.name);
|
|
761
|
+
return `export declare const ${toIdentifier(event.id)}: { readonly id: ${id}; readonly kind: "app-event"; readonly name: ${name} };\n`;
|
|
762
|
+
})
|
|
763
|
+
.join('');
|
|
764
|
+
const exports = `${cardExports}${objectExports}${eventExports}`;
|
|
765
|
+
return `// Generated by hs-x. Do not edit.\n${exports || 'export {};\n'}`;
|
|
766
|
+
}
|
|
767
|
+
export function renderRefsModule(workers, declarations = {}) {
|
|
768
|
+
const cardExports = cardBackendCapabilities(workers)
|
|
769
|
+
.map((capability) => {
|
|
770
|
+
const id = JSON.stringify(capability.id);
|
|
771
|
+
const path = JSON.stringify(cardBackendDispatchPath(capability.id));
|
|
772
|
+
return `export const ${toIdentifier(capability.id)} = Object.freeze({ id: ${id}, kind: "card-backend", dispatch: Object.freeze({ method: "POST", path: ${path} }) });\n`;
|
|
773
|
+
})
|
|
774
|
+
.join('');
|
|
775
|
+
const objectExports = (declarations.appObjects ?? [])
|
|
776
|
+
.map((object) => {
|
|
777
|
+
const id = JSON.stringify(object.id);
|
|
778
|
+
const name = JSON.stringify(object.name);
|
|
779
|
+
return `export const ${toIdentifier(object.id)} = Object.freeze({ id: ${id}, kind: "app-object", name: ${name} });\n`;
|
|
780
|
+
})
|
|
781
|
+
.join('');
|
|
782
|
+
const eventExports = (declarations.appEvents ?? [])
|
|
783
|
+
.map((event) => {
|
|
784
|
+
const id = JSON.stringify(event.id);
|
|
785
|
+
const name = JSON.stringify(event.name);
|
|
786
|
+
return `export const ${toIdentifier(event.id)} = Object.freeze({ id: ${id}, kind: "app-event", name: ${name} });\n`;
|
|
787
|
+
})
|
|
788
|
+
.join('');
|
|
789
|
+
const exports = `${cardExports}${objectExports}${eventExports}`;
|
|
790
|
+
return `// Generated by hs-x. Do not edit.\n${exports || 'export {};\n'}`;
|
|
791
|
+
}
|
|
792
|
+
function renderMigratedAppConfig(appName, fetchOrigin) {
|
|
793
|
+
return `import { defineApp } from "@hs-x/sdk";
|
|
794
|
+
|
|
795
|
+
export default defineApp({
|
|
796
|
+
name: ${JSON.stringify(appName.replace(/\s+Legacy$/i, ''))},
|
|
797
|
+
distribution: "private",
|
|
798
|
+
auth: "oauth",
|
|
799
|
+
platformVersion: "2026.03",
|
|
800
|
+
scopes: ["crm.objects.deals.read"],
|
|
801
|
+
permittedUrls: {
|
|
802
|
+
fetch: [${JSON.stringify(fetchOrigin)}],
|
|
803
|
+
},
|
|
804
|
+
});
|
|
805
|
+
`;
|
|
806
|
+
}
|
|
807
|
+
function renderMigratedAppMetadata(appName, fetchOrigin) {
|
|
808
|
+
const name = appName.replace(/\s+Legacy$/i, '');
|
|
809
|
+
return `${JSON.stringify({
|
|
810
|
+
uid: toKebabCase(name),
|
|
811
|
+
type: 'app',
|
|
812
|
+
config: {
|
|
813
|
+
description: `Migrated app card project for ${name}.`,
|
|
814
|
+
name,
|
|
815
|
+
distribution: 'private',
|
|
816
|
+
auth: {
|
|
817
|
+
type: 'static',
|
|
818
|
+
requiredScopes: ['oauth', 'crm.objects.deals.read'],
|
|
819
|
+
optionalScopes: [],
|
|
820
|
+
conditionallyRequiredScopes: [],
|
|
821
|
+
},
|
|
822
|
+
permittedUrls: {
|
|
823
|
+
fetch: [fetchOrigin],
|
|
824
|
+
iframe: [],
|
|
825
|
+
img: [],
|
|
826
|
+
},
|
|
827
|
+
support: {
|
|
828
|
+
supportEmail: 'support@example.com',
|
|
829
|
+
documentationUrl: 'https://example.com/docs',
|
|
830
|
+
supportUrl: 'https://example.com/support',
|
|
831
|
+
supportPhone: '+18005555555',
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
}, null, 2)}\n`;
|
|
835
|
+
}
|
|
836
|
+
function renderMigratedCardsPackage() {
|
|
837
|
+
return `${JSON.stringify({
|
|
838
|
+
name: 'hs-x-migrated-cards',
|
|
839
|
+
version: '0.1.0',
|
|
840
|
+
license: 'UNLICENSED',
|
|
841
|
+
dependencies: {
|
|
842
|
+
'@hubspot/ui-extensions': 'latest',
|
|
843
|
+
react: '^18.2.0',
|
|
844
|
+
},
|
|
845
|
+
}, null, 2)}\n`;
|
|
846
|
+
}
|
|
847
|
+
function renderMigratedCardComponent(componentName, fetchUrl) {
|
|
848
|
+
return `import {
|
|
849
|
+
CrmContext,
|
|
850
|
+
ExtensionPointApiActions,
|
|
851
|
+
Flex,
|
|
852
|
+
Text,
|
|
853
|
+
hubspot,
|
|
854
|
+
} from "@hubspot/ui-extensions";
|
|
855
|
+
|
|
856
|
+
interface ExtensionProps {
|
|
857
|
+
context: CrmContext;
|
|
858
|
+
actions: ExtensionPointApiActions<"crm.record.tab">;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
const fetchUrl = ${JSON.stringify(fetchUrl)};
|
|
862
|
+
|
|
863
|
+
hubspot.extend<"crm.record.tab">(({ context, actions }: ExtensionProps) => (
|
|
864
|
+
<${componentName} context={context} actions={actions} />
|
|
865
|
+
));
|
|
866
|
+
|
|
867
|
+
function ${componentName}(_props: ExtensionProps) {
|
|
868
|
+
return (
|
|
869
|
+
<Flex direction="column" gap="small">
|
|
870
|
+
<Text>Legacy card data source: {fetchUrl}</Text>
|
|
871
|
+
</Flex>
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
`;
|
|
875
|
+
}
|
|
876
|
+
function renderMigratedCardMetadata(options) {
|
|
877
|
+
return `${JSON.stringify({
|
|
878
|
+
uid: options.uid,
|
|
879
|
+
type: 'card',
|
|
880
|
+
config: {
|
|
881
|
+
name: options.title,
|
|
882
|
+
description: `Migrated App Card for ${options.title}.`,
|
|
883
|
+
location: 'crm.record.tab',
|
|
884
|
+
objectTypes: options.objectTypes.map(toHubSpotObjectType),
|
|
885
|
+
entrypoint: `/app/cards/${options.componentName}.tsx`,
|
|
886
|
+
},
|
|
887
|
+
}, null, 2)}\n`;
|
|
888
|
+
}
|
|
889
|
+
function toHubSpotObjectType(value) {
|
|
890
|
+
const normalized = value
|
|
891
|
+
.trim()
|
|
892
|
+
.replace(/[^a-zA-Z0-9]+/g, '_')
|
|
893
|
+
.toUpperCase();
|
|
894
|
+
return normalized.endsWith('S') ? normalized.slice(0, -1) : normalized;
|
|
895
|
+
}
|
|
896
|
+
function cardBackendCapabilities(workers) {
|
|
897
|
+
return workers.flatMap((worker) => worker.capabilities.filter((capability) => capability.kind === 'card-backend'));
|
|
898
|
+
}
|
|
899
|
+
function needs(worker, need) {
|
|
900
|
+
return worker.capabilities.some((capability) => capability.runtimeNeeds.includes(need));
|
|
901
|
+
}
|
|
902
|
+
function declaredSchemaProperties(schema) {
|
|
903
|
+
return Object.entries(schema).flatMap(([name, declaration]) => {
|
|
904
|
+
if (typeof declaration === 'string') {
|
|
905
|
+
return [{ propertyName: name, type: declaration }];
|
|
906
|
+
}
|
|
907
|
+
if (isRecord(declaration) && typeof declaration.type === 'string') {
|
|
908
|
+
return [
|
|
909
|
+
{
|
|
910
|
+
propertyName: typeof declaration.property === 'string' ? declaration.property : name,
|
|
911
|
+
type: declaration.type,
|
|
912
|
+
},
|
|
913
|
+
];
|
|
914
|
+
}
|
|
915
|
+
return [];
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
function missingPropertyPlanItem(input) {
|
|
919
|
+
if (input.manageSchema === false) {
|
|
920
|
+
return {
|
|
921
|
+
kind: 'warning',
|
|
922
|
+
...input,
|
|
923
|
+
message: `${input.objectType}.${input.propertyName} is missing; this sync does not manage portal schema. Create it in HubSpot or set manageSchema: "properties".`,
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
return {
|
|
927
|
+
kind: 'will-create-property',
|
|
928
|
+
...input,
|
|
929
|
+
message: `WILL CREATE ${input.objectType}.${input.propertyName} (${input.declaredType}) for ${input.capabilityId}.`,
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
function mismatchedPropertyPlanItem(input) {
|
|
933
|
+
if (input.manageSchema === false) {
|
|
934
|
+
return {
|
|
935
|
+
kind: 'warning',
|
|
936
|
+
...input,
|
|
937
|
+
message: `${input.objectType}.${input.propertyName} declares ${input.declaredType}, portal is ${input.observedType}. Writes from ${input.capabilityId} will fail until reconciled.`,
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
return {
|
|
941
|
+
kind: 'will-alter-property',
|
|
942
|
+
...input,
|
|
943
|
+
message: `WILL ALTER ${input.objectType}.${input.propertyName} from ${input.observedType} to ${input.declaredType} for ${input.capabilityId}.`,
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
function isRecord(value) {
|
|
947
|
+
return typeof value === 'object' && value !== null;
|
|
948
|
+
}
|
|
949
|
+
function cardBackendDispatchPath(capabilityId) {
|
|
950
|
+
return `/_hsx/cards/${encodeURIComponent(capabilityId)}`;
|
|
951
|
+
}
|
|
952
|
+
function toIdentifier(value) {
|
|
953
|
+
const identifier = value
|
|
954
|
+
.replace(/-([a-z0-9])/g, (_, char) => char.toUpperCase())
|
|
955
|
+
.replace(/[^a-zA-Z0-9_$]/g, '_');
|
|
956
|
+
return /^[a-zA-Z_$]/.test(identifier) ? identifier : `_${identifier}`;
|
|
957
|
+
}
|
|
958
|
+
function toKebabCase(value) {
|
|
959
|
+
return (value
|
|
960
|
+
.trim()
|
|
961
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
962
|
+
.replace(/[^a-zA-Z0-9]+/g, '-')
|
|
963
|
+
.replace(/^-+|-+$/g, '')
|
|
964
|
+
.toLowerCase() || 'migrated-card');
|
|
965
|
+
}
|
|
966
|
+
function toResourceSlug(value) {
|
|
967
|
+
const slug = value
|
|
968
|
+
.trim()
|
|
969
|
+
.toLowerCase()
|
|
970
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
971
|
+
.replace(/^-+|-+$/g, '');
|
|
972
|
+
return slug || 'resource';
|
|
973
|
+
}
|
|
974
|
+
function toPascalCase(value) {
|
|
975
|
+
const words = toKebabCase(value).split('-').filter(Boolean);
|
|
976
|
+
const identifier = words
|
|
977
|
+
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)
|
|
978
|
+
.join('');
|
|
979
|
+
return /^[A-Z]/.test(identifier) ? identifier : 'MigratedCard';
|
|
980
|
+
}
|
|
981
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAcjC,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AA4HvC,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAAwC;IAExC,MAAM,QAAQ,GAAoB;QAChC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM;YACvC,CAAC,CAAC,EAAE,qBAAqB,EAAE,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,EAAE;YAC/D,CAAC,CAAC,EAAE,CAAC;QACP,GAA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IACnC,MAAM,IAAI,GAAG,KAAK;SACf,IAAI,EAAE;SACN,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC3B,OAAO,IAAI,IAAI,UAAU,CAAC;AAC5B,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,KAAK;SACrB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;SAChE,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC;AACjE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hs-x/codegen",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "HS-X codegen — .hs-x/refs stubs for card↔backend, portal schema typing.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -b",
|
|
20
|
+
"clean": "tsc -b --clean"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@hs-x/types": "0.1.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@hs-x/fixtures": "0.1.0"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
}
|
|
31
|
+
}
|