@uniformdev/mesh-edgehancer-sdk 20.31.1-alpha.7 → 20.32.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +417 -133
- package/dist/index.d.ts +417 -133
- package/dist/index.esm.js +174 -71
- package/dist/index.js +178 -71
- package/dist/index.mjs +174 -71
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
@@ -1,3 +1,86 @@
|
|
1
|
+
// ../../lib/ai-sdk/src/InvocationContexts.ts
|
2
|
+
import { z } from "zod";
|
3
|
+
var invocationContextsSchema = z.enum([
|
4
|
+
"composition",
|
5
|
+
"compositionPattern",
|
6
|
+
"componentPattern",
|
7
|
+
"entry",
|
8
|
+
"entryPattern",
|
9
|
+
"general"
|
10
|
+
]);
|
11
|
+
var invocationContextInfoSchema = z.object({
|
12
|
+
context: invocationContextsSchema,
|
13
|
+
id: z.string(),
|
14
|
+
displayName: z.string().optional(),
|
15
|
+
icon: z.string().optional()
|
16
|
+
});
|
17
|
+
var invocationContextAnnotationSchema = z.object({
|
18
|
+
type: z.literal("invocationContext"),
|
19
|
+
value: invocationContextInfoSchema
|
20
|
+
});
|
21
|
+
|
22
|
+
// ../../lib/ai-sdk/src/toolDefinitions/editing/createPropertyEdit.ts
|
23
|
+
import { z as z2 } from "zod";
|
24
|
+
var createPropertyEdit = {
|
25
|
+
displayName: "Create Property Edit",
|
26
|
+
description: "Edits a property on a composition, entry, or pattern with AI. This is a callable tool NOT FOR AGENT USE - agents use applyPropertyEdit to broker client-side application of the edit.",
|
27
|
+
inputSchema: z2.object({
|
28
|
+
edit: z2.string().describe("Describe the edit to be made to the property"),
|
29
|
+
currentValue: z2.unknown().describe("Current value of the property (if any exists)").optional(),
|
30
|
+
projectGuidance: z2.string().describe("Guidance prompt for the project (if any exists)").optional(),
|
31
|
+
componentGuidance: z2.string().describe("Guidance prompt for the parent component").optional(),
|
32
|
+
audienceGuidance: z2.string().describe(
|
33
|
+
"Guidance prompt for the target audience of a personalized variation. Omit for non-variation edits."
|
34
|
+
).optional(),
|
35
|
+
propertyDefinition: z2.object({
|
36
|
+
id: z2.string(),
|
37
|
+
name: z2.string(),
|
38
|
+
type: z2.string(),
|
39
|
+
guidance: z2.string().describe("Guidance prompt from the property definition (if any exists)").optional(),
|
40
|
+
typeConfig: z2.unknown().optional().describe("Type-specific configuration for the property")
|
41
|
+
}),
|
42
|
+
outputLocale: z2.string().optional().describe("The locale to use when writing the edited value"),
|
43
|
+
documentContext: z2.string().describe("Content of the surrounding document the property is part of").optional()
|
44
|
+
}),
|
45
|
+
outputSchema: z2.object({
|
46
|
+
newValue: z2.string().describe(
|
47
|
+
"The new value of the property. When the action is clear or resetOverride, this should be empty."
|
48
|
+
),
|
49
|
+
treatNewValueAsJson: z2.boolean().describe("Whether the newValue is a JSON string"),
|
50
|
+
summary: z2.string().describe(
|
51
|
+
"A completion message to the user that summarizes the action taken. This should be 1 sentence, in English."
|
52
|
+
).optional(),
|
53
|
+
action: z2.enum(["setValue", "clearValue", "resetOverride"]).describe(
|
54
|
+
"setValue = update the value, clearValue = remove the value/set to empty, resetOverride = remove a pattern override and inherit the pattern value. Only use resetOverride if the prompt asks for it."
|
55
|
+
),
|
56
|
+
success: z2.boolean().describe("Whether the edit could be completed successfully")
|
57
|
+
}),
|
58
|
+
runsAt: "server",
|
59
|
+
timeout: 100,
|
60
|
+
callable: true
|
61
|
+
};
|
62
|
+
|
63
|
+
// src/afterAIEdit.ts
|
64
|
+
import { z as z3 } from "zod";
|
65
|
+
var afterAIEditResultSchema = z3.strictObject({
|
66
|
+
newValue: z3.unknown(),
|
67
|
+
success: z3.boolean(),
|
68
|
+
summary: z3.string().optional()
|
69
|
+
});
|
70
|
+
var afterAIEditContextSchema = z3.strictObject({
|
71
|
+
editRequest: createPropertyEdit.inputSchema,
|
72
|
+
invocationContext: invocationContextsSchema,
|
73
|
+
userId: z3.string(),
|
74
|
+
currentLocale: z3.string().optional(),
|
75
|
+
projectId: z3.string(),
|
76
|
+
currentValue: z3.unknown().optional(),
|
77
|
+
newValue: z3.unknown(),
|
78
|
+
result: z3.object({
|
79
|
+
success: z3.boolean(),
|
80
|
+
summary: z3.string().optional()
|
81
|
+
})
|
82
|
+
});
|
83
|
+
|
1
84
|
// src/batchUtils.ts
|
2
85
|
function convertBatchResultsToEdgehancerResult({
|
3
86
|
batch,
|
@@ -57,6 +140,22 @@ var COLLECTION_DEFAULT_LIMIT = 20;
|
|
57
140
|
var COLLECTION_MAX_LIMIT = 50;
|
58
141
|
var COLLECTION_DEFAULT_OFFSET = 0;
|
59
142
|
|
143
|
+
// src/createAIEdit.ts
|
144
|
+
import { z as z4 } from "zod";
|
145
|
+
var createAIEditContextSchema = z4.strictObject({
|
146
|
+
editRequest: createPropertyEdit.inputSchema,
|
147
|
+
invocationContext: invocationContextsSchema,
|
148
|
+
userId: z4.string(),
|
149
|
+
currentLocale: z4.string().optional(),
|
150
|
+
projectId: z4.string()
|
151
|
+
});
|
152
|
+
var createAIEditResultSchema = z4.strictObject({
|
153
|
+
outputJsonSchema: z4.record(z4.string(), z4.any()).describe("JSON schema (draft-07) for the edited content result"),
|
154
|
+
instructions: z4.string().describe(
|
155
|
+
"Instructions for the AI editor LLM to follow (e.g. conventions/rules, allowed values, etc). Just describe your value type, do not give guiding instructions. There is no need to worry about clearing or resetting values, that is automatically handled."
|
156
|
+
)
|
157
|
+
});
|
158
|
+
|
60
159
|
// src/fetchUtils.ts
|
61
160
|
function getDataResourceAsRequest(data) {
|
62
161
|
var _a;
|
@@ -96,78 +195,78 @@ function copyKeyValuePairs(source, target) {
|
|
96
195
|
}
|
97
196
|
|
98
197
|
// src/preRequest.ts
|
99
|
-
import { z as
|
198
|
+
import { z as z6 } from "zod";
|
100
199
|
|
101
200
|
// src/shared.ts
|
102
201
|
import { assert } from "tsafe";
|
103
|
-
import { z } from "zod";
|
104
|
-
var parameterDefinitionSchema =
|
105
|
-
key:
|
106
|
-
value:
|
107
|
-
omitIfEmpty:
|
202
|
+
import { z as z5 } from "zod";
|
203
|
+
var parameterDefinitionSchema = z5.object({
|
204
|
+
key: z5.string(),
|
205
|
+
value: z5.string(),
|
206
|
+
omitIfEmpty: z5.boolean().optional()
|
108
207
|
});
|
109
|
-
var resolvingIssueSchema =
|
110
|
-
|
111
|
-
|
112
|
-
message:
|
113
|
-
subType:
|
114
|
-
issueReference:
|
115
|
-
deepLink:
|
208
|
+
var resolvingIssueSchema = z5.union([
|
209
|
+
z5.string(),
|
210
|
+
z5.object({
|
211
|
+
message: z5.string(),
|
212
|
+
subType: z5.enum(["unpublishedData", "configuration"]).optional(),
|
213
|
+
issueReference: z5.string().optional(),
|
214
|
+
deepLink: z5.string().optional()
|
116
215
|
})
|
117
216
|
]);
|
118
|
-
var variableDefinitionSchema =
|
119
|
-
displayName:
|
120
|
-
type:
|
121
|
-
default:
|
122
|
-
helpText:
|
123
|
-
order:
|
124
|
-
source:
|
217
|
+
var variableDefinitionSchema = z5.object({
|
218
|
+
displayName: z5.string().optional(),
|
219
|
+
type: z5.string().optional(),
|
220
|
+
default: z5.string(),
|
221
|
+
helpText: z5.string().optional(),
|
222
|
+
order: z5.number().optional(),
|
223
|
+
source: z5.string().optional()
|
125
224
|
});
|
126
|
-
var customEdgehancerDefinitionSchema =
|
127
|
-
preRequest:
|
128
|
-
request:
|
225
|
+
var customEdgehancerDefinitionSchema = z5.object({
|
226
|
+
preRequest: z5.string().optional(),
|
227
|
+
request: z5.string().optional()
|
129
228
|
});
|
130
|
-
var dataSourceVariantSchema =
|
131
|
-
|
132
|
-
headers:
|
133
|
-
parameters:
|
134
|
-
variables:
|
229
|
+
var dataSourceVariantSchema = z5.intersection(
|
230
|
+
z5.object({
|
231
|
+
headers: z5.array(parameterDefinitionSchema).optional(),
|
232
|
+
parameters: z5.array(parameterDefinitionSchema).optional(),
|
233
|
+
variables: z5.record(variableDefinitionSchema).optional()
|
135
234
|
}),
|
136
|
-
|
235
|
+
z5.object({ url: z5.string() })
|
137
236
|
);
|
138
|
-
var mergedDataTypeSchema =
|
139
|
-
id:
|
140
|
-
displayName:
|
141
|
-
archetype:
|
142
|
-
allowedOnComponents:
|
143
|
-
badgeIconUrl:
|
144
|
-
connectorType:
|
145
|
-
url:
|
146
|
-
headers:
|
147
|
-
parameters:
|
148
|
-
body:
|
149
|
-
method:
|
150
|
-
variables:
|
151
|
-
custom:
|
152
|
-
customPublic:
|
153
|
-
ttl:
|
154
|
-
purgeKey:
|
155
|
-
localeMapping:
|
237
|
+
var mergedDataTypeSchema = z5.object({
|
238
|
+
id: z5.string(),
|
239
|
+
displayName: z5.string(),
|
240
|
+
archetype: z5.string().optional(),
|
241
|
+
allowedOnComponents: z5.array(z5.string()).optional(),
|
242
|
+
badgeIconUrl: z5.string().optional(),
|
243
|
+
connectorType: z5.string(),
|
244
|
+
url: z5.string(),
|
245
|
+
headers: z5.array(parameterDefinitionSchema).optional(),
|
246
|
+
parameters: z5.array(parameterDefinitionSchema).optional(),
|
247
|
+
body: z5.string().optional(),
|
248
|
+
method: z5.enum(["GET", "POST", "HEAD"]),
|
249
|
+
variables: z5.record(variableDefinitionSchema).optional(),
|
250
|
+
custom: z5.record(z5.unknown()).optional(),
|
251
|
+
customPublic: z5.record(z5.unknown()).optional(),
|
252
|
+
ttl: z5.number().optional(),
|
253
|
+
purgeKey: z5.string().optional(),
|
254
|
+
localeMapping: z5.record(z5.string()).optional(),
|
156
255
|
edgehancer: customEdgehancerDefinitionSchema.optional(),
|
157
|
-
uiBadgeText:
|
158
|
-
variants:
|
256
|
+
uiBadgeText: z5.string().max(12).optional(),
|
257
|
+
variants: z5.object({
|
159
258
|
unpublished: dataSourceVariantSchema.optional()
|
160
259
|
}).optional(),
|
161
|
-
enableUnpublishedMode:
|
260
|
+
enableUnpublishedMode: z5.boolean().optional()
|
162
261
|
});
|
163
262
|
assert();
|
164
|
-
var dataResourceSchema =
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
263
|
+
var dataResourceSchema = z5.union([
|
264
|
+
z5.string(),
|
265
|
+
z5.object({}).catchall(z5.unknown()),
|
266
|
+
z5.number(),
|
267
|
+
z5.boolean(),
|
268
|
+
z5.array(z5.unknown()),
|
269
|
+
z5.undefined()
|
171
270
|
]);
|
172
271
|
|
173
272
|
// src/preRequest.ts
|
@@ -180,39 +279,43 @@ var edgehancerMergedDataTypeSchema = mergedDataTypeSchema.omit({
|
|
180
279
|
purgeKey: true,
|
181
280
|
variables: true
|
182
281
|
});
|
183
|
-
var preRequestEdgehancerDataResourceResultSchema =
|
184
|
-
errors:
|
185
|
-
warnings:
|
186
|
-
infos:
|
282
|
+
var preRequestEdgehancerDataResourceResultSchema = z6.strictObject({
|
283
|
+
errors: z6.array(resolvingIssueSchema).optional(),
|
284
|
+
warnings: z6.array(resolvingIssueSchema).optional(),
|
285
|
+
infos: z6.array(resolvingIssueSchema).optional(),
|
187
286
|
dataResource: edgehancerMergedDataTypeSchema
|
188
287
|
});
|
189
|
-
var preRequestEdgehancerResultSchema =
|
190
|
-
dataResources:
|
288
|
+
var preRequestEdgehancerResultSchema = z6.strictObject({
|
289
|
+
dataResources: z6.array(preRequestEdgehancerDataResourceResultSchema)
|
191
290
|
});
|
192
291
|
|
193
292
|
// src/request.ts
|
194
|
-
import { z as
|
195
|
-
var requestEdgehancerDataResourceResolutionResultSchema =
|
196
|
-
errors:
|
293
|
+
import { z as z7 } from "zod";
|
294
|
+
var requestEdgehancerDataResourceResolutionResultSchema = z7.strictObject({
|
295
|
+
errors: z7.array(resolvingIssueSchema).optional().describe(
|
197
296
|
"Errors that occurred while running your code to return with the API response, if any. Unhandled exceptions will be captured automatically."
|
198
297
|
),
|
199
|
-
warnings:
|
200
|
-
infos:
|
298
|
+
warnings: z7.array(resolvingIssueSchema).optional().describe("Warnings that occurred while running your code to return with the API response, if any."),
|
299
|
+
infos: z7.array(resolvingIssueSchema).optional().describe(
|
201
300
|
"Informational messages that occurred while running your code to return with the API response, if any."
|
202
301
|
),
|
203
|
-
surrogateKeys:
|
302
|
+
surrogateKeys: z7.array(z7.string()).optional().describe(
|
204
303
|
"Extra surrogate keys for the data that was fetched. These act as auxiliary cache keys that can allow granular purging of cached data."
|
205
304
|
),
|
206
305
|
result: dataResourceSchema.describe("The result of fetching the data resource")
|
207
306
|
});
|
208
|
-
var requestEdgehancerResultSchema =
|
209
|
-
results:
|
307
|
+
var requestEdgehancerResultSchema = z7.strictObject({
|
308
|
+
results: z7.array(requestEdgehancerDataResourceResolutionResultSchema)
|
210
309
|
});
|
211
310
|
export {
|
212
311
|
COLLECTION_DEFAULT_LIMIT,
|
213
312
|
COLLECTION_DEFAULT_OFFSET,
|
214
313
|
COLLECTION_MAX_LIMIT,
|
314
|
+
afterAIEditContextSchema,
|
315
|
+
afterAIEditResultSchema,
|
215
316
|
convertBatchResultsToEdgehancerResult,
|
317
|
+
createAIEditContextSchema,
|
318
|
+
createAIEditResultSchema,
|
216
319
|
dataResourceSchema,
|
217
320
|
edgehancerMergedDataTypeSchema,
|
218
321
|
getDataResourceAsRequest,
|
package/dist/index.js
CHANGED
@@ -23,7 +23,11 @@ __export(src_exports, {
|
|
23
23
|
COLLECTION_DEFAULT_LIMIT: () => COLLECTION_DEFAULT_LIMIT,
|
24
24
|
COLLECTION_DEFAULT_OFFSET: () => COLLECTION_DEFAULT_OFFSET,
|
25
25
|
COLLECTION_MAX_LIMIT: () => COLLECTION_MAX_LIMIT,
|
26
|
+
afterAIEditContextSchema: () => afterAIEditContextSchema,
|
27
|
+
afterAIEditResultSchema: () => afterAIEditResultSchema,
|
26
28
|
convertBatchResultsToEdgehancerResult: () => convertBatchResultsToEdgehancerResult,
|
29
|
+
createAIEditContextSchema: () => createAIEditContextSchema,
|
30
|
+
createAIEditResultSchema: () => createAIEditResultSchema,
|
27
31
|
dataResourceSchema: () => dataResourceSchema,
|
28
32
|
edgehancerMergedDataTypeSchema: () => edgehancerMergedDataTypeSchema,
|
29
33
|
getDataResourceAsRequest: () => getDataResourceAsRequest,
|
@@ -40,6 +44,89 @@ __export(src_exports, {
|
|
40
44
|
});
|
41
45
|
module.exports = __toCommonJS(src_exports);
|
42
46
|
|
47
|
+
// ../../lib/ai-sdk/src/InvocationContexts.ts
|
48
|
+
var import_zod = require("zod");
|
49
|
+
var invocationContextsSchema = import_zod.z.enum([
|
50
|
+
"composition",
|
51
|
+
"compositionPattern",
|
52
|
+
"componentPattern",
|
53
|
+
"entry",
|
54
|
+
"entryPattern",
|
55
|
+
"general"
|
56
|
+
]);
|
57
|
+
var invocationContextInfoSchema = import_zod.z.object({
|
58
|
+
context: invocationContextsSchema,
|
59
|
+
id: import_zod.z.string(),
|
60
|
+
displayName: import_zod.z.string().optional(),
|
61
|
+
icon: import_zod.z.string().optional()
|
62
|
+
});
|
63
|
+
var invocationContextAnnotationSchema = import_zod.z.object({
|
64
|
+
type: import_zod.z.literal("invocationContext"),
|
65
|
+
value: invocationContextInfoSchema
|
66
|
+
});
|
67
|
+
|
68
|
+
// ../../lib/ai-sdk/src/toolDefinitions/editing/createPropertyEdit.ts
|
69
|
+
var import_zod2 = require("zod");
|
70
|
+
var createPropertyEdit = {
|
71
|
+
displayName: "Create Property Edit",
|
72
|
+
description: "Edits a property on a composition, entry, or pattern with AI. This is a callable tool NOT FOR AGENT USE - agents use applyPropertyEdit to broker client-side application of the edit.",
|
73
|
+
inputSchema: import_zod2.z.object({
|
74
|
+
edit: import_zod2.z.string().describe("Describe the edit to be made to the property"),
|
75
|
+
currentValue: import_zod2.z.unknown().describe("Current value of the property (if any exists)").optional(),
|
76
|
+
projectGuidance: import_zod2.z.string().describe("Guidance prompt for the project (if any exists)").optional(),
|
77
|
+
componentGuidance: import_zod2.z.string().describe("Guidance prompt for the parent component").optional(),
|
78
|
+
audienceGuidance: import_zod2.z.string().describe(
|
79
|
+
"Guidance prompt for the target audience of a personalized variation. Omit for non-variation edits."
|
80
|
+
).optional(),
|
81
|
+
propertyDefinition: import_zod2.z.object({
|
82
|
+
id: import_zod2.z.string(),
|
83
|
+
name: import_zod2.z.string(),
|
84
|
+
type: import_zod2.z.string(),
|
85
|
+
guidance: import_zod2.z.string().describe("Guidance prompt from the property definition (if any exists)").optional(),
|
86
|
+
typeConfig: import_zod2.z.unknown().optional().describe("Type-specific configuration for the property")
|
87
|
+
}),
|
88
|
+
outputLocale: import_zod2.z.string().optional().describe("The locale to use when writing the edited value"),
|
89
|
+
documentContext: import_zod2.z.string().describe("Content of the surrounding document the property is part of").optional()
|
90
|
+
}),
|
91
|
+
outputSchema: import_zod2.z.object({
|
92
|
+
newValue: import_zod2.z.string().describe(
|
93
|
+
"The new value of the property. When the action is clear or resetOverride, this should be empty."
|
94
|
+
),
|
95
|
+
treatNewValueAsJson: import_zod2.z.boolean().describe("Whether the newValue is a JSON string"),
|
96
|
+
summary: import_zod2.z.string().describe(
|
97
|
+
"A completion message to the user that summarizes the action taken. This should be 1 sentence, in English."
|
98
|
+
).optional(),
|
99
|
+
action: import_zod2.z.enum(["setValue", "clearValue", "resetOverride"]).describe(
|
100
|
+
"setValue = update the value, clearValue = remove the value/set to empty, resetOverride = remove a pattern override and inherit the pattern value. Only use resetOverride if the prompt asks for it."
|
101
|
+
),
|
102
|
+
success: import_zod2.z.boolean().describe("Whether the edit could be completed successfully")
|
103
|
+
}),
|
104
|
+
runsAt: "server",
|
105
|
+
timeout: 100,
|
106
|
+
callable: true
|
107
|
+
};
|
108
|
+
|
109
|
+
// src/afterAIEdit.ts
|
110
|
+
var import_zod3 = require("zod");
|
111
|
+
var afterAIEditResultSchema = import_zod3.z.strictObject({
|
112
|
+
newValue: import_zod3.z.unknown(),
|
113
|
+
success: import_zod3.z.boolean(),
|
114
|
+
summary: import_zod3.z.string().optional()
|
115
|
+
});
|
116
|
+
var afterAIEditContextSchema = import_zod3.z.strictObject({
|
117
|
+
editRequest: createPropertyEdit.inputSchema,
|
118
|
+
invocationContext: invocationContextsSchema,
|
119
|
+
userId: import_zod3.z.string(),
|
120
|
+
currentLocale: import_zod3.z.string().optional(),
|
121
|
+
projectId: import_zod3.z.string(),
|
122
|
+
currentValue: import_zod3.z.unknown().optional(),
|
123
|
+
newValue: import_zod3.z.unknown(),
|
124
|
+
result: import_zod3.z.object({
|
125
|
+
success: import_zod3.z.boolean(),
|
126
|
+
summary: import_zod3.z.string().optional()
|
127
|
+
})
|
128
|
+
});
|
129
|
+
|
43
130
|
// src/batchUtils.ts
|
44
131
|
function convertBatchResultsToEdgehancerResult({
|
45
132
|
batch,
|
@@ -99,6 +186,22 @@ var COLLECTION_DEFAULT_LIMIT = 20;
|
|
99
186
|
var COLLECTION_MAX_LIMIT = 50;
|
100
187
|
var COLLECTION_DEFAULT_OFFSET = 0;
|
101
188
|
|
189
|
+
// src/createAIEdit.ts
|
190
|
+
var import_zod4 = require("zod");
|
191
|
+
var createAIEditContextSchema = import_zod4.z.strictObject({
|
192
|
+
editRequest: createPropertyEdit.inputSchema,
|
193
|
+
invocationContext: invocationContextsSchema,
|
194
|
+
userId: import_zod4.z.string(),
|
195
|
+
currentLocale: import_zod4.z.string().optional(),
|
196
|
+
projectId: import_zod4.z.string()
|
197
|
+
});
|
198
|
+
var createAIEditResultSchema = import_zod4.z.strictObject({
|
199
|
+
outputJsonSchema: import_zod4.z.record(import_zod4.z.string(), import_zod4.z.any()).describe("JSON schema (draft-07) for the edited content result"),
|
200
|
+
instructions: import_zod4.z.string().describe(
|
201
|
+
"Instructions for the AI editor LLM to follow (e.g. conventions/rules, allowed values, etc). Just describe your value type, do not give guiding instructions. There is no need to worry about clearing or resetting values, that is automatically handled."
|
202
|
+
)
|
203
|
+
});
|
204
|
+
|
102
205
|
// src/fetchUtils.ts
|
103
206
|
function getDataResourceAsRequest(data) {
|
104
207
|
var _a;
|
@@ -138,78 +241,78 @@ function copyKeyValuePairs(source, target) {
|
|
138
241
|
}
|
139
242
|
|
140
243
|
// src/preRequest.ts
|
141
|
-
var
|
244
|
+
var import_zod6 = require("zod");
|
142
245
|
|
143
246
|
// src/shared.ts
|
144
247
|
var import_tsafe = require("tsafe");
|
145
|
-
var
|
146
|
-
var parameterDefinitionSchema =
|
147
|
-
key:
|
148
|
-
value:
|
149
|
-
omitIfEmpty:
|
248
|
+
var import_zod5 = require("zod");
|
249
|
+
var parameterDefinitionSchema = import_zod5.z.object({
|
250
|
+
key: import_zod5.z.string(),
|
251
|
+
value: import_zod5.z.string(),
|
252
|
+
omitIfEmpty: import_zod5.z.boolean().optional()
|
150
253
|
});
|
151
|
-
var resolvingIssueSchema =
|
152
|
-
|
153
|
-
|
154
|
-
message:
|
155
|
-
subType:
|
156
|
-
issueReference:
|
157
|
-
deepLink:
|
254
|
+
var resolvingIssueSchema = import_zod5.z.union([
|
255
|
+
import_zod5.z.string(),
|
256
|
+
import_zod5.z.object({
|
257
|
+
message: import_zod5.z.string(),
|
258
|
+
subType: import_zod5.z.enum(["unpublishedData", "configuration"]).optional(),
|
259
|
+
issueReference: import_zod5.z.string().optional(),
|
260
|
+
deepLink: import_zod5.z.string().optional()
|
158
261
|
})
|
159
262
|
]);
|
160
|
-
var variableDefinitionSchema =
|
161
|
-
displayName:
|
162
|
-
type:
|
163
|
-
default:
|
164
|
-
helpText:
|
165
|
-
order:
|
166
|
-
source:
|
263
|
+
var variableDefinitionSchema = import_zod5.z.object({
|
264
|
+
displayName: import_zod5.z.string().optional(),
|
265
|
+
type: import_zod5.z.string().optional(),
|
266
|
+
default: import_zod5.z.string(),
|
267
|
+
helpText: import_zod5.z.string().optional(),
|
268
|
+
order: import_zod5.z.number().optional(),
|
269
|
+
source: import_zod5.z.string().optional()
|
167
270
|
});
|
168
|
-
var customEdgehancerDefinitionSchema =
|
169
|
-
preRequest:
|
170
|
-
request:
|
271
|
+
var customEdgehancerDefinitionSchema = import_zod5.z.object({
|
272
|
+
preRequest: import_zod5.z.string().optional(),
|
273
|
+
request: import_zod5.z.string().optional()
|
171
274
|
});
|
172
|
-
var dataSourceVariantSchema =
|
173
|
-
|
174
|
-
headers:
|
175
|
-
parameters:
|
176
|
-
variables:
|
275
|
+
var dataSourceVariantSchema = import_zod5.z.intersection(
|
276
|
+
import_zod5.z.object({
|
277
|
+
headers: import_zod5.z.array(parameterDefinitionSchema).optional(),
|
278
|
+
parameters: import_zod5.z.array(parameterDefinitionSchema).optional(),
|
279
|
+
variables: import_zod5.z.record(variableDefinitionSchema).optional()
|
177
280
|
}),
|
178
|
-
|
281
|
+
import_zod5.z.object({ url: import_zod5.z.string() })
|
179
282
|
);
|
180
|
-
var mergedDataTypeSchema =
|
181
|
-
id:
|
182
|
-
displayName:
|
183
|
-
archetype:
|
184
|
-
allowedOnComponents:
|
185
|
-
badgeIconUrl:
|
186
|
-
connectorType:
|
187
|
-
url:
|
188
|
-
headers:
|
189
|
-
parameters:
|
190
|
-
body:
|
191
|
-
method:
|
192
|
-
variables:
|
193
|
-
custom:
|
194
|
-
customPublic:
|
195
|
-
ttl:
|
196
|
-
purgeKey:
|
197
|
-
localeMapping:
|
283
|
+
var mergedDataTypeSchema = import_zod5.z.object({
|
284
|
+
id: import_zod5.z.string(),
|
285
|
+
displayName: import_zod5.z.string(),
|
286
|
+
archetype: import_zod5.z.string().optional(),
|
287
|
+
allowedOnComponents: import_zod5.z.array(import_zod5.z.string()).optional(),
|
288
|
+
badgeIconUrl: import_zod5.z.string().optional(),
|
289
|
+
connectorType: import_zod5.z.string(),
|
290
|
+
url: import_zod5.z.string(),
|
291
|
+
headers: import_zod5.z.array(parameterDefinitionSchema).optional(),
|
292
|
+
parameters: import_zod5.z.array(parameterDefinitionSchema).optional(),
|
293
|
+
body: import_zod5.z.string().optional(),
|
294
|
+
method: import_zod5.z.enum(["GET", "POST", "HEAD"]),
|
295
|
+
variables: import_zod5.z.record(variableDefinitionSchema).optional(),
|
296
|
+
custom: import_zod5.z.record(import_zod5.z.unknown()).optional(),
|
297
|
+
customPublic: import_zod5.z.record(import_zod5.z.unknown()).optional(),
|
298
|
+
ttl: import_zod5.z.number().optional(),
|
299
|
+
purgeKey: import_zod5.z.string().optional(),
|
300
|
+
localeMapping: import_zod5.z.record(import_zod5.z.string()).optional(),
|
198
301
|
edgehancer: customEdgehancerDefinitionSchema.optional(),
|
199
|
-
uiBadgeText:
|
200
|
-
variants:
|
302
|
+
uiBadgeText: import_zod5.z.string().max(12).optional(),
|
303
|
+
variants: import_zod5.z.object({
|
201
304
|
unpublished: dataSourceVariantSchema.optional()
|
202
305
|
}).optional(),
|
203
|
-
enableUnpublishedMode:
|
306
|
+
enableUnpublishedMode: import_zod5.z.boolean().optional()
|
204
307
|
});
|
205
308
|
(0, import_tsafe.assert)();
|
206
|
-
var dataResourceSchema =
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
309
|
+
var dataResourceSchema = import_zod5.z.union([
|
310
|
+
import_zod5.z.string(),
|
311
|
+
import_zod5.z.object({}).catchall(import_zod5.z.unknown()),
|
312
|
+
import_zod5.z.number(),
|
313
|
+
import_zod5.z.boolean(),
|
314
|
+
import_zod5.z.array(import_zod5.z.unknown()),
|
315
|
+
import_zod5.z.undefined()
|
213
316
|
]);
|
214
317
|
|
215
318
|
// src/preRequest.ts
|
@@ -222,40 +325,44 @@ var edgehancerMergedDataTypeSchema = mergedDataTypeSchema.omit({
|
|
222
325
|
purgeKey: true,
|
223
326
|
variables: true
|
224
327
|
});
|
225
|
-
var preRequestEdgehancerDataResourceResultSchema =
|
226
|
-
errors:
|
227
|
-
warnings:
|
228
|
-
infos:
|
328
|
+
var preRequestEdgehancerDataResourceResultSchema = import_zod6.z.strictObject({
|
329
|
+
errors: import_zod6.z.array(resolvingIssueSchema).optional(),
|
330
|
+
warnings: import_zod6.z.array(resolvingIssueSchema).optional(),
|
331
|
+
infos: import_zod6.z.array(resolvingIssueSchema).optional(),
|
229
332
|
dataResource: edgehancerMergedDataTypeSchema
|
230
333
|
});
|
231
|
-
var preRequestEdgehancerResultSchema =
|
232
|
-
dataResources:
|
334
|
+
var preRequestEdgehancerResultSchema = import_zod6.z.strictObject({
|
335
|
+
dataResources: import_zod6.z.array(preRequestEdgehancerDataResourceResultSchema)
|
233
336
|
});
|
234
337
|
|
235
338
|
// src/request.ts
|
236
|
-
var
|
237
|
-
var requestEdgehancerDataResourceResolutionResultSchema =
|
238
|
-
errors:
|
339
|
+
var import_zod7 = require("zod");
|
340
|
+
var requestEdgehancerDataResourceResolutionResultSchema = import_zod7.z.strictObject({
|
341
|
+
errors: import_zod7.z.array(resolvingIssueSchema).optional().describe(
|
239
342
|
"Errors that occurred while running your code to return with the API response, if any. Unhandled exceptions will be captured automatically."
|
240
343
|
),
|
241
|
-
warnings:
|
242
|
-
infos:
|
344
|
+
warnings: import_zod7.z.array(resolvingIssueSchema).optional().describe("Warnings that occurred while running your code to return with the API response, if any."),
|
345
|
+
infos: import_zod7.z.array(resolvingIssueSchema).optional().describe(
|
243
346
|
"Informational messages that occurred while running your code to return with the API response, if any."
|
244
347
|
),
|
245
|
-
surrogateKeys:
|
348
|
+
surrogateKeys: import_zod7.z.array(import_zod7.z.string()).optional().describe(
|
246
349
|
"Extra surrogate keys for the data that was fetched. These act as auxiliary cache keys that can allow granular purging of cached data."
|
247
350
|
),
|
248
351
|
result: dataResourceSchema.describe("The result of fetching the data resource")
|
249
352
|
});
|
250
|
-
var requestEdgehancerResultSchema =
|
251
|
-
results:
|
353
|
+
var requestEdgehancerResultSchema = import_zod7.z.strictObject({
|
354
|
+
results: import_zod7.z.array(requestEdgehancerDataResourceResolutionResultSchema)
|
252
355
|
});
|
253
356
|
// Annotate the CommonJS export names for ESM import in node:
|
254
357
|
0 && (module.exports = {
|
255
358
|
COLLECTION_DEFAULT_LIMIT,
|
256
359
|
COLLECTION_DEFAULT_OFFSET,
|
257
360
|
COLLECTION_MAX_LIMIT,
|
361
|
+
afterAIEditContextSchema,
|
362
|
+
afterAIEditResultSchema,
|
258
363
|
convertBatchResultsToEdgehancerResult,
|
364
|
+
createAIEditContextSchema,
|
365
|
+
createAIEditResultSchema,
|
259
366
|
dataResourceSchema,
|
260
367
|
edgehancerMergedDataTypeSchema,
|
261
368
|
getDataResourceAsRequest,
|