@servicenow/sdk-build-plugins 2.0.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/AttachmentPlugin.d.ts +253 -0
- package/dist/AttachmentPlugin.js +216 -0
- package/dist/AttachmentPlugin.js.map +1 -0
- package/dist/BusinessRulePlugin.d.ts +56 -0
- package/dist/BusinessRulePlugin.js +171 -0
- package/dist/BusinessRulePlugin.js.map +1 -0
- package/dist/CrossScopePrivilegePlugin.d.ts +22 -0
- package/dist/CrossScopePrivilegePlugin.js +42 -0
- package/dist/CrossScopePrivilegePlugin.js.map +1 -0
- package/dist/DefaultPlugin.d.ts +71 -0
- package/dist/DefaultPlugin.js +238 -0
- package/dist/DefaultPlugin.js.map +1 -0
- package/dist/IdPlugin.d.ts +17 -0
- package/dist/IdPlugin.js +45 -0
- package/dist/IdPlugin.js.map +1 -0
- package/dist/ListPlugin.d.ts +91 -0
- package/dist/ListPlugin.js +398 -0
- package/dist/ListPlugin.js.map +1 -0
- package/dist/PropertyPlugin.d.ts +122 -0
- package/dist/PropertyPlugin.js +165 -0
- package/dist/PropertyPlugin.js.map +1 -0
- package/dist/ScriptTemplatePlugin.d.ts +31 -0
- package/dist/ScriptTemplatePlugin.js +208 -0
- package/dist/ScriptTemplatePlugin.js.map +1 -0
- package/dist/UserPreferencePlugin.d.ts +16 -0
- package/dist/UserPreferencePlugin.js +30 -0
- package/dist/UserPreferencePlugin.js.map +1 -0
- package/dist/aclAndRole/AclPlugin.d.ts +117 -0
- package/dist/aclAndRole/AclPlugin.js +285 -0
- package/dist/aclAndRole/AclPlugin.js.map +1 -0
- package/dist/aclAndRole/RolePlugin.d.ts +58 -0
- package/dist/aclAndRole/RolePlugin.js +152 -0
- package/dist/aclAndRole/RolePlugin.js.map +1 -0
- package/dist/aclAndRole/Util.d.ts +3 -0
- package/dist/aclAndRole/Util.js +106 -0
- package/dist/aclAndRole/Util.js.map +1 -0
- package/dist/app/ApplicationMenuPlugin.d.ts +32 -0
- package/dist/app/ApplicationMenuPlugin.js +106 -0
- package/dist/app/ApplicationMenuPlugin.js.map +1 -0
- package/dist/atf/ATFComposer.d.ts +492 -0
- package/dist/atf/ATFComposer.js +2717 -0
- package/dist/atf/ATFComposer.js.map +1 -0
- package/dist/atf/TestPlugin.d.ts +31 -0
- package/dist/atf/TestPlugin.js +95 -0
- package/dist/atf/TestPlugin.js.map +1 -0
- package/dist/atf/index.d.ts +1 -0
- package/dist/atf/index.js +9 -0
- package/dist/atf/index.js.map +1 -0
- package/dist/db/ColumnPlugins.d.ts +278 -0
- package/dist/db/ColumnPlugins.js +112 -0
- package/dist/db/ColumnPlugins.js.map +1 -0
- package/dist/db/RecordPlugin.d.ts +208 -0
- package/dist/db/RecordPlugin.js +287 -0
- package/dist/db/RecordPlugin.js.map +1 -0
- package/dist/db/TablePlugin.d.ts +742 -0
- package/dist/db/TablePlugin.js +1249 -0
- package/dist/db/TablePlugin.js.map +1 -0
- package/dist/db/index.d.ts +3 -0
- package/dist/db/index.js +27 -0
- package/dist/db/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.d.ts +12 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.js +371 -0
- package/dist/scriptedRESTAPI/RESTDeserializationUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.d.ts +15 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.js +177 -0
- package/dist/scriptedRESTAPI/RESTSerializationUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.d.ts +144 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.js +318 -0
- package/dist/scriptedRESTAPI/RestApiPlugin.js.map +1 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.d.ts +190 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.js +53 -0
- package/dist/scriptedRESTAPI/RestSchemaUtils.js.map +1 -0
- package/dist/scriptedRESTAPI/RestUtils.d.ts +75 -0
- package/dist/scriptedRESTAPI/RestUtils.js +469 -0
- package/dist/scriptedRESTAPI/RestUtils.js.map +1 -0
- package/dist/scripts/ClientScriptPlugin.d.ts +43 -0
- package/dist/scripts/ClientScriptPlugin.js +190 -0
- package/dist/scripts/ClientScriptPlugin.js.map +1 -0
- package/dist/scripts/scriptUtils.d.ts +15 -0
- package/dist/scripts/scriptUtils.js +83 -0
- package/dist/scripts/scriptUtils.js.map +1 -0
- package/dist/uxf/ExperiencePlugin.d.ts +22 -0
- package/dist/uxf/ExperiencePlugin.js +55 -0
- package/dist/uxf/ExperiencePlugin.js.map +1 -0
- package/dist/uxf/RoutesPlugin.d.ts +22 -0
- package/dist/uxf/RoutesPlugin.js +176 -0
- package/dist/uxf/RoutesPlugin.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.d.ts +4 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.js +65 -0
- package/dist/uxf/UxfFormulaParser/cleanUxValue.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.d.ts +189 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.js +158 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/api.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.d.ts +13 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +604 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.d.ts +12 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/grammarParser.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.d.ts +31 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +64 -0
- package/dist/uxf/UxfFormulaParser/grammerParser/spanHelpers.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/index.d.ts +3 -0
- package/dist/uxf/UxfFormulaParser/index.js +11 -0
- package/dist/uxf/UxfFormulaParser/index.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/parser.d.ts +8 -0
- package/dist/uxf/UxfFormulaParser/parser.js +87 -0
- package/dist/uxf/UxfFormulaParser/parser.js.map +1 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.d.ts +8 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js +17 -0
- package/dist/uxf/UxfFormulaParser/utils/getErrorMsg.js.map +1 -0
- package/dist/uxf/constants.d.ts +2 -0
- package/dist/uxf/constants.js +8 -0
- package/dist/uxf/constants.js.map +1 -0
- package/dist/uxf/index.d.ts +2 -0
- package/dist/uxf/index.js +11 -0
- package/dist/uxf/index.js.map +1 -0
- package/dist/uxf/tectonicIdGenerator.d.ts +12 -0
- package/dist/uxf/tectonicIdGenerator.js +102 -0
- package/dist/uxf/tectonicIdGenerator.js.map +1 -0
- package/license +9 -0
- package/package.json +42 -0
- package/src/AttachmentPlugin.ts +262 -0
- package/src/BusinessRulePlugin.ts +251 -0
- package/src/CrossScopePrivilegePlugin.ts +54 -0
- package/src/DefaultPlugin.ts +272 -0
- package/src/IdPlugin.ts +47 -0
- package/src/ListPlugin.ts +497 -0
- package/src/PropertyPlugin.ts +218 -0
- package/src/ScriptTemplatePlugin.ts +223 -0
- package/src/UserPreferencePlugin.ts +36 -0
- package/src/aclAndRole/AclPlugin.ts +410 -0
- package/src/aclAndRole/RolePlugin.ts +225 -0
- package/src/aclAndRole/Util.ts +104 -0
- package/src/app/ApplicationMenuPlugin.ts +158 -0
- package/src/atf/ATFComposer.ts +3356 -0
- package/src/atf/TestPlugin.ts +119 -0
- package/src/atf/index.ts +1 -0
- package/src/db/ColumnPlugins.ts +117 -0
- package/src/db/RecordPlugin.ts +391 -0
- package/src/db/TablePlugin.ts +1581 -0
- package/src/db/index.ts +3 -0
- package/src/index.ts +16 -0
- package/src/scriptedRESTAPI/RESTDeserializationUtils.ts +410 -0
- package/src/scriptedRESTAPI/RESTSerializationUtils.ts +227 -0
- package/src/scriptedRESTAPI/RestApiPlugin.ts +438 -0
- package/src/scriptedRESTAPI/RestSchemaUtils.ts +72 -0
- package/src/scriptedRESTAPI/RestUtils.ts +507 -0
- package/src/scripts/ClientScriptPlugin.ts +251 -0
- package/src/scripts/scriptUtils.ts +81 -0
- package/src/uxf/ExperiencePlugin.ts +64 -0
- package/src/uxf/RoutesPlugin.ts +215 -0
- package/src/uxf/UxfFormulaParser/cleanUxValue.ts +73 -0
- package/src/uxf/UxfFormulaParser/grammerParser/api.js +166 -0
- package/src/uxf/UxfFormulaParser/grammerParser/clientTransformMap.js +606 -0
- package/src/uxf/UxfFormulaParser/grammerParser/grammarParser.js +551 -0
- package/src/uxf/UxfFormulaParser/grammerParser/spanHelpers.js +65 -0
- package/src/uxf/UxfFormulaParser/index.ts +4 -0
- package/src/uxf/UxfFormulaParser/parser.ts +64 -0
- package/src/uxf/UxfFormulaParser/utils/getErrorMsg.ts +13 -0
- package/src/uxf/constants.ts +4 -0
- package/src/uxf/index.ts +2 -0
- package/src/uxf/tectonicIdGenerator.ts +81 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { SysAttachmentConfig } from '@servicenow/sdk-core/runtime/sys';
|
|
3
|
+
import { SourceFile } from 'ts-morph';
|
|
4
|
+
import { Diagnostic } from '@servicenow/sdk-project';
|
|
5
|
+
export declare const AttachmentPlugin: {
|
|
6
|
+
readonly name: "Attachment";
|
|
7
|
+
readonly ownedTables: {
|
|
8
|
+
readonly sys_attachment: {
|
|
9
|
+
readonly diagnosticLevel: Diagnostic.Level.Warn;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly extractors: {
|
|
13
|
+
readonly entity: {
|
|
14
|
+
readonly CallExpression: (node: import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").ExtractionResult<import("@servicenow/sdk-build-core").EntityData<SysAttachmentConfig>>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly composers: {
|
|
18
|
+
readonly entity: {
|
|
19
|
+
readonly attachment: (entity: import("@servicenow/sdk-build-core").EntityData<Record<string, unknown>>) => {
|
|
20
|
+
kind: string;
|
|
21
|
+
node: import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression> | import("ts-morph").Node<import("ts-morph").ts.EndOfFileToken> | import("ts-morph").TypeAliasDeclaration | import("ts-morph").TypeReferenceNode | import("ts-morph").TypeLiteralNode | import("ts-morph").PropertySignature | import("ts-morph").TupleTypeNode | import("ts-morph").FunctionExpression | import("ts-morph").FunctionDeclaration | import("ts-morph").ArrayLiteralExpression | import("ts-morph").StringLiteral | import("ts-morph").NumericLiteral | import("ts-morph").TrueLiteral | import("ts-morph").FalseLiteral | import("ts-morph").Identifier | SourceFile | import("ts-morph").VariableDeclaration | import("ts-morph").ClassDeclaration | import("ts-morph").ExportDeclaration | import("ts-morph").ObjectLiteralExpression | import("ts-morph").AsExpression | import("ts-morph").ComputedPropertyName | import("ts-morph").PropertyAssignment | import("ts-morph").ShorthandPropertyAssignment | import("ts-morph").PropertyAccessExpression<import("ts-morph").ts.PropertyAccessExpression> | import("ts-morph").NoSubstitutionTemplateLiteral | import("ts-morph").ExpressionStatement | import("ts-morph").TaggedTemplateExpression | import("ts-morph").ExportAssignment | import("ts-morph").ElementAccessExpression<import("ts-morph").ts.ElementAccessExpression> | import("ts-morph").TemplateExpression | import("ts-morph").ImportClause | import("ts-morph").ImportSpecifier | import("ts-morph").ImportDeclaration | import("ts-morph").NamedImports | import("ts-morph").VariableStatement | import("ts-morph").VariableDeclarationList | import("ts-morph").Node<import("ts-morph").ts.PlusToken> | import("ts-morph").Node<import("ts-morph").ts.ExportKeyword> | import("ts-morph").Node<import("ts-morph").ts.KeywordTypeNode<import("ts-morph").ts.SyntaxKind.AnyKeyword>> | import("ts-morph").ModuleDeclaration | import("ts-morph").ModuleBlock | import("ts-morph").Block | import("ts-morph").ParameterDeclaration | import("ts-morph").Node<import("ts-morph").ts.EqualsGreaterThanToken> | import("ts-morph").ArrowFunction | import("ts-morph").TemplateHead | import("ts-morph").TemplateMiddle | import("ts-morph").TemplateSpan | import("ts-morph").TemplateTail | import("ts-morph").PrefixUnaryExpression;
|
|
22
|
+
guid: string;
|
|
23
|
+
data: SysAttachmentConfig;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly xml: {
|
|
27
|
+
readonly record: (xml: import("@servicenow/sdk-build-core").XmlData<import("@servicenow/sdk-build-core").PrimitiveData>) => {
|
|
28
|
+
action: "INSERT_OR_UPDATE" | "DELETE" | "delete_multiple";
|
|
29
|
+
kind: string;
|
|
30
|
+
guid: string;
|
|
31
|
+
data: AttachmentEntityData;
|
|
32
|
+
} | undefined;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly generators: {
|
|
36
|
+
readonly attachment: (document: import("@servicenow/sdk-build-core").UnlinkedDocument<"attachment"> & import("@servicenow/sdk-build-core").Arranged, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").LinkedDocument<"attachment", import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>>;
|
|
37
|
+
};
|
|
38
|
+
readonly transformers: {
|
|
39
|
+
readonly attachment: {
|
|
40
|
+
readonly CallExpression: (document: import("@servicenow/sdk-build-core").Document<any, import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>> & {
|
|
41
|
+
entity?: import("@servicenow/sdk-build-core").EntityData;
|
|
42
|
+
node: import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>;
|
|
43
|
+
} & import("@servicenow/sdk-build-core").Arranged, context: import("@servicenow/sdk-build-core").Context) => boolean;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
readonly serializers: {
|
|
47
|
+
readonly attachment: (document: import("@servicenow/sdk-build-core").Document<"attachment"> & import("@servicenow/sdk-build-core").Arranged, context: import("@servicenow/sdk-build-core").Context) => {
|
|
48
|
+
name: `sys_attachment_${string}.xml`;
|
|
49
|
+
directory: "update";
|
|
50
|
+
content: any;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
declare const SysAttachmentSchema: z.ZodObject<{
|
|
55
|
+
'@_action': z.ZodUnion<[z.ZodLiteral<"INSERT_OR_UPDATE">, z.ZodLiteral<"DELETE">, z.ZodLiteral<"delete_multiple">]>;
|
|
56
|
+
sys_id: z.ZodEffects<z.ZodObject<{
|
|
57
|
+
'#text': z.ZodString;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
'#text': string;
|
|
60
|
+
}, {
|
|
61
|
+
'#text': string;
|
|
62
|
+
}>, string, {
|
|
63
|
+
'#text': string;
|
|
64
|
+
}>;
|
|
65
|
+
content_type: z.ZodEffects<z.ZodObject<{
|
|
66
|
+
'#text': z.ZodString;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
'#text': string;
|
|
69
|
+
}, {
|
|
70
|
+
'#text': string;
|
|
71
|
+
}>, string, {
|
|
72
|
+
'#text': string;
|
|
73
|
+
}>;
|
|
74
|
+
file_name: z.ZodEffects<z.ZodObject<{
|
|
75
|
+
'#text': z.ZodString;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
'#text': string;
|
|
78
|
+
}, {
|
|
79
|
+
'#text': string;
|
|
80
|
+
}>, string, {
|
|
81
|
+
'#text': string;
|
|
82
|
+
}>;
|
|
83
|
+
hash: z.ZodEffects<z.ZodObject<{
|
|
84
|
+
'#text': z.ZodString;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
'#text': string;
|
|
87
|
+
}, {
|
|
88
|
+
'#text': string;
|
|
89
|
+
}>, string, {
|
|
90
|
+
'#text': string;
|
|
91
|
+
}>;
|
|
92
|
+
table_name: z.ZodEffects<z.ZodObject<{
|
|
93
|
+
'#text': z.ZodString;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
'#text': string;
|
|
96
|
+
}, {
|
|
97
|
+
'#text': string;
|
|
98
|
+
}>, string, {
|
|
99
|
+
'#text': string;
|
|
100
|
+
}>;
|
|
101
|
+
table_sys_id: z.ZodEffects<z.ZodObject<{
|
|
102
|
+
'#text': z.ZodString;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
'#text': string;
|
|
105
|
+
}, {
|
|
106
|
+
'#text': string;
|
|
107
|
+
}>, string, {
|
|
108
|
+
'#text': string;
|
|
109
|
+
}>;
|
|
110
|
+
size_bytes: z.ZodEffects<z.ZodObject<{
|
|
111
|
+
'#text': z.ZodNumber;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
'#text': number;
|
|
114
|
+
}, {
|
|
115
|
+
'#text': number;
|
|
116
|
+
}>, number, {
|
|
117
|
+
'#text': number;
|
|
118
|
+
}>;
|
|
119
|
+
size_compressed: z.ZodEffects<z.ZodObject<{
|
|
120
|
+
'#text': z.ZodNumber;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
'#text': number;
|
|
123
|
+
}, {
|
|
124
|
+
'#text': number;
|
|
125
|
+
}>, number, {
|
|
126
|
+
'#text': number;
|
|
127
|
+
}>;
|
|
128
|
+
}, "strip", z.ZodIntersection<z.ZodObject<{
|
|
129
|
+
'#text': z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodUndefined]>;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
'#text'?: string | number | boolean | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
'#text'?: string | number | boolean | undefined;
|
|
134
|
+
}>, z.ZodRecord<z.ZodString, z.ZodAny>>, {
|
|
135
|
+
sys_id: string;
|
|
136
|
+
'@_action': "INSERT_OR_UPDATE" | "DELETE" | "delete_multiple";
|
|
137
|
+
content_type: string;
|
|
138
|
+
file_name: string;
|
|
139
|
+
hash: string;
|
|
140
|
+
table_name: string;
|
|
141
|
+
table_sys_id: string;
|
|
142
|
+
size_bytes: number;
|
|
143
|
+
size_compressed: number;
|
|
144
|
+
}, {
|
|
145
|
+
sys_id: {
|
|
146
|
+
'#text': string;
|
|
147
|
+
};
|
|
148
|
+
'@_action': "INSERT_OR_UPDATE" | "DELETE" | "delete_multiple";
|
|
149
|
+
content_type: {
|
|
150
|
+
'#text': string;
|
|
151
|
+
};
|
|
152
|
+
file_name: {
|
|
153
|
+
'#text': string;
|
|
154
|
+
};
|
|
155
|
+
hash: {
|
|
156
|
+
'#text': string;
|
|
157
|
+
};
|
|
158
|
+
table_name: {
|
|
159
|
+
'#text': string;
|
|
160
|
+
};
|
|
161
|
+
table_sys_id: {
|
|
162
|
+
'#text': string;
|
|
163
|
+
};
|
|
164
|
+
size_bytes: {
|
|
165
|
+
'#text': number;
|
|
166
|
+
};
|
|
167
|
+
size_compressed: {
|
|
168
|
+
'#text': number;
|
|
169
|
+
};
|
|
170
|
+
}>;
|
|
171
|
+
declare const SysAttachmentDocSchema: z.ZodObject<{
|
|
172
|
+
sys_id: z.ZodObject<{
|
|
173
|
+
'#text': z.ZodString;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
'#text': string;
|
|
176
|
+
}, {
|
|
177
|
+
'#text': string;
|
|
178
|
+
}>;
|
|
179
|
+
'@_action': z.ZodUnion<[z.ZodLiteral<"INSERT_OR_UPDATE">, z.ZodLiteral<"DELETE">, z.ZodLiteral<"delete_multiple">]>;
|
|
180
|
+
data: z.ZodEffects<z.ZodObject<{
|
|
181
|
+
'#text': z.ZodString;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
'#text': string;
|
|
184
|
+
}, {
|
|
185
|
+
'#text': string;
|
|
186
|
+
}>, string, {
|
|
187
|
+
'#text': string;
|
|
188
|
+
}>;
|
|
189
|
+
length: z.ZodEffects<z.ZodObject<{
|
|
190
|
+
'#text': z.ZodNumber;
|
|
191
|
+
}, "strip", z.ZodTypeAny, {
|
|
192
|
+
'#text': number;
|
|
193
|
+
}, {
|
|
194
|
+
'#text': number;
|
|
195
|
+
}>, number, {
|
|
196
|
+
'#text': number;
|
|
197
|
+
}>;
|
|
198
|
+
position: z.ZodEffects<z.ZodObject<{
|
|
199
|
+
'#text': z.ZodNumber;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
'#text': number;
|
|
202
|
+
}, {
|
|
203
|
+
'#text': number;
|
|
204
|
+
}>, number, {
|
|
205
|
+
'#text': number;
|
|
206
|
+
}>;
|
|
207
|
+
sys_attachment: z.ZodEffects<z.ZodObject<{
|
|
208
|
+
'#text': z.ZodString;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
'#text': string;
|
|
211
|
+
}, {
|
|
212
|
+
'#text': string;
|
|
213
|
+
}>, string, {
|
|
214
|
+
'#text': string;
|
|
215
|
+
}>;
|
|
216
|
+
}, "strip", z.ZodIntersection<z.ZodObject<{
|
|
217
|
+
'#text': z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodUndefined]>;
|
|
218
|
+
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
'#text'?: string | number | boolean | undefined;
|
|
220
|
+
}, {
|
|
221
|
+
'#text'?: string | number | boolean | undefined;
|
|
222
|
+
}>, z.ZodRecord<z.ZodString, z.ZodAny>>, {
|
|
223
|
+
length: number;
|
|
224
|
+
data: string;
|
|
225
|
+
sys_id: {
|
|
226
|
+
'#text': string;
|
|
227
|
+
};
|
|
228
|
+
'@_action': "INSERT_OR_UPDATE" | "DELETE" | "delete_multiple";
|
|
229
|
+
sys_attachment: string;
|
|
230
|
+
position: number;
|
|
231
|
+
}, {
|
|
232
|
+
length: {
|
|
233
|
+
'#text': number;
|
|
234
|
+
};
|
|
235
|
+
data: {
|
|
236
|
+
'#text': string;
|
|
237
|
+
};
|
|
238
|
+
sys_id: {
|
|
239
|
+
'#text': string;
|
|
240
|
+
};
|
|
241
|
+
'@_action': "INSERT_OR_UPDATE" | "DELETE" | "delete_multiple";
|
|
242
|
+
sys_attachment: {
|
|
243
|
+
'#text': string;
|
|
244
|
+
};
|
|
245
|
+
position: {
|
|
246
|
+
'#text': number;
|
|
247
|
+
};
|
|
248
|
+
}>;
|
|
249
|
+
type AttachmentEntityData = {
|
|
250
|
+
attachment: z.infer<typeof SysAttachmentSchema>;
|
|
251
|
+
attachmentDocs: Array<z.infer<typeof SysAttachmentDocSchema>>;
|
|
252
|
+
};
|
|
253
|
+
export {};
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.AttachmentPlugin = void 0;
|
|
27
|
+
const sdk_build_core_1 = require("@servicenow/sdk-build-core");
|
|
28
|
+
const zlib = __importStar(require("node:zlib"));
|
|
29
|
+
const path = __importStar(require("path"));
|
|
30
|
+
const crypto = __importStar(require("crypto"));
|
|
31
|
+
const RecordPlugin_1 = require("./db/RecordPlugin");
|
|
32
|
+
const z = __importStar(require("zod"));
|
|
33
|
+
const sys_1 = require("@servicenow/sdk-core/runtime/sys");
|
|
34
|
+
const sdk_project_1 = require("@servicenow/sdk-project");
|
|
35
|
+
exports.AttachmentPlugin = (0, sdk_build_core_1.Plugin)({
|
|
36
|
+
name: 'Attachment',
|
|
37
|
+
ownedTables: {
|
|
38
|
+
sys_attachment: { diagnosticLevel: sdk_project_1.Diagnostic.Level.Warn },
|
|
39
|
+
},
|
|
40
|
+
extractors: {
|
|
41
|
+
entity: {
|
|
42
|
+
CallExpression: (node, context) => {
|
|
43
|
+
return (0, sdk_build_core_1.extractCallExpression)(sys_1.SysAttachment, 'attachment', node, context, (attachment) => attachment.id);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
composers: {
|
|
48
|
+
entity: {
|
|
49
|
+
attachment(entity) {
|
|
50
|
+
return {
|
|
51
|
+
kind: 'attachment',
|
|
52
|
+
node: entity.getNode(),
|
|
53
|
+
guid: entity.getGuid(),
|
|
54
|
+
data: entity.getValue(),
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
xml: {
|
|
59
|
+
record(xml) {
|
|
60
|
+
const parseResult = AttachmentXmlSchema.safeParse(xml.data['record_update']);
|
|
61
|
+
if (!parseResult.success) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
const { sys_attachment, sys_attachment_doc } = parseResult.data;
|
|
65
|
+
const data = {
|
|
66
|
+
attachment: sys_attachment,
|
|
67
|
+
attachmentDocs: Array.isArray(sys_attachment_doc) ? sys_attachment_doc : [sys_attachment_doc],
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
action: sys_attachment['@_action'],
|
|
71
|
+
kind: 'attachment',
|
|
72
|
+
guid: sys_attachment.sys_id,
|
|
73
|
+
data,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
generators: {
|
|
79
|
+
attachment(document, context) {
|
|
80
|
+
return (0, sdk_build_core_1.linkDocument)(document, (0, sdk_build_core_1.generateCallExpression)(context, (0, sdk_build_core_1.getOrCreateEntitySourceFile)(context, (0, sdk_build_core_1.getSysUpdateName)(document, 'sys_attachment')), '@servicenow/sdk/core', sys_1.SysAttachment, {}));
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
transformers: {
|
|
84
|
+
attachment: {
|
|
85
|
+
CallExpression(document, context) {
|
|
86
|
+
const expressionName = (0, sdk_build_core_1.getCallExpressionName)(document.node);
|
|
87
|
+
if (expressionName !== sys_1.SysAttachment.name) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (document.action === 'DELETE') {
|
|
91
|
+
(0, sdk_build_core_1.removeNode)(document.node);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (document.action !== 'INSERT_OR_UPDATE') {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
const { attachment, attachmentDocs } = document.data;
|
|
98
|
+
(0, sdk_build_core_1.transformFunctionArguments)(document.node, sys_1.SysAttachment, {
|
|
99
|
+
id: document.guid,
|
|
100
|
+
fileName: attachment.file_name,
|
|
101
|
+
contentType: attachment.content_type,
|
|
102
|
+
filePath: `./${attachment.file_name}`,
|
|
103
|
+
tableName: attachment.table_name,
|
|
104
|
+
tableSysId: attachment.table_sys_id,
|
|
105
|
+
});
|
|
106
|
+
/**
|
|
107
|
+
* Attachments are gzip compressed and base64 encoded into multiple sys_attachment_doc chunks
|
|
108
|
+
* Rebuild the archive and decompress it to disk
|
|
109
|
+
*/
|
|
110
|
+
const dataBuffer = Buffer.alloc(attachment.size_compressed);
|
|
111
|
+
let position = 0;
|
|
112
|
+
attachmentDocs
|
|
113
|
+
.sort((a, b) => a.position - b.position)
|
|
114
|
+
.forEach((doc) => {
|
|
115
|
+
position += dataBuffer.write(doc.data, position, 'base64');
|
|
116
|
+
});
|
|
117
|
+
const filePath = getSourceFileDirectory(document.node.getSourceFile());
|
|
118
|
+
if (!sdk_project_1.FileSystem.existsSync(context.fs, filePath)) {
|
|
119
|
+
context.fs.mkdirSync(filePath, { recursive: true });
|
|
120
|
+
}
|
|
121
|
+
context.fs.writeFileSync(path.join(filePath, attachment.file_name), zlib.gunzipSync(dataBuffer), {
|
|
122
|
+
encoding: 'binary',
|
|
123
|
+
});
|
|
124
|
+
return true;
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
serializers: {
|
|
129
|
+
attachment(document, context) {
|
|
130
|
+
/**
|
|
131
|
+
<unload>
|
|
132
|
+
<sys_attachment/>
|
|
133
|
+
<sys_attachment_doc/>
|
|
134
|
+
<sys_attachment_doc/>
|
|
135
|
+
</unload>
|
|
136
|
+
*/
|
|
137
|
+
const data = document.data;
|
|
138
|
+
const xmlBuilder = (0, sdk_build_core_1.unloadBuilder)(context);
|
|
139
|
+
const CHUNK_SIZE = 4 * 1024;
|
|
140
|
+
const attachmentEle = (0, sdk_build_core_1.recordXml)(xmlBuilder.xml, 'sys_attachment', document.guid);
|
|
141
|
+
attachmentEle.addSysScope(context);
|
|
142
|
+
attachmentEle.fields({
|
|
143
|
+
compressed: true,
|
|
144
|
+
content_type: data.contentType,
|
|
145
|
+
file_name: data.fileName,
|
|
146
|
+
table_name: data.tableName,
|
|
147
|
+
table_sys_id: data.tableSysId,
|
|
148
|
+
chunk_size: CHUNK_SIZE,
|
|
149
|
+
});
|
|
150
|
+
const directoryPath = getSourceFileDirectory(document.node.getSourceFile());
|
|
151
|
+
const contentFilePath = path.join(directoryPath, data.filePath);
|
|
152
|
+
if (!sdk_project_1.FileSystem.existsSync(context.fs, contentFilePath)) {
|
|
153
|
+
throw new Error(`Attachment file not found for attachment ${document.guid}: ${contentFilePath}`);
|
|
154
|
+
}
|
|
155
|
+
// Compress the file with gzip, then break into chuncks and base64 encode for each sys_attachment_doc
|
|
156
|
+
const hash = crypto.createHash('md5');
|
|
157
|
+
const contents = context.fs.readFileSync(contentFilePath, { flag: 'r' });
|
|
158
|
+
attachmentEle.field('size_bites', contents.length);
|
|
159
|
+
const zipEncoded = zlib.gzipSync(contents);
|
|
160
|
+
attachmentEle.field('size_compressed', zipEncoded.length);
|
|
161
|
+
hash.update(zipEncoded);
|
|
162
|
+
attachmentEle.field('hash', hash.digest('hex'));
|
|
163
|
+
const dataArray = Uint8Array.from(zipEncoded);
|
|
164
|
+
let position = 0;
|
|
165
|
+
let readOffset = position * CHUNK_SIZE;
|
|
166
|
+
while (readOffset < dataArray.length) {
|
|
167
|
+
const dataChunk = dataArray.slice(readOffset, readOffset + CHUNK_SIZE);
|
|
168
|
+
const dataChunkBase64 = Buffer.from(dataChunk).toString('base64');
|
|
169
|
+
const attachmentDoc = (0, sdk_build_core_1.recordXml)(xmlBuilder.xml, 'sys_attachment_doc', context.keys.registerCompositeId('sys_attachment_doc', {
|
|
170
|
+
attachment: document.guid,
|
|
171
|
+
data: dataChunkBase64,
|
|
172
|
+
}));
|
|
173
|
+
attachmentDoc.fields({
|
|
174
|
+
data: dataChunkBase64,
|
|
175
|
+
length: dataChunkBase64.length,
|
|
176
|
+
position,
|
|
177
|
+
sys_attachment: document.guid,
|
|
178
|
+
});
|
|
179
|
+
position++;
|
|
180
|
+
readOffset = position * CHUNK_SIZE;
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
name: `sys_attachment_${document.guid}.xml`,
|
|
184
|
+
directory: 'update',
|
|
185
|
+
content: xmlBuilder.end(),
|
|
186
|
+
};
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
function getSourceFileDirectory(sourceFile) {
|
|
191
|
+
const parsedPath = path.parse(path.normalize(sourceFile.getFilePath()));
|
|
192
|
+
return parsedPath.dir;
|
|
193
|
+
}
|
|
194
|
+
const TextStringSchema = z.object({ '#text': z.string() }).transform((val) => val['#text']);
|
|
195
|
+
const TextIntSchema = z.object({ '#text': z.number() }).transform((val) => val['#text']);
|
|
196
|
+
const SysAttachmentSchema = RecordPlugin_1.RecordXmlSchema.extend({
|
|
197
|
+
sys_id: TextStringSchema,
|
|
198
|
+
content_type: TextStringSchema,
|
|
199
|
+
file_name: TextStringSchema,
|
|
200
|
+
hash: TextStringSchema,
|
|
201
|
+
table_name: TextStringSchema,
|
|
202
|
+
table_sys_id: TextStringSchema,
|
|
203
|
+
size_bytes: TextIntSchema,
|
|
204
|
+
size_compressed: TextIntSchema,
|
|
205
|
+
});
|
|
206
|
+
const SysAttachmentDocSchema = RecordPlugin_1.RecordXmlSchema.extend({
|
|
207
|
+
data: TextStringSchema,
|
|
208
|
+
length: TextIntSchema,
|
|
209
|
+
position: TextIntSchema,
|
|
210
|
+
sys_attachment: TextStringSchema,
|
|
211
|
+
});
|
|
212
|
+
const AttachmentXmlSchema = z.object({
|
|
213
|
+
sys_attachment: SysAttachmentSchema,
|
|
214
|
+
sys_attachment_doc: z.union([z.array(SysAttachmentDocSchema), SysAttachmentDocSchema]),
|
|
215
|
+
});
|
|
216
|
+
//# sourceMappingURL=AttachmentPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentPlugin.js","sourceRoot":"","sources":["../src/AttachmentPlugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAYmC;AACnC,gDAAiC;AACjC,2CAA4B;AAC5B,+CAAgC;AAChC,oDAAmD;AACnD,uCAAwB;AACxB,0DAAqF;AAErF,yDAAgE;AAEnD,QAAA,gBAAgB,GAAG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ectData } from '@servicenow/sdk-build-core';
|
|
2
|
+
import { Diagnostic } from '@servicenow/sdk-project';
|
|
3
|
+
import { Record } from '@servicenow/sdk-core/runtime/db';
|
|
4
|
+
declare const _default: {
|
|
5
|
+
readonly name: "BusinessRule";
|
|
6
|
+
readonly ownedTables: {
|
|
7
|
+
readonly sys_script: {
|
|
8
|
+
readonly diagnosticLevel: Diagnostic.Level.Warn;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
readonly extractors: {
|
|
12
|
+
readonly entity: {
|
|
13
|
+
readonly CallExpression: (node: import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").ExtractionResult<EntityData<Record<"sys_script">>>;
|
|
14
|
+
};
|
|
15
|
+
readonly raw: {
|
|
16
|
+
readonly FunctionDeclaration: (node: import("ts-morph").FunctionDeclaration, context: import("@servicenow/sdk-build-core").Context) => {
|
|
17
|
+
handled: false;
|
|
18
|
+
diagnostics?: never;
|
|
19
|
+
data?: never;
|
|
20
|
+
} | {
|
|
21
|
+
handled: true;
|
|
22
|
+
diagnostics: never[];
|
|
23
|
+
data: ObjectData<{
|
|
24
|
+
readonly filePath: string;
|
|
25
|
+
readonly functionName: string | undefined;
|
|
26
|
+
readonly isDefault: boolean;
|
|
27
|
+
}>[];
|
|
28
|
+
};
|
|
29
|
+
readonly FunctionExpression: (node: import("ts-morph").FunctionExpression, context: import("@servicenow/sdk-build-core").Context) => {
|
|
30
|
+
handled: false;
|
|
31
|
+
diagnostics?: never;
|
|
32
|
+
data?: never;
|
|
33
|
+
} | {
|
|
34
|
+
handled: true;
|
|
35
|
+
diagnostics: never[];
|
|
36
|
+
data: ObjectData<{
|
|
37
|
+
readonly filePath: string;
|
|
38
|
+
readonly functionName: string | undefined;
|
|
39
|
+
readonly isDefault: boolean;
|
|
40
|
+
}>[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly generators: {
|
|
45
|
+
readonly record: (document: import("@servicenow/sdk-build-core").UnlinkedDocument<"record"> & import("@servicenow/sdk-build-core").Arranged, context: import("@servicenow/sdk-build-core").Context) => import("@servicenow/sdk-build-core").LinkedDocument<"record", import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>> | undefined;
|
|
46
|
+
};
|
|
47
|
+
readonly transformers: {
|
|
48
|
+
readonly record: {
|
|
49
|
+
readonly CallExpression: (document: import("@servicenow/sdk-build-core").Document<any, import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>> & {
|
|
50
|
+
entity?: EntityData;
|
|
51
|
+
node: import("ts-morph").CallExpression<import("ts-morph").ts.CallExpression>;
|
|
52
|
+
} & import("@servicenow/sdk-build-core").Arranged, context: import("@servicenow/sdk-build-core").Context) => boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export default _default;
|