@auxx/sdk 0.0.5 → 0.0.7
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/lib/api/api.js +36 -46
- package/lib/api/schemas.js +24 -32
- package/lib/auxx.js +4 -1
- package/lib/client/workflow/components/fields/index.d.ts +4 -0
- package/lib/client/workflow/components/fields/index.d.ts.map +1 -0
- package/lib/client/workflow/components/fields/index.js +3 -0
- package/lib/client/workflow/components/fields/var-field-group.d.ts +9 -0
- package/lib/client/workflow/components/fields/var-field-group.d.ts.map +1 -0
- package/lib/client/workflow/components/fields/var-field-group.js +3 -0
- package/lib/client/workflow/components/fields/var-field.d.ts +12 -0
- package/lib/client/workflow/components/fields/var-field.d.ts.map +1 -0
- package/lib/client/workflow/components/fields/var-field.js +3 -0
- package/lib/client/workflow/components/fields/var-input.d.ts +16 -0
- package/lib/client/workflow/components/fields/var-input.d.ts.map +1 -0
- package/lib/client/workflow/components/fields/var-input.js +3 -0
- package/lib/client/workflow/hooks/use-workflow.d.ts +31 -4
- package/lib/client/workflow/hooks/use-workflow.d.ts.map +1 -1
- package/lib/commands/dev/boot.js +2 -16
- package/lib/commands/dev/onboarding.js +1 -0
- package/lib/commands/dev/upload.js +33 -15
- package/lib/commands/dev.js +7 -6
- package/lib/commands/version/create.js +44 -39
- package/lib/commands/version/list.js +29 -25
- package/lib/print-errors.js +13 -5
- package/lib/root/workflow/types.d.ts +10 -0
- package/lib/root/workflow/types.d.ts.map +1 -1
- package/lib/runtime/reconciler/tags/index.d.ts +3 -0
- package/lib/runtime/reconciler/tags/index.d.ts.map +1 -1
- package/lib/runtime/reconciler/tags/index.js +9 -0
- package/lib/runtime/reconciler/tags/workflow-var-field-group-tag.d.ts +7 -0
- package/lib/runtime/reconciler/tags/workflow-var-field-group-tag.d.ts.map +1 -0
- package/lib/runtime/reconciler/tags/workflow-var-field-group-tag.js +17 -0
- package/lib/runtime/reconciler/tags/workflow-var-field-tag.d.ts +7 -0
- package/lib/runtime/reconciler/tags/workflow-var-field-tag.d.ts.map +1 -0
- package/lib/runtime/reconciler/tags/workflow-var-field-tag.js +20 -0
- package/lib/runtime/reconciler/tags/workflow-var-input-tag.d.ts +7 -0
- package/lib/runtime/reconciler/tags/workflow-var-input-tag.d.ts.map +1 -0
- package/lib/runtime/reconciler/tags/workflow-var-input-tag.js +22 -0
- package/lib/runtime/workflow.d.ts +9 -0
- package/lib/runtime/workflow.d.ts.map +1 -1
- package/lib/runtime/workflow.js +126 -7
- package/lib/util/calculate-bundle-sha.js +0 -4
- package/package.json +1 -1
- package/lib/spinners/get-versions.spinner.js +0 -5
package/lib/api/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { complete, errored } from '../errors.js';
|
|
2
2
|
import { Fetcher } from './fetcher.js';
|
|
3
3
|
import { AUTH_API } from '../env.js';
|
|
4
|
-
import { appInfoSchema,
|
|
4
|
+
import { appInfoSchema, checkBundlesResponseSchema, confirmBundlesResponseSchema, createDeploymentResponseSchema, fetchAppLogsResponseSchema, installationSchema, listAppsResponseSchema, listDeploymentsResponseSchema, listDevOrganizationsResponseSchema, oidcUserInfoSchema, TEST_APP_INFO, TEST_ORGANIZATIONS, tokenResponseSchema, whoamiSchema, } from './schemas.js';
|
|
5
5
|
class ApiImpl {
|
|
6
6
|
fetcher;
|
|
7
7
|
constructor() {
|
|
@@ -101,62 +101,62 @@ class ApiImpl {
|
|
|
101
101
|
}
|
|
102
102
|
return complete(result.value.organizations);
|
|
103
103
|
}
|
|
104
|
-
async
|
|
104
|
+
async checkBundles({ appId, clientSha, serverSha, }) {
|
|
105
105
|
const result = await this.fetcher.post({
|
|
106
|
-
path: `/api/v1/apps/${appId}/
|
|
107
|
-
body: {
|
|
108
|
-
|
|
109
|
-
cli_version: cliVersion,
|
|
110
|
-
},
|
|
111
|
-
schema: createVersionSchema,
|
|
106
|
+
path: `/api/v1/apps/${appId}/bundles/check`,
|
|
107
|
+
body: { clientSha, serverSha },
|
|
108
|
+
schema: checkBundlesResponseSchema,
|
|
112
109
|
});
|
|
113
110
|
if (!result.success) {
|
|
114
|
-
return errored({ code: '
|
|
111
|
+
return errored({ code: 'CHECK_BUNDLES_ERROR', error: result.error });
|
|
115
112
|
}
|
|
116
113
|
return complete(result.value);
|
|
117
114
|
}
|
|
118
|
-
async
|
|
115
|
+
async confirmBundles({ appId, clientSha, serverSha, }) {
|
|
119
116
|
const result = await this.fetcher.post({
|
|
120
|
-
path: `/api/v1/apps/${appId}/
|
|
121
|
-
body: {
|
|
122
|
-
|
|
123
|
-
settings_schema: settingsSchema,
|
|
124
|
-
},
|
|
125
|
-
schema: completeBundleUploadSchema,
|
|
117
|
+
path: `/api/v1/apps/${appId}/bundles/confirm`,
|
|
118
|
+
body: { clientSha, serverSha },
|
|
119
|
+
schema: confirmBundlesResponseSchema,
|
|
126
120
|
});
|
|
127
121
|
if (!result.success) {
|
|
128
|
-
return errored({ code: '
|
|
122
|
+
return errored({ code: 'CONFIRM_BUNDLES_ERROR', error: result.error });
|
|
129
123
|
}
|
|
130
|
-
return complete(
|
|
124
|
+
return complete(result.value);
|
|
131
125
|
}
|
|
132
|
-
async
|
|
126
|
+
async createDeployment({ appId, clientBundleSha, serverBundleSha, deploymentType, settingsSchema, targetOrganizationId, environmentVariables, version, metadata, }) {
|
|
133
127
|
const result = await this.fetcher.post({
|
|
134
|
-
path: `/api/v1/apps/${appId}/
|
|
128
|
+
path: `/api/v1/apps/${appId}/deployments`,
|
|
135
129
|
body: {
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
clientBundleSha,
|
|
131
|
+
serverBundleSha,
|
|
132
|
+
deploymentType,
|
|
133
|
+
settingsSchema,
|
|
134
|
+
targetOrganizationId,
|
|
135
|
+
environmentVariables,
|
|
136
|
+
version,
|
|
137
|
+
metadata,
|
|
138
138
|
},
|
|
139
|
-
schema:
|
|
139
|
+
schema: createDeploymentResponseSchema,
|
|
140
140
|
});
|
|
141
141
|
if (!result.success) {
|
|
142
|
-
return errored({ code: '
|
|
142
|
+
return errored({ code: 'CREATE_DEPLOYMENT_ERROR', error: result.error });
|
|
143
143
|
}
|
|
144
|
-
return complete(
|
|
144
|
+
return complete(result.value);
|
|
145
145
|
}
|
|
146
|
-
async
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
schema:
|
|
146
|
+
async listDeployments({ appId, type }) {
|
|
147
|
+
const params = new URLSearchParams();
|
|
148
|
+
if (type)
|
|
149
|
+
params.append('type', type);
|
|
150
|
+
const queryString = params.toString();
|
|
151
|
+
const path = `/api/v1/apps/${appId}/deployments${queryString ? `?${queryString}` : ''}`;
|
|
152
|
+
const result = await this.fetcher.get({
|
|
153
|
+
path,
|
|
154
|
+
schema: listDeploymentsResponseSchema,
|
|
155
155
|
});
|
|
156
156
|
if (!result.success) {
|
|
157
|
-
return errored({ code: '
|
|
157
|
+
return errored({ code: 'LIST_DEPLOYMENTS_ERROR', error: result.error });
|
|
158
158
|
}
|
|
159
|
-
return complete(result.value);
|
|
159
|
+
return complete(result.value.deployments);
|
|
160
160
|
}
|
|
161
161
|
async fetchInstallation({ appId, organizationId }) {
|
|
162
162
|
const result = await this.fetcher.get({
|
|
@@ -171,16 +171,6 @@ class ApiImpl {
|
|
|
171
171
|
}
|
|
172
172
|
return complete(result);
|
|
173
173
|
}
|
|
174
|
-
async fetchVersions(appId) {
|
|
175
|
-
const result = await this.fetcher.get({
|
|
176
|
-
path: `/api/v1/apps/${appId}/prod-versions`,
|
|
177
|
-
schema: versionsSchema,
|
|
178
|
-
});
|
|
179
|
-
if (!result.success) {
|
|
180
|
-
return errored({ code: 'FETCH_VERSIONS_ERROR', error: result.error });
|
|
181
|
-
}
|
|
182
|
-
return complete(result.value.app_prod_versions);
|
|
183
|
-
}
|
|
184
174
|
async fetchAppLogs({ organizationHandle, appSlug, cursor, limit = 100, }) {
|
|
185
175
|
const params = new URLSearchParams();
|
|
186
176
|
if (cursor)
|
package/lib/api/schemas.js
CHANGED
|
@@ -53,29 +53,35 @@ export const listAppsResponseSchema = z.object({
|
|
|
53
53
|
apps: z.array(appDataSchema),
|
|
54
54
|
}),
|
|
55
55
|
});
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
bundleSha: z.string().optional(),
|
|
56
|
+
const bundleCheckItemSchema = z.object({
|
|
57
|
+
exists: z.boolean(),
|
|
58
|
+
bundleId: z.string(),
|
|
59
|
+
uploadUrl: z.string().nullable(),
|
|
61
60
|
});
|
|
62
|
-
export const
|
|
63
|
-
|
|
61
|
+
export const checkBundlesResponseSchema = z.object({
|
|
62
|
+
client: bundleCheckItemSchema,
|
|
63
|
+
server: bundleCheckItemSchema,
|
|
64
64
|
});
|
|
65
|
-
export const
|
|
65
|
+
export const confirmBundlesResponseSchema = z.object({
|
|
66
66
|
success: z.boolean(),
|
|
67
67
|
});
|
|
68
|
-
export const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
created_at: z.string(),
|
|
72
|
-
released_at: z.string().nullable().optional(),
|
|
73
|
-
is_published: z.boolean(),
|
|
74
|
-
num_installations: z.number(),
|
|
75
|
-
publication_status: z.enum(['private', 'in-review', 'published', 'rejected', 'unpublished']),
|
|
68
|
+
export const createDeploymentResponseSchema = z.object({
|
|
69
|
+
deploymentId: z.string(),
|
|
70
|
+
version: z.string().nullable(),
|
|
76
71
|
});
|
|
77
|
-
export const
|
|
78
|
-
|
|
72
|
+
export const deploymentSchema = z.object({
|
|
73
|
+
id: z.string(),
|
|
74
|
+
deploymentType: z.enum(['development', 'production']),
|
|
75
|
+
version: z.string().nullable(),
|
|
76
|
+
status: z.string(),
|
|
77
|
+
clientBundleSha: z.string(),
|
|
78
|
+
serverBundleSha: z.string(),
|
|
79
|
+
settingsSchema: z.unknown().nullable(),
|
|
80
|
+
metadata: z.unknown().nullable(),
|
|
81
|
+
createdAt: z.string(),
|
|
82
|
+
});
|
|
83
|
+
export const listDeploymentsResponseSchema = z.object({
|
|
84
|
+
deployments: z.array(deploymentSchema),
|
|
79
85
|
});
|
|
80
86
|
export const organizationResponseSchema = z.object({
|
|
81
87
|
id: z.string(),
|
|
@@ -86,20 +92,6 @@ export const organizationResponseSchema = z.object({
|
|
|
86
92
|
export const listDevOrganizationsResponseSchema = z.object({
|
|
87
93
|
organizations: z.array(organizationResponseSchema),
|
|
88
94
|
});
|
|
89
|
-
export const createVersionSchema = z.object({
|
|
90
|
-
versionId: z.string(),
|
|
91
|
-
appId: z.string(),
|
|
92
|
-
major: z.number(),
|
|
93
|
-
minor: z.number(),
|
|
94
|
-
bundle: bundleSchema,
|
|
95
|
-
});
|
|
96
|
-
export const createDevVersionSchema = z.object({
|
|
97
|
-
versionId: z.string(),
|
|
98
|
-
appId: z.string(),
|
|
99
|
-
major: z.number(),
|
|
100
|
-
minor: z.number(),
|
|
101
|
-
bundle: bundleSchema,
|
|
102
|
-
});
|
|
103
95
|
export const installationSchema = z.object({
|
|
104
96
|
appId: z.string(),
|
|
105
97
|
organizationId: z.string(),
|
package/lib/auxx.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import './env-loader.js';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
3
4
|
import { Command } from 'commander';
|
|
4
5
|
import { apps } from './commands/apps.js';
|
|
5
6
|
import { build } from './commands/build.js';
|
|
@@ -10,11 +11,13 @@ import { logout } from './commands/logout.js';
|
|
|
10
11
|
import { logs } from './commands/logs.js';
|
|
11
12
|
import { version } from './commands/version/index.js';
|
|
12
13
|
import { whoami } from './commands/whoami.js';
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
const pkg = require('../package.json');
|
|
13
16
|
const program = new Command();
|
|
14
17
|
program
|
|
15
18
|
.name('auxx')
|
|
16
19
|
.description('CLI tool to create Auxx apps')
|
|
17
|
-
.version(
|
|
20
|
+
.version(pkg.version)
|
|
18
21
|
.addCommand(init)
|
|
19
22
|
.addCommand(apps)
|
|
20
23
|
.addCommand(build)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/workflow/components/fields/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface VarFieldGroupProps {
|
|
3
|
+
orientation?: 'horizontal' | 'vertical';
|
|
4
|
+
validationError?: string;
|
|
5
|
+
validationType?: 'error' | 'warning';
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const VarFieldGroup: React.FC<VarFieldGroupProps>;
|
|
9
|
+
//# sourceMappingURL=var-field-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"var-field-group.d.ts","sourceRoot":"","sources":["../../../../../src/client/workflow/components/fields/var-field-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,kBAAkB;IAEjC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IAEvC,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAEpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAKD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoBtD,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface VarFieldProps {
|
|
3
|
+
name?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
type?: string;
|
|
8
|
+
showIcon?: boolean;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const VarField: React.FC<VarFieldProps>;
|
|
12
|
+
//# sourceMappingURL=var-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"var-field.d.ts","sourceRoot":"","sources":["../../../../../src/client/workflow/components/fields/var-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,aAAa;IAE5B,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAKD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0B5C,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface VarInputProps {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
acceptsVariables?: boolean;
|
|
7
|
+
variableTypes?: string[];
|
|
8
|
+
format?: string;
|
|
9
|
+
options?: readonly (string | {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
})[];
|
|
13
|
+
multiline?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const VarInput: React.FC<VarInputProps>;
|
|
16
|
+
//# sourceMappingURL=var-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"var-input.d.ts","sourceRoot":"","sources":["../../../../../src/client/workflow/components/fields/var-input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,aAAa;IAE5B,IAAI,EAAE,MAAM,CAAA;IAEZ,IAAI,EAAE,MAAM,CAAA;IAEZ,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IAExB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,OAAO,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAA;IAEhE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAQD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAS5C,CAAA"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { InferWorkflowInput, WorkflowSchema } from '../../../root/workflow/types.js';
|
|
3
|
-
import { type
|
|
4
|
-
import { type
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { type VarFieldProps } from '../components/fields/var-field.js';
|
|
4
|
+
import { type VarFieldGroupProps } from '../components/fields/var-field-group.js';
|
|
5
|
+
import type { BooleanInputProps } from '../components/inputs/boolean-input.js';
|
|
6
|
+
import type { NumberInputProps } from '../components/inputs/number-input.js';
|
|
7
|
+
import type { SelectInputProps } from '../components/inputs/select-input.js';
|
|
8
|
+
import type { StringInputProps } from '../components/inputs/string-input.js';
|
|
7
9
|
import { type InputGroupProps } from '../components/layout/input-group.js';
|
|
8
10
|
import { type SectionProps } from '../components/layout/section.js';
|
|
9
11
|
import { type ConditionalRenderProps } from '../components/utility/conditional-render.js';
|
|
@@ -20,14 +22,39 @@ export interface WorkflowBooleanInputProps<TSchema extends WorkflowSchema> exten
|
|
|
20
22
|
export interface WorkflowSelectInputProps<TSchema extends WorkflowSchema> extends Omit<SelectInputProps, 'name' | 'value' | 'onChange'> {
|
|
21
23
|
name: PathToField<TSchema['inputs'], 'select'>;
|
|
22
24
|
}
|
|
25
|
+
export interface WorkflowOptionsInputProps<TSchema extends WorkflowSchema> {
|
|
26
|
+
name: PathToField<TSchema['inputs'], 'select'>;
|
|
27
|
+
options?: readonly (string | {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
})[];
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface WorkflowVarInputProps {
|
|
34
|
+
name: string;
|
|
35
|
+
type: string;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
acceptsVariables?: boolean;
|
|
38
|
+
variableTypes?: string[];
|
|
39
|
+
format?: string;
|
|
40
|
+
options?: readonly (string | {
|
|
41
|
+
label: string;
|
|
42
|
+
value: string;
|
|
43
|
+
})[];
|
|
44
|
+
multiline?: boolean;
|
|
45
|
+
}
|
|
23
46
|
export interface WorkflowConditionalRenderProps<TSchema extends WorkflowSchema> extends Omit<ConditionalRenderProps, 'data'> {
|
|
24
47
|
when: (data: InferWorkflowInput<TSchema>) => boolean;
|
|
25
48
|
}
|
|
26
49
|
export interface UseWorkflowApi<TSchema extends WorkflowSchema> {
|
|
50
|
+
VarInput: (props: WorkflowVarInputProps) => ReactElement;
|
|
27
51
|
StringInput: (props: WorkflowStringInputProps<TSchema>) => ReactElement;
|
|
28
52
|
NumberInput: (props: WorkflowNumberInputProps<TSchema>) => ReactElement;
|
|
29
53
|
BooleanInput: (props: WorkflowBooleanInputProps<TSchema>) => ReactElement;
|
|
30
54
|
SelectInput: (props: WorkflowSelectInputProps<TSchema>) => ReactElement;
|
|
55
|
+
OptionsInput: (props: WorkflowOptionsInputProps<TSchema>) => ReactElement;
|
|
56
|
+
VarField: (props: VarFieldProps) => ReactElement;
|
|
57
|
+
VarFieldGroup: (props: VarFieldGroupProps) => ReactElement;
|
|
31
58
|
Section: (props: SectionProps) => ReactElement;
|
|
32
59
|
InputGroup: (props: InputGroupProps) => ReactElement;
|
|
33
60
|
ConditionalRender: (props: WorkflowConditionalRenderProps<TSchema>) => ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-workflow.d.ts","sourceRoot":"","sources":["../../../../src/client/workflow/hooks/use-workflow.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"use-workflow.d.ts","sourceRoot":"","sources":["../../../../src/client/workflow/hooks/use-workflow.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,YAAY,EAAwB,MAAM,OAAO,CAAA;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACzF,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAEhG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACtF,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC5E,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,6CAA6C,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAmB3D,MAAM,WAAW,wBAAwB,CAAC,OAAO,SAAS,cAAc,CACtE,SAAQ,IAAI,CAAC,gBAAgB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AAA;IAGpD,iBAAiB,EAAE,CAAC,KAAK,EAAE,8BAA8B,CAAC,OAAO,CAAC,KAAK,YAAY,CAAA;CACpF;AAkCD,wBAAgB,WAAW,CAAC,OAAO,SAAS,cAAc,EACxD,MAAM,EAAE,OAAO,GACd,cAAc,CAAC,OAAO,CAAC,CA0KzB"}
|
package/lib/commands/dev/boot.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { api } from '../../api/api.js';
|
|
2
1
|
import { isErrored } from '../../errors.js';
|
|
3
2
|
import { printCliVersionError, printDetermineOrganizationError, printFetcherError, printPackageJsonError, } from '../../print-errors.js';
|
|
4
3
|
import { determineOrganization } from '../../spinners/determine-organization.spinner.js';
|
|
@@ -32,24 +31,11 @@ export async function boot({ organizationSlug }) {
|
|
|
32
31
|
process.exit(1);
|
|
33
32
|
}
|
|
34
33
|
const cliVersion = cliVersionResult.value;
|
|
35
|
-
const devVersionResult = await api.createDevVersion({
|
|
36
|
-
appId: appInfo.id,
|
|
37
|
-
cliVersion,
|
|
38
|
-
targetOrganizationId: organization.id,
|
|
39
|
-
environmentVariables,
|
|
40
|
-
});
|
|
41
|
-
if (isErrored(devVersionResult)) {
|
|
42
|
-
printFetcherError('Error creating dev version', devVersionResult.error);
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
const devVersion = devVersionResult.value;
|
|
46
34
|
return {
|
|
47
35
|
appId: appInfo.id,
|
|
48
36
|
appSlug,
|
|
49
|
-
devVersionId: devVersion.versionId,
|
|
50
|
-
bundleId: devVersion.bundle.id,
|
|
51
|
-
clientBundleUploadUrl: devVersion.bundle.clientBundleUploadUrl,
|
|
52
|
-
serverBundleUploadUrl: devVersion.bundle.serverBundleUploadUrl,
|
|
53
37
|
organization,
|
|
38
|
+
environmentVariables,
|
|
39
|
+
cliVersion,
|
|
54
40
|
};
|
|
55
41
|
}
|
|
@@ -11,6 +11,7 @@ export function onboarding({ appId, appSlug, organization }) {
|
|
|
11
11
|
open(`${APP_URL}/app/settings/apps/${appSlug}`);
|
|
12
12
|
});
|
|
13
13
|
const poll = async () => {
|
|
14
|
+
await new Promise((resolve) => setTimeout(resolve, 15_000));
|
|
14
15
|
const installationResult = await api.fetchInstallation({
|
|
15
16
|
appId,
|
|
16
17
|
organizationId: organization.id,
|
|
@@ -2,32 +2,50 @@ import chalk from 'chalk';
|
|
|
2
2
|
import notifier from 'node-notifier';
|
|
3
3
|
import { api } from '../../api/api.js';
|
|
4
4
|
import { combineAsync, complete, isErrored } from '../../errors.js';
|
|
5
|
-
import {
|
|
5
|
+
import { calculateBundleSha } from '../../util/calculate-bundle-sha.js';
|
|
6
6
|
import { spinnerify } from '../../util/spinner.js';
|
|
7
7
|
import { uploadBundle } from '../../util/upload-bundle.js';
|
|
8
|
-
export async function upload({ contents,
|
|
8
|
+
export async function upload({ contents, appId, targetOrganizationId, environmentVariables, cliVersion, settingsSchema, }) {
|
|
9
9
|
return await spinnerify('Uploading...', () => `Upload complete at ${new Date().toLocaleTimeString()}`, async () => {
|
|
10
10
|
const [clientBundle, serverBundle] = contents;
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const clientSha = calculateBundleSha(clientBundle);
|
|
12
|
+
const serverSha = calculateBundleSha(serverBundle);
|
|
13
|
+
const checkResult = await api.checkBundles({ appId, clientSha, serverSha });
|
|
14
|
+
if (isErrored(checkResult)) {
|
|
15
|
+
return checkResult;
|
|
16
|
+
}
|
|
17
|
+
const uploads = [];
|
|
18
|
+
if (!checkResult.value.client.exists) {
|
|
19
|
+
uploads.push(uploadBundle(clientBundle, checkResult.value.client.uploadUrl));
|
|
20
|
+
}
|
|
21
|
+
if (!checkResult.value.server.exists) {
|
|
22
|
+
uploads.push(uploadBundle(serverBundle, checkResult.value.server.uploadUrl));
|
|
23
|
+
}
|
|
24
|
+
if (uploads.length > 0) {
|
|
25
|
+
const uploadResults = await combineAsync(uploads);
|
|
26
|
+
if (isErrored(uploadResults)) {
|
|
27
|
+
return uploadResults;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const confirmResult = await api.confirmBundles({ appId, clientSha, serverSha });
|
|
31
|
+
if (isErrored(confirmResult)) {
|
|
32
|
+
return confirmResult;
|
|
18
33
|
}
|
|
19
34
|
if (settingsSchema) {
|
|
20
35
|
process.stdout.write(`${chalk.green('✓ ')}Settings schema included\n`);
|
|
21
36
|
}
|
|
22
|
-
const
|
|
37
|
+
const deployResult = await api.createDeployment({
|
|
23
38
|
appId,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
clientBundleSha: clientSha,
|
|
40
|
+
serverBundleSha: serverSha,
|
|
41
|
+
deploymentType: 'development',
|
|
42
|
+
targetOrganizationId,
|
|
43
|
+
environmentVariables,
|
|
27
44
|
settingsSchema,
|
|
45
|
+
metadata: { cliVersion },
|
|
28
46
|
});
|
|
29
|
-
if (isErrored(
|
|
30
|
-
return
|
|
47
|
+
if (isErrored(deployResult)) {
|
|
48
|
+
return deployResult;
|
|
31
49
|
}
|
|
32
50
|
try {
|
|
33
51
|
notifier.notify({
|
package/lib/commands/dev.js
CHANGED
|
@@ -103,7 +103,9 @@ export const dev = new Command('dev')
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
try {
|
|
106
|
-
const { appId, appSlug, organization,
|
|
106
|
+
const { appId, appSlug, organization, environmentVariables, cliVersion } = await boot({
|
|
107
|
+
organizationSlug,
|
|
108
|
+
});
|
|
107
109
|
const cleanupOnboardingDaemon = onboarding({ appId, appSlug, organization });
|
|
108
110
|
cleanupFunctions.push(cleanupOnboardingDaemon);
|
|
109
111
|
let haveTsErrors = false;
|
|
@@ -126,15 +128,14 @@ export const dev = new Command('dev')
|
|
|
126
128
|
}
|
|
127
129
|
const uploadResult = await upload({
|
|
128
130
|
contents,
|
|
129
|
-
versionId: devVersionId,
|
|
130
|
-
bundleId,
|
|
131
|
-
clientBundleUploadUrl,
|
|
132
|
-
serverBundleUploadUrl,
|
|
133
131
|
appId,
|
|
132
|
+
targetOrganizationId: organization.id,
|
|
133
|
+
environmentVariables,
|
|
134
|
+
cliVersion,
|
|
134
135
|
settingsSchema,
|
|
135
136
|
});
|
|
136
137
|
if (isErrored(uploadResult)) {
|
|
137
|
-
printUploadError(uploadResult
|
|
138
|
+
printUploadError(uploadResult);
|
|
138
139
|
}
|
|
139
140
|
}, async (error) => {
|
|
140
141
|
haveBundlingErrors = true;
|
|
@@ -7,9 +7,8 @@ import { combineAsync, isErrored } from '../../errors.js';
|
|
|
7
7
|
import { printCliVersionError, printFetcherError, printPackageJsonError, } from '../../print-errors.js';
|
|
8
8
|
import { getAppInfo } from '../../spinners/get-app-info.spinner.js';
|
|
9
9
|
import { getAppSlugFromPackageJson } from '../../spinners/get-app-slug-from-package-json.js';
|
|
10
|
-
import { getVersions } from '../../spinners/get-versions.spinner.js';
|
|
11
10
|
import { assertAppSettings } from '../../util/assert-app-settings.js';
|
|
12
|
-
import {
|
|
11
|
+
import { calculateBundleSha } from '../../util/calculate-bundle-sha.js';
|
|
13
12
|
import { ensureAppEntryPoint } from '../../util/ensure-app-entry-point.js';
|
|
14
13
|
import { exitWithMissingAppSettings } from '../../util/exit-with-missing-app-settings.js';
|
|
15
14
|
import { exitWithMissingEntryPoint } from '../../util/exit-with-missing-entry-point.js';
|
|
@@ -20,7 +19,7 @@ import { uploadBundle } from '../../util/upload-bundle.js';
|
|
|
20
19
|
import { printBuildContextError } from '../dev/prepare-build-context.js';
|
|
21
20
|
import { bundleJavaScript } from './create/bundle-javascript.js';
|
|
22
21
|
export const versionCreate = new Command('create')
|
|
23
|
-
.description('Create a new
|
|
22
|
+
.description('Create a new deployment of your auxx app')
|
|
24
23
|
.action(async () => {
|
|
25
24
|
if (USE_APP_TS) {
|
|
26
25
|
const appEntryPointResult = await ensureAppEntryPoint();
|
|
@@ -70,56 +69,62 @@ export const versionCreate = new Command('create')
|
|
|
70
69
|
if (settingsSchema) {
|
|
71
70
|
process.stdout.write(`${chalk.green('✓ ')}Settings schema extracted\n`);
|
|
72
71
|
}
|
|
73
|
-
const
|
|
74
|
-
const versionsResult = await getVersions(appInfo);
|
|
75
|
-
if (isErrored(versionsResult)) {
|
|
76
|
-
printFetcherError('Error fetching versions', versionsResult.error);
|
|
77
|
-
process.exit(1);
|
|
78
|
-
}
|
|
79
|
-
const versions = versionsResult.value;
|
|
80
|
-
const versionResult = await spinnerify('Uploading...', 'Upload complete', async () => {
|
|
72
|
+
const deployResult = await spinnerify('Uploading...', 'Upload complete', async () => {
|
|
81
73
|
const cliVersionResult = loadAuxxCliVersion();
|
|
82
74
|
if (isErrored(cliVersionResult)) {
|
|
83
75
|
printCliVersionError(cliVersionResult);
|
|
84
76
|
process.exit(1);
|
|
85
77
|
}
|
|
86
78
|
const cliVersion = cliVersionResult.value;
|
|
87
|
-
const
|
|
79
|
+
const clientSha = calculateBundleSha(clientBundle);
|
|
80
|
+
const serverSha = calculateBundleSha(serverBundle);
|
|
81
|
+
const checkResult = await api.checkBundles({ appId: appInfo.id, clientSha, serverSha });
|
|
82
|
+
if (isErrored(checkResult)) {
|
|
83
|
+
printFetcherError('Error checking bundles', checkResult);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
const uploads = [];
|
|
87
|
+
if (!checkResult.value.client.exists) {
|
|
88
|
+
uploads.push(uploadBundle(clientBundle, checkResult.value.client.uploadUrl));
|
|
89
|
+
}
|
|
90
|
+
if (!checkResult.value.server.exists) {
|
|
91
|
+
uploads.push(uploadBundle(serverBundle, checkResult.value.server.uploadUrl));
|
|
92
|
+
}
|
|
93
|
+
if (uploads.length > 0) {
|
|
94
|
+
const uploadResult = await combineAsync(uploads);
|
|
95
|
+
if (isErrored(uploadResult)) {
|
|
96
|
+
process.stderr.write(`${chalk.red('✖ ')}Failed to upload bundle\n`);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const confirmResult = await api.confirmBundles({
|
|
88
101
|
appId: appInfo.id,
|
|
89
|
-
|
|
90
|
-
|
|
102
|
+
clientSha,
|
|
103
|
+
serverSha,
|
|
91
104
|
});
|
|
92
|
-
if (isErrored(
|
|
93
|
-
printFetcherError('Error
|
|
105
|
+
if (isErrored(confirmResult)) {
|
|
106
|
+
printFetcherError('Error confirming bundles', confirmResult);
|
|
94
107
|
process.exit(1);
|
|
95
108
|
}
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
const result = await api.createDeployment({
|
|
110
|
+
appId: appInfo.id,
|
|
111
|
+
clientBundleSha: clientSha,
|
|
112
|
+
serverBundleSha: serverSha,
|
|
113
|
+
deploymentType: 'production',
|
|
114
|
+
settingsSchema,
|
|
115
|
+
metadata: { cliVersion },
|
|
116
|
+
});
|
|
117
|
+
if (isErrored(result)) {
|
|
118
|
+
printFetcherError('Error creating deployment', result);
|
|
103
119
|
process.exit(1);
|
|
104
120
|
}
|
|
105
|
-
return
|
|
121
|
+
return result;
|
|
106
122
|
});
|
|
107
|
-
if (isErrored(
|
|
108
|
-
process.stderr.write(`${chalk.red('✖ ')}Failed to create
|
|
109
|
-
process.exit(1);
|
|
110
|
-
}
|
|
111
|
-
const version = versionResult.value;
|
|
112
|
-
const signingResult = await spinnerify('Signing bundles...', 'Bundles signed', async () => await api.completeProdBundleUpload({
|
|
113
|
-
appId: appInfo.id,
|
|
114
|
-
versionId: version.versionId,
|
|
115
|
-
bundleId: version.bundle.id,
|
|
116
|
-
bundleSha,
|
|
117
|
-
settingsSchema,
|
|
118
|
-
}));
|
|
119
|
-
if (isErrored(signingResult)) {
|
|
120
|
-
printFetcherError('Error signing bundles', signingResult.error);
|
|
123
|
+
if (isErrored(deployResult)) {
|
|
124
|
+
process.stderr.write(`${chalk.red('✖ ')}Failed to create deployment: ${deployResult.error}\n`);
|
|
121
125
|
process.exit(1);
|
|
122
126
|
}
|
|
123
|
-
|
|
127
|
+
const deployment = deployResult.value;
|
|
128
|
+
process.stdout.write(`\nDeployment ${chalk.green(deployment.version ?? deployment.deploymentId)} created!\n\n`);
|
|
124
129
|
process.exit(0);
|
|
125
130
|
});
|
|
@@ -2,15 +2,16 @@ import chalk from 'chalk';
|
|
|
2
2
|
import Table from 'cli-table3';
|
|
3
3
|
import { Command } from 'commander';
|
|
4
4
|
import { format as formatDate } from 'date-fns';
|
|
5
|
+
import { api } from '../../api/api.js';
|
|
5
6
|
import { authenticator } from '../../auth/auth.js';
|
|
6
7
|
import { isErrored } from '../../errors.js';
|
|
7
8
|
import { printFetcherError, printPackageJsonError } from '../../print-errors.js';
|
|
8
9
|
import { getAppInfo } from '../../spinners/get-app-info.spinner.js';
|
|
9
10
|
import { getAppSlugFromPackageJson } from '../../spinners/get-app-slug-from-package-json.js';
|
|
10
|
-
import {
|
|
11
|
+
import { spinnerify } from '../../util/spinner.js';
|
|
11
12
|
export const versionList = new Command()
|
|
12
13
|
.name('list')
|
|
13
|
-
.description('List all
|
|
14
|
+
.description('List all production deployments of your app')
|
|
14
15
|
.action(async () => {
|
|
15
16
|
await authenticator.ensureAuthed();
|
|
16
17
|
const appSlugResult = await getAppSlugFromPackageJson();
|
|
@@ -25,42 +26,45 @@ export const versionList = new Command()
|
|
|
25
26
|
process.exit(1);
|
|
26
27
|
}
|
|
27
28
|
const appInfo = appInfoResult.value;
|
|
28
|
-
const
|
|
29
|
-
if (isErrored(
|
|
30
|
-
printFetcherError('Error loading
|
|
29
|
+
const deploymentsResult = await spinnerify('Loading deployments...', 'Deployments loaded', async () => await api.listDeployments({ appId: appInfo.id, type: 'production' }));
|
|
30
|
+
if (isErrored(deploymentsResult)) {
|
|
31
|
+
printFetcherError('Error loading deployments', deploymentsResult.error);
|
|
31
32
|
process.exit(1);
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
process.stdout.write('No
|
|
34
|
+
const deployments = deploymentsResult.value;
|
|
35
|
+
if (deployments.length === 0) {
|
|
36
|
+
process.stdout.write('No deployments found\n');
|
|
36
37
|
process.exit(0);
|
|
37
38
|
}
|
|
39
|
+
const statusColors = {
|
|
40
|
+
active: chalk.green,
|
|
41
|
+
'pending-review': chalk.yellow,
|
|
42
|
+
'in-review': chalk.yellow,
|
|
43
|
+
approved: chalk.cyan,
|
|
44
|
+
published: chalk.green,
|
|
45
|
+
rejected: chalk.red,
|
|
46
|
+
withdrawn: chalk.gray,
|
|
47
|
+
deprecated: chalk.gray,
|
|
48
|
+
};
|
|
38
49
|
const table = new Table({
|
|
39
|
-
head: ['Version', 'Status', '
|
|
50
|
+
head: ['Version', 'Status', 'Bundles', 'Created'].map((h) => chalk.bold(h)),
|
|
40
51
|
style: {
|
|
41
52
|
head: [],
|
|
42
53
|
border: [],
|
|
43
54
|
},
|
|
44
|
-
colAligns: ['center', 'left', '
|
|
55
|
+
colAligns: ['center', 'left', 'left', 'left'],
|
|
45
56
|
});
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
'in-review': chalk.yellow,
|
|
50
|
-
published: chalk.green,
|
|
51
|
-
rejected: chalk.red,
|
|
52
|
-
unpublished: chalk.gray,
|
|
53
|
-
};
|
|
54
|
-
const formattedStatus = version.publication_status
|
|
55
|
-
.split('_')
|
|
57
|
+
deployments.forEach((d) => {
|
|
58
|
+
const formattedStatus = d.status
|
|
59
|
+
.split('-')
|
|
56
60
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
57
61
|
.join(' ');
|
|
62
|
+
const colorFn = statusColors[d.status] ?? chalk.white;
|
|
58
63
|
table.push([
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
formatDate(new Date(version.created_at), 'MMM d, yyyy, HH:mm'),
|
|
64
|
+
d.version ?? d.id.slice(0, 8),
|
|
65
|
+
colorFn(formattedStatus),
|
|
66
|
+
d.clientBundleSha.slice(0, 8),
|
|
67
|
+
formatDate(new Date(d.createdAt), 'MMM d, yyyy, HH:mm'),
|
|
64
68
|
]);
|
|
65
69
|
});
|
|
66
70
|
process.stdout.write('\n' + table.toString() + '\n');
|
package/lib/print-errors.js
CHANGED
|
@@ -18,17 +18,25 @@ export function printFetcherError(message, { error }) {
|
|
|
18
18
|
break;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
export function printUploadError(
|
|
22
|
-
const e =
|
|
21
|
+
export function printUploadError(result) {
|
|
22
|
+
const e = result.error;
|
|
23
23
|
switch (e.code) {
|
|
24
24
|
case 'BUNDLE_UPLOAD_ERROR':
|
|
25
25
|
process.stderr.write(chalk.red(`Error uploading bundle: ${e.uploadUrl}\n`));
|
|
26
|
+
if (e.status) {
|
|
27
|
+
process.stderr.write(chalk.red(` Status: ${e.status} ${e.statusText ?? ''}\n`));
|
|
28
|
+
}
|
|
26
29
|
break;
|
|
27
30
|
case 'START_UPLOAD_ERROR':
|
|
28
|
-
process.stderr.write(chalk.red(`Error starting upload: ${e}\n`));
|
|
31
|
+
process.stderr.write(chalk.red(`Error starting upload: ${e.error.message}\n`));
|
|
32
|
+
break;
|
|
33
|
+
case 'CHECK_BUNDLES_ERROR':
|
|
34
|
+
case 'CONFIRM_BUNDLES_ERROR':
|
|
35
|
+
case 'CREATE_DEPLOYMENT_ERROR':
|
|
36
|
+
printFetcherError(`Upload failed (${e.code})`, e);
|
|
29
37
|
break;
|
|
30
|
-
|
|
31
|
-
process.stderr.write(chalk.red(`
|
|
38
|
+
default:
|
|
39
|
+
process.stderr.write(chalk.red(`Upload error: ${e.code}\n`));
|
|
32
40
|
break;
|
|
33
41
|
}
|
|
34
42
|
}
|
|
@@ -65,9 +65,19 @@ export interface WorkflowExecutionContext {
|
|
|
65
65
|
organization: WorkflowOrganization;
|
|
66
66
|
sdk: WorkflowSDK;
|
|
67
67
|
}
|
|
68
|
+
export interface WorkflowLayoutSection {
|
|
69
|
+
type: 'section';
|
|
70
|
+
title: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
fields: string[];
|
|
73
|
+
collapsible?: boolean;
|
|
74
|
+
initialOpen?: boolean;
|
|
75
|
+
}
|
|
68
76
|
export interface WorkflowSchema {
|
|
69
77
|
inputs: Record<string, any>;
|
|
70
78
|
outputs: Record<string, any>;
|
|
79
|
+
layout?: WorkflowLayoutSection[];
|
|
80
|
+
computeOutputs?: (inputs: Record<string, any>) => Record<string, any>;
|
|
71
81
|
}
|
|
72
82
|
export interface WorkflowBlockConfig {
|
|
73
83
|
timeout?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/root/workflow/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAK1C,oBAAY,QAAQ;IAElB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,GAAG,QAAQ;IAGX,MAAM,WAAW;IACjB,KAAK,UAAU;IAGf,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IAGb,SAAS,cAAc;CACxB;AAKD,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,WAAW,GACX,aAAa,GACb,IAAI,GACJ,MAAM,GACN,SAAS,GACT,QAAQ,CAAA;AAKZ,MAAM,WAAW,UAAU;IAEzB,EAAE,EAAE,MAAM,CAAA;IAEV,IAAI,EAAE,MAAM,CAAA;IAEZ,KAAK,EAAE,MAAM,CAAA;IAEb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B;AAKD,MAAM,WAAW,YAAY;IAE3B,EAAE,EAAE,MAAM,CAAA;IAEV,KAAK,EAAE,MAAM,CAAA;IAEb,IAAI,EAAE,MAAM,CAAA;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,mBAAmB,CAAC,CAAC,SAAS,cAAc,IAAI;KACzD,CAAC,IAAI,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3D,CAAA"}
|
|
@@ -30,5 +30,8 @@ export { WorkflowSectionTag } from './workflow-section-tag.js';
|
|
|
30
30
|
export { WorkflowSelectInputTag } from './workflow-select-input-tag.js';
|
|
31
31
|
export { WorkflowSeparatorTag } from './workflow-separator-tag.js';
|
|
32
32
|
export { WorkflowStringInputTag } from './workflow-string-input-tag.js';
|
|
33
|
+
export { WorkflowVarFieldGroupTag } from './workflow-var-field-group-tag.js';
|
|
34
|
+
export { WorkflowVarFieldTag } from './workflow-var-field-tag.js';
|
|
35
|
+
export { WorkflowVarInputTag } from './workflow-var-input-tag.js';
|
|
33
36
|
export { WorkflowVariableInputTag } from './workflow-variable-input-tag.js';
|
|
34
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/reconciler/tags/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/reconciler/tags/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAiC5C,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAmCpF,CAAA;AAKD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAKD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OA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ACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAA;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -25,6 +25,9 @@ import { WorkflowSectionTag } from './workflow-section-tag.js';
|
|
|
25
25
|
import { WorkflowSelectInputTag } from './workflow-select-input-tag.js';
|
|
26
26
|
import { WorkflowSeparatorTag } from './workflow-separator-tag.js';
|
|
27
27
|
import { WorkflowStringInputTag } from './workflow-string-input-tag.js';
|
|
28
|
+
import { WorkflowVarFieldGroupTag } from './workflow-var-field-group-tag.js';
|
|
29
|
+
import { WorkflowVarFieldTag } from './workflow-var-field-tag.js';
|
|
30
|
+
import { WorkflowVarInputTag } from './workflow-var-input-tag.js';
|
|
28
31
|
import { WorkflowVariableInputTag } from './workflow-variable-input-tag.js';
|
|
29
32
|
export const TAG_REGISTRY = {
|
|
30
33
|
auxxtextblock: TextBlockTag,
|
|
@@ -57,6 +60,9 @@ export const TAG_REGISTRY = {
|
|
|
57
60
|
auxxworkflowconditionalrender: WorkflowConditionalRenderTag,
|
|
58
61
|
auxxworkflowvariableinput: WorkflowVariableInputTag,
|
|
59
62
|
auxxworkflowinputeditor: WorkflowInputEditorTag,
|
|
63
|
+
auxxworkflowvarinput: WorkflowVarInputTag,
|
|
64
|
+
auxxworkflowvarfield: WorkflowVarFieldTag,
|
|
65
|
+
auxxworkflowvarfieldgroup: WorkflowVarFieldGroupTag,
|
|
60
66
|
};
|
|
61
67
|
export function isCustomElement(tagName) {
|
|
62
68
|
return tagName in TAG_REGISTRY;
|
|
@@ -96,4 +102,7 @@ export { WorkflowSectionTag } from './workflow-section-tag.js';
|
|
|
96
102
|
export { WorkflowSelectInputTag } from './workflow-select-input-tag.js';
|
|
97
103
|
export { WorkflowSeparatorTag } from './workflow-separator-tag.js';
|
|
98
104
|
export { WorkflowStringInputTag } from './workflow-string-input-tag.js';
|
|
105
|
+
export { WorkflowVarFieldGroupTag } from './workflow-var-field-group-tag.js';
|
|
106
|
+
export { WorkflowVarFieldTag } from './workflow-var-field-tag.js';
|
|
107
|
+
export { WorkflowVarInputTag } from './workflow-var-input-tag.js';
|
|
99
108
|
export { WorkflowVariableInputTag } from './workflow-variable-input-tag.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseTag } from './base-tag.js';
|
|
2
|
+
export declare class WorkflowVarFieldGroupTag extends BaseTag {
|
|
3
|
+
getTagName(): string;
|
|
4
|
+
getComponentName(): string;
|
|
5
|
+
getAttributes(props: Record<string, any>): Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=workflow-var-field-group-tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-var-field-group-tag.d.ts","sourceRoot":"","sources":["../../../../src/runtime/reconciler/tags/workflow-var-field-group-tag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAMvC,qBAAa,wBAAyB,SAAQ,OAAO;IACnD,UAAU,IAAI,MAAM;IAIpB,gBAAgB,IAAI,MAAM;IAI1B,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAS/D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseTag } from './base-tag.js';
|
|
2
|
+
export class WorkflowVarFieldGroupTag extends BaseTag {
|
|
3
|
+
getTagName() {
|
|
4
|
+
return 'div';
|
|
5
|
+
}
|
|
6
|
+
getComponentName() {
|
|
7
|
+
return 'WorkflowVarFieldGroup';
|
|
8
|
+
}
|
|
9
|
+
getAttributes(props) {
|
|
10
|
+
const { orientation, validationError, validationType } = props;
|
|
11
|
+
return {
|
|
12
|
+
orientation,
|
|
13
|
+
validationError,
|
|
14
|
+
validationType,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseTag } from './base-tag.js';
|
|
2
|
+
export declare class WorkflowVarFieldTag extends BaseTag {
|
|
3
|
+
getTagName(): string;
|
|
4
|
+
getComponentName(): string;
|
|
5
|
+
getAttributes(props: Record<string, any>): Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=workflow-var-field-tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-var-field-tag.d.ts","sourceRoot":"","sources":["../../../../src/runtime/reconciler/tags/workflow-var-field-tag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAMvC,qBAAa,mBAAoB,SAAQ,OAAO;IAC9C,UAAU,IAAI,MAAM;IAIpB,gBAAgB,IAAI,MAAM;IAI1B,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAY/D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseTag } from './base-tag.js';
|
|
2
|
+
export class WorkflowVarFieldTag extends BaseTag {
|
|
3
|
+
getTagName() {
|
|
4
|
+
return 'div';
|
|
5
|
+
}
|
|
6
|
+
getComponentName() {
|
|
7
|
+
return 'WorkflowVarField';
|
|
8
|
+
}
|
|
9
|
+
getAttributes(props) {
|
|
10
|
+
const { name, title, description, required, type, showIcon } = props;
|
|
11
|
+
return {
|
|
12
|
+
name,
|
|
13
|
+
title,
|
|
14
|
+
description,
|
|
15
|
+
required,
|
|
16
|
+
type,
|
|
17
|
+
showIcon,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseTag } from './base-tag.js';
|
|
2
|
+
export declare class WorkflowVarInputTag extends BaseTag {
|
|
3
|
+
getTagName(): string;
|
|
4
|
+
getComponentName(): string;
|
|
5
|
+
getAttributes(props: Record<string, any>): Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=workflow-var-input-tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-var-input-tag.d.ts","sourceRoot":"","sources":["../../../../src/runtime/reconciler/tags/workflow-var-input-tag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAOvC,qBAAa,mBAAoB,SAAQ,OAAO;IAC9C,UAAU,IAAI,MAAM;IAIpB,gBAAgB,IAAI,MAAM;IAI1B,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAe/D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseTag } from './base-tag.js';
|
|
2
|
+
export class WorkflowVarInputTag extends BaseTag {
|
|
3
|
+
getTagName() {
|
|
4
|
+
return 'div';
|
|
5
|
+
}
|
|
6
|
+
getComponentName() {
|
|
7
|
+
return 'VarInputInternal';
|
|
8
|
+
}
|
|
9
|
+
getAttributes(props) {
|
|
10
|
+
const { name, type, placeholder, acceptsVariables, variableTypes, format, options, multiline } = props;
|
|
11
|
+
return {
|
|
12
|
+
name,
|
|
13
|
+
type,
|
|
14
|
+
placeholder,
|
|
15
|
+
acceptsVariables,
|
|
16
|
+
variableTypes,
|
|
17
|
+
format,
|
|
18
|
+
options,
|
|
19
|
+
multiline,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -29,6 +29,15 @@ interface WorkflowBlock {
|
|
|
29
29
|
}>;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
+
layout?: Array<{
|
|
33
|
+
type: 'section';
|
|
34
|
+
title: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
fields: string[];
|
|
37
|
+
collapsible?: boolean;
|
|
38
|
+
initialOpen?: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
computeOutputs?: (inputs: Record<string, any>) => Record<string, any>;
|
|
32
41
|
};
|
|
33
42
|
config?: {
|
|
34
43
|
canRunSingle?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/runtime/workflow.ts"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAkB/D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAC5B,OAAO,CAAC,EAAE;YACR,OAAO,CAAC,EAAE,KAAK,CAAC;gBAAE,EAAE,EAAE,MAAM,CAAC;gBAAC,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;YAC/C,OAAO,CAAC,EAAE,KAAK,CAAC;gBAAE,EAAE,EAAE,MAAM,CAAC;gBAAC,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC,CAA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;oBAAC,OAAO,EAAE,MAAM,CAAC;oBAAC,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;iBAAE,CAAC,CAAA;aAC9E,CAAA;SACF,CAAA;QACD,MAAM,CAAC,EAAE,KAAK,CAAC;YACb,IAAI,EAAE,SAAS,CAAA;YACf,KAAK,EAAE,MAAM,CAAA;YACb,WAAW,CAAC,EAAE,MAAM,CAAA;YACpB,MAAM,EAAE,MAAM,EAAE,CAAA;YAChB,WAAW,CAAC,EAAE,OAAO,CAAA;YACrB,WAAW,CAAC,EAAE,OAAO,CAAA;SACtB,CAAC,CAAA;QACF,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KACtE,CAAA;IACD,MAAM,CAAC,EAAE;QACP,YAAY,CAAC,EAAE,OAAO,CAAA;KACvB,CAAA;IACD,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CACvC;AAyXD,wBAAgB,iBAAiB,IAAI,aAAa,EAAE,CA2CnD"}
|
package/lib/runtime/workflow.js
CHANGED
|
@@ -14,6 +14,12 @@ function WorkflowPanelContainer({ blockId, nodeId, initialData, PanelComponent,
|
|
|
14
14
|
const unsubscribe = Host.onRequest(`update-panel-data-${nodeId}`, handler);
|
|
15
15
|
return unsubscribe;
|
|
16
16
|
}, [nodeId]);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const block = getWorkflowBlock(blockId);
|
|
19
|
+
if (block) {
|
|
20
|
+
evaluateComputeOutputs(block, nodeId, data);
|
|
21
|
+
}
|
|
22
|
+
}, [blockId, nodeId, data]);
|
|
17
23
|
const updateData = useCallback((updates) => {
|
|
18
24
|
setData((prev) => ({ ...prev, ...updates }));
|
|
19
25
|
Host.sendMessage('workflow-node-data-update', { nodeId, data: updates });
|
|
@@ -200,6 +206,17 @@ function serializeNestedField(fieldJson, kind) {
|
|
|
200
206
|
}
|
|
201
207
|
return field;
|
|
202
208
|
}
|
|
209
|
+
function resolveBlockIcon(icon) {
|
|
210
|
+
if (typeof icon !== 'string' || !icon)
|
|
211
|
+
return undefined;
|
|
212
|
+
if (icon.startsWith('url:') || icon.startsWith('base64:'))
|
|
213
|
+
return icon;
|
|
214
|
+
if (icon.startsWith('data:'))
|
|
215
|
+
return `base64:${icon}`;
|
|
216
|
+
if (icon.startsWith('http://') || icon.startsWith('https://'))
|
|
217
|
+
return `url:${icon}`;
|
|
218
|
+
return icon;
|
|
219
|
+
}
|
|
203
220
|
export function getWorkflowBlocks() {
|
|
204
221
|
const surfaces = SURFACES.getAll();
|
|
205
222
|
const workflowBlockSurfaces = surfaces.filter((s) => s.type === 'workflow-block');
|
|
@@ -213,7 +230,7 @@ export function getWorkflowBlocks() {
|
|
|
213
230
|
label: fullBlock.label,
|
|
214
231
|
description: fullBlock.description,
|
|
215
232
|
category: fullBlock.category,
|
|
216
|
-
icon: fullBlock.icon,
|
|
233
|
+
icon: resolveBlockIcon(fullBlock.icon),
|
|
217
234
|
color: fullBlock.color,
|
|
218
235
|
config: fullBlock.config,
|
|
219
236
|
};
|
|
@@ -222,8 +239,10 @@ export function getWorkflowBlocks() {
|
|
|
222
239
|
inputs: serializeFields(fullBlock.schema.inputs || {}, 'input'),
|
|
223
240
|
outputs: serializeFields(fullBlock.schema.outputs || {}, 'output'),
|
|
224
241
|
handles: fullBlock.schema.handles || { sources: [], targets: [] },
|
|
242
|
+
layout: fullBlock.schema.layout,
|
|
225
243
|
};
|
|
226
244
|
}
|
|
245
|
+
metadata.hasPanel = !!fullBlock.panel;
|
|
227
246
|
return metadata;
|
|
228
247
|
})
|
|
229
248
|
.filter(Boolean);
|
|
@@ -289,8 +308,10 @@ async function renderWorkflowPanel(blockId, nodeId, data) {
|
|
|
289
308
|
}
|
|
290
309
|
const PanelComponent = block.panel;
|
|
291
310
|
if (!PanelComponent) {
|
|
311
|
+
const defaultPanel = generateDefaultPanel(block, data);
|
|
312
|
+
evaluateComputeOutputs(block, nodeId, data);
|
|
292
313
|
return {
|
|
293
|
-
component:
|
|
314
|
+
component: defaultPanel,
|
|
294
315
|
};
|
|
295
316
|
}
|
|
296
317
|
const renderState = { isInitialRenderComplete: false };
|
|
@@ -336,13 +357,65 @@ function createDefaultNodeComponent(block, _data) {
|
|
|
336
357
|
};
|
|
337
358
|
}
|
|
338
359
|
function generateDefaultPanel(block, _data) {
|
|
360
|
+
const serializedInputs = serializeFields(block.schema.inputs || {}, 'input');
|
|
361
|
+
const inputFields = Object.entries(serializedInputs);
|
|
362
|
+
if (inputFields.length === 0) {
|
|
363
|
+
return {
|
|
364
|
+
children: [{ instance_type: 'text', text: `Configure ${block.label}` }],
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
const layout = block.schema.layout || [
|
|
368
|
+
{
|
|
369
|
+
type: 'section',
|
|
370
|
+
title: 'Configuration',
|
|
371
|
+
fields: inputFields.map(([name]) => name),
|
|
372
|
+
},
|
|
373
|
+
];
|
|
339
374
|
return {
|
|
340
|
-
children:
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
375
|
+
children: layout.map((section) => ({
|
|
376
|
+
instance_type: 'instance',
|
|
377
|
+
component: 'WorkflowSection',
|
|
378
|
+
attributes: {
|
|
379
|
+
title: section.title,
|
|
380
|
+
description: section.description,
|
|
381
|
+
collapsible: section.collapsible,
|
|
382
|
+
defaultOpen: section.initialOpen ?? true,
|
|
344
383
|
},
|
|
345
|
-
|
|
384
|
+
children: [
|
|
385
|
+
{
|
|
386
|
+
instance_type: 'instance',
|
|
387
|
+
component: 'WorkflowVarFieldGroup',
|
|
388
|
+
attributes: {},
|
|
389
|
+
children: section.fields
|
|
390
|
+
.map((fieldName) => {
|
|
391
|
+
const field = serializedInputs[fieldName];
|
|
392
|
+
if (!field)
|
|
393
|
+
return null;
|
|
394
|
+
return {
|
|
395
|
+
instance_type: 'instance',
|
|
396
|
+
component: 'WorkflowVarField',
|
|
397
|
+
attributes: {},
|
|
398
|
+
children: [
|
|
399
|
+
{
|
|
400
|
+
instance_type: 'instance',
|
|
401
|
+
component: 'VarInputInternal',
|
|
402
|
+
attributes: {
|
|
403
|
+
name: fieldName,
|
|
404
|
+
type: field.type,
|
|
405
|
+
placeholder: field.placeholder,
|
|
406
|
+
acceptsVariables: field.acceptsVariables,
|
|
407
|
+
variableTypes: field.variableTypes,
|
|
408
|
+
format: field.format,
|
|
409
|
+
options: field.options,
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
};
|
|
414
|
+
})
|
|
415
|
+
.filter(Boolean),
|
|
416
|
+
},
|
|
417
|
+
],
|
|
418
|
+
})),
|
|
346
419
|
};
|
|
347
420
|
}
|
|
348
421
|
function cleanupWorkflowPanelRender(nodeId) {
|
|
@@ -351,6 +424,52 @@ function cleanupWorkflowPanelRender(nodeId) {
|
|
|
351
424
|
function cleanupWorkflowNodeRender(nodeId) {
|
|
352
425
|
activeNodeRenders.delete(nodeId);
|
|
353
426
|
}
|
|
427
|
+
const computeOutputsTimers = new Map();
|
|
428
|
+
function evaluateComputeOutputs(block, nodeId, data) {
|
|
429
|
+
if (!block.schema?.computeOutputs)
|
|
430
|
+
return;
|
|
431
|
+
const existing = computeOutputsTimers.get(nodeId);
|
|
432
|
+
if (existing)
|
|
433
|
+
clearTimeout(existing);
|
|
434
|
+
computeOutputsTimers.set(nodeId, setTimeout(() => {
|
|
435
|
+
computeOutputsTimers.delete(nodeId);
|
|
436
|
+
try {
|
|
437
|
+
const computed = block.schema.computeOutputs(data);
|
|
438
|
+
if (computed && typeof computed === 'object') {
|
|
439
|
+
const serialized = serializeComputedOutputs(computed);
|
|
440
|
+
Host.sendMessage('workflow-block-outputs-updated', {
|
|
441
|
+
nodeId,
|
|
442
|
+
blockId: block.id,
|
|
443
|
+
outputs: serialized,
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
catch (err) {
|
|
448
|
+
console.error('[Workflow] computeOutputs error:', err);
|
|
449
|
+
}
|
|
450
|
+
}, 300));
|
|
451
|
+
}
|
|
452
|
+
function serializeComputedOutputs(outputs) {
|
|
453
|
+
const result = {};
|
|
454
|
+
for (const [key, fieldNode] of Object.entries(outputs)) {
|
|
455
|
+
if (fieldNode && typeof fieldNode.toJSON === 'function') {
|
|
456
|
+
const json = fieldNode.toJSON();
|
|
457
|
+
const metadata = json._metadata || {};
|
|
458
|
+
result[key] = {
|
|
459
|
+
name: key,
|
|
460
|
+
label: metadata.label || key,
|
|
461
|
+
type: json.type || 'any',
|
|
462
|
+
description: metadata.description,
|
|
463
|
+
required: metadata.required,
|
|
464
|
+
_fieldKind: 'output',
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
else if (fieldNode && typeof fieldNode === 'object' && fieldNode.type) {
|
|
468
|
+
result[key] = { name: key, ...fieldNode };
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return result;
|
|
472
|
+
}
|
|
354
473
|
Host.onRequest('get-workflow-blocks', async () => {
|
|
355
474
|
const blocks = getWorkflowBlocks();
|
|
356
475
|
return { blocks };
|
|
@@ -2,7 +2,3 @@ import { createHash } from 'crypto';
|
|
|
2
2
|
export function calculateBundleSha(bundleContent) {
|
|
3
3
|
return createHash('sha256').update(bundleContent).digest('hex');
|
|
4
4
|
}
|
|
5
|
-
export function calculateBundleShas(clientBundle, serverBundle) {
|
|
6
|
-
const combined = `${clientBundle}\n---BUNDLE_SEPARATOR---\n${serverBundle}`;
|
|
7
|
-
return calculateBundleSha(combined);
|
|
8
|
-
}
|
package/package.json
CHANGED