@uniformdev/mesh-edgehancer-sdk 20.32.1-alpha.3 → 20.32.1
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 +133 -417
- package/dist/index.d.ts +133 -417
- package/dist/index.esm.js +71 -174
- package/dist/index.js +71 -178
- package/dist/index.mjs +71 -174
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
@@ -1,86 +1,3 @@
|
|
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
|
-
|
84
1
|
// src/batchUtils.ts
|
85
2
|
function convertBatchResultsToEdgehancerResult({
|
86
3
|
batch,
|
@@ -140,22 +57,6 @@ var COLLECTION_DEFAULT_LIMIT = 20;
|
|
140
57
|
var COLLECTION_MAX_LIMIT = 50;
|
141
58
|
var COLLECTION_DEFAULT_OFFSET = 0;
|
142
59
|
|
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
|
-
|
159
60
|
// src/fetchUtils.ts
|
160
61
|
function getDataResourceAsRequest(data) {
|
161
62
|
var _a;
|
@@ -195,78 +96,78 @@ function copyKeyValuePairs(source, target) {
|
|
195
96
|
}
|
196
97
|
|
197
98
|
// src/preRequest.ts
|
198
|
-
import { z as
|
99
|
+
import { z as z2 } from "zod";
|
199
100
|
|
200
101
|
// src/shared.ts
|
201
102
|
import { assert } from "tsafe";
|
202
|
-
import { z
|
203
|
-
var parameterDefinitionSchema =
|
204
|
-
key:
|
205
|
-
value:
|
206
|
-
omitIfEmpty:
|
103
|
+
import { z } from "zod";
|
104
|
+
var parameterDefinitionSchema = z.object({
|
105
|
+
key: z.string(),
|
106
|
+
value: z.string(),
|
107
|
+
omitIfEmpty: z.boolean().optional()
|
207
108
|
});
|
208
|
-
var resolvingIssueSchema =
|
209
|
-
|
210
|
-
|
211
|
-
message:
|
212
|
-
subType:
|
213
|
-
issueReference:
|
214
|
-
deepLink:
|
109
|
+
var resolvingIssueSchema = z.union([
|
110
|
+
z.string(),
|
111
|
+
z.object({
|
112
|
+
message: z.string(),
|
113
|
+
subType: z.enum(["unpublishedData", "configuration"]).optional(),
|
114
|
+
issueReference: z.string().optional(),
|
115
|
+
deepLink: z.string().optional()
|
215
116
|
})
|
216
117
|
]);
|
217
|
-
var variableDefinitionSchema =
|
218
|
-
displayName:
|
219
|
-
type:
|
220
|
-
default:
|
221
|
-
helpText:
|
222
|
-
order:
|
223
|
-
source:
|
118
|
+
var variableDefinitionSchema = z.object({
|
119
|
+
displayName: z.string().optional(),
|
120
|
+
type: z.string().optional(),
|
121
|
+
default: z.string(),
|
122
|
+
helpText: z.string().optional(),
|
123
|
+
order: z.number().optional(),
|
124
|
+
source: z.string().optional()
|
224
125
|
});
|
225
|
-
var customEdgehancerDefinitionSchema =
|
226
|
-
preRequest:
|
227
|
-
request:
|
126
|
+
var customEdgehancerDefinitionSchema = z.object({
|
127
|
+
preRequest: z.string().optional(),
|
128
|
+
request: z.string().optional()
|
228
129
|
});
|
229
|
-
var dataSourceVariantSchema =
|
230
|
-
|
231
|
-
headers:
|
232
|
-
parameters:
|
233
|
-
variables:
|
130
|
+
var dataSourceVariantSchema = z.intersection(
|
131
|
+
z.object({
|
132
|
+
headers: z.array(parameterDefinitionSchema).optional(),
|
133
|
+
parameters: z.array(parameterDefinitionSchema).optional(),
|
134
|
+
variables: z.record(variableDefinitionSchema).optional()
|
234
135
|
}),
|
235
|
-
|
136
|
+
z.object({ url: z.string() })
|
236
137
|
);
|
237
|
-
var mergedDataTypeSchema =
|
238
|
-
id:
|
239
|
-
displayName:
|
240
|
-
archetype:
|
241
|
-
allowedOnComponents:
|
242
|
-
badgeIconUrl:
|
243
|
-
connectorType:
|
244
|
-
url:
|
245
|
-
headers:
|
246
|
-
parameters:
|
247
|
-
body:
|
248
|
-
method:
|
249
|
-
variables:
|
250
|
-
custom:
|
251
|
-
customPublic:
|
252
|
-
ttl:
|
253
|
-
purgeKey:
|
254
|
-
localeMapping:
|
138
|
+
var mergedDataTypeSchema = z.object({
|
139
|
+
id: z.string(),
|
140
|
+
displayName: z.string(),
|
141
|
+
archetype: z.string().optional(),
|
142
|
+
allowedOnComponents: z.array(z.string()).optional(),
|
143
|
+
badgeIconUrl: z.string().optional(),
|
144
|
+
connectorType: z.string(),
|
145
|
+
url: z.string(),
|
146
|
+
headers: z.array(parameterDefinitionSchema).optional(),
|
147
|
+
parameters: z.array(parameterDefinitionSchema).optional(),
|
148
|
+
body: z.string().optional(),
|
149
|
+
method: z.enum(["GET", "POST", "HEAD"]),
|
150
|
+
variables: z.record(variableDefinitionSchema).optional(),
|
151
|
+
custom: z.record(z.unknown()).optional(),
|
152
|
+
customPublic: z.record(z.unknown()).optional(),
|
153
|
+
ttl: z.number().optional(),
|
154
|
+
purgeKey: z.string().optional(),
|
155
|
+
localeMapping: z.record(z.string()).optional(),
|
255
156
|
edgehancer: customEdgehancerDefinitionSchema.optional(),
|
256
|
-
uiBadgeText:
|
257
|
-
variants:
|
157
|
+
uiBadgeText: z.string().max(12).optional(),
|
158
|
+
variants: z.object({
|
258
159
|
unpublished: dataSourceVariantSchema.optional()
|
259
160
|
}).optional(),
|
260
|
-
enableUnpublishedMode:
|
161
|
+
enableUnpublishedMode: z.boolean().optional()
|
261
162
|
});
|
262
163
|
assert();
|
263
|
-
var dataResourceSchema =
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
164
|
+
var dataResourceSchema = z.union([
|
165
|
+
z.string(),
|
166
|
+
z.object({}).catchall(z.unknown()),
|
167
|
+
z.number(),
|
168
|
+
z.boolean(),
|
169
|
+
z.array(z.unknown()),
|
170
|
+
z.undefined()
|
270
171
|
]);
|
271
172
|
|
272
173
|
// src/preRequest.ts
|
@@ -279,43 +180,39 @@ var edgehancerMergedDataTypeSchema = mergedDataTypeSchema.omit({
|
|
279
180
|
purgeKey: true,
|
280
181
|
variables: true
|
281
182
|
});
|
282
|
-
var preRequestEdgehancerDataResourceResultSchema =
|
283
|
-
errors:
|
284
|
-
warnings:
|
285
|
-
infos:
|
183
|
+
var preRequestEdgehancerDataResourceResultSchema = z2.strictObject({
|
184
|
+
errors: z2.array(resolvingIssueSchema).optional(),
|
185
|
+
warnings: z2.array(resolvingIssueSchema).optional(),
|
186
|
+
infos: z2.array(resolvingIssueSchema).optional(),
|
286
187
|
dataResource: edgehancerMergedDataTypeSchema
|
287
188
|
});
|
288
|
-
var preRequestEdgehancerResultSchema =
|
289
|
-
dataResources:
|
189
|
+
var preRequestEdgehancerResultSchema = z2.strictObject({
|
190
|
+
dataResources: z2.array(preRequestEdgehancerDataResourceResultSchema)
|
290
191
|
});
|
291
192
|
|
292
193
|
// src/request.ts
|
293
|
-
import { z as
|
294
|
-
var requestEdgehancerDataResourceResolutionResultSchema =
|
295
|
-
errors:
|
194
|
+
import { z as z3 } from "zod";
|
195
|
+
var requestEdgehancerDataResourceResolutionResultSchema = z3.strictObject({
|
196
|
+
errors: z3.array(resolvingIssueSchema).optional().describe(
|
296
197
|
"Errors that occurred while running your code to return with the API response, if any. Unhandled exceptions will be captured automatically."
|
297
198
|
),
|
298
|
-
warnings:
|
299
|
-
infos:
|
199
|
+
warnings: z3.array(resolvingIssueSchema).optional().describe("Warnings that occurred while running your code to return with the API response, if any."),
|
200
|
+
infos: z3.array(resolvingIssueSchema).optional().describe(
|
300
201
|
"Informational messages that occurred while running your code to return with the API response, if any."
|
301
202
|
),
|
302
|
-
surrogateKeys:
|
203
|
+
surrogateKeys: z3.array(z3.string()).optional().describe(
|
303
204
|
"Extra surrogate keys for the data that was fetched. These act as auxiliary cache keys that can allow granular purging of cached data."
|
304
205
|
),
|
305
206
|
result: dataResourceSchema.describe("The result of fetching the data resource")
|
306
207
|
});
|
307
|
-
var requestEdgehancerResultSchema =
|
308
|
-
results:
|
208
|
+
var requestEdgehancerResultSchema = z3.strictObject({
|
209
|
+
results: z3.array(requestEdgehancerDataResourceResolutionResultSchema)
|
309
210
|
});
|
310
211
|
export {
|
311
212
|
COLLECTION_DEFAULT_LIMIT,
|
312
213
|
COLLECTION_DEFAULT_OFFSET,
|
313
214
|
COLLECTION_MAX_LIMIT,
|
314
|
-
afterAIEditContextSchema,
|
315
|
-
afterAIEditResultSchema,
|
316
215
|
convertBatchResultsToEdgehancerResult,
|
317
|
-
createAIEditContextSchema,
|
318
|
-
createAIEditResultSchema,
|
319
216
|
dataResourceSchema,
|
320
217
|
edgehancerMergedDataTypeSchema,
|
321
218
|
getDataResourceAsRequest,
|
package/dist/index.js
CHANGED
@@ -23,11 +23,7 @@ __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,
|
28
26
|
convertBatchResultsToEdgehancerResult: () => convertBatchResultsToEdgehancerResult,
|
29
|
-
createAIEditContextSchema: () => createAIEditContextSchema,
|
30
|
-
createAIEditResultSchema: () => createAIEditResultSchema,
|
31
27
|
dataResourceSchema: () => dataResourceSchema,
|
32
28
|
edgehancerMergedDataTypeSchema: () => edgehancerMergedDataTypeSchema,
|
33
29
|
getDataResourceAsRequest: () => getDataResourceAsRequest,
|
@@ -44,89 +40,6 @@ __export(src_exports, {
|
|
44
40
|
});
|
45
41
|
module.exports = __toCommonJS(src_exports);
|
46
42
|
|
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
|
-
|
130
43
|
// src/batchUtils.ts
|
131
44
|
function convertBatchResultsToEdgehancerResult({
|
132
45
|
batch,
|
@@ -186,22 +99,6 @@ var COLLECTION_DEFAULT_LIMIT = 20;
|
|
186
99
|
var COLLECTION_MAX_LIMIT = 50;
|
187
100
|
var COLLECTION_DEFAULT_OFFSET = 0;
|
188
101
|
|
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
|
-
|
205
102
|
// src/fetchUtils.ts
|
206
103
|
function getDataResourceAsRequest(data) {
|
207
104
|
var _a;
|
@@ -241,78 +138,78 @@ function copyKeyValuePairs(source, target) {
|
|
241
138
|
}
|
242
139
|
|
243
140
|
// src/preRequest.ts
|
244
|
-
var
|
141
|
+
var import_zod2 = require("zod");
|
245
142
|
|
246
143
|
// src/shared.ts
|
247
144
|
var import_tsafe = require("tsafe");
|
248
|
-
var
|
249
|
-
var parameterDefinitionSchema =
|
250
|
-
key:
|
251
|
-
value:
|
252
|
-
omitIfEmpty:
|
145
|
+
var import_zod = require("zod");
|
146
|
+
var parameterDefinitionSchema = import_zod.z.object({
|
147
|
+
key: import_zod.z.string(),
|
148
|
+
value: import_zod.z.string(),
|
149
|
+
omitIfEmpty: import_zod.z.boolean().optional()
|
253
150
|
});
|
254
|
-
var resolvingIssueSchema =
|
255
|
-
|
256
|
-
|
257
|
-
message:
|
258
|
-
subType:
|
259
|
-
issueReference:
|
260
|
-
deepLink:
|
151
|
+
var resolvingIssueSchema = import_zod.z.union([
|
152
|
+
import_zod.z.string(),
|
153
|
+
import_zod.z.object({
|
154
|
+
message: import_zod.z.string(),
|
155
|
+
subType: import_zod.z.enum(["unpublishedData", "configuration"]).optional(),
|
156
|
+
issueReference: import_zod.z.string().optional(),
|
157
|
+
deepLink: import_zod.z.string().optional()
|
261
158
|
})
|
262
159
|
]);
|
263
|
-
var variableDefinitionSchema =
|
264
|
-
displayName:
|
265
|
-
type:
|
266
|
-
default:
|
267
|
-
helpText:
|
268
|
-
order:
|
269
|
-
source:
|
160
|
+
var variableDefinitionSchema = import_zod.z.object({
|
161
|
+
displayName: import_zod.z.string().optional(),
|
162
|
+
type: import_zod.z.string().optional(),
|
163
|
+
default: import_zod.z.string(),
|
164
|
+
helpText: import_zod.z.string().optional(),
|
165
|
+
order: import_zod.z.number().optional(),
|
166
|
+
source: import_zod.z.string().optional()
|
270
167
|
});
|
271
|
-
var customEdgehancerDefinitionSchema =
|
272
|
-
preRequest:
|
273
|
-
request:
|
168
|
+
var customEdgehancerDefinitionSchema = import_zod.z.object({
|
169
|
+
preRequest: import_zod.z.string().optional(),
|
170
|
+
request: import_zod.z.string().optional()
|
274
171
|
});
|
275
|
-
var dataSourceVariantSchema =
|
276
|
-
|
277
|
-
headers:
|
278
|
-
parameters:
|
279
|
-
variables:
|
172
|
+
var dataSourceVariantSchema = import_zod.z.intersection(
|
173
|
+
import_zod.z.object({
|
174
|
+
headers: import_zod.z.array(parameterDefinitionSchema).optional(),
|
175
|
+
parameters: import_zod.z.array(parameterDefinitionSchema).optional(),
|
176
|
+
variables: import_zod.z.record(variableDefinitionSchema).optional()
|
280
177
|
}),
|
281
|
-
|
178
|
+
import_zod.z.object({ url: import_zod.z.string() })
|
282
179
|
);
|
283
|
-
var mergedDataTypeSchema =
|
284
|
-
id:
|
285
|
-
displayName:
|
286
|
-
archetype:
|
287
|
-
allowedOnComponents:
|
288
|
-
badgeIconUrl:
|
289
|
-
connectorType:
|
290
|
-
url:
|
291
|
-
headers:
|
292
|
-
parameters:
|
293
|
-
body:
|
294
|
-
method:
|
295
|
-
variables:
|
296
|
-
custom:
|
297
|
-
customPublic:
|
298
|
-
ttl:
|
299
|
-
purgeKey:
|
300
|
-
localeMapping:
|
180
|
+
var mergedDataTypeSchema = import_zod.z.object({
|
181
|
+
id: import_zod.z.string(),
|
182
|
+
displayName: import_zod.z.string(),
|
183
|
+
archetype: import_zod.z.string().optional(),
|
184
|
+
allowedOnComponents: import_zod.z.array(import_zod.z.string()).optional(),
|
185
|
+
badgeIconUrl: import_zod.z.string().optional(),
|
186
|
+
connectorType: import_zod.z.string(),
|
187
|
+
url: import_zod.z.string(),
|
188
|
+
headers: import_zod.z.array(parameterDefinitionSchema).optional(),
|
189
|
+
parameters: import_zod.z.array(parameterDefinitionSchema).optional(),
|
190
|
+
body: import_zod.z.string().optional(),
|
191
|
+
method: import_zod.z.enum(["GET", "POST", "HEAD"]),
|
192
|
+
variables: import_zod.z.record(variableDefinitionSchema).optional(),
|
193
|
+
custom: import_zod.z.record(import_zod.z.unknown()).optional(),
|
194
|
+
customPublic: import_zod.z.record(import_zod.z.unknown()).optional(),
|
195
|
+
ttl: import_zod.z.number().optional(),
|
196
|
+
purgeKey: import_zod.z.string().optional(),
|
197
|
+
localeMapping: import_zod.z.record(import_zod.z.string()).optional(),
|
301
198
|
edgehancer: customEdgehancerDefinitionSchema.optional(),
|
302
|
-
uiBadgeText:
|
303
|
-
variants:
|
199
|
+
uiBadgeText: import_zod.z.string().max(12).optional(),
|
200
|
+
variants: import_zod.z.object({
|
304
201
|
unpublished: dataSourceVariantSchema.optional()
|
305
202
|
}).optional(),
|
306
|
-
enableUnpublishedMode:
|
203
|
+
enableUnpublishedMode: import_zod.z.boolean().optional()
|
307
204
|
});
|
308
205
|
(0, import_tsafe.assert)();
|
309
|
-
var dataResourceSchema =
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
206
|
+
var dataResourceSchema = import_zod.z.union([
|
207
|
+
import_zod.z.string(),
|
208
|
+
import_zod.z.object({}).catchall(import_zod.z.unknown()),
|
209
|
+
import_zod.z.number(),
|
210
|
+
import_zod.z.boolean(),
|
211
|
+
import_zod.z.array(import_zod.z.unknown()),
|
212
|
+
import_zod.z.undefined()
|
316
213
|
]);
|
317
214
|
|
318
215
|
// src/preRequest.ts
|
@@ -325,44 +222,40 @@ var edgehancerMergedDataTypeSchema = mergedDataTypeSchema.omit({
|
|
325
222
|
purgeKey: true,
|
326
223
|
variables: true
|
327
224
|
});
|
328
|
-
var preRequestEdgehancerDataResourceResultSchema =
|
329
|
-
errors:
|
330
|
-
warnings:
|
331
|
-
infos:
|
225
|
+
var preRequestEdgehancerDataResourceResultSchema = import_zod2.z.strictObject({
|
226
|
+
errors: import_zod2.z.array(resolvingIssueSchema).optional(),
|
227
|
+
warnings: import_zod2.z.array(resolvingIssueSchema).optional(),
|
228
|
+
infos: import_zod2.z.array(resolvingIssueSchema).optional(),
|
332
229
|
dataResource: edgehancerMergedDataTypeSchema
|
333
230
|
});
|
334
|
-
var preRequestEdgehancerResultSchema =
|
335
|
-
dataResources:
|
231
|
+
var preRequestEdgehancerResultSchema = import_zod2.z.strictObject({
|
232
|
+
dataResources: import_zod2.z.array(preRequestEdgehancerDataResourceResultSchema)
|
336
233
|
});
|
337
234
|
|
338
235
|
// src/request.ts
|
339
|
-
var
|
340
|
-
var requestEdgehancerDataResourceResolutionResultSchema =
|
341
|
-
errors:
|
236
|
+
var import_zod3 = require("zod");
|
237
|
+
var requestEdgehancerDataResourceResolutionResultSchema = import_zod3.z.strictObject({
|
238
|
+
errors: import_zod3.z.array(resolvingIssueSchema).optional().describe(
|
342
239
|
"Errors that occurred while running your code to return with the API response, if any. Unhandled exceptions will be captured automatically."
|
343
240
|
),
|
344
|
-
warnings:
|
345
|
-
infos:
|
241
|
+
warnings: import_zod3.z.array(resolvingIssueSchema).optional().describe("Warnings that occurred while running your code to return with the API response, if any."),
|
242
|
+
infos: import_zod3.z.array(resolvingIssueSchema).optional().describe(
|
346
243
|
"Informational messages that occurred while running your code to return with the API response, if any."
|
347
244
|
),
|
348
|
-
surrogateKeys:
|
245
|
+
surrogateKeys: import_zod3.z.array(import_zod3.z.string()).optional().describe(
|
349
246
|
"Extra surrogate keys for the data that was fetched. These act as auxiliary cache keys that can allow granular purging of cached data."
|
350
247
|
),
|
351
248
|
result: dataResourceSchema.describe("The result of fetching the data resource")
|
352
249
|
});
|
353
|
-
var requestEdgehancerResultSchema =
|
354
|
-
results:
|
250
|
+
var requestEdgehancerResultSchema = import_zod3.z.strictObject({
|
251
|
+
results: import_zod3.z.array(requestEdgehancerDataResourceResolutionResultSchema)
|
355
252
|
});
|
356
253
|
// Annotate the CommonJS export names for ESM import in node:
|
357
254
|
0 && (module.exports = {
|
358
255
|
COLLECTION_DEFAULT_LIMIT,
|
359
256
|
COLLECTION_DEFAULT_OFFSET,
|
360
257
|
COLLECTION_MAX_LIMIT,
|
361
|
-
afterAIEditContextSchema,
|
362
|
-
afterAIEditResultSchema,
|
363
258
|
convertBatchResultsToEdgehancerResult,
|
364
|
-
createAIEditContextSchema,
|
365
|
-
createAIEditResultSchema,
|
366
259
|
dataResourceSchema,
|
367
260
|
edgehancerMergedDataTypeSchema,
|
368
261
|
getDataResourceAsRequest,
|