@salsita-ai/contracts 0.0.0-stage → 0.49.0-develop.cbee856178
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/CHANGELOG.md +419 -0
- package/LICENSE +61 -0
- package/README.md +28 -2
- package/dist/api/access-level.d.ts +7 -0
- package/dist/api/access-level.js +1 -0
- package/dist/api/access-token.d.ts +6 -0
- package/dist/api/access-token.js +1 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +1 -0
- package/dist/api/session-role.d.ts +8 -0
- package/dist/api/session-role.js +1 -0
- package/dist/api/session-token.d.ts +22 -0
- package/dist/api/session-token.js +1 -0
- package/dist/assistant/browser-details-tool.d.ts +16 -0
- package/dist/assistant/browser-details-tool.js +1 -0
- package/dist/assistant/deployment-assistant.d.ts +84 -0
- package/dist/assistant/deployment-assistant.js +1 -0
- package/dist/assistant/graphql-tools.d.ts +120 -0
- package/dist/assistant/graphql-tools.js +1 -0
- package/dist/assistant/index.d.ts +6 -0
- package/dist/assistant/index.js +1 -0
- package/dist/assistant/message-metadata.d.ts +17 -0
- package/dist/assistant/message-metadata.js +1 -0
- package/dist/chat/api.d.ts +52 -0
- package/dist/chat/api.js +1 -0
- package/dist/chat/completions/messages.d.ts +3 -0
- package/dist/chat/completions/messages.js +1 -0
- package/dist/chat/completions/types.d.ts +28 -0
- package/dist/chat/completions/types.js +1 -0
- package/dist/chat/functions/augmentations.d.ts +3 -0
- package/dist/chat/functions/augmentations.js +1 -0
- package/dist/chat/functions/create.d.ts +5 -0
- package/dist/chat/functions/create.js +1 -0
- package/dist/chat/functions/process.d.ts +14 -0
- package/dist/chat/functions/process.js +1 -0
- package/dist/chat/functions/types.d.ts +21 -0
- package/dist/chat/functions/types.js +1 -0
- package/dist/chat/functions/validate.d.ts +1 -0
- package/dist/chat/functions/validate.js +2 -0
- package/dist/chat/index.d.ts +10 -0
- package/dist/chat/index.js +1 -0
- package/dist/chat/utils/types.d.ts +1 -0
- package/dist/chat/utils/types.js +1 -0
- package/dist/clerk/clerk-backend-api-client.d.ts +129 -0
- package/dist/clerk/clerk-backend-api-client.js +1 -0
- package/dist/clerk/clerk-backend-api-types.d.ts +740 -0
- package/dist/clerk/clerk-backend-api-types.js +1 -0
- package/dist/clerk/clerk-session-token.d.ts +28 -0
- package/dist/clerk/clerk-session-token.js +1 -0
- package/dist/clerk/clerk-token-service.d.ts +15 -0
- package/dist/clerk/clerk-token-service.js +1 -0
- package/dist/clerk/index.d.ts +4 -0
- package/dist/clerk/index.js +1 -0
- package/dist/domain/deployments/ai-image-domain.d.ts +10 -0
- package/dist/domain/deployments/ai-image-domain.js +1 -0
- package/dist/domain/deployments/api-token-domain.d.ts +8 -0
- package/dist/domain/deployments/api-token-domain.js +1 -0
- package/dist/domain/deployments/configuration-schema-domain.d.ts +22 -0
- package/dist/domain/deployments/configuration-schema-domain.js +1 -0
- package/dist/domain/deployments/customer-domain.d.ts +69 -0
- package/dist/domain/deployments/customer-domain.js +1 -0
- package/dist/domain/deployments/deployment-build-domain.d.ts +78 -0
- package/dist/domain/deployments/deployment-build-domain.js +1 -0
- package/dist/domain/deployments/deployment-domain.d.ts +126 -0
- package/dist/domain/deployments/deployment-domain.js +1 -0
- package/dist/domain/deployments/embedding-domain.d.ts +9 -0
- package/dist/domain/deployments/embedding-domain.js +1 -0
- package/dist/domain/deployments/environment-domain.d.ts +107 -0
- package/dist/domain/deployments/environment-domain.js +1 -0
- package/dist/domain/deployments/image-render-domain.d.ts +22 -0
- package/dist/domain/deployments/image-render-domain.js +1 -0
- package/dist/domain/deployments/index.d.ts +14 -0
- package/dist/domain/deployments/index.js +1 -0
- package/dist/domain/deployments/oauth-connection-domain.d.ts +62 -0
- package/dist/domain/deployments/oauth-connection-domain.js +1 -0
- package/dist/domain/deployments/oauth-provider-domain.d.ts +23 -0
- package/dist/domain/deployments/oauth-provider-domain.js +1 -0
- package/dist/domain/deployments/project-domain.d.ts +26 -0
- package/dist/domain/deployments/project-domain.js +1 -0
- package/dist/domain/deployments/sdk-builder-setup-domain.d.ts +13 -0
- package/dist/domain/deployments/sdk-builder-setup-domain.js +1 -0
- package/dist/domain/deployments/session-domain.d.ts +20 -0
- package/dist/domain/deployments/session-domain.js +1 -0
- package/dist/domain/feedback/feedback-domain.d.ts +55 -0
- package/dist/domain/feedback/feedback-domain.js +1 -0
- package/dist/domain/feedback/index.d.ts +1 -0
- package/dist/domain/feedback/index.js +1 -0
- package/dist/domain/index.d.ts +3 -0
- package/dist/domain/index.js +1 -0
- package/dist/domain/product-configurations/configurations-domain.d.ts +113 -0
- package/dist/domain/product-configurations/configurations-domain.js +1 -0
- package/dist/domain/product-configurations/index.d.ts +1 -0
- package/dist/domain/product-configurations/index.js +1 -0
- package/dist/webhook/core/index.d.ts +3 -0
- package/dist/webhook/core/index.js +1 -0
- package/dist/webhook/core/task-resource.d.ts +80 -0
- package/dist/webhook/core/task-resource.js +1 -0
- package/dist/webhook/core/task-type.d.ts +18 -0
- package/dist/webhook/core/task-type.js +1 -0
- package/dist/webhook/core/template.d.ts +65 -0
- package/dist/webhook/core/template.js +1 -0
- package/dist/webhook/empty-xlsx.d.ts +10 -0
- package/dist/webhook/empty-xlsx.js +1 -0
- package/dist/webhook/excel-workbook-client.d.ts +78 -0
- package/dist/webhook/excel-workbook-client.js +1 -0
- package/dist/webhook/google-sheets-client.d.ts +23 -0
- package/dist/webhook/google-sheets-client.js +1 -0
- package/dist/webhook/implementation/index.d.ts +4 -0
- package/dist/webhook/implementation/index.js +1 -0
- package/dist/webhook/implementation/webhook-api-types.d.ts +302 -0
- package/dist/webhook/implementation/webhook-api-types.js +1 -0
- package/dist/webhook/implementation/webhook-client.d.ts +85 -0
- package/dist/webhook/implementation/webhook-client.js +1 -0
- package/dist/webhook/implementation/webhook-routing.d.ts +30 -0
- package/dist/webhook/implementation/webhook-routing.js +1 -0
- package/dist/webhook/implementation/webhook-tunnel-types.d.ts +114 -0
- package/dist/webhook/implementation/webhook-tunnel-types.js +1 -0
- package/dist/webhook/index.d.ts +7 -0
- package/dist/webhook/index.js +1 -0
- package/dist/webhook/spreadsheet-adapter-factory.d.ts +10 -0
- package/dist/webhook/spreadsheet-adapter-factory.js +1 -0
- package/dist/webhook/spreadsheet-adapter.d.ts +94 -0
- package/dist/webhook/spreadsheet-adapter.js +1 -0
- package/dist/webhook/tasks/call-lambda-back-task.d.ts +22 -0
- package/dist/webhook/tasks/call-lambda-back-task.js +1 -0
- package/dist/webhook/tasks/edit-google-spreadsheet-task.d.ts +48 -0
- package/dist/webhook/tasks/edit-google-spreadsheet-task.js +1 -0
- package/dist/webhook/tasks/finalize-task.d.ts +184 -0
- package/dist/webhook/tasks/finalize-task.js +1 -0
- package/dist/webhook/tasks/generate-configuration-link-task.d.ts +56 -0
- package/dist/webhook/tasks/generate-configuration-link-task.js +1 -0
- package/dist/webhook/tasks/generate-csv-task.d.ts +30 -0
- package/dist/webhook/tasks/generate-csv-task.js +1 -0
- package/dist/webhook/tasks/generate-images-task.d.ts +404 -0
- package/dist/webhook/tasks/generate-images-task.js +1 -0
- package/dist/webhook/tasks/generate-pdf-task.d.ts +188 -0
- package/dist/webhook/tasks/generate-pdf-task.js +1 -0
- package/dist/webhook/tasks/index.d.ts +13 -0
- package/dist/webhook/tasks/index.js +1 -0
- package/dist/webhook/tasks/publish-revision-chunks-staged-task.d.ts +73 -0
- package/dist/webhook/tasks/publish-revision-chunks-staged-task.js +1 -0
- package/dist/webhook/tasks/publish-revision-chunks-task.d.ts +76 -0
- package/dist/webhook/tasks/publish-revision-chunks-task.js +1 -0
- package/dist/webhook/tasks/publish-revision-task.d.ts +38 -0
- package/dist/webhook/tasks/publish-revision-task.js +1 -0
- package/dist/webhook/tasks/send-email-task.d.ts +129 -0
- package/dist/webhook/tasks/send-email-task.js +1 -0
- package/dist/webhook/tasks/send-http-task.d.ts +27 -0
- package/dist/webhook/tasks/send-http-task.js +1 -0
- package/dist/webhook/tasks/woocommerce-add-to-cart-task.d.ts +91 -0
- package/dist/webhook/tasks/woocommerce-add-to-cart-task.js +1 -0
- package/dist/webhook/webhook-payload.d.ts +56 -0
- package/dist/webhook/webhook-payload.js +1 -0
- package/package.json +84 -3
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TaskType } from '../core/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* PBR material values applied to a named material in the Blender template.
|
|
5
|
+
* For texture maps, a URL applies a map, `null` removes the authored map, and omission preserves it.
|
|
6
|
+
*/
|
|
7
|
+
export interface BlenderMaterialOverride {
|
|
8
|
+
/** Name of the material in the Blender template. */
|
|
9
|
+
readonly baseMaterialName: string;
|
|
10
|
+
/** Base color as a six-digit hex color. */
|
|
11
|
+
readonly color?: string | undefined;
|
|
12
|
+
/** Surface roughness. */
|
|
13
|
+
readonly roughness?: number | undefined;
|
|
14
|
+
/** Surface metalness. */
|
|
15
|
+
readonly metalness?: number | undefined;
|
|
16
|
+
/** Base-color texture map. */
|
|
17
|
+
readonly textureUrl?: string | null | undefined;
|
|
18
|
+
/** Roughness texture map. */
|
|
19
|
+
readonly roughnessMapUrl?: string | null | undefined;
|
|
20
|
+
/** Tangent-space normal texture map. */
|
|
21
|
+
readonly normalMapUrl?: string | null | undefined;
|
|
22
|
+
/** Strength of the normal-map effect. */
|
|
23
|
+
readonly normalScale?: number | undefined;
|
|
24
|
+
/** Ambient-occlusion texture map. */
|
|
25
|
+
readonly aoMapUrl?: string | null | undefined;
|
|
26
|
+
/** Strength of the ambient-occlusion map. */
|
|
27
|
+
readonly aoMapIntensity?: number | undefined;
|
|
28
|
+
/** Bump texture map. */
|
|
29
|
+
readonly bumpMapUrl?: string | null | undefined;
|
|
30
|
+
/** Strength of the bump-map effect. */
|
|
31
|
+
readonly bumpScale?: number | undefined;
|
|
32
|
+
/** Metalness texture map. */
|
|
33
|
+
readonly metalnessMapUrl?: string | null | undefined;
|
|
34
|
+
/** Emissive color as a six-digit hex color. */
|
|
35
|
+
readonly emissive?: string | undefined;
|
|
36
|
+
/** Strength of the emissive color. */
|
|
37
|
+
readonly emissiveIntensity?: number | undefined;
|
|
38
|
+
/** Alpha texture map. */
|
|
39
|
+
readonly alphaMapUrl?: string | null | undefined;
|
|
40
|
+
/** Whether the material uses Blender's transparent blend mode. */
|
|
41
|
+
readonly transparent?: boolean | undefined;
|
|
42
|
+
/** Material opacity from zero to one. */
|
|
43
|
+
readonly opacity?: number | undefined;
|
|
44
|
+
/** Clearcoat layer strength. */
|
|
45
|
+
readonly clearcoat?: number | undefined;
|
|
46
|
+
/** Clearcoat layer roughness. */
|
|
47
|
+
readonly clearcoatRoughness?: number | undefined;
|
|
48
|
+
/** Sheen layer strength. */
|
|
49
|
+
readonly sheen?: number | undefined;
|
|
50
|
+
/** Sheen layer roughness. */
|
|
51
|
+
readonly sheenRoughness?: number | undefined;
|
|
52
|
+
/** Sheen color as a six-digit hex color. */
|
|
53
|
+
readonly sheenColor?: string | undefined;
|
|
54
|
+
/** Specular reflection intensity. */
|
|
55
|
+
readonly specularIntensity?: number | undefined;
|
|
56
|
+
/** Specular reflection color as a six-digit hex color. */
|
|
57
|
+
readonly specularColor?: string | undefined;
|
|
58
|
+
/** Index of refraction. */
|
|
59
|
+
readonly ior?: number | undefined;
|
|
60
|
+
/** Transmission strength. */
|
|
61
|
+
readonly transmission?: number | undefined;
|
|
62
|
+
/** Anisotropic reflection strength. */
|
|
63
|
+
readonly anisotropyStrength?: number | undefined;
|
|
64
|
+
/** Anisotropic reflection rotation, in radians. */
|
|
65
|
+
readonly anisotropyRotation?: number | undefined;
|
|
66
|
+
/** Anisotropy texture map. */
|
|
67
|
+
readonly anisotropyMapUrl?: string | null | undefined;
|
|
68
|
+
/** Clearcoat texture map. */
|
|
69
|
+
readonly clearcoatMapUrl?: string | null | undefined;
|
|
70
|
+
/** Clearcoat roughness texture map. */
|
|
71
|
+
readonly clearcoatRoughnessMapUrl?: string | null | undefined;
|
|
72
|
+
/** Clearcoat normal texture map. */
|
|
73
|
+
readonly clearcoatNormalMapUrl?: string | null | undefined;
|
|
74
|
+
/** Strength of the clearcoat normal-map effect. */
|
|
75
|
+
readonly clearcoatNormalScale?: number | undefined;
|
|
76
|
+
/** Sheen color texture map. */
|
|
77
|
+
readonly sheenColorMapUrl?: string | null | undefined;
|
|
78
|
+
/** Sheen roughness texture map. */
|
|
79
|
+
readonly sheenRoughnessMapUrl?: string | null | undefined;
|
|
80
|
+
/** Specular intensity texture map. */
|
|
81
|
+
readonly specularIntensityMapUrl?: string | null | undefined;
|
|
82
|
+
/** Specular color texture map. */
|
|
83
|
+
readonly specularColorMapUrl?: string | null | undefined;
|
|
84
|
+
/** Transmission texture map. */
|
|
85
|
+
readonly transmissionMapUrl?: string | null | undefined;
|
|
86
|
+
/** Displacement texture map. */
|
|
87
|
+
readonly displacementMapUrl?: string | null | undefined;
|
|
88
|
+
/** Strength of geometry displacement. */
|
|
89
|
+
readonly displacementScale?: number | undefined;
|
|
90
|
+
/** Horizontal texture repeat factor. */
|
|
91
|
+
readonly repeatX?: number | undefined;
|
|
92
|
+
/** Vertical texture repeat factor. */
|
|
93
|
+
readonly repeatY?: number | undefined;
|
|
94
|
+
}
|
|
95
|
+
export interface DefaultRenderedEntity {
|
|
96
|
+
readonly id: string;
|
|
97
|
+
readonly type: 'default';
|
|
98
|
+
readonly objectName: string;
|
|
99
|
+
readonly position: [number, number, number];
|
|
100
|
+
readonly rotation?: [number, number, number, number];
|
|
101
|
+
/** Scale multiplied with the Blender template object's authored scale. */
|
|
102
|
+
readonly scale?: [number, number, number];
|
|
103
|
+
readonly materialOverrides?: Record<string, BlenderMaterialOverride>;
|
|
104
|
+
readonly morphTargetInfluences?: Record<string, number>;
|
|
105
|
+
}
|
|
106
|
+
export declare const BlenderMaterialOverrideSchema: z.ZodObject<{
|
|
107
|
+
baseMaterialName: z.ZodString;
|
|
108
|
+
color: z.ZodOptional<z.ZodString>;
|
|
109
|
+
roughness: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
metalness: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
textureUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
roughnessMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
|
+
normalMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
normalScale: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
aoMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
aoMapIntensity: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
bumpMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
|
+
bumpScale: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
metalnessMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
120
|
+
emissive: z.ZodOptional<z.ZodString>;
|
|
121
|
+
emissiveIntensity: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
alphaMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
transparent: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
clearcoat: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
clearcoatRoughness: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
sheen: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
sheenRoughness: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
sheenColor: z.ZodOptional<z.ZodString>;
|
|
130
|
+
specularIntensity: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
specularColor: z.ZodOptional<z.ZodString>;
|
|
132
|
+
ior: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
transmission: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
anisotropyStrength: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
anisotropyRotation: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
anisotropyMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
137
|
+
clearcoatMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
138
|
+
clearcoatRoughnessMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
clearcoatNormalMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
140
|
+
clearcoatNormalScale: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
sheenColorMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
142
|
+
sheenRoughnessMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
143
|
+
specularIntensityMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
specularColorMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
+
transmissionMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
146
|
+
displacementMapUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
|
+
displacementScale: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
repeatX: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
repeatY: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
|
151
|
+
baseMaterialName: string;
|
|
152
|
+
color?: string | undefined;
|
|
153
|
+
roughness?: number | undefined;
|
|
154
|
+
metalness?: number | undefined;
|
|
155
|
+
textureUrl?: string | null | undefined;
|
|
156
|
+
roughnessMapUrl?: string | null | undefined;
|
|
157
|
+
normalMapUrl?: string | null | undefined;
|
|
158
|
+
normalScale?: number | undefined;
|
|
159
|
+
aoMapUrl?: string | null | undefined;
|
|
160
|
+
aoMapIntensity?: number | undefined;
|
|
161
|
+
bumpMapUrl?: string | null | undefined;
|
|
162
|
+
bumpScale?: number | undefined;
|
|
163
|
+
metalnessMapUrl?: string | null | undefined;
|
|
164
|
+
emissive?: string | undefined;
|
|
165
|
+
emissiveIntensity?: number | undefined;
|
|
166
|
+
alphaMapUrl?: string | null | undefined;
|
|
167
|
+
transparent?: boolean | undefined;
|
|
168
|
+
opacity?: number | undefined;
|
|
169
|
+
clearcoat?: number | undefined;
|
|
170
|
+
clearcoatRoughness?: number | undefined;
|
|
171
|
+
sheen?: number | undefined;
|
|
172
|
+
sheenRoughness?: number | undefined;
|
|
173
|
+
sheenColor?: string | undefined;
|
|
174
|
+
specularIntensity?: number | undefined;
|
|
175
|
+
specularColor?: string | undefined;
|
|
176
|
+
ior?: number | undefined;
|
|
177
|
+
transmission?: number | undefined;
|
|
178
|
+
anisotropyStrength?: number | undefined;
|
|
179
|
+
anisotropyRotation?: number | undefined;
|
|
180
|
+
anisotropyMapUrl?: string | null | undefined;
|
|
181
|
+
clearcoatMapUrl?: string | null | undefined;
|
|
182
|
+
clearcoatRoughnessMapUrl?: string | null | undefined;
|
|
183
|
+
clearcoatNormalMapUrl?: string | null | undefined;
|
|
184
|
+
clearcoatNormalScale?: number | undefined;
|
|
185
|
+
sheenColorMapUrl?: string | null | undefined;
|
|
186
|
+
sheenRoughnessMapUrl?: string | null | undefined;
|
|
187
|
+
specularIntensityMapUrl?: string | null | undefined;
|
|
188
|
+
specularColorMapUrl?: string | null | undefined;
|
|
189
|
+
transmissionMapUrl?: string | null | undefined;
|
|
190
|
+
displacementMapUrl?: string | null | undefined;
|
|
191
|
+
displacementScale?: number | undefined;
|
|
192
|
+
repeatX?: number | undefined;
|
|
193
|
+
repeatY?: number | undefined;
|
|
194
|
+
}, {
|
|
195
|
+
baseMaterialName: string;
|
|
196
|
+
color?: string | undefined;
|
|
197
|
+
roughness?: number | undefined;
|
|
198
|
+
metalness?: number | undefined;
|
|
199
|
+
textureUrl?: string | null | undefined;
|
|
200
|
+
roughnessMapUrl?: string | null | undefined;
|
|
201
|
+
normalMapUrl?: string | null | undefined;
|
|
202
|
+
normalScale?: number | undefined;
|
|
203
|
+
aoMapUrl?: string | null | undefined;
|
|
204
|
+
aoMapIntensity?: number | undefined;
|
|
205
|
+
bumpMapUrl?: string | null | undefined;
|
|
206
|
+
bumpScale?: number | undefined;
|
|
207
|
+
metalnessMapUrl?: string | null | undefined;
|
|
208
|
+
emissive?: string | undefined;
|
|
209
|
+
emissiveIntensity?: number | undefined;
|
|
210
|
+
alphaMapUrl?: string | null | undefined;
|
|
211
|
+
transparent?: boolean | undefined;
|
|
212
|
+
opacity?: number | undefined;
|
|
213
|
+
clearcoat?: number | undefined;
|
|
214
|
+
clearcoatRoughness?: number | undefined;
|
|
215
|
+
sheen?: number | undefined;
|
|
216
|
+
sheenRoughness?: number | undefined;
|
|
217
|
+
sheenColor?: string | undefined;
|
|
218
|
+
specularIntensity?: number | undefined;
|
|
219
|
+
specularColor?: string | undefined;
|
|
220
|
+
ior?: number | undefined;
|
|
221
|
+
transmission?: number | undefined;
|
|
222
|
+
anisotropyStrength?: number | undefined;
|
|
223
|
+
anisotropyRotation?: number | undefined;
|
|
224
|
+
anisotropyMapUrl?: string | null | undefined;
|
|
225
|
+
clearcoatMapUrl?: string | null | undefined;
|
|
226
|
+
clearcoatRoughnessMapUrl?: string | null | undefined;
|
|
227
|
+
clearcoatNormalMapUrl?: string | null | undefined;
|
|
228
|
+
clearcoatNormalScale?: number | undefined;
|
|
229
|
+
sheenColorMapUrl?: string | null | undefined;
|
|
230
|
+
sheenRoughnessMapUrl?: string | null | undefined;
|
|
231
|
+
specularIntensityMapUrl?: string | null | undefined;
|
|
232
|
+
specularColorMapUrl?: string | null | undefined;
|
|
233
|
+
transmissionMapUrl?: string | null | undefined;
|
|
234
|
+
displacementMapUrl?: string | null | undefined;
|
|
235
|
+
displacementScale?: number | undefined;
|
|
236
|
+
repeatX?: number | undefined;
|
|
237
|
+
repeatY?: number | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
export declare const DefaultRenderedEntity: z.ZodType<DefaultRenderedEntity>;
|
|
240
|
+
/**
|
|
241
|
+
* Custom entity to be rendered that is not supported by the rendering script out of the box and needs to be handled by a custom rendering script
|
|
242
|
+
*/
|
|
243
|
+
export interface CustomRenderedEntity {
|
|
244
|
+
readonly id: string;
|
|
245
|
+
readonly type: 'custom';
|
|
246
|
+
readonly objectName: string;
|
|
247
|
+
readonly [key: string]: unknown;
|
|
248
|
+
}
|
|
249
|
+
export declare const CustomRenderedEntity: z.ZodType<CustomRenderedEntity>;
|
|
250
|
+
export type RenderedEntity = DefaultRenderedEntity | CustomRenderedEntity;
|
|
251
|
+
export declare const RenderedEntity: z.ZodType<RenderedEntity>;
|
|
252
|
+
/** Depth-of-field settings for a Blender render camera. */
|
|
253
|
+
export interface BlenderCameraDof {
|
|
254
|
+
/** Whether depth of field is enabled. */
|
|
255
|
+
readonly enabled: boolean;
|
|
256
|
+
/** Aperture size in f-stops. */
|
|
257
|
+
readonly apertureFstop?: number;
|
|
258
|
+
/** Focus distance in Blender units. */
|
|
259
|
+
readonly focusDistance?: number;
|
|
260
|
+
}
|
|
261
|
+
/** Blender scene and render-engine settings applied by the render worker. */
|
|
262
|
+
export interface BlenderRenderSettings {
|
|
263
|
+
/** View-transform exposure. */
|
|
264
|
+
readonly exposure?: number;
|
|
265
|
+
/** Blender color-management view transform. */
|
|
266
|
+
readonly viewTransform?: 'AgX' | 'Filmic' | 'Standard' | 'Raw';
|
|
267
|
+
/** Blender look preset for the selected view transform. */
|
|
268
|
+
readonly look?: string;
|
|
269
|
+
/** Display/view gamma. */
|
|
270
|
+
readonly gamma?: number;
|
|
271
|
+
/** Private deployment asset path to the HDRI image. */
|
|
272
|
+
readonly hdriFile?: string;
|
|
273
|
+
/** Strength of the world background shader. */
|
|
274
|
+
readonly hdriStrength?: number;
|
|
275
|
+
/** HDRI rotation around the Z axis, in radians. */
|
|
276
|
+
readonly hdriRotation?: number;
|
|
277
|
+
/** Whether the rendered film has a transparent background. */
|
|
278
|
+
readonly filmTransparent?: boolean;
|
|
279
|
+
/** Render samples for Cycles or EEVEE. */
|
|
280
|
+
readonly samples?: number;
|
|
281
|
+
/** Whether Cycles denoising is enabled. */
|
|
282
|
+
readonly useDenoising?: boolean;
|
|
283
|
+
/** Cycles denoiser engine. */
|
|
284
|
+
readonly denoiser?: 'OPENIMAGEDENOISE' | 'OPTIX';
|
|
285
|
+
/** Maximum number of Cycles light-path bounces. */
|
|
286
|
+
readonly maxBounces?: number;
|
|
287
|
+
/** Maximum number of Cycles diffuse bounces. */
|
|
288
|
+
readonly diffuseBounces?: number;
|
|
289
|
+
/** Maximum number of Cycles glossy bounces. */
|
|
290
|
+
readonly glossyBounces?: number;
|
|
291
|
+
/** Whether a glare/fog-glow compositor pass is enabled. */
|
|
292
|
+
readonly glareEnabled?: boolean;
|
|
293
|
+
/** Brightness threshold for the glare effect. */
|
|
294
|
+
readonly glareThreshold?: number;
|
|
295
|
+
/** Mix intensity of the glare effect. */
|
|
296
|
+
readonly glareIntensity?: number;
|
|
297
|
+
/** Lens-distortion amount. */
|
|
298
|
+
readonly lensDistortion?: number;
|
|
299
|
+
/** Chromatic-aberration amount. */
|
|
300
|
+
readonly chromaticAberration?: number;
|
|
301
|
+
/** Vignette strength; values above zero enable the effect. */
|
|
302
|
+
readonly vignette?: number;
|
|
303
|
+
/** Film-grain strength; values above zero enable the effect. */
|
|
304
|
+
readonly filmGrain?: number;
|
|
305
|
+
/** Density of the world volume-scatter effect. */
|
|
306
|
+
readonly volumeScatterDensity?: number;
|
|
307
|
+
/** Anisotropy of the world volume-scatter effect, used when density is set. */
|
|
308
|
+
readonly volumeScatterAnisotropy?: number;
|
|
309
|
+
}
|
|
310
|
+
/** Light created in Blender for a rendered scene. */
|
|
311
|
+
export interface BlenderLight {
|
|
312
|
+
/** Unique name for the Blender light and its scene object. */
|
|
313
|
+
readonly id: string;
|
|
314
|
+
/** Blender light type. */
|
|
315
|
+
readonly type: 'POINT' | 'SPOT' | 'SUN' | 'AREA';
|
|
316
|
+
/** Light position in Blender coordinates. */
|
|
317
|
+
readonly position: [number, number, number];
|
|
318
|
+
/** Six-digit hex light color. */
|
|
319
|
+
readonly color?: string;
|
|
320
|
+
/** Light energy in Blender. */
|
|
321
|
+
readonly intensity?: number;
|
|
322
|
+
/** Whether the light casts shadows. */
|
|
323
|
+
readonly castShadow?: boolean;
|
|
324
|
+
/** Physical radius of a point or spot light, controlling shadow softness. */
|
|
325
|
+
readonly radius?: number;
|
|
326
|
+
/** Half-angle of a spotlight cone, in radians. */
|
|
327
|
+
readonly angle?: number;
|
|
328
|
+
/** Spotlight edge softness from zero to one. */
|
|
329
|
+
readonly penumbra?: number;
|
|
330
|
+
/** Point in Blender coordinates that a spot, sun, or area light faces. */
|
|
331
|
+
readonly target?: [number, number, number];
|
|
332
|
+
/** Blender rotation quaternion in `(w, x, y, z)` order. */
|
|
333
|
+
readonly rotation?: [number, number, number, number];
|
|
334
|
+
/** Whether Blender displays the spotlight cone in the viewport. */
|
|
335
|
+
readonly showCone?: boolean;
|
|
336
|
+
/** Whether a spotlight uses a square rather than circular cone. */
|
|
337
|
+
readonly useSquare?: boolean;
|
|
338
|
+
/** Angular diameter of a sun light in radians, controlling shadow softness. */
|
|
339
|
+
readonly blenderAngle?: number;
|
|
340
|
+
/** Area-light width in millimeters. */
|
|
341
|
+
readonly width?: number;
|
|
342
|
+
/** Area-light height in millimeters. */
|
|
343
|
+
readonly height?: number;
|
|
344
|
+
/** Shape of the area-light emitter. */
|
|
345
|
+
readonly shape?: 'SQUARE' | 'RECTANGLE' | 'DISK' | 'ELLIPSE';
|
|
346
|
+
/** Angular spread of an area light, in radians. */
|
|
347
|
+
readonly spread?: number;
|
|
348
|
+
/** Specular reflection contribution. */
|
|
349
|
+
readonly specularFactor?: number;
|
|
350
|
+
/** Diffuse lighting contribution. */
|
|
351
|
+
readonly diffuseFactor?: number;
|
|
352
|
+
/** Volumetric-scatter contribution. */
|
|
353
|
+
readonly volumeFactor?: number;
|
|
354
|
+
}
|
|
355
|
+
export interface GenerateImagesTask {
|
|
356
|
+
readonly type: typeof TaskType.GenerateImages;
|
|
357
|
+
readonly deploymentId: string;
|
|
358
|
+
/**
|
|
359
|
+
* The name of the blender setup template file that will be used to render the images.
|
|
360
|
+
* It assumes that the template is uploaded to the private deployment assets
|
|
361
|
+
*/
|
|
362
|
+
readonly blenderSetupTemplate: string;
|
|
363
|
+
/**
|
|
364
|
+
* The name of the python script that will be used to render the images, if not provided the default script will be used.
|
|
365
|
+
* It assumes that the script is uploaded to the private deployment assets
|
|
366
|
+
*/
|
|
367
|
+
readonly blenderPythonScriptName?: string;
|
|
368
|
+
/**
|
|
369
|
+
* The template files that will be used to render the images. It assumes that the files are uploaded to the private deployment assets.
|
|
370
|
+
*/
|
|
371
|
+
readonly templateFiles: readonly string[];
|
|
372
|
+
/** Render settings used as defaults for every image in this task. */
|
|
373
|
+
readonly renderSettings?: BlenderRenderSettings;
|
|
374
|
+
readonly images: ReadonlyArray<{
|
|
375
|
+
readonly name: string;
|
|
376
|
+
readonly fileFormat: 'PNG' | 'JPEG';
|
|
377
|
+
readonly width: number;
|
|
378
|
+
readonly height: number;
|
|
379
|
+
readonly renderedEntities: readonly RenderedEntity[];
|
|
380
|
+
/** Lights created for this image. */
|
|
381
|
+
readonly lights?: readonly BlenderLight[];
|
|
382
|
+
/** Render settings merged over the task-level defaults for this image. */
|
|
383
|
+
readonly renderSettings?: BlenderRenderSettings;
|
|
384
|
+
/**
|
|
385
|
+
* When omitted, the Blender setup template’s active camera (and any cameras in the file) are kept:
|
|
386
|
+
* the worker does not delete cameras or spawn a look-at camera.
|
|
387
|
+
*/
|
|
388
|
+
readonly camera?: {
|
|
389
|
+
readonly position: [number, number, number];
|
|
390
|
+
readonly target: [number, number, number];
|
|
391
|
+
/** Vertical field of view in degrees. */
|
|
392
|
+
readonly fov?: number;
|
|
393
|
+
/** Camera depth-of-field settings. */
|
|
394
|
+
readonly dof?: BlenderCameraDof;
|
|
395
|
+
/** Camera sensor width in millimeters. */
|
|
396
|
+
readonly sensorWidth?: number;
|
|
397
|
+
/** Near clipping distance in Blender units. */
|
|
398
|
+
readonly clipStart?: number;
|
|
399
|
+
/** Far clipping distance in Blender units. */
|
|
400
|
+
readonly clipEnd?: number;
|
|
401
|
+
};
|
|
402
|
+
}>;
|
|
403
|
+
}
|
|
404
|
+
export declare const GenerateImagesTask: z.ZodType<GenerateImagesTask>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as n}from"zod";import{TaskType as o}from"../core/index.js";export const BlenderMaterialOverrideSchema=n.object({baseMaterialName:n.string(),color:n.string().optional(),roughness:n.number().optional(),metalness:n.number().optional(),textureUrl:n.string().nullable().optional(),roughnessMapUrl:n.string().nullable().optional(),normalMapUrl:n.string().nullable().optional(),normalScale:n.number().optional(),aoMapUrl:n.string().nullable().optional(),aoMapIntensity:n.number().optional(),bumpMapUrl:n.string().nullable().optional(),bumpScale:n.number().optional(),metalnessMapUrl:n.string().nullable().optional(),emissive:n.string().optional(),emissiveIntensity:n.number().optional(),alphaMapUrl:n.string().nullable().optional(),transparent:n.boolean().optional(),opacity:n.number().optional(),clearcoat:n.number().optional(),clearcoatRoughness:n.number().optional(),sheen:n.number().optional(),sheenRoughness:n.number().optional(),sheenColor:n.string().optional(),specularIntensity:n.number().optional(),specularColor:n.string().optional(),ior:n.number().optional(),transmission:n.number().optional(),anisotropyStrength:n.number().optional(),anisotropyRotation:n.number().optional(),anisotropyMapUrl:n.string().nullable().optional(),clearcoatMapUrl:n.string().nullable().optional(),clearcoatRoughnessMapUrl:n.string().nullable().optional(),clearcoatNormalMapUrl:n.string().nullable().optional(),clearcoatNormalScale:n.number().optional(),sheenColorMapUrl:n.string().nullable().optional(),sheenRoughnessMapUrl:n.string().nullable().optional(),specularIntensityMapUrl:n.string().nullable().optional(),specularColorMapUrl:n.string().nullable().optional(),transmissionMapUrl:n.string().nullable().optional(),displacementMapUrl:n.string().nullable().optional(),displacementScale:n.number().optional(),repeatX:n.number().optional(),repeatY:n.number().optional()});export const DefaultRenderedEntity=n.object({id:n.string(),type:n.literal("default"),objectName:n.string(),position:n.tuple([n.number(),n.number(),n.number()]),rotation:n.tuple([n.number(),n.number(),n.number(),n.number()]).optional(),scale:n.tuple([n.number(),n.number(),n.number()]).optional(),materialOverrides:n.record(BlenderMaterialOverrideSchema).optional(),morphTargetInfluences:n.record(n.number()).optional()});export const CustomRenderedEntity=n.object({id:n.string(),objectName:n.string(),type:n.literal("custom")}).and(n.record(n.unknown()));export const RenderedEntity=n.union([DefaultRenderedEntity,CustomRenderedEntity]);let e=n.object({enabled:n.boolean(),apertureFstop:n.number().optional(),focusDistance:n.number().optional()}),t=n.object({exposure:n.number().optional(),viewTransform:n.enum(["AgX","Filmic","Standard","Raw"]).optional(),look:n.string().optional(),gamma:n.number().optional(),hdriFile:n.string().optional(),hdriStrength:n.number().optional(),hdriRotation:n.number().optional(),filmTransparent:n.boolean().optional(),samples:n.number().optional(),useDenoising:n.boolean().optional(),denoiser:n.enum(["OPENIMAGEDENOISE","OPTIX"]).optional(),maxBounces:n.number().optional(),diffuseBounces:n.number().optional(),glossyBounces:n.number().optional(),glareEnabled:n.boolean().optional(),glareThreshold:n.number().optional(),glareIntensity:n.number().optional(),lensDistortion:n.number().optional(),chromaticAberration:n.number().optional(),vignette:n.number().optional(),filmGrain:n.number().optional(),volumeScatterDensity:n.number().optional(),volumeScatterAnisotropy:n.number().optional()}),r=n.object({id:n.string(),type:n.enum(["POINT","SPOT","SUN","AREA"]),position:n.tuple([n.number(),n.number(),n.number()]),color:n.string().optional(),intensity:n.number().optional(),castShadow:n.boolean().optional(),radius:n.number().optional(),angle:n.number().optional(),penumbra:n.number().optional(),target:n.tuple([n.number(),n.number(),n.number()]).optional(),rotation:n.tuple([n.number(),n.number(),n.number(),n.number()]).optional(),showCone:n.boolean().optional(),useSquare:n.boolean().optional(),blenderAngle:n.number().optional(),width:n.number().optional(),height:n.number().optional(),shape:n.enum(["SQUARE","RECTANGLE","DISK","ELLIPSE"]).optional(),spread:n.number().optional(),specularFactor:n.number().optional(),diffuseFactor:n.number().optional(),volumeFactor:n.number().optional()});export const GenerateImagesTask=n.object({type:n.literal(o.GenerateImages),deploymentId:n.string(),blenderSetupTemplate:n.string(),blenderPythonScriptName:n.string().optional(),templateFiles:n.array(n.string()),renderSettings:t.optional(),images:n.array(n.object({name:n.string(),fileFormat:n.literal("PNG").or(n.literal("JPEG")),width:n.number(),height:n.number(),renderedEntities:n.array(RenderedEntity),lights:n.array(r).optional(),renderSettings:t.optional(),camera:n.object({position:n.tuple([n.number(),n.number(),n.number()]),target:n.tuple([n.number(),n.number(),n.number()]),fov:n.number().optional(),dof:e.optional(),sensorWidth:n.number().optional(),clipStart:n.number().optional(),clipEnd:n.number().optional()}).optional()}))});
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type FinalizeTaskResource, StoredTemplate, TaskType, Template, TemplateResource } from '../core/index.js';
|
|
3
|
+
export declare const PdfUnitValueSchema: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
4
|
+
/**
|
|
5
|
+
* A PDF unit value accepted by PdfShift. Numbers are interpreted as pixels.
|
|
6
|
+
*/
|
|
7
|
+
export type PdfUnitValue = z.infer<typeof PdfUnitValueSchema>;
|
|
8
|
+
export interface GeneratePdfTask {
|
|
9
|
+
type: typeof TaskType.GeneratePdf;
|
|
10
|
+
/**
|
|
11
|
+
* The name of the pdf file
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
html: StoredTemplate | Template;
|
|
15
|
+
/**
|
|
16
|
+
* You can define margin for the document (space between the limits of the document and the beginning of the content).
|
|
17
|
+
* Use strings to specify the units, e.g. "10cm" or "10in". Numbers are interpreted as pixels.
|
|
18
|
+
*/
|
|
19
|
+
margin: {
|
|
20
|
+
top: PdfUnitValue;
|
|
21
|
+
right: PdfUnitValue;
|
|
22
|
+
bottom: PdfUnitValue;
|
|
23
|
+
left: PdfUnitValue;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Format of the document. You can either use the standard values (Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5)
|
|
27
|
+
* or a custom {width}x{height} value. For {width} and {height}, you can indicate the following units: in, cm, mm.
|
|
28
|
+
*/
|
|
29
|
+
format?: string;
|
|
30
|
+
/**
|
|
31
|
+
* You can configure the aspect of your header document using the following values.
|
|
32
|
+
*/
|
|
33
|
+
header: {
|
|
34
|
+
/**
|
|
35
|
+
* Element to add in the header part of the document. You can use variables... Don't forget to escape these in template so they are not interpreted as Handlebars variables, eg. \{{page}}
|
|
36
|
+
* {{date}} Formatted print date
|
|
37
|
+
* {{title}} Title of the HTML document
|
|
38
|
+
* {{url}} Page URL
|
|
39
|
+
* {{page}} Current page
|
|
40
|
+
* {{total}} Total number of pages
|
|
41
|
+
*/
|
|
42
|
+
html: StoredTemplate | Template;
|
|
43
|
+
/**
|
|
44
|
+
* A spacing between the footer and the content.
|
|
45
|
+
* Use strings to specify the units, e.g. "10cm" or "10in". Numbers are interpreted as pixels.
|
|
46
|
+
*/
|
|
47
|
+
height: PdfUnitValue;
|
|
48
|
+
/**
|
|
49
|
+
* Start to display the header/footer at that given page. Important: If you send header AND footer, and set a start_at higher than 1, it must be the same for header and footer.
|
|
50
|
+
*/
|
|
51
|
+
startAt: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* You can configure the aspect of your footer document using the following values.
|
|
55
|
+
*/
|
|
56
|
+
footer: {
|
|
57
|
+
/**
|
|
58
|
+
* Element to add in the footer part of the document. You can use variables... Don't forget to escape these in template so they are not interpreted as Handlebars variables, eg. \{{page}}
|
|
59
|
+
* {{date}} Formatted print date
|
|
60
|
+
* {{title}} Title of the HTML document
|
|
61
|
+
* {{url}} Page URL
|
|
62
|
+
* {{page}} Current page
|
|
63
|
+
* {{total}} Total number of pages
|
|
64
|
+
*/
|
|
65
|
+
html: StoredTemplate | Template;
|
|
66
|
+
/**
|
|
67
|
+
* A spacing between the footer and the content.
|
|
68
|
+
* Use strings to specify the units, e.g. "10cm" or "10in". Numbers are interpreted as pixels.
|
|
69
|
+
*/
|
|
70
|
+
height: PdfUnitValue;
|
|
71
|
+
/**
|
|
72
|
+
* Start to display the header/footer at that given page. Important: If you send header AND footer, and set a start_at higher than 1, it must be the same for header and footer.
|
|
73
|
+
*/
|
|
74
|
+
startAt: number;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export declare const GeneratePdfTask: z.ZodType<GeneratePdfTask>;
|
|
78
|
+
export declare const validateGeneratePdfTask: (task: GeneratePdfTask, resources: FinalizeTaskResource[]) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Text watermark stamped onto every page. Maps to PdfShift's text-mode `watermark` payload.
|
|
81
|
+
* All styling fields are optional; PdfShift applies its own defaults when omitted.
|
|
82
|
+
*/
|
|
83
|
+
export interface PdfTextWatermark {
|
|
84
|
+
kind: 'text';
|
|
85
|
+
/** Watermark text. */
|
|
86
|
+
text: string;
|
|
87
|
+
/** Font size in pixels. */
|
|
88
|
+
fontSize?: number;
|
|
89
|
+
/** Font family, e.g. `Helvetica`. */
|
|
90
|
+
fontFamily?: string;
|
|
91
|
+
/** Text color as a bare hex string without the leading `#`, e.g. `ff0000`. */
|
|
92
|
+
color?: string;
|
|
93
|
+
/** Opacity as a percentage, 0–100. */
|
|
94
|
+
opacity?: number;
|
|
95
|
+
bold?: boolean;
|
|
96
|
+
italic?: boolean;
|
|
97
|
+
/** Horizontal placement — `left`/`center`/`right` or a numeric value with a unit (`px`, `cm`, `mm`, `in`, `pt`). */
|
|
98
|
+
offsetX?: string;
|
|
99
|
+
/** Vertical placement — `top`/`middle`/`bottom` or a numeric value with a unit (`px`, `cm`, `mm`, `in`, `pt`). */
|
|
100
|
+
offsetY?: string;
|
|
101
|
+
/** Rotation in degrees. */
|
|
102
|
+
rotate?: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Image watermark stamped onto every page. Maps to PdfShift's image-mode `watermark` payload.
|
|
106
|
+
* PdfShift supports only positioning/rotation for images — no opacity or styling.
|
|
107
|
+
*/
|
|
108
|
+
export interface PdfImageWatermark {
|
|
109
|
+
kind: 'image';
|
|
110
|
+
/**
|
|
111
|
+
* Image source. May be a public URL, a base64 data URI, or a `configuration-resource://<name>` placeholder
|
|
112
|
+
* (interpolated to a signed URL before rendering — the referenced resource must be in `includeResources`).
|
|
113
|
+
*/
|
|
114
|
+
image: string;
|
|
115
|
+
/** Horizontal placement — `left`/`center`/`right` or a numeric value with a unit (`px`, `cm`, `mm`, `in`, `pt`). */
|
|
116
|
+
offsetX?: string;
|
|
117
|
+
/** Vertical placement — `top`/`middle`/`bottom` or a numeric value with a unit (`px`, `cm`, `mm`, `in`, `pt`). */
|
|
118
|
+
offsetY?: string;
|
|
119
|
+
/** Rotation in degrees. */
|
|
120
|
+
rotate?: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A single watermark applied to all pages. PdfShift permits exactly one watermark per document — either text or image.
|
|
124
|
+
*/
|
|
125
|
+
export type PdfWatermark = PdfTextWatermark | PdfImageWatermark;
|
|
126
|
+
export interface GenerateStaticPdfTask {
|
|
127
|
+
type: typeof TaskType.GenerateStaticPdf;
|
|
128
|
+
/**
|
|
129
|
+
* The name of the pdf file
|
|
130
|
+
*/
|
|
131
|
+
name: string;
|
|
132
|
+
/**
|
|
133
|
+
* Body HTML for the PDF.
|
|
134
|
+
*
|
|
135
|
+
* `configuration-resource://<name>` occurrences are replaced with the resource value before rendering.
|
|
136
|
+
* The referenced resource must be listed in `includeResources`.
|
|
137
|
+
*
|
|
138
|
+
* PdfShift template macros (`{{page}}`, `{{total}}`, `{{date}}`, `{{title}}`, `{{url}}`) pass through unchanged
|
|
139
|
+
* and are resolved by PdfShift at render time.
|
|
140
|
+
*/
|
|
141
|
+
html: string;
|
|
142
|
+
/**
|
|
143
|
+
* Format of the document. You can either use the standard values (Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5)
|
|
144
|
+
* or a custom {width}x{height} value. For {width} and {height}, you can indicate the following units: in, cm, mm.
|
|
145
|
+
*/
|
|
146
|
+
format?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Margin between the document limits and content.
|
|
149
|
+
* Use strings to specify the units, e.g. "10cm" or "10in". Numbers are interpreted as pixels.
|
|
150
|
+
*/
|
|
151
|
+
margin: {
|
|
152
|
+
top: PdfUnitValue;
|
|
153
|
+
right: PdfUnitValue;
|
|
154
|
+
bottom: PdfUnitValue;
|
|
155
|
+
left: PdfUnitValue;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Header HTML, height and start page. Use the same `configuration-resource://` placeholder convention as `html`.
|
|
159
|
+
* Use `height: 0` to omit the header.
|
|
160
|
+
* Use strings to specify the units, e.g. "10cm" or "10in". Numbers are interpreted as pixels.
|
|
161
|
+
*/
|
|
162
|
+
header: {
|
|
163
|
+
html: string;
|
|
164
|
+
height: PdfUnitValue;
|
|
165
|
+
startAt: number;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Footer HTML, height and start page. Use the same `configuration-resource://` placeholder convention as `html`.
|
|
169
|
+
* Use `height: 0` to omit the footer.
|
|
170
|
+
* Use strings to specify the units, e.g. "10cm" or "10in". Numbers are interpreted as pixels.
|
|
171
|
+
*/
|
|
172
|
+
footer: {
|
|
173
|
+
html: string;
|
|
174
|
+
height: PdfUnitValue;
|
|
175
|
+
startAt: number;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Resources referenced by `configuration-resource://<name>` placeholders across body, header and footer.
|
|
179
|
+
*/
|
|
180
|
+
includeResources: readonly TemplateResource[];
|
|
181
|
+
/**
|
|
182
|
+
* Optional watermark applied to every page. An image watermark may reference a resource via the
|
|
183
|
+
* `configuration-resource://<name>` placeholder convention (the resource must be in `includeResources`).
|
|
184
|
+
*/
|
|
185
|
+
watermark?: PdfWatermark;
|
|
186
|
+
}
|
|
187
|
+
export declare const GenerateStaticPdfTask: z.ZodType<GenerateStaticPdfTask>;
|
|
188
|
+
export declare const validateGenerateStaticPdfTask: (task: GenerateStaticPdfTask, resources: FinalizeTaskResource[]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as t}from"zod";import{StoredTemplate as e,TaskType as n,Template as o,TemplateResource as i,validateTemplate as a}from"../core/index.js";export const PdfUnitValueSchema=t.union([t.number(),t.string().regex(/^-?\d+(\.\d+)?(px|cm|mm|in|pt)$/)]);export const GeneratePdfTask=t.object({type:t.literal(n.GeneratePdf),name:t.string(),html:t.union([e,o]),format:t.string().optional(),margin:t.object({top:PdfUnitValueSchema,right:PdfUnitValueSchema,bottom:PdfUnitValueSchema,left:PdfUnitValueSchema}),header:t.object({html:t.union([e,o]),height:PdfUnitValueSchema,startAt:t.number()}),footer:t.object({html:t.union([e,o]),height:PdfUnitValueSchema,startAt:t.number()})});export const validateGeneratePdfTask=(t,e)=>{a(t.html,e),a(t.header.html,e),a(t.footer.html,e)};let r=t.discriminatedUnion("kind",[t.object({kind:t.literal("text"),text:t.string(),fontSize:t.number().optional(),fontFamily:t.string().optional(),color:t.string().optional(),opacity:t.number().optional(),bold:t.boolean().optional(),italic:t.boolean().optional(),offsetX:t.string().optional(),offsetY:t.string().optional(),rotate:t.number().optional()}),t.object({kind:t.literal("image"),image:t.string(),offsetX:t.string().optional(),offsetY:t.string().optional(),rotate:t.number().optional()})]);export const GenerateStaticPdfTask=t.object({type:t.literal(n.GenerateStaticPdf),name:t.string(),html:t.string(),format:t.string().optional(),margin:t.object({top:PdfUnitValueSchema,right:PdfUnitValueSchema,bottom:PdfUnitValueSchema,left:PdfUnitValueSchema}),header:t.object({html:t.string(),height:PdfUnitValueSchema,startAt:t.number()}),footer:t.object({html:t.string(),height:PdfUnitValueSchema,startAt:t.number()}),includeResources:t.array(i),watermark:r.optional()});export const validateGenerateStaticPdfTask=(t,e)=>{t.includeResources.forEach(t=>{if(null==e.find(e=>e.name===t.name))throw Error(`The provided FinalizeTask configuration is invalid! Static PDF includeResources references "${t.name}" which is not declared in the resources. Declare it or remove the reference.`)})};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { GenerateConfigurationLinkTask } from './generate-configuration-link-task.js';
|
|
2
|
+
export { type PdfUnitValue, type PdfWatermark, type PdfTextWatermark, type PdfImageWatermark, PdfUnitValueSchema, GeneratePdfTask, GenerateStaticPdfTask, validateGeneratePdfTask, validateGenerateStaticPdfTask, } from './generate-pdf-task.js';
|
|
3
|
+
export { GenerateCsvTask } from './generate-csv-task.js';
|
|
4
|
+
export { SendEmailTask, SendStaticEmailTask, EmailAttachment, Base64EmailAttachment, ResourceEmailAttachment, validateSendEmailTask, validateSendStaticEmailTask, } from './send-email-task.js';
|
|
5
|
+
export { SendHttpRequestTask } from './send-http-task.js';
|
|
6
|
+
export { WooCommerceAddToCartItem, WooCommerceAddToCartResource, WooCommerceAddToCartTask, WooCommerceAddToCartFee, WooCommerceAddToCartFeeType, } from './woocommerce-add-to-cart-task.js';
|
|
7
|
+
export { PublishRevisionTask, createPublishRevisionTask } from './publish-revision-task.js';
|
|
8
|
+
export { type ChunkDefinition, PublishRevisionChunksTask, createPublishRevisionChunksTask, } from './publish-revision-chunks-task.js';
|
|
9
|
+
export { PublishRevisionChunksStagedData, PublishRevisionChunksStagedTask, createPublishRevisionChunksStagedTask, } from './publish-revision-chunks-staged-task.js';
|
|
10
|
+
export { CallLambdaBackResourceType, CallLambdaBackResource, CallLambdaBackTask, validateCallLambdaBackTask, } from './call-lambda-back-task.js';
|
|
11
|
+
export { type BlenderMaterialOverride, BlenderMaterialOverrideSchema, type BlenderLight, type BlenderRenderSettings, type BlenderCameraDof, GenerateImagesTask, RenderedEntity, CustomRenderedEntity, DefaultRenderedEntity, } from './generate-images-task.js';
|
|
12
|
+
export { EditGoogleSpreadsheetTask, GoogleSpreadsheetEdit, GoogleSpreadsheetCellValue, GoogleSpreadsheetReference, GoogleSpreadsheetEditMode, } from './edit-google-spreadsheet-task.js';
|
|
13
|
+
export { WebhookFinalizeTaskConfiguration, type WebhookFinalizeTask, validateTaskConfiguration, } from './finalize-task.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{GenerateConfigurationLinkTask}from"./generate-configuration-link-task.js";export{PdfUnitValueSchema,GeneratePdfTask,GenerateStaticPdfTask,validateGeneratePdfTask,validateGenerateStaticPdfTask}from"./generate-pdf-task.js";export{GenerateCsvTask}from"./generate-csv-task.js";export{SendEmailTask,SendStaticEmailTask,EmailAttachment,Base64EmailAttachment,ResourceEmailAttachment,validateSendEmailTask,validateSendStaticEmailTask}from"./send-email-task.js";export{SendHttpRequestTask}from"./send-http-task.js";export{WooCommerceAddToCartItem,WooCommerceAddToCartResource,WooCommerceAddToCartTask,WooCommerceAddToCartFee,WooCommerceAddToCartFeeType}from"./woocommerce-add-to-cart-task.js";export{PublishRevisionTask,createPublishRevisionTask}from"./publish-revision-task.js";export{PublishRevisionChunksTask,createPublishRevisionChunksTask}from"./publish-revision-chunks-task.js";export{PublishRevisionChunksStagedData,PublishRevisionChunksStagedTask,createPublishRevisionChunksStagedTask}from"./publish-revision-chunks-staged-task.js";export{CallLambdaBackResourceType,CallLambdaBackResource,CallLambdaBackTask,validateCallLambdaBackTask}from"./call-lambda-back-task.js";export{BlenderMaterialOverrideSchema,GenerateImagesTask,RenderedEntity,CustomRenderedEntity,DefaultRenderedEntity}from"./generate-images-task.js";export{EditGoogleSpreadsheetTask,GoogleSpreadsheetEdit,GoogleSpreadsheetCellValue,GoogleSpreadsheetReference,GoogleSpreadsheetEditMode}from"./edit-google-spreadsheet-task.js";export{WebhookFinalizeTaskConfiguration,validateTaskConfiguration}from"./finalize-task.js";
|