mcp-dataverse 0.3.8 → 0.4.5
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/CAPABILITIES.md +1304 -1039
- package/LICENSE +21 -21
- package/README.md +137 -105
- package/dist/auth-provider.factory-MSMLSOX3.js +1 -0
- package/dist/chunk-24RDOMG4.js +29 -0
- package/dist/chunk-MPWVUZBX.js +35 -0
- package/dist/chunk-PAX4NW5B.js +1 -0
- package/dist/chunk-SUDI4JM6.js +3 -0
- package/dist/config.loader-VTIKUDN7.js +1 -0
- package/dist/dataverse-client-advanced-ZG4OPCGR.js +1 -0
- package/dist/doctor.js +2 -102
- package/dist/http-server.js +4 -61
- package/dist/install.js +8 -233
- package/dist/server.js +43 -202
- package/dist/setup-auth.js +18 -41
- package/package.json +95 -94
- package/server.json +51 -50
- package/dist/auth/auth-provider.factory.d.ts +0 -4
- package/dist/auth/auth-provider.factory.d.ts.map +0 -1
- package/dist/auth/auth-provider.factory.js +0 -5
- package/dist/auth/auth-provider.factory.js.map +0 -1
- package/dist/auth/auth-provider.interface.d.ts +0 -21
- package/dist/auth/auth-provider.interface.d.ts.map +0 -1
- package/dist/auth/auth-provider.interface.js +0 -2
- package/dist/auth/auth-provider.interface.js.map +0 -1
- package/dist/auth/device-code-auth-provider.d.ts +0 -18
- package/dist/auth/device-code-auth-provider.d.ts.map +0 -1
- package/dist/auth/device-code-auth-provider.js +0 -167
- package/dist/auth/device-code-auth-provider.js.map +0 -1
- package/dist/config/config.loader.d.ts +0 -3
- package/dist/config/config.loader.d.ts.map +0 -1
- package/dist/config/config.loader.js +0 -39
- package/dist/config/config.loader.js.map +0 -1
- package/dist/config/config.schema.d.ts +0 -16
- package/dist/config/config.schema.d.ts.map +0 -1
- package/dist/config/config.schema.js +0 -20
- package/dist/config/config.schema.js.map +0 -1
- package/dist/dataverse/dataverse-client-advanced.d.ts +0 -53
- package/dist/dataverse/dataverse-client-advanced.d.ts.map +0 -1
- package/dist/dataverse/dataverse-client-advanced.js +0 -199
- package/dist/dataverse/dataverse-client-advanced.js.map +0 -1
- package/dist/dataverse/dataverse-client.actions.d.ts +0 -11
- package/dist/dataverse/dataverse-client.actions.d.ts.map +0 -1
- package/dist/dataverse/dataverse-client.actions.js +0 -25
- package/dist/dataverse/dataverse-client.actions.js.map +0 -1
- package/dist/dataverse/dataverse-client.batch.d.ts +0 -10
- package/dist/dataverse/dataverse-client.batch.d.ts.map +0 -1
- package/dist/dataverse/dataverse-client.batch.js +0 -74
- package/dist/dataverse/dataverse-client.batch.js.map +0 -1
- package/dist/dataverse/dataverse-client.d.ts +0 -46
- package/dist/dataverse/dataverse-client.d.ts.map +0 -1
- package/dist/dataverse/dataverse-client.js +0 -275
- package/dist/dataverse/dataverse-client.js.map +0 -1
- package/dist/dataverse/dataverse-client.metadata.d.ts +0 -41
- package/dist/dataverse/dataverse-client.metadata.d.ts.map +0 -1
- package/dist/dataverse/dataverse-client.metadata.js +0 -124
- package/dist/dataverse/dataverse-client.metadata.js.map +0 -1
- package/dist/dataverse/dataverse-client.utils.d.ts +0 -14
- package/dist/dataverse/dataverse-client.utils.d.ts.map +0 -1
- package/dist/dataverse/dataverse-client.utils.js +0 -65
- package/dist/dataverse/dataverse-client.utils.js.map +0 -1
- package/dist/dataverse/http-client.d.ts +0 -38
- package/dist/dataverse/http-client.d.ts.map +0 -1
- package/dist/dataverse/http-client.js +0 -111
- package/dist/dataverse/http-client.js.map +0 -1
- package/dist/dataverse/types.d.ts +0 -68
- package/dist/dataverse/types.d.ts.map +0 -1
- package/dist/dataverse/types.js +0 -2
- package/dist/dataverse/types.js.map +0 -1
- package/dist/doctor.d.ts +0 -7
- package/dist/doctor.d.ts.map +0 -1
- package/dist/doctor.js.map +0 -1
- package/dist/http-server.d.ts +0 -3
- package/dist/http-server.d.ts.map +0 -1
- package/dist/http-server.js.map +0 -1
- package/dist/install.d.ts +0 -3
- package/dist/install.d.ts.map +0 -1
- package/dist/install.js.map +0 -1
- package/dist/resources/resource-provider.d.ts +0 -11
- package/dist/resources/resource-provider.d.ts.map +0 -1
- package/dist/resources/resource-provider.js +0 -79
- package/dist/resources/resource-provider.js.map +0 -1
- package/dist/server.d.ts +0 -3
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/setup-auth.d.ts +0 -3
- package/dist/setup-auth.d.ts.map +0 -1
- package/dist/setup-auth.js.map +0 -1
- package/dist/tools/actions.tools.d.ts +0 -206
- package/dist/tools/actions.tools.d.ts.map +0 -1
- package/dist/tools/actions.tools.js +0 -256
- package/dist/tools/actions.tools.js.map +0 -1
- package/dist/tools/annotations.tools.d.ts +0 -94
- package/dist/tools/annotations.tools.d.ts.map +0 -1
- package/dist/tools/annotations.tools.js +0 -225
- package/dist/tools/annotations.tools.js.map +0 -1
- package/dist/tools/audit.tools.d.ts +0 -51
- package/dist/tools/audit.tools.d.ts.map +0 -1
- package/dist/tools/audit.tools.js +0 -170
- package/dist/tools/audit.tools.js.map +0 -1
- package/dist/tools/auth.tools.d.ts +0 -23
- package/dist/tools/auth.tools.d.ts.map +0 -1
- package/dist/tools/auth.tools.js +0 -36
- package/dist/tools/auth.tools.js.map +0 -1
- package/dist/tools/batch.tools.d.ts +0 -52
- package/dist/tools/batch.tools.d.ts.map +0 -1
- package/dist/tools/batch.tools.js +0 -89
- package/dist/tools/batch.tools.js.map +0 -1
- package/dist/tools/crud.tools.d.ts +0 -260
- package/dist/tools/crud.tools.d.ts.map +0 -1
- package/dist/tools/crud.tools.js +0 -290
- package/dist/tools/crud.tools.js.map +0 -1
- package/dist/tools/customization.tools.d.ts +0 -127
- package/dist/tools/customization.tools.d.ts.map +0 -1
- package/dist/tools/customization.tools.js +0 -285
- package/dist/tools/customization.tools.js.map +0 -1
- package/dist/tools/environment.tools.d.ts +0 -106
- package/dist/tools/environment.tools.d.ts.map +0 -1
- package/dist/tools/environment.tools.js +0 -274
- package/dist/tools/environment.tools.js.map +0 -1
- package/dist/tools/file.tools.d.ts +0 -73
- package/dist/tools/file.tools.d.ts.map +0 -1
- package/dist/tools/file.tools.js +0 -160
- package/dist/tools/file.tools.js.map +0 -1
- package/dist/tools/guardrails.d.ts +0 -22
- package/dist/tools/guardrails.d.ts.map +0 -1
- package/dist/tools/guardrails.js +0 -56
- package/dist/tools/guardrails.js.map +0 -1
- package/dist/tools/impersonate.tools.d.ts +0 -44
- package/dist/tools/impersonate.tools.d.ts.map +0 -1
- package/dist/tools/impersonate.tools.js +0 -87
- package/dist/tools/impersonate.tools.js.map +0 -1
- package/dist/tools/metadata.tools.d.ts +0 -279
- package/dist/tools/metadata.tools.d.ts.map +0 -1
- package/dist/tools/metadata.tools.js +0 -400
- package/dist/tools/metadata.tools.js.map +0 -1
- package/dist/tools/org.tools.d.ts +0 -32
- package/dist/tools/org.tools.d.ts.map +0 -1
- package/dist/tools/org.tools.js +0 -65
- package/dist/tools/org.tools.js.map +0 -1
- package/dist/tools/output.utils.d.ts +0 -63
- package/dist/tools/output.utils.d.ts.map +0 -1
- package/dist/tools/output.utils.js +0 -78
- package/dist/tools/output.utils.js.map +0 -1
- package/dist/tools/progress.d.ts +0 -15
- package/dist/tools/progress.d.ts.map +0 -1
- package/dist/tools/progress.js +0 -29
- package/dist/tools/progress.js.map +0 -1
- package/dist/tools/quality.tools.d.ts +0 -36
- package/dist/tools/quality.tools.d.ts.map +0 -1
- package/dist/tools/quality.tools.js +0 -97
- package/dist/tools/quality.tools.js.map +0 -1
- package/dist/tools/query.tools.d.ts +0 -151
- package/dist/tools/query.tools.d.ts.map +0 -1
- package/dist/tools/query.tools.js +0 -293
- package/dist/tools/query.tools.js.map +0 -1
- package/dist/tools/relations.tools.d.ts +0 -77
- package/dist/tools/relations.tools.d.ts.map +0 -1
- package/dist/tools/relations.tools.js +0 -96
- package/dist/tools/relations.tools.js.map +0 -1
- package/dist/tools/router.tools.d.ts +0 -5
- package/dist/tools/router.tools.d.ts.map +0 -1
- package/dist/tools/router.tools.js +0 -247
- package/dist/tools/router.tools.js.map +0 -1
- package/dist/tools/search.tools.d.ts +0 -74
- package/dist/tools/search.tools.d.ts.map +0 -1
- package/dist/tools/search.tools.js +0 -142
- package/dist/tools/search.tools.js.map +0 -1
- package/dist/tools/solution.tools.d.ts +0 -113
- package/dist/tools/solution.tools.d.ts.map +0 -1
- package/dist/tools/solution.tools.js +0 -176
- package/dist/tools/solution.tools.js.map +0 -1
- package/dist/tools/teams.tools.d.ts +0 -65
- package/dist/tools/teams.tools.d.ts.map +0 -1
- package/dist/tools/teams.tools.js +0 -127
- package/dist/tools/teams.tools.js.map +0 -1
- package/dist/tools/tool-registry.d.ts +0 -35
- package/dist/tools/tool-registry.d.ts.map +0 -1
- package/dist/tools/tool-registry.js +0 -31
- package/dist/tools/tool-registry.js.map +0 -1
- package/dist/tools/trace.tools.d.ts +0 -75
- package/dist/tools/trace.tools.d.ts.map +0 -1
- package/dist/tools/trace.tools.js +0 -233
- package/dist/tools/trace.tools.js.map +0 -1
- package/dist/tools/tracking.tools.d.ts +0 -41
- package/dist/tools/tracking.tools.d.ts.map +0 -1
- package/dist/tools/tracking.tools.js +0 -76
- package/dist/tools/tracking.tools.js.map +0 -1
- package/dist/tools/users.tools.d.ts +0 -141
- package/dist/tools/users.tools.d.ts.map +0 -1
- package/dist/tools/users.tools.js +0 -321
- package/dist/tools/users.tools.js.map +0 -1
- package/dist/tools/validation.utils.d.ts +0 -6
- package/dist/tools/validation.utils.d.ts.map +0 -1
- package/dist/tools/validation.utils.js +0 -14
- package/dist/tools/validation.utils.js.map +0 -1
- package/dist/tools/views.tools.d.ts +0 -36
- package/dist/tools/views.tools.d.ts.map +0 -1
- package/dist/tools/views.tools.js +0 -92
- package/dist/tools/views.tools.js.map +0 -1
- package/dist/tools/workflow.tools.d.ts +0 -111
- package/dist/tools/workflow.tools.d.ts.map +0 -1
- package/dist/tools/workflow.tools.js +0 -449
- package/dist/tools/workflow.tools.js.map +0 -1
- package/dist/transport.d.ts +0 -6
- package/dist/transport.d.ts.map +0 -1
- package/dist/transport.js +0 -21
- package/dist/transport.js.map +0 -1
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { formatData } from "./output.utils.js";
|
|
3
|
-
import { safeEntitySetName } from "./validation.utils.js";
|
|
4
|
-
export const actionTools = [
|
|
5
|
-
{
|
|
6
|
-
name: "dataverse_execute_action",
|
|
7
|
-
description: "Executes a global (unbound) Dataverse action that is not tied to a specific record — for example WinOpportunity, SendEmail, or custom process actions. Use dataverse_execute_bound_action when the action must operate on a particular record. Actions differ from functions in that they are state-changing operations; for read-only operations use dataverse_execute_function. WHEN TO USE: Invoking global Dataverse actions or custom process actions like WinOpportunity or SendEmail. BEST PRACTICES: Check action parameters via metadata or docs; use dataverse_execute_bound_action for record-scoped actions. WORKFLOW: update_record.",
|
|
8
|
-
inputSchema: {
|
|
9
|
-
type: "object",
|
|
10
|
-
properties: {
|
|
11
|
-
actionName: {
|
|
12
|
-
type: "string",
|
|
13
|
-
description: 'Action logical name (e.g., "WinOpportunity")',
|
|
14
|
-
},
|
|
15
|
-
parameters: { type: "object", description: "Action parameters" },
|
|
16
|
-
},
|
|
17
|
-
required: ["actionName"],
|
|
18
|
-
},
|
|
19
|
-
annotations: {
|
|
20
|
-
readOnlyHint: false,
|
|
21
|
-
destructiveHint: false,
|
|
22
|
-
idempotentHint: false,
|
|
23
|
-
openWorldHint: true,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "dataverse_execute_function",
|
|
28
|
-
description: "Executes a global (unbound) Dataverse OData function that is read-only and returns data without side effects — for example RetrieveTotalRecordCount or InitializeFrom. Use dataverse_execute_action for state-changing operations. Use dataverse_execute_bound_action when the function/action requires a specific record context. WHEN TO USE: Calling global read-only OData functions like RetrieveTotalRecordCount or InitializeFrom. BEST PRACTICES: Functions are side-effect-free and safe to retry; use dataverse_execute_action for mutations. WORKFLOW: query_data.",
|
|
29
|
-
inputSchema: {
|
|
30
|
-
type: "object",
|
|
31
|
-
properties: {
|
|
32
|
-
functionName: {
|
|
33
|
-
type: "string",
|
|
34
|
-
description: 'Function name (e.g., "WhoAmI", "RetrieveTotalRecordCount")',
|
|
35
|
-
},
|
|
36
|
-
parameters: {
|
|
37
|
-
type: "object",
|
|
38
|
-
description: "Function parameters as string key-value pairs",
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
required: ["functionName"],
|
|
42
|
-
},
|
|
43
|
-
annotations: {
|
|
44
|
-
readOnlyHint: true,
|
|
45
|
-
destructiveHint: false,
|
|
46
|
-
idempotentHint: true,
|
|
47
|
-
openWorldHint: true,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: "dataverse_execute_bound_action",
|
|
52
|
-
description: "Executes a Dataverse action bound to a specific record instance, passing the entity set name and record GUID as context (e.g., QualifyLead on a lead, or a custom action scoped to an account). The actionName should not include the Microsoft.Dynamics.CRM namespace prefix. Use dataverse_execute_action for global unbound actions that do not require a record context. WHEN TO USE: Running an action scoped to a specific record, e.g. QualifyLead on a lead. BEST PRACTICES: Omit the Microsoft.Dynamics.CRM namespace prefix; ensure the record exists first. WORKFLOW: update_record.",
|
|
53
|
-
inputSchema: {
|
|
54
|
-
type: "object",
|
|
55
|
-
properties: {
|
|
56
|
-
entitySetName: { type: "string" },
|
|
57
|
-
id: { type: "string", description: "Record GUID" },
|
|
58
|
-
actionName: {
|
|
59
|
-
type: "string",
|
|
60
|
-
description: "Action name (without Microsoft.Dynamics.CRM prefix)",
|
|
61
|
-
},
|
|
62
|
-
parameters: { type: "object", description: "Action parameters" },
|
|
63
|
-
},
|
|
64
|
-
required: ["entitySetName", "id", "actionName"],
|
|
65
|
-
},
|
|
66
|
-
annotations: {
|
|
67
|
-
readOnlyHint: false,
|
|
68
|
-
destructiveHint: false,
|
|
69
|
-
idempotentHint: false,
|
|
70
|
-
openWorldHint: true,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: "dataverse_retrieve_dependencies_for_delete",
|
|
75
|
-
description: "Checks what solution components would block deletion of a specific component. Provide the Dataverse component type code (1=Entity, 2=Attribute, 26=SavedQuery, 29=Workflow, 92=PluginAssembly) and the component GUID. Use before deleting shared Dataverse customization components. WHEN TO USE: Before deleting a solution component to check for blocking dependencies. BEST PRACTICES: Resolve all dependencies before attempting deletion. WORKFLOW: manage_solution.",
|
|
76
|
-
inputSchema: {
|
|
77
|
-
type: "object",
|
|
78
|
-
properties: {
|
|
79
|
-
componentType: {
|
|
80
|
-
type: "number",
|
|
81
|
-
description: "Dataverse component type code (1=Entity, 2=Attribute, 29=Workflow, 92=PluginAssembly)",
|
|
82
|
-
},
|
|
83
|
-
objectId: { type: "string", description: "Component GUID" },
|
|
84
|
-
},
|
|
85
|
-
required: ["componentType", "objectId"],
|
|
86
|
-
},
|
|
87
|
-
annotations: {
|
|
88
|
-
readOnlyHint: true,
|
|
89
|
-
destructiveHint: false,
|
|
90
|
-
idempotentHint: true,
|
|
91
|
-
openWorldHint: true,
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "dataverse_execute_bound_function",
|
|
96
|
-
description: "Executes a Dataverse function bound to a specific record (e.g., CalculateRollupField, GetQuantityAvailable). Use for read-only computed operations on a single record. Unlike bound actions, bound functions do not modify data. WHEN TO USE: Calling a read-only computed function on a specific record, e.g. CalculateRollupField. BEST PRACTICES: Functions are side-effect-free and safe to call repeatedly; pass parameters as string key-value pairs. WORKFLOW: query_data.",
|
|
97
|
-
inputSchema: {
|
|
98
|
-
type: "object",
|
|
99
|
-
properties: {
|
|
100
|
-
entitySetName: {
|
|
101
|
-
type: "string",
|
|
102
|
-
description: 'OData entity set name of the table (e.g., "accounts")',
|
|
103
|
-
},
|
|
104
|
-
id: { type: "string", description: "GUID of the record" },
|
|
105
|
-
functionName: {
|
|
106
|
-
type: "string",
|
|
107
|
-
description: 'Name of the bound function (e.g., "CalculateRollupField")',
|
|
108
|
-
},
|
|
109
|
-
parameters: {
|
|
110
|
-
type: "object",
|
|
111
|
-
description: "Function parameters as key-value pairs of strings",
|
|
112
|
-
additionalProperties: { type: "string" },
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
required: ["entitySetName", "id", "functionName"],
|
|
116
|
-
},
|
|
117
|
-
annotations: {
|
|
118
|
-
readOnlyHint: true,
|
|
119
|
-
destructiveHint: false,
|
|
120
|
-
idempotentHint: true,
|
|
121
|
-
openWorldHint: true,
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: "dataverse_list_dependencies",
|
|
126
|
-
description: "Lists workflows, Power Automate flows, Business Rules, and custom actions that reference a given table. Use to detect hidden dependencies before modifying or removing a table. Returns component name, type, state (Active/Draft), trigger event (Create/Update/Delete), and count. WHEN TO USE: Before modifying or removing a table, to discover workflows, flows, and plugins that reference it. BEST PRACTICES: Filter by componentType to focus on specific dependency kinds. WORKFLOW: manage_solution.",
|
|
127
|
-
inputSchema: {
|
|
128
|
-
type: "object",
|
|
129
|
-
properties: {
|
|
130
|
-
tableName: {
|
|
131
|
-
type: "string",
|
|
132
|
-
description: 'Logical name of the table to check (e.g., "account", "contact")',
|
|
133
|
-
},
|
|
134
|
-
componentType: {
|
|
135
|
-
type: "array",
|
|
136
|
-
items: {
|
|
137
|
-
type: "string",
|
|
138
|
-
enum: [
|
|
139
|
-
"Workflow",
|
|
140
|
-
"Flow",
|
|
141
|
-
"BusinessRule",
|
|
142
|
-
"Action",
|
|
143
|
-
"BusinessProcessFlow",
|
|
144
|
-
"Plugin",
|
|
145
|
-
"CustomAPI",
|
|
146
|
-
],
|
|
147
|
-
},
|
|
148
|
-
description: "Filter by component type. Default: all types.",
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
required: ["tableName"],
|
|
152
|
-
},
|
|
153
|
-
annotations: {
|
|
154
|
-
readOnlyHint: true,
|
|
155
|
-
destructiveHint: false,
|
|
156
|
-
idempotentHint: true,
|
|
157
|
-
openWorldHint: true,
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
];
|
|
161
|
-
/** Allow only identifier-safe names: letters, digits, underscores, dots (for namespace prefixes). */
|
|
162
|
-
const SAFE_API_NAME = /^[a-zA-Z0-9_.]+$/;
|
|
163
|
-
const ExecuteActionInput = z.object({
|
|
164
|
-
actionName: z
|
|
165
|
-
.string()
|
|
166
|
-
.min(1)
|
|
167
|
-
.regex(SAFE_API_NAME, "actionName must contain only letters, digits, underscores, or dots"),
|
|
168
|
-
parameters: z.record(z.unknown()).optional().default({}),
|
|
169
|
-
});
|
|
170
|
-
const ExecuteFunctionInput = z.object({
|
|
171
|
-
functionName: z
|
|
172
|
-
.string()
|
|
173
|
-
.min(1)
|
|
174
|
-
.regex(SAFE_API_NAME, "functionName must contain only letters, digits, underscores, or dots"),
|
|
175
|
-
parameters: z.record(z.string()).optional().default({}),
|
|
176
|
-
});
|
|
177
|
-
const ExecuteBoundActionInput = z.object({
|
|
178
|
-
entitySetName: safeEntitySetName,
|
|
179
|
-
id: z.string().uuid(),
|
|
180
|
-
actionName: z
|
|
181
|
-
.string()
|
|
182
|
-
.min(1)
|
|
183
|
-
.regex(SAFE_API_NAME, "actionName must contain only letters, digits, underscores, or dots"),
|
|
184
|
-
parameters: z.record(z.unknown()).optional().default({}),
|
|
185
|
-
});
|
|
186
|
-
const RetrieveDependenciesForDeleteInput = z.object({
|
|
187
|
-
componentType: z.number().int().positive(),
|
|
188
|
-
objectId: z.string().uuid(),
|
|
189
|
-
});
|
|
190
|
-
const VALID_COMPONENT_TYPES = [
|
|
191
|
-
"Workflow",
|
|
192
|
-
"Flow",
|
|
193
|
-
"BusinessRule",
|
|
194
|
-
"Action",
|
|
195
|
-
"BusinessProcessFlow",
|
|
196
|
-
"Plugin",
|
|
197
|
-
"CustomAPI",
|
|
198
|
-
];
|
|
199
|
-
const ListTableDependenciesInput = z.object({
|
|
200
|
-
tableName: z.string().min(1),
|
|
201
|
-
componentType: z.array(z.enum(VALID_COMPONENT_TYPES)).optional(),
|
|
202
|
-
});
|
|
203
|
-
const ExecuteBoundFunctionInput = z.object({
|
|
204
|
-
entitySetName: safeEntitySetName,
|
|
205
|
-
id: z.string().uuid(),
|
|
206
|
-
functionName: z
|
|
207
|
-
.string()
|
|
208
|
-
.min(1)
|
|
209
|
-
.regex(SAFE_API_NAME, "functionName must contain only letters, digits, underscores, or dots"),
|
|
210
|
-
parameters: z.record(z.string()).optional().default({}),
|
|
211
|
-
});
|
|
212
|
-
export async function handleActionTool(name, args, client) {
|
|
213
|
-
switch (name) {
|
|
214
|
-
case "dataverse_execute_action": {
|
|
215
|
-
const { actionName, parameters } = ExecuteActionInput.parse(args);
|
|
216
|
-
const result = await client.executeAction(actionName, parameters);
|
|
217
|
-
return formatData(`Executed unbound action ${actionName}`, result, [
|
|
218
|
-
"Use dataverse_list_custom_actions to discover available actions",
|
|
219
|
-
]);
|
|
220
|
-
}
|
|
221
|
-
case "dataverse_execute_function": {
|
|
222
|
-
const { functionName, parameters } = ExecuteFunctionInput.parse(args);
|
|
223
|
-
const result = await client.executeFunction(functionName, parameters);
|
|
224
|
-
return formatData(`Executed function ${functionName}`, result, [
|
|
225
|
-
"Functions are read-only operations",
|
|
226
|
-
]);
|
|
227
|
-
}
|
|
228
|
-
case "dataverse_execute_bound_action": {
|
|
229
|
-
const { entitySetName, id, actionName, parameters } = ExecuteBoundActionInput.parse(args);
|
|
230
|
-
const result = await client.executeBoundAction(entitySetName, id, actionName, parameters);
|
|
231
|
-
return formatData(`Executed bound action ${actionName} on ${entitySetName}(${id})`, result);
|
|
232
|
-
}
|
|
233
|
-
case "dataverse_list_dependencies": {
|
|
234
|
-
const { tableName, componentType } = ListTableDependenciesInput.parse(args);
|
|
235
|
-
const result = await client.listTableDependencies(tableName, componentType);
|
|
236
|
-
const typedDeps = result;
|
|
237
|
-
return formatData(`${typedDeps.count} dependencies found for component`, result, ["Use this information before deleting or modifying the component"]);
|
|
238
|
-
}
|
|
239
|
-
case "dataverse_retrieve_dependencies_for_delete": {
|
|
240
|
-
const { componentType, objectId } = RetrieveDependenciesForDeleteInput.parse(args);
|
|
241
|
-
const result = await client.listDependencies(componentType, objectId);
|
|
242
|
-
const items = Array.isArray(result)
|
|
243
|
-
? result
|
|
244
|
-
: (result.value ?? [result]);
|
|
245
|
-
return formatData(`${items.length} dependencies found`, result, ["Review dependencies before deleting the component"]);
|
|
246
|
-
}
|
|
247
|
-
case "dataverse_execute_bound_function": {
|
|
248
|
-
const { entitySetName, id, functionName, parameters } = ExecuteBoundFunctionInput.parse(args);
|
|
249
|
-
const result = await client.executeBoundFunction(entitySetName, id, functionName, parameters);
|
|
250
|
-
return formatData(`Executed bound function ${functionName} on ${entitySetName}(${id})`, result);
|
|
251
|
-
}
|
|
252
|
-
default:
|
|
253
|
-
throw new Error(`Unknown action tool: ${name}`);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
//# sourceMappingURL=actions.tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.tools.js","sourceRoot":"","sources":["../../src/tools/actions.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,mnBAAmnB;QACrnB,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8CAA8C;iBAC5D;gBACD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;aACjE;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SACzB;QACD,WAA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ataverseAdvancedClient } from "../dataverse/dataverse-client-advanced.js";
|
|
2
|
-
export declare const annotationTools: ({
|
|
3
|
-
name: string;
|
|
4
|
-
description: string;
|
|
5
|
-
inputSchema: {
|
|
6
|
-
type: "object";
|
|
7
|
-
properties: {
|
|
8
|
-
recordId: {
|
|
9
|
-
type: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
includeContent: {
|
|
13
|
-
type: string;
|
|
14
|
-
description: string;
|
|
15
|
-
default: boolean;
|
|
16
|
-
};
|
|
17
|
-
top: {
|
|
18
|
-
type: string;
|
|
19
|
-
description: string;
|
|
20
|
-
default: number;
|
|
21
|
-
};
|
|
22
|
-
mimeTypeFilter: {
|
|
23
|
-
type: string;
|
|
24
|
-
description: string;
|
|
25
|
-
};
|
|
26
|
-
entitySetName?: never;
|
|
27
|
-
notetext?: never;
|
|
28
|
-
subject?: never;
|
|
29
|
-
filename?: never;
|
|
30
|
-
mimetype?: never;
|
|
31
|
-
documentbody?: never;
|
|
32
|
-
};
|
|
33
|
-
required: string[];
|
|
34
|
-
};
|
|
35
|
-
annotations: {
|
|
36
|
-
readOnlyHint: boolean;
|
|
37
|
-
destructiveHint: boolean;
|
|
38
|
-
idempotentHint: boolean;
|
|
39
|
-
openWorldHint: boolean;
|
|
40
|
-
};
|
|
41
|
-
} | {
|
|
42
|
-
name: string;
|
|
43
|
-
description: string;
|
|
44
|
-
inputSchema: {
|
|
45
|
-
type: "object";
|
|
46
|
-
properties: {
|
|
47
|
-
recordId: {
|
|
48
|
-
type: string;
|
|
49
|
-
description: string;
|
|
50
|
-
};
|
|
51
|
-
entitySetName: {
|
|
52
|
-
type: string;
|
|
53
|
-
description: string;
|
|
54
|
-
};
|
|
55
|
-
notetext: {
|
|
56
|
-
type: string;
|
|
57
|
-
description: string;
|
|
58
|
-
};
|
|
59
|
-
subject: {
|
|
60
|
-
type: string;
|
|
61
|
-
description: string;
|
|
62
|
-
};
|
|
63
|
-
filename: {
|
|
64
|
-
type: string;
|
|
65
|
-
description: string;
|
|
66
|
-
};
|
|
67
|
-
mimetype: {
|
|
68
|
-
type: string;
|
|
69
|
-
description: string;
|
|
70
|
-
};
|
|
71
|
-
documentbody: {
|
|
72
|
-
type: string;
|
|
73
|
-
description: string;
|
|
74
|
-
};
|
|
75
|
-
includeContent?: never;
|
|
76
|
-
top?: never;
|
|
77
|
-
mimeTypeFilter?: never;
|
|
78
|
-
};
|
|
79
|
-
required: string[];
|
|
80
|
-
};
|
|
81
|
-
annotations: {
|
|
82
|
-
readOnlyHint: boolean;
|
|
83
|
-
destructiveHint: boolean;
|
|
84
|
-
idempotentHint: boolean;
|
|
85
|
-
openWorldHint: boolean;
|
|
86
|
-
};
|
|
87
|
-
})[];
|
|
88
|
-
export declare function handleAnnotationTool(name: string, args: unknown, client: DataverseAdvancedClient): Promise<{
|
|
89
|
-
content: Array<{
|
|
90
|
-
type: "text";
|
|
91
|
-
text: string;
|
|
92
|
-
}>;
|
|
93
|
-
}>;
|
|
94
|
-
//# sourceMappingURL=annotations.tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.tools.d.ts","sourceRoot":"","sources":["../../src/tools/annotations.tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAqCzF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoF3B,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAoI7D"}
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { esc } from "../dataverse/dataverse-client.utils.js";
|
|
3
|
-
import { formatData, formatPrerequisiteError } from "./output.utils.js";
|
|
4
|
-
import { safeEntitySetName } from "./validation.utils.js";
|
|
5
|
-
const GetAnnotationsInput = z.object({
|
|
6
|
-
recordId: z.string().uuid(),
|
|
7
|
-
includeContent: z.boolean().optional().default(false),
|
|
8
|
-
top: z.number().int().positive().max(100).optional().default(20),
|
|
9
|
-
mimeTypeFilter: z.string().optional(),
|
|
10
|
-
});
|
|
11
|
-
const CreateAnnotationInput = z
|
|
12
|
-
.object({
|
|
13
|
-
recordId: z.string().uuid(),
|
|
14
|
-
entitySetName: safeEntitySetName,
|
|
15
|
-
notetext: z.string().optional(),
|
|
16
|
-
subject: z.string().optional(),
|
|
17
|
-
filename: z.string().optional(),
|
|
18
|
-
mimetype: z.string().optional(),
|
|
19
|
-
documentbody: z.string().optional(),
|
|
20
|
-
})
|
|
21
|
-
.refine((data) => Boolean(data.notetext) || Boolean(data.documentbody), {
|
|
22
|
-
message: "At least one of notetext or documentbody is required",
|
|
23
|
-
});
|
|
24
|
-
function logicalNameFromEntitySet(entitySetName) {
|
|
25
|
-
const irregulars = {
|
|
26
|
-
opportunities: "opportunity",
|
|
27
|
-
territories: "territory",
|
|
28
|
-
categories: "category",
|
|
29
|
-
queues: "queue",
|
|
30
|
-
activities: "activitypointer",
|
|
31
|
-
};
|
|
32
|
-
return irregulars[entitySetName] ?? entitySetName.replace(/s$/, "");
|
|
33
|
-
}
|
|
34
|
-
export const annotationTools = [
|
|
35
|
-
{
|
|
36
|
-
name: "dataverse_get_annotations",
|
|
37
|
-
description: "Retrieves notes and file attachments (annotations) linked to a Dataverse record. Returns note text, file metadata (name, size, MIME type), owner, and timestamps. Set includeContent=true to also retrieve base64 file content (warning: can be very large). WHEN TO USE: Retrieving notes or file attachments linked to a specific record. BEST PRACTICES: Avoid includeContent=true unless you need file data — base64 payloads can be very large. WORKFLOW: file_operations.",
|
|
38
|
-
inputSchema: {
|
|
39
|
-
type: "object",
|
|
40
|
-
properties: {
|
|
41
|
-
recordId: {
|
|
42
|
-
type: "string",
|
|
43
|
-
description: "The parent record's GUID",
|
|
44
|
-
},
|
|
45
|
-
includeContent: {
|
|
46
|
-
type: "boolean",
|
|
47
|
-
description: "If true, include documentbody (base64). WARNING: can be very large.",
|
|
48
|
-
default: false,
|
|
49
|
-
},
|
|
50
|
-
top: {
|
|
51
|
-
type: "number",
|
|
52
|
-
description: "Maximum number of annotations to return (default 20, max 100)",
|
|
53
|
-
default: 20,
|
|
54
|
-
},
|
|
55
|
-
mimeTypeFilter: {
|
|
56
|
-
type: "string",
|
|
57
|
-
description: 'Filter by MIME type (e.g. "application/pdf")',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
required: ["recordId"],
|
|
61
|
-
},
|
|
62
|
-
annotations: {
|
|
63
|
-
readOnlyHint: true,
|
|
64
|
-
destructiveHint: false,
|
|
65
|
-
idempotentHint: true,
|
|
66
|
-
openWorldHint: true,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: "dataverse_create_annotation",
|
|
71
|
-
description: "Creates a note or file attachment (annotation) linked to a Dataverse record. Provide notetext for a text note, documentbody (base64) for a file attachment, or both. The parent record is identified by entitySetName and recordId. WHEN TO USE: Adding a text note or file attachment to an existing record. BEST PRACTICES: Provide filename and mimetype when attaching files; at least notetext or documentbody is required. WORKFLOW: file_operations.",
|
|
72
|
-
inputSchema: {
|
|
73
|
-
type: "object",
|
|
74
|
-
properties: {
|
|
75
|
-
recordId: {
|
|
76
|
-
type: "string",
|
|
77
|
-
description: "The parent record's GUID",
|
|
78
|
-
},
|
|
79
|
-
entitySetName: {
|
|
80
|
-
type: "string",
|
|
81
|
-
description: 'The OData entity set name of the parent record (e.g., "accounts", "contacts")',
|
|
82
|
-
},
|
|
83
|
-
notetext: {
|
|
84
|
-
type: "string",
|
|
85
|
-
description: "Text content of the note",
|
|
86
|
-
},
|
|
87
|
-
subject: {
|
|
88
|
-
type: "string",
|
|
89
|
-
description: "Subject/title of the note",
|
|
90
|
-
},
|
|
91
|
-
filename: {
|
|
92
|
-
type: "string",
|
|
93
|
-
description: "File name (required when attaching a file)",
|
|
94
|
-
},
|
|
95
|
-
mimetype: {
|
|
96
|
-
type: "string",
|
|
97
|
-
description: 'MIME type of the file (e.g., "application/pdf")',
|
|
98
|
-
},
|
|
99
|
-
documentbody: {
|
|
100
|
-
type: "string",
|
|
101
|
-
description: "Base64-encoded file content",
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
required: ["recordId", "entitySetName"],
|
|
105
|
-
},
|
|
106
|
-
annotations: {
|
|
107
|
-
readOnlyHint: false,
|
|
108
|
-
destructiveHint: false,
|
|
109
|
-
idempotentHint: false,
|
|
110
|
-
openWorldHint: true,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
];
|
|
114
|
-
export async function handleAnnotationTool(name, args, client) {
|
|
115
|
-
switch (name) {
|
|
116
|
-
case "dataverse_get_annotations": {
|
|
117
|
-
const params = GetAnnotationsInput.parse(args);
|
|
118
|
-
const selectFields = [
|
|
119
|
-
"annotationid",
|
|
120
|
-
"subject",
|
|
121
|
-
"notetext",
|
|
122
|
-
"filename",
|
|
123
|
-
"filesize",
|
|
124
|
-
"mimetype",
|
|
125
|
-
"isdocument",
|
|
126
|
-
"createdon",
|
|
127
|
-
"modifiedon",
|
|
128
|
-
"_ownerid_value",
|
|
129
|
-
];
|
|
130
|
-
if (params.includeContent) {
|
|
131
|
-
selectFields.push("documentbody");
|
|
132
|
-
}
|
|
133
|
-
const filterParts = [`_objectid_value eq ${params.recordId}`];
|
|
134
|
-
if (params.mimeTypeFilter) {
|
|
135
|
-
filterParts.push(`mimetype eq '${esc(params.mimeTypeFilter)}'`);
|
|
136
|
-
}
|
|
137
|
-
const response = await client.query("annotations", {
|
|
138
|
-
select: selectFields,
|
|
139
|
-
filter: filterParts.join(" and "),
|
|
140
|
-
orderby: "createdon desc",
|
|
141
|
-
top: params.top,
|
|
142
|
-
});
|
|
143
|
-
const rows = (response.value ?? []);
|
|
144
|
-
const annotations = rows.map((row) => {
|
|
145
|
-
const result = {
|
|
146
|
-
id: row["annotationid"] ?? "",
|
|
147
|
-
subject: row["subject"] ?? null,
|
|
148
|
-
noteText: row["notetext"] ?? null,
|
|
149
|
-
isDocument: row["isdocument"] === true,
|
|
150
|
-
createdOn: row["createdon"] ?? "",
|
|
151
|
-
modifiedOn: row["modifiedon"] ?? "",
|
|
152
|
-
owner: row["_ownerid_value"] ?? null,
|
|
153
|
-
};
|
|
154
|
-
if (row["isdocument"] === true) {
|
|
155
|
-
result.fileName = row["filename"] ?? null;
|
|
156
|
-
result.fileSize = row["filesize"] ?? null;
|
|
157
|
-
result.mimeType = row["mimetype"] ?? null;
|
|
158
|
-
}
|
|
159
|
-
if (params.includeContent && row["documentbody"]) {
|
|
160
|
-
result.documentBody = row["documentbody"];
|
|
161
|
-
}
|
|
162
|
-
return result;
|
|
163
|
-
});
|
|
164
|
-
return formatData(`${annotations.length} annotations found for record ${params.recordId}`, {
|
|
165
|
-
recordId: params.recordId,
|
|
166
|
-
annotations,
|
|
167
|
-
count: annotations.length,
|
|
168
|
-
}, ["Use dataverse_create_annotation to add a note or attachment"]);
|
|
169
|
-
}
|
|
170
|
-
case "dataverse_create_annotation": {
|
|
171
|
-
const params = CreateAnnotationInput.parse(args);
|
|
172
|
-
const entityLogicalName = logicalNameFromEntitySet(params.entitySetName);
|
|
173
|
-
const data = {
|
|
174
|
-
[`objectid_${entityLogicalName}@odata.bind`]: `/${params.entitySetName}(${params.recordId})`,
|
|
175
|
-
objecttypecode: entityLogicalName,
|
|
176
|
-
};
|
|
177
|
-
if (params.notetext !== undefined)
|
|
178
|
-
data["notetext"] = params.notetext;
|
|
179
|
-
if (params.subject !== undefined)
|
|
180
|
-
data["subject"] = params.subject;
|
|
181
|
-
if (params.filename !== undefined)
|
|
182
|
-
data["filename"] = params.filename;
|
|
183
|
-
if (params.mimetype !== undefined)
|
|
184
|
-
data["mimetype"] = params.mimetype;
|
|
185
|
-
if (params.documentbody !== undefined) {
|
|
186
|
-
data["documentbody"] = params.documentbody;
|
|
187
|
-
data["isdocument"] = true;
|
|
188
|
-
}
|
|
189
|
-
let annotationId;
|
|
190
|
-
try {
|
|
191
|
-
annotationId = await client.createRecord("annotations", data);
|
|
192
|
-
}
|
|
193
|
-
catch (err) {
|
|
194
|
-
const msg = String(err);
|
|
195
|
-
if (msg.includes("0x80048d19") ||
|
|
196
|
-
(msg.includes("objectid_") && msg.includes("undeclared"))) {
|
|
197
|
-
return formatPrerequisiteError({
|
|
198
|
-
type: "feature_disabled",
|
|
199
|
-
feature: "Notes (HasNotes)",
|
|
200
|
-
cannotProceedBecause: `The table '${entityLogicalName}' does not have Notes enabled (HasNotes=false), so annotations cannot be created.`,
|
|
201
|
-
adminPortal: "Power Apps Maker Portal",
|
|
202
|
-
steps: [
|
|
203
|
-
`Open Power Apps maker portal (make.powerapps.com)`,
|
|
204
|
-
`Navigate to Tables → search for '${entityLogicalName}'`,
|
|
205
|
-
`Open the table → click Properties or Settings`,
|
|
206
|
-
`Enable "Notes (includes file attachments)"`,
|
|
207
|
-
`Save the table, then publish customizations`,
|
|
208
|
-
],
|
|
209
|
-
fixableViaToolName: "dataverse_update_entity",
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
throw err;
|
|
213
|
-
}
|
|
214
|
-
return formatData(`Created annotation ${annotationId}`, {
|
|
215
|
-
created: true,
|
|
216
|
-
annotationId,
|
|
217
|
-
parentRecordId: params.recordId,
|
|
218
|
-
entitySetName: params.entitySetName,
|
|
219
|
-
}, ["Use dataverse_get_annotations to list all notes for this record"]);
|
|
220
|
-
}
|
|
221
|
-
default:
|
|
222
|
-
throw new Error(`Unknown annotation tool: ${name}`);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
//# sourceMappingURL=annotations.tools.js.map
|
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C;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { DataverseAdvancedClient } from "../dataverse/dataverse-client-advanced.js";
|
|
2
|
-
export declare const auditTools: {
|
|
3
|
-
name: string;
|
|
4
|
-
description: string;
|
|
5
|
-
inputSchema: {
|
|
6
|
-
type: "object";
|
|
7
|
-
properties: {
|
|
8
|
-
recordId: {
|
|
9
|
-
type: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
entityLogicalName: {
|
|
13
|
-
type: string;
|
|
14
|
-
description: string;
|
|
15
|
-
};
|
|
16
|
-
userId: {
|
|
17
|
-
type: string;
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
fromDate: {
|
|
21
|
-
type: string;
|
|
22
|
-
description: string;
|
|
23
|
-
};
|
|
24
|
-
top: {
|
|
25
|
-
type: string;
|
|
26
|
-
description: string;
|
|
27
|
-
};
|
|
28
|
-
operations: {
|
|
29
|
-
type: string;
|
|
30
|
-
items: {
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
description: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
required: never[];
|
|
37
|
-
};
|
|
38
|
-
annotations: {
|
|
39
|
-
readOnlyHint: boolean;
|
|
40
|
-
destructiveHint: boolean;
|
|
41
|
-
idempotentHint: boolean;
|
|
42
|
-
openWorldHint: boolean;
|
|
43
|
-
};
|
|
44
|
-
}[];
|
|
45
|
-
export declare function handleAuditTool(name: string, args: unknown, client: DataverseAdvancedClient): Promise<{
|
|
46
|
-
content: Array<{
|
|
47
|
-
type: "text";
|
|
48
|
-
text: string;
|
|
49
|
-
}>;
|
|
50
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=audit.tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"audit.tools.d.ts","sourceRoot":"","sources":["../../src/tools/audit.tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAuBzF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDtB,CAAC;AAoEF,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA4E7D"}
|