@trackunit/custom-field-api 0.1.130 → 0.1.131
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/index.cjs.js +1032 -6
- package/index.esm.js +1030 -8
- package/package.json +1 -1
- package/src/generated/graphql-api/gql.d.ts +2 -2
- package/src/generated/graphql-api/graphql.d.ts +246 -0
- package/src/generated/graphql-api/mock.d.ts +9 -0
- package/src/index.d.ts +3 -1
- package/src/useAllCustomFieldDefinitions.d.ts +25 -0
- package/src/useAllCustomFieldsValueAndDefinition.d.ts +42 -0
- package/src/useCustomFieldDefinitions.d.ts +1 -0
- package/src/useCustomFieldsValueAndDefinition.d.ts +3 -0
package/index.cjs.js
CHANGED
|
@@ -956,13 +956,845 @@ const GetCustomFieldsForSiteDocument = {
|
|
|
956
956
|
},
|
|
957
957
|
],
|
|
958
958
|
};
|
|
959
|
+
const GetCustomFieldsForAssetForIrisAppDocument = {
|
|
960
|
+
kind: "Document",
|
|
961
|
+
definitions: [
|
|
962
|
+
{
|
|
963
|
+
kind: "OperationDefinition",
|
|
964
|
+
operation: "query",
|
|
965
|
+
name: { kind: "Name", value: "GetCustomFieldsForAssetForIrisApp" },
|
|
966
|
+
variableDefinitions: [
|
|
967
|
+
{
|
|
968
|
+
kind: "VariableDefinition",
|
|
969
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "entityId" } },
|
|
970
|
+
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } },
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
kind: "VariableDefinition",
|
|
974
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
975
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "SystemOfMeasurement" } },
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
kind: "VariableDefinition",
|
|
979
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "irisAppId" } },
|
|
980
|
+
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } },
|
|
981
|
+
},
|
|
982
|
+
],
|
|
983
|
+
selectionSet: {
|
|
984
|
+
kind: "SelectionSet",
|
|
985
|
+
selections: [
|
|
986
|
+
{
|
|
987
|
+
kind: "Field",
|
|
988
|
+
name: { kind: "Name", value: "asset" },
|
|
989
|
+
arguments: [
|
|
990
|
+
{
|
|
991
|
+
kind: "Argument",
|
|
992
|
+
name: { kind: "Name", value: "id" },
|
|
993
|
+
value: { kind: "Variable", name: { kind: "Name", value: "entityId" } },
|
|
994
|
+
},
|
|
995
|
+
],
|
|
996
|
+
selectionSet: {
|
|
997
|
+
kind: "SelectionSet",
|
|
998
|
+
selections: [
|
|
999
|
+
{
|
|
1000
|
+
kind: "Field",
|
|
1001
|
+
name: { kind: "Name", value: "customFields" },
|
|
1002
|
+
arguments: [
|
|
1003
|
+
{
|
|
1004
|
+
kind: "Argument",
|
|
1005
|
+
name: { kind: "Name", value: "owner" },
|
|
1006
|
+
value: {
|
|
1007
|
+
kind: "ObjectValue",
|
|
1008
|
+
fields: [
|
|
1009
|
+
{
|
|
1010
|
+
kind: "ObjectField",
|
|
1011
|
+
name: { kind: "Name", value: "ownerType" },
|
|
1012
|
+
value: { kind: "EnumValue", value: "IRIS_APP" },
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
kind: "ObjectField",
|
|
1016
|
+
name: { kind: "Name", value: "irisAppId" },
|
|
1017
|
+
value: { kind: "Variable", name: { kind: "Name", value: "irisAppId" } },
|
|
1018
|
+
},
|
|
1019
|
+
],
|
|
1020
|
+
},
|
|
1021
|
+
},
|
|
1022
|
+
],
|
|
1023
|
+
selectionSet: {
|
|
1024
|
+
kind: "SelectionSet",
|
|
1025
|
+
selections: [
|
|
1026
|
+
{
|
|
1027
|
+
kind: "Field",
|
|
1028
|
+
name: { kind: "Name", value: "edges" },
|
|
1029
|
+
selectionSet: {
|
|
1030
|
+
kind: "SelectionSet",
|
|
1031
|
+
selections: [
|
|
1032
|
+
{
|
|
1033
|
+
kind: "Field",
|
|
1034
|
+
name: { kind: "Name", value: "node" },
|
|
1035
|
+
selectionSet: {
|
|
1036
|
+
kind: "SelectionSet",
|
|
1037
|
+
selections: [
|
|
1038
|
+
{
|
|
1039
|
+
kind: "FragmentSpread",
|
|
1040
|
+
name: { kind: "Name", value: "CustomFieldValueAndDefinition" },
|
|
1041
|
+
},
|
|
1042
|
+
],
|
|
1043
|
+
},
|
|
1044
|
+
},
|
|
1045
|
+
],
|
|
1046
|
+
},
|
|
1047
|
+
},
|
|
1048
|
+
],
|
|
1049
|
+
},
|
|
1050
|
+
},
|
|
1051
|
+
],
|
|
1052
|
+
},
|
|
1053
|
+
},
|
|
1054
|
+
],
|
|
1055
|
+
},
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
kind: "FragmentDefinition",
|
|
1059
|
+
name: { kind: "Name", value: "CustomFieldValueAndDefinition" },
|
|
1060
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomFieldValueAndDefinition" } },
|
|
1061
|
+
selectionSet: {
|
|
1062
|
+
kind: "SelectionSet",
|
|
1063
|
+
selections: [
|
|
1064
|
+
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
|
|
1065
|
+
{
|
|
1066
|
+
kind: "Field",
|
|
1067
|
+
name: { kind: "Name", value: "definition" },
|
|
1068
|
+
selectionSet: {
|
|
1069
|
+
kind: "SelectionSet",
|
|
1070
|
+
selections: [
|
|
1071
|
+
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
|
|
1072
|
+
{ kind: "Field", name: { kind: "Name", value: "description" } },
|
|
1073
|
+
{ kind: "Field", name: { kind: "Name", value: "entityType" } },
|
|
1074
|
+
{ kind: "Field", name: { kind: "Name", value: "id" } },
|
|
1075
|
+
{ kind: "Field", name: { kind: "Name", value: "key" } },
|
|
1076
|
+
{
|
|
1077
|
+
kind: "Field",
|
|
1078
|
+
name: { kind: "Name", value: "owner" },
|
|
1079
|
+
selectionSet: {
|
|
1080
|
+
kind: "SelectionSet",
|
|
1081
|
+
selections: [
|
|
1082
|
+
{ kind: "Field", name: { kind: "Name", value: "irisAppId" } },
|
|
1083
|
+
{
|
|
1084
|
+
kind: "Field",
|
|
1085
|
+
name: { kind: "Name", value: "marketplaceEntry" },
|
|
1086
|
+
selectionSet: {
|
|
1087
|
+
kind: "SelectionSet",
|
|
1088
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "name" } }],
|
|
1089
|
+
},
|
|
1090
|
+
},
|
|
1091
|
+
{ kind: "Field", name: { kind: "Name", value: "ownerType" } },
|
|
1092
|
+
],
|
|
1093
|
+
},
|
|
1094
|
+
},
|
|
1095
|
+
{ kind: "Field", name: { kind: "Name", value: "title" } },
|
|
1096
|
+
{
|
|
1097
|
+
kind: "Field",
|
|
1098
|
+
name: { kind: "Name", value: "translations" },
|
|
1099
|
+
selectionSet: {
|
|
1100
|
+
kind: "SelectionSet",
|
|
1101
|
+
selections: [
|
|
1102
|
+
{ kind: "Field", name: { kind: "Name", value: "description" } },
|
|
1103
|
+
{ kind: "Field", name: { kind: "Name", value: "title" } },
|
|
1104
|
+
{ kind: "Field", name: { kind: "Name", value: "language" } },
|
|
1105
|
+
],
|
|
1106
|
+
},
|
|
1107
|
+
},
|
|
1108
|
+
{ kind: "Field", name: { kind: "Name", value: "type" } },
|
|
1109
|
+
{ kind: "Field", name: { kind: "Name", value: "uiEditable" } },
|
|
1110
|
+
{ kind: "Field", name: { kind: "Name", value: "uiVisible" } },
|
|
1111
|
+
{
|
|
1112
|
+
kind: "InlineFragment",
|
|
1113
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DropDownFieldDefinition" } },
|
|
1114
|
+
selectionSet: {
|
|
1115
|
+
kind: "SelectionSet",
|
|
1116
|
+
selections: [
|
|
1117
|
+
{ kind: "Field", name: { kind: "Name", value: "allValues" } },
|
|
1118
|
+
{ kind: "Field", name: { kind: "Name", value: "multiSelect" } },
|
|
1119
|
+
],
|
|
1120
|
+
},
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
kind: "InlineFragment",
|
|
1124
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NumberFieldDefinition" } },
|
|
1125
|
+
selectionSet: {
|
|
1126
|
+
kind: "SelectionSet",
|
|
1127
|
+
selections: [
|
|
1128
|
+
{ kind: "Field", name: { kind: "Name", value: "isInteger" } },
|
|
1129
|
+
{
|
|
1130
|
+
kind: "Field",
|
|
1131
|
+
name: { kind: "Name", value: "maximumNumber" },
|
|
1132
|
+
arguments: [
|
|
1133
|
+
{
|
|
1134
|
+
kind: "Argument",
|
|
1135
|
+
name: { kind: "Name", value: "systemOfMeasurement" },
|
|
1136
|
+
value: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1137
|
+
},
|
|
1138
|
+
],
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
kind: "Field",
|
|
1142
|
+
name: { kind: "Name", value: "minimumNumber" },
|
|
1143
|
+
arguments: [
|
|
1144
|
+
{
|
|
1145
|
+
kind: "Argument",
|
|
1146
|
+
name: { kind: "Name", value: "systemOfMeasurement" },
|
|
1147
|
+
value: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1148
|
+
},
|
|
1149
|
+
],
|
|
1150
|
+
},
|
|
1151
|
+
{ kind: "Field", name: { kind: "Name", value: "unitSi" } },
|
|
1152
|
+
{ kind: "Field", name: { kind: "Name", value: "unitUs" } },
|
|
1153
|
+
],
|
|
1154
|
+
},
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
kind: "InlineFragment",
|
|
1158
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "MonetaryFieldDefinition" } },
|
|
1159
|
+
selectionSet: {
|
|
1160
|
+
kind: "SelectionSet",
|
|
1161
|
+
selections: [
|
|
1162
|
+
{ kind: "Field", name: { kind: "Name", value: "currency" } },
|
|
1163
|
+
{ kind: "Field", name: { kind: "Name", value: "maximumNumber" } },
|
|
1164
|
+
{ kind: "Field", name: { kind: "Name", value: "minimumNumber" } },
|
|
1165
|
+
],
|
|
1166
|
+
},
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
kind: "InlineFragment",
|
|
1170
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "StringFieldDefinition" } },
|
|
1171
|
+
selectionSet: {
|
|
1172
|
+
kind: "SelectionSet",
|
|
1173
|
+
selections: [
|
|
1174
|
+
{ kind: "Field", name: { kind: "Name", value: "maximumLength" } },
|
|
1175
|
+
{ kind: "Field", name: { kind: "Name", value: "minimumLength" } },
|
|
1176
|
+
{ kind: "Field", name: { kind: "Name", value: "pattern" } },
|
|
1177
|
+
],
|
|
1178
|
+
},
|
|
1179
|
+
},
|
|
1180
|
+
],
|
|
1181
|
+
},
|
|
1182
|
+
},
|
|
1183
|
+
{ kind: "Field", name: { kind: "Name", value: "valueEditable" } },
|
|
1184
|
+
{
|
|
1185
|
+
kind: "InlineFragment",
|
|
1186
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BooleanFieldValueAndDefinition" } },
|
|
1187
|
+
selectionSet: {
|
|
1188
|
+
kind: "SelectionSet",
|
|
1189
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "booleanValue" } }],
|
|
1190
|
+
},
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
kind: "InlineFragment",
|
|
1194
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DateFieldValueAndDefinition" } },
|
|
1195
|
+
selectionSet: {
|
|
1196
|
+
kind: "SelectionSet",
|
|
1197
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "dateValue" } }],
|
|
1198
|
+
},
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
kind: "InlineFragment",
|
|
1202
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DropDownFieldValueAndDefinition" } },
|
|
1203
|
+
selectionSet: {
|
|
1204
|
+
kind: "SelectionSet",
|
|
1205
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringArrayValue" } }],
|
|
1206
|
+
},
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
kind: "InlineFragment",
|
|
1210
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EmailFieldValueAndDefinition" } },
|
|
1211
|
+
selectionSet: {
|
|
1212
|
+
kind: "SelectionSet",
|
|
1213
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringValue" } }],
|
|
1214
|
+
},
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
kind: "InlineFragment",
|
|
1218
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "JsonFieldValueAndDefinition" } },
|
|
1219
|
+
selectionSet: {
|
|
1220
|
+
kind: "SelectionSet",
|
|
1221
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "jsonValue" } }],
|
|
1222
|
+
},
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
kind: "InlineFragment",
|
|
1226
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NumberFieldValueAndDefinition" } },
|
|
1227
|
+
selectionSet: {
|
|
1228
|
+
kind: "SelectionSet",
|
|
1229
|
+
selections: [
|
|
1230
|
+
{
|
|
1231
|
+
kind: "Field",
|
|
1232
|
+
name: { kind: "Name", value: "numberValue" },
|
|
1233
|
+
arguments: [
|
|
1234
|
+
{
|
|
1235
|
+
kind: "Argument",
|
|
1236
|
+
name: { kind: "Name", value: "systemOfMeasurement" },
|
|
1237
|
+
value: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1238
|
+
},
|
|
1239
|
+
],
|
|
1240
|
+
},
|
|
1241
|
+
],
|
|
1242
|
+
},
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
kind: "InlineFragment",
|
|
1246
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "MonetaryFieldValueAndDefinition" } },
|
|
1247
|
+
selectionSet: {
|
|
1248
|
+
kind: "SelectionSet",
|
|
1249
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "numberValue" } }],
|
|
1250
|
+
},
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
kind: "InlineFragment",
|
|
1254
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "PhoneNumberFieldValueAndDefinition" } },
|
|
1255
|
+
selectionSet: {
|
|
1256
|
+
kind: "SelectionSet",
|
|
1257
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringValue" } }],
|
|
1258
|
+
},
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
kind: "InlineFragment",
|
|
1262
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "StringFieldValueAndDefinition" } },
|
|
1263
|
+
selectionSet: {
|
|
1264
|
+
kind: "SelectionSet",
|
|
1265
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringValue" } }],
|
|
1266
|
+
},
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
kind: "InlineFragment",
|
|
1270
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "WebAddressFieldValueAndDefinition" } },
|
|
1271
|
+
selectionSet: {
|
|
1272
|
+
kind: "SelectionSet",
|
|
1273
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringValue" } }],
|
|
1274
|
+
},
|
|
1275
|
+
},
|
|
1276
|
+
],
|
|
1277
|
+
},
|
|
1278
|
+
},
|
|
1279
|
+
],
|
|
1280
|
+
};
|
|
1281
|
+
const GetCustomFieldsForSiteForIrisAppDocument = {
|
|
1282
|
+
kind: "Document",
|
|
1283
|
+
definitions: [
|
|
1284
|
+
{
|
|
1285
|
+
kind: "OperationDefinition",
|
|
1286
|
+
operation: "query",
|
|
1287
|
+
name: { kind: "Name", value: "GetCustomFieldsForSiteForIrisApp" },
|
|
1288
|
+
variableDefinitions: [
|
|
1289
|
+
{
|
|
1290
|
+
kind: "VariableDefinition",
|
|
1291
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "entityId" } },
|
|
1292
|
+
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } },
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
kind: "VariableDefinition",
|
|
1296
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1297
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "SystemOfMeasurement" } },
|
|
1298
|
+
},
|
|
1299
|
+
{
|
|
1300
|
+
kind: "VariableDefinition",
|
|
1301
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "irisAppId" } },
|
|
1302
|
+
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } },
|
|
1303
|
+
},
|
|
1304
|
+
],
|
|
1305
|
+
selectionSet: {
|
|
1306
|
+
kind: "SelectionSet",
|
|
1307
|
+
selections: [
|
|
1308
|
+
{
|
|
1309
|
+
kind: "Field",
|
|
1310
|
+
name: { kind: "Name", value: "site" },
|
|
1311
|
+
arguments: [
|
|
1312
|
+
{
|
|
1313
|
+
kind: "Argument",
|
|
1314
|
+
name: { kind: "Name", value: "id" },
|
|
1315
|
+
value: { kind: "Variable", name: { kind: "Name", value: "entityId" } },
|
|
1316
|
+
},
|
|
1317
|
+
],
|
|
1318
|
+
selectionSet: {
|
|
1319
|
+
kind: "SelectionSet",
|
|
1320
|
+
selections: [
|
|
1321
|
+
{
|
|
1322
|
+
kind: "Field",
|
|
1323
|
+
name: { kind: "Name", value: "customFields" },
|
|
1324
|
+
arguments: [
|
|
1325
|
+
{
|
|
1326
|
+
kind: "Argument",
|
|
1327
|
+
name: { kind: "Name", value: "owner" },
|
|
1328
|
+
value: {
|
|
1329
|
+
kind: "ObjectValue",
|
|
1330
|
+
fields: [
|
|
1331
|
+
{
|
|
1332
|
+
kind: "ObjectField",
|
|
1333
|
+
name: { kind: "Name", value: "ownerType" },
|
|
1334
|
+
value: { kind: "EnumValue", value: "IRIS_APP" },
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
kind: "ObjectField",
|
|
1338
|
+
name: { kind: "Name", value: "irisAppId" },
|
|
1339
|
+
value: { kind: "Variable", name: { kind: "Name", value: "irisAppId" } },
|
|
1340
|
+
},
|
|
1341
|
+
],
|
|
1342
|
+
},
|
|
1343
|
+
},
|
|
1344
|
+
],
|
|
1345
|
+
selectionSet: {
|
|
1346
|
+
kind: "SelectionSet",
|
|
1347
|
+
selections: [
|
|
1348
|
+
{
|
|
1349
|
+
kind: "Field",
|
|
1350
|
+
name: { kind: "Name", value: "edges" },
|
|
1351
|
+
selectionSet: {
|
|
1352
|
+
kind: "SelectionSet",
|
|
1353
|
+
selections: [
|
|
1354
|
+
{
|
|
1355
|
+
kind: "Field",
|
|
1356
|
+
name: { kind: "Name", value: "node" },
|
|
1357
|
+
selectionSet: {
|
|
1358
|
+
kind: "SelectionSet",
|
|
1359
|
+
selections: [
|
|
1360
|
+
{
|
|
1361
|
+
kind: "FragmentSpread",
|
|
1362
|
+
name: { kind: "Name", value: "CustomFieldValueAndDefinition" },
|
|
1363
|
+
},
|
|
1364
|
+
],
|
|
1365
|
+
},
|
|
1366
|
+
},
|
|
1367
|
+
],
|
|
1368
|
+
},
|
|
1369
|
+
},
|
|
1370
|
+
],
|
|
1371
|
+
},
|
|
1372
|
+
},
|
|
1373
|
+
],
|
|
1374
|
+
},
|
|
1375
|
+
},
|
|
1376
|
+
],
|
|
1377
|
+
},
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
kind: "FragmentDefinition",
|
|
1381
|
+
name: { kind: "Name", value: "CustomFieldValueAndDefinition" },
|
|
1382
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomFieldValueAndDefinition" } },
|
|
1383
|
+
selectionSet: {
|
|
1384
|
+
kind: "SelectionSet",
|
|
1385
|
+
selections: [
|
|
1386
|
+
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
|
|
1387
|
+
{
|
|
1388
|
+
kind: "Field",
|
|
1389
|
+
name: { kind: "Name", value: "definition" },
|
|
1390
|
+
selectionSet: {
|
|
1391
|
+
kind: "SelectionSet",
|
|
1392
|
+
selections: [
|
|
1393
|
+
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
|
|
1394
|
+
{ kind: "Field", name: { kind: "Name", value: "description" } },
|
|
1395
|
+
{ kind: "Field", name: { kind: "Name", value: "entityType" } },
|
|
1396
|
+
{ kind: "Field", name: { kind: "Name", value: "id" } },
|
|
1397
|
+
{ kind: "Field", name: { kind: "Name", value: "key" } },
|
|
1398
|
+
{
|
|
1399
|
+
kind: "Field",
|
|
1400
|
+
name: { kind: "Name", value: "owner" },
|
|
1401
|
+
selectionSet: {
|
|
1402
|
+
kind: "SelectionSet",
|
|
1403
|
+
selections: [
|
|
1404
|
+
{ kind: "Field", name: { kind: "Name", value: "irisAppId" } },
|
|
1405
|
+
{
|
|
1406
|
+
kind: "Field",
|
|
1407
|
+
name: { kind: "Name", value: "marketplaceEntry" },
|
|
1408
|
+
selectionSet: {
|
|
1409
|
+
kind: "SelectionSet",
|
|
1410
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "name" } }],
|
|
1411
|
+
},
|
|
1412
|
+
},
|
|
1413
|
+
{ kind: "Field", name: { kind: "Name", value: "ownerType" } },
|
|
1414
|
+
],
|
|
1415
|
+
},
|
|
1416
|
+
},
|
|
1417
|
+
{ kind: "Field", name: { kind: "Name", value: "title" } },
|
|
1418
|
+
{
|
|
1419
|
+
kind: "Field",
|
|
1420
|
+
name: { kind: "Name", value: "translations" },
|
|
1421
|
+
selectionSet: {
|
|
1422
|
+
kind: "SelectionSet",
|
|
1423
|
+
selections: [
|
|
1424
|
+
{ kind: "Field", name: { kind: "Name", value: "description" } },
|
|
1425
|
+
{ kind: "Field", name: { kind: "Name", value: "title" } },
|
|
1426
|
+
{ kind: "Field", name: { kind: "Name", value: "language" } },
|
|
1427
|
+
],
|
|
1428
|
+
},
|
|
1429
|
+
},
|
|
1430
|
+
{ kind: "Field", name: { kind: "Name", value: "type" } },
|
|
1431
|
+
{ kind: "Field", name: { kind: "Name", value: "uiEditable" } },
|
|
1432
|
+
{ kind: "Field", name: { kind: "Name", value: "uiVisible" } },
|
|
1433
|
+
{
|
|
1434
|
+
kind: "InlineFragment",
|
|
1435
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DropDownFieldDefinition" } },
|
|
1436
|
+
selectionSet: {
|
|
1437
|
+
kind: "SelectionSet",
|
|
1438
|
+
selections: [
|
|
1439
|
+
{ kind: "Field", name: { kind: "Name", value: "allValues" } },
|
|
1440
|
+
{ kind: "Field", name: { kind: "Name", value: "multiSelect" } },
|
|
1441
|
+
],
|
|
1442
|
+
},
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
kind: "InlineFragment",
|
|
1446
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NumberFieldDefinition" } },
|
|
1447
|
+
selectionSet: {
|
|
1448
|
+
kind: "SelectionSet",
|
|
1449
|
+
selections: [
|
|
1450
|
+
{ kind: "Field", name: { kind: "Name", value: "isInteger" } },
|
|
1451
|
+
{
|
|
1452
|
+
kind: "Field",
|
|
1453
|
+
name: { kind: "Name", value: "maximumNumber" },
|
|
1454
|
+
arguments: [
|
|
1455
|
+
{
|
|
1456
|
+
kind: "Argument",
|
|
1457
|
+
name: { kind: "Name", value: "systemOfMeasurement" },
|
|
1458
|
+
value: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1459
|
+
},
|
|
1460
|
+
],
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
kind: "Field",
|
|
1464
|
+
name: { kind: "Name", value: "minimumNumber" },
|
|
1465
|
+
arguments: [
|
|
1466
|
+
{
|
|
1467
|
+
kind: "Argument",
|
|
1468
|
+
name: { kind: "Name", value: "systemOfMeasurement" },
|
|
1469
|
+
value: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1470
|
+
},
|
|
1471
|
+
],
|
|
1472
|
+
},
|
|
1473
|
+
{ kind: "Field", name: { kind: "Name", value: "unitSi" } },
|
|
1474
|
+
{ kind: "Field", name: { kind: "Name", value: "unitUs" } },
|
|
1475
|
+
],
|
|
1476
|
+
},
|
|
1477
|
+
},
|
|
1478
|
+
{
|
|
1479
|
+
kind: "InlineFragment",
|
|
1480
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "MonetaryFieldDefinition" } },
|
|
1481
|
+
selectionSet: {
|
|
1482
|
+
kind: "SelectionSet",
|
|
1483
|
+
selections: [
|
|
1484
|
+
{ kind: "Field", name: { kind: "Name", value: "currency" } },
|
|
1485
|
+
{ kind: "Field", name: { kind: "Name", value: "maximumNumber" } },
|
|
1486
|
+
{ kind: "Field", name: { kind: "Name", value: "minimumNumber" } },
|
|
1487
|
+
],
|
|
1488
|
+
},
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
kind: "InlineFragment",
|
|
1492
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "StringFieldDefinition" } },
|
|
1493
|
+
selectionSet: {
|
|
1494
|
+
kind: "SelectionSet",
|
|
1495
|
+
selections: [
|
|
1496
|
+
{ kind: "Field", name: { kind: "Name", value: "maximumLength" } },
|
|
1497
|
+
{ kind: "Field", name: { kind: "Name", value: "minimumLength" } },
|
|
1498
|
+
{ kind: "Field", name: { kind: "Name", value: "pattern" } },
|
|
1499
|
+
],
|
|
1500
|
+
},
|
|
1501
|
+
},
|
|
1502
|
+
],
|
|
1503
|
+
},
|
|
1504
|
+
},
|
|
1505
|
+
{ kind: "Field", name: { kind: "Name", value: "valueEditable" } },
|
|
1506
|
+
{
|
|
1507
|
+
kind: "InlineFragment",
|
|
1508
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BooleanFieldValueAndDefinition" } },
|
|
1509
|
+
selectionSet: {
|
|
1510
|
+
kind: "SelectionSet",
|
|
1511
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "booleanValue" } }],
|
|
1512
|
+
},
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
kind: "InlineFragment",
|
|
1516
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DateFieldValueAndDefinition" } },
|
|
1517
|
+
selectionSet: {
|
|
1518
|
+
kind: "SelectionSet",
|
|
1519
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "dateValue" } }],
|
|
1520
|
+
},
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
kind: "InlineFragment",
|
|
1524
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DropDownFieldValueAndDefinition" } },
|
|
1525
|
+
selectionSet: {
|
|
1526
|
+
kind: "SelectionSet",
|
|
1527
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringArrayValue" } }],
|
|
1528
|
+
},
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
kind: "InlineFragment",
|
|
1532
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EmailFieldValueAndDefinition" } },
|
|
1533
|
+
selectionSet: {
|
|
1534
|
+
kind: "SelectionSet",
|
|
1535
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringValue" } }],
|
|
1536
|
+
},
|
|
1537
|
+
},
|
|
1538
|
+
{
|
|
1539
|
+
kind: "InlineFragment",
|
|
1540
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "JsonFieldValueAndDefinition" } },
|
|
1541
|
+
selectionSet: {
|
|
1542
|
+
kind: "SelectionSet",
|
|
1543
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "jsonValue" } }],
|
|
1544
|
+
},
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
kind: "InlineFragment",
|
|
1548
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NumberFieldValueAndDefinition" } },
|
|
1549
|
+
selectionSet: {
|
|
1550
|
+
kind: "SelectionSet",
|
|
1551
|
+
selections: [
|
|
1552
|
+
{
|
|
1553
|
+
kind: "Field",
|
|
1554
|
+
name: { kind: "Name", value: "numberValue" },
|
|
1555
|
+
arguments: [
|
|
1556
|
+
{
|
|
1557
|
+
kind: "Argument",
|
|
1558
|
+
name: { kind: "Name", value: "systemOfMeasurement" },
|
|
1559
|
+
value: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1560
|
+
},
|
|
1561
|
+
],
|
|
1562
|
+
},
|
|
1563
|
+
],
|
|
1564
|
+
},
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
kind: "InlineFragment",
|
|
1568
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "MonetaryFieldValueAndDefinition" } },
|
|
1569
|
+
selectionSet: {
|
|
1570
|
+
kind: "SelectionSet",
|
|
1571
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "numberValue" } }],
|
|
1572
|
+
},
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
kind: "InlineFragment",
|
|
1576
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "PhoneNumberFieldValueAndDefinition" } },
|
|
1577
|
+
selectionSet: {
|
|
1578
|
+
kind: "SelectionSet",
|
|
1579
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringValue" } }],
|
|
1580
|
+
},
|
|
1581
|
+
},
|
|
1582
|
+
{
|
|
1583
|
+
kind: "InlineFragment",
|
|
1584
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "StringFieldValueAndDefinition" } },
|
|
1585
|
+
selectionSet: {
|
|
1586
|
+
kind: "SelectionSet",
|
|
1587
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringValue" } }],
|
|
1588
|
+
},
|
|
1589
|
+
},
|
|
1590
|
+
{
|
|
1591
|
+
kind: "InlineFragment",
|
|
1592
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "WebAddressFieldValueAndDefinition" } },
|
|
1593
|
+
selectionSet: {
|
|
1594
|
+
kind: "SelectionSet",
|
|
1595
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "stringValue" } }],
|
|
1596
|
+
},
|
|
1597
|
+
},
|
|
1598
|
+
],
|
|
1599
|
+
},
|
|
1600
|
+
},
|
|
1601
|
+
],
|
|
1602
|
+
};
|
|
959
1603
|
const GetCustomFieldDefinitionsDocument = {
|
|
960
1604
|
kind: "Document",
|
|
961
1605
|
definitions: [
|
|
962
1606
|
{
|
|
963
1607
|
kind: "OperationDefinition",
|
|
964
1608
|
operation: "query",
|
|
965
|
-
name: { kind: "Name", value: "GetCustomFieldDefinitions" },
|
|
1609
|
+
name: { kind: "Name", value: "GetCustomFieldDefinitions" },
|
|
1610
|
+
variableDefinitions: [
|
|
1611
|
+
{
|
|
1612
|
+
kind: "VariableDefinition",
|
|
1613
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "entityType" } },
|
|
1614
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "CustomFieldEntityType" } },
|
|
1615
|
+
defaultValue: { kind: "EnumValue", value: "ASSET" },
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
kind: "VariableDefinition",
|
|
1619
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1620
|
+
type: { kind: "NamedType", name: { kind: "Name", value: "SystemOfMeasurement" } },
|
|
1621
|
+
},
|
|
1622
|
+
],
|
|
1623
|
+
selectionSet: {
|
|
1624
|
+
kind: "SelectionSet",
|
|
1625
|
+
selections: [
|
|
1626
|
+
{
|
|
1627
|
+
kind: "Field",
|
|
1628
|
+
name: { kind: "Name", value: "customFieldDefinitions" },
|
|
1629
|
+
arguments: [
|
|
1630
|
+
{
|
|
1631
|
+
kind: "Argument",
|
|
1632
|
+
name: { kind: "Name", value: "uiVisible" },
|
|
1633
|
+
value: { kind: "BooleanValue", value: true },
|
|
1634
|
+
},
|
|
1635
|
+
{ kind: "Argument", name: { kind: "Name", value: "first" }, value: { kind: "IntValue", value: "100" } },
|
|
1636
|
+
{
|
|
1637
|
+
kind: "Argument",
|
|
1638
|
+
name: { kind: "Name", value: "entityType" },
|
|
1639
|
+
value: { kind: "Variable", name: { kind: "Name", value: "entityType" } },
|
|
1640
|
+
},
|
|
1641
|
+
],
|
|
1642
|
+
selectionSet: {
|
|
1643
|
+
kind: "SelectionSet",
|
|
1644
|
+
selections: [
|
|
1645
|
+
{
|
|
1646
|
+
kind: "Field",
|
|
1647
|
+
name: { kind: "Name", value: "edges" },
|
|
1648
|
+
selectionSet: {
|
|
1649
|
+
kind: "SelectionSet",
|
|
1650
|
+
selections: [
|
|
1651
|
+
{
|
|
1652
|
+
kind: "Field",
|
|
1653
|
+
name: { kind: "Name", value: "node" },
|
|
1654
|
+
selectionSet: {
|
|
1655
|
+
kind: "SelectionSet",
|
|
1656
|
+
selections: [
|
|
1657
|
+
{ kind: "FragmentSpread", name: { kind: "Name", value: "CustomFieldDefinition" } },
|
|
1658
|
+
],
|
|
1659
|
+
},
|
|
1660
|
+
},
|
|
1661
|
+
],
|
|
1662
|
+
},
|
|
1663
|
+
},
|
|
1664
|
+
],
|
|
1665
|
+
},
|
|
1666
|
+
},
|
|
1667
|
+
],
|
|
1668
|
+
},
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
kind: "FragmentDefinition",
|
|
1672
|
+
name: { kind: "Name", value: "CustomFieldDefinition" },
|
|
1673
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomFieldDefinition" } },
|
|
1674
|
+
selectionSet: {
|
|
1675
|
+
kind: "SelectionSet",
|
|
1676
|
+
selections: [
|
|
1677
|
+
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
|
|
1678
|
+
{ kind: "Field", name: { kind: "Name", value: "description" } },
|
|
1679
|
+
{ kind: "Field", name: { kind: "Name", value: "entityType" } },
|
|
1680
|
+
{ kind: "Field", name: { kind: "Name", value: "id" } },
|
|
1681
|
+
{ kind: "Field", name: { kind: "Name", value: "key" } },
|
|
1682
|
+
{
|
|
1683
|
+
kind: "Field",
|
|
1684
|
+
name: { kind: "Name", value: "owner" },
|
|
1685
|
+
selectionSet: {
|
|
1686
|
+
kind: "SelectionSet",
|
|
1687
|
+
selections: [
|
|
1688
|
+
{ kind: "Field", name: { kind: "Name", value: "irisAppId" } },
|
|
1689
|
+
{
|
|
1690
|
+
kind: "Field",
|
|
1691
|
+
name: { kind: "Name", value: "marketplaceEntry" },
|
|
1692
|
+
selectionSet: {
|
|
1693
|
+
kind: "SelectionSet",
|
|
1694
|
+
selections: [{ kind: "Field", name: { kind: "Name", value: "name" } }],
|
|
1695
|
+
},
|
|
1696
|
+
},
|
|
1697
|
+
{ kind: "Field", name: { kind: "Name", value: "ownerType" } },
|
|
1698
|
+
],
|
|
1699
|
+
},
|
|
1700
|
+
},
|
|
1701
|
+
{ kind: "Field", name: { kind: "Name", value: "title" } },
|
|
1702
|
+
{
|
|
1703
|
+
kind: "Field",
|
|
1704
|
+
name: { kind: "Name", value: "translations" },
|
|
1705
|
+
selectionSet: {
|
|
1706
|
+
kind: "SelectionSet",
|
|
1707
|
+
selections: [
|
|
1708
|
+
{ kind: "Field", name: { kind: "Name", value: "description" } },
|
|
1709
|
+
{ kind: "Field", name: { kind: "Name", value: "title" } },
|
|
1710
|
+
{ kind: "Field", name: { kind: "Name", value: "language" } },
|
|
1711
|
+
],
|
|
1712
|
+
},
|
|
1713
|
+
},
|
|
1714
|
+
{ kind: "Field", name: { kind: "Name", value: "type" } },
|
|
1715
|
+
{ kind: "Field", name: { kind: "Name", value: "uiEditable" } },
|
|
1716
|
+
{ kind: "Field", name: { kind: "Name", value: "uiVisible" } },
|
|
1717
|
+
{
|
|
1718
|
+
kind: "InlineFragment",
|
|
1719
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DropDownFieldDefinition" } },
|
|
1720
|
+
selectionSet: {
|
|
1721
|
+
kind: "SelectionSet",
|
|
1722
|
+
selections: [
|
|
1723
|
+
{ kind: "Field", name: { kind: "Name", value: "allValues" } },
|
|
1724
|
+
{ kind: "Field", name: { kind: "Name", value: "multiSelect" } },
|
|
1725
|
+
],
|
|
1726
|
+
},
|
|
1727
|
+
},
|
|
1728
|
+
{
|
|
1729
|
+
kind: "InlineFragment",
|
|
1730
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NumberFieldDefinition" } },
|
|
1731
|
+
selectionSet: {
|
|
1732
|
+
kind: "SelectionSet",
|
|
1733
|
+
selections: [
|
|
1734
|
+
{ kind: "Field", name: { kind: "Name", value: "isInteger" } },
|
|
1735
|
+
{
|
|
1736
|
+
kind: "Field",
|
|
1737
|
+
name: { kind: "Name", value: "maximumNumber" },
|
|
1738
|
+
arguments: [
|
|
1739
|
+
{
|
|
1740
|
+
kind: "Argument",
|
|
1741
|
+
name: { kind: "Name", value: "systemOfMeasurement" },
|
|
1742
|
+
value: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1743
|
+
},
|
|
1744
|
+
],
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
kind: "Field",
|
|
1748
|
+
name: { kind: "Name", value: "minimumNumber" },
|
|
1749
|
+
arguments: [
|
|
1750
|
+
{
|
|
1751
|
+
kind: "Argument",
|
|
1752
|
+
name: { kind: "Name", value: "systemOfMeasurement" },
|
|
1753
|
+
value: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
1754
|
+
},
|
|
1755
|
+
],
|
|
1756
|
+
},
|
|
1757
|
+
{ kind: "Field", name: { kind: "Name", value: "unitSi" } },
|
|
1758
|
+
{ kind: "Field", name: { kind: "Name", value: "unitUs" } },
|
|
1759
|
+
],
|
|
1760
|
+
},
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
kind: "InlineFragment",
|
|
1764
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "MonetaryFieldDefinition" } },
|
|
1765
|
+
selectionSet: {
|
|
1766
|
+
kind: "SelectionSet",
|
|
1767
|
+
selections: [
|
|
1768
|
+
{ kind: "Field", name: { kind: "Name", value: "currency" } },
|
|
1769
|
+
{ kind: "Field", name: { kind: "Name", value: "maximumNumber" } },
|
|
1770
|
+
{ kind: "Field", name: { kind: "Name", value: "minimumNumber" } },
|
|
1771
|
+
],
|
|
1772
|
+
},
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
kind: "InlineFragment",
|
|
1776
|
+
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "StringFieldDefinition" } },
|
|
1777
|
+
selectionSet: {
|
|
1778
|
+
kind: "SelectionSet",
|
|
1779
|
+
selections: [
|
|
1780
|
+
{ kind: "Field", name: { kind: "Name", value: "maximumLength" } },
|
|
1781
|
+
{ kind: "Field", name: { kind: "Name", value: "minimumLength" } },
|
|
1782
|
+
{ kind: "Field", name: { kind: "Name", value: "pattern" } },
|
|
1783
|
+
],
|
|
1784
|
+
},
|
|
1785
|
+
},
|
|
1786
|
+
],
|
|
1787
|
+
},
|
|
1788
|
+
},
|
|
1789
|
+
],
|
|
1790
|
+
};
|
|
1791
|
+
const GetCustomFieldDefinitionsForIrisAppDocument = {
|
|
1792
|
+
kind: "Document",
|
|
1793
|
+
definitions: [
|
|
1794
|
+
{
|
|
1795
|
+
kind: "OperationDefinition",
|
|
1796
|
+
operation: "query",
|
|
1797
|
+
name: { kind: "Name", value: "GetCustomFieldDefinitionsForIrisApp" },
|
|
966
1798
|
variableDefinitions: [
|
|
967
1799
|
{
|
|
968
1800
|
kind: "VariableDefinition",
|
|
@@ -975,6 +1807,11 @@ const GetCustomFieldDefinitionsDocument = {
|
|
|
975
1807
|
variable: { kind: "Variable", name: { kind: "Name", value: "systemOfMeasurement" } },
|
|
976
1808
|
type: { kind: "NamedType", name: { kind: "Name", value: "SystemOfMeasurement" } },
|
|
977
1809
|
},
|
|
1810
|
+
{
|
|
1811
|
+
kind: "VariableDefinition",
|
|
1812
|
+
variable: { kind: "Variable", name: { kind: "Name", value: "irisAppId" } },
|
|
1813
|
+
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } },
|
|
1814
|
+
},
|
|
978
1815
|
],
|
|
979
1816
|
selectionSet: {
|
|
980
1817
|
kind: "SelectionSet",
|
|
@@ -994,6 +1831,25 @@ const GetCustomFieldDefinitionsDocument = {
|
|
|
994
1831
|
name: { kind: "Name", value: "entityType" },
|
|
995
1832
|
value: { kind: "Variable", name: { kind: "Name", value: "entityType" } },
|
|
996
1833
|
},
|
|
1834
|
+
{
|
|
1835
|
+
kind: "Argument",
|
|
1836
|
+
name: { kind: "Name", value: "owner" },
|
|
1837
|
+
value: {
|
|
1838
|
+
kind: "ObjectValue",
|
|
1839
|
+
fields: [
|
|
1840
|
+
{
|
|
1841
|
+
kind: "ObjectField",
|
|
1842
|
+
name: { kind: "Name", value: "ownerType" },
|
|
1843
|
+
value: { kind: "EnumValue", value: "IRIS_APP" },
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
kind: "ObjectField",
|
|
1847
|
+
name: { kind: "Name", value: "irisAppId" },
|
|
1848
|
+
value: { kind: "Variable", name: { kind: "Name", value: "irisAppId" } },
|
|
1849
|
+
},
|
|
1850
|
+
],
|
|
1851
|
+
},
|
|
1852
|
+
},
|
|
997
1853
|
],
|
|
998
1854
|
selectionSet: {
|
|
999
1855
|
kind: "SelectionSet",
|
|
@@ -1246,9 +2102,164 @@ const UpdateCustomFieldValuesDocument = {
|
|
|
1246
2102
|
],
|
|
1247
2103
|
};
|
|
1248
2104
|
|
|
2105
|
+
const getCustomFieldDefinitionFromRelevantNode$1 = (node) => getFragmentData(CustomFieldDefinitionFragmentDoc, node);
|
|
2106
|
+
/**
|
|
2107
|
+
* Custom hook to fetch all custom field definitions for a specified entity type.
|
|
2108
|
+
*
|
|
2109
|
+
* @param {UseAllCustomFieldDefinitionsProps} props - The properties for the custom fields query.
|
|
2110
|
+
* @param {SupportedEntityTypes} [props.entityType] - The type of the entity (e.g., 'ASSET' or 'SITE').
|
|
2111
|
+
* @returns {UseAllCustomFieldDefinitionsReturnValue} An object containing a loading state and an array of custom field definitions.
|
|
2112
|
+
*/
|
|
2113
|
+
const useAllCustomFieldDefinitions = ({ entityType, filterQuery, owners, systemOfMeasurement, onlyEditable, }) => {
|
|
2114
|
+
var _a;
|
|
2115
|
+
const { data: definitions, loading } = client.useQuery(GetCustomFieldDefinitionsDocument, {
|
|
2116
|
+
variables: {
|
|
2117
|
+
entityType,
|
|
2118
|
+
systemOfMeasurement,
|
|
2119
|
+
},
|
|
2120
|
+
context: {
|
|
2121
|
+
headers: {
|
|
2122
|
+
"TU-PREVIEW": "JUNGLE-DIGGER",
|
|
2123
|
+
},
|
|
2124
|
+
},
|
|
2125
|
+
});
|
|
2126
|
+
const { language } = reactCoreHooks.useCurrentUserLanguage();
|
|
2127
|
+
const definitionsArray = react.useMemo(() => {
|
|
2128
|
+
var _a, _b;
|
|
2129
|
+
return (((_b = (_a = definitions === null || definitions === void 0 ? void 0 : definitions.customFieldDefinitions) === null || _a === void 0 ? void 0 : _a.edges) === null || _b === void 0 ? void 0 : _b.map(edge => getCustomFieldDefinitionFromRelevantNode$1(edge === null || edge === void 0 ? void 0 : edge.node))) ||
|
|
2130
|
+
[]);
|
|
2131
|
+
}, [(_a = definitions === null || definitions === void 0 ? void 0 : definitions.customFieldDefinitions) === null || _a === void 0 ? void 0 : _a.edges]);
|
|
2132
|
+
const filteredDefinitions = react.useMemo(() => definitionsArray
|
|
2133
|
+
.filter(sharedUtils.nonNullable)
|
|
2134
|
+
.filter(def => { var _a; return (owners && ((_a = def.owner) === null || _a === void 0 ? void 0 : _a.ownerType) ? owners.includes(def.owner.ownerType) : true); })
|
|
2135
|
+
.filter(def => (onlyEditable ? def.uiEditable : true))
|
|
2136
|
+
.map(def => {
|
|
2137
|
+
var _a, _b, _c;
|
|
2138
|
+
return (Object.assign(Object.assign({}, def), { title: (_c = (_b = (_a = def.translations) === null || _a === void 0 ? void 0 : _a.find(t => (t === null || t === void 0 ? void 0 : t.language) === language || (t === null || t === void 0 ? void 0 : t.language) === "en")) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : "" }));
|
|
2139
|
+
})
|
|
2140
|
+
.filter(def => (filterQuery ? def.title.toLowerCase().includes(filterQuery.toLowerCase()) : true)), [definitionsArray, filterQuery, language, owners, onlyEditable]);
|
|
2141
|
+
const appNameFromId = react.useCallback((appId) => {
|
|
2142
|
+
var _a, _b, _c, _d;
|
|
2143
|
+
if (!appId) {
|
|
2144
|
+
return undefined;
|
|
2145
|
+
}
|
|
2146
|
+
const matching = filteredDefinitions.find(definition => { var _a; return ((_a = definition.owner) === null || _a === void 0 ? void 0 : _a.irisAppId) === appId; });
|
|
2147
|
+
if (!matching) {
|
|
2148
|
+
return undefined;
|
|
2149
|
+
}
|
|
2150
|
+
return (_c = (_b = (_a = matching.owner) === null || _a === void 0 ? void 0 : _a.marketplaceEntry) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : (_d = matching.owner) === null || _d === void 0 ? void 0 : _d.irisAppId;
|
|
2151
|
+
}, [filteredDefinitions]);
|
|
2152
|
+
return react.useMemo(() => ({ definitions: filteredDefinitions, loading, appNameFromId }), [filteredDefinitions, loading, appNameFromId]);
|
|
2153
|
+
};
|
|
2154
|
+
|
|
2155
|
+
/**
|
|
2156
|
+
* A function used to get the CustomFieldValueAndDefinition from a node of CustomFieldValueAndDefinition.
|
|
2157
|
+
*
|
|
2158
|
+
* @param node - The node containing the CustomFieldValueAndDefinition, which may be null or undefined.
|
|
2159
|
+
* @returns {CustomFieldValueAndDefinitionNode} The CustomFieldValueAndDefinition if it exists, or undefined otherwise.
|
|
2160
|
+
*/
|
|
2161
|
+
const getAllCustomFieldValueAndDefinitionFromRelevantNode = (node) => getFragmentData(CustomFieldValueAndDefinitionFragmentDoc, node);
|
|
2162
|
+
/**
|
|
2163
|
+
* Custom hook to fetch custom fields and definitions for a specified entity.
|
|
2164
|
+
* This only returns the values that are filled out. If the value is null or undefined, it will not be returned.
|
|
2165
|
+
* It does return all custom fields, even if they are not filled out.
|
|
2166
|
+
*
|
|
2167
|
+
* @param {UseAllCustomFieldsValueAndDefinitionProps} props - The properties for the custom fields query.
|
|
2168
|
+
* @param {string} [props.entityId] - The ID of the entity for which custom fields are fetched. Can be either an asset or a site.
|
|
2169
|
+
* @param {AllSupportedEntityTypes} [props.entityType] - The type of the entity (e.g., 'ASSET' or 'SITE'). Determines which query to execute.
|
|
2170
|
+
* @param {SystemOfMeasurement} props.systemOfMeasurement - The system of measurement to be used in the custom fields.
|
|
2171
|
+
* @returns {UseAllCustomFieldsValueAndDefinitionReturnValue} An object containing a loading state and an array of custom fields and definitions.
|
|
2172
|
+
*/
|
|
2173
|
+
const useAllCustomFieldsValueAndDefinition = ({ entityId, entityType, systemOfMeasurement, }) => {
|
|
2174
|
+
var _a, _b, _c, _d;
|
|
2175
|
+
const { data: assetFields, loading: loadingAssetFields } = client.useQuery(GetCustomFieldsForAssetDocument, {
|
|
2176
|
+
variables: {
|
|
2177
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
2178
|
+
entityId: entityId, // Assertion used as ts does not understand the skip removes nulls and undefined.
|
|
2179
|
+
systemOfMeasurement,
|
|
2180
|
+
},
|
|
2181
|
+
skip: entityType !== "ASSET" || !entityId,
|
|
2182
|
+
context: {
|
|
2183
|
+
headers: {
|
|
2184
|
+
"TU-PREVIEW": "JUNGLE-DIGGER",
|
|
2185
|
+
},
|
|
2186
|
+
},
|
|
2187
|
+
});
|
|
2188
|
+
const { data: siteFields, loading: loadingSiteFields } = client.useQuery(GetCustomFieldsForSiteDocument, {
|
|
2189
|
+
variables: {
|
|
2190
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
2191
|
+
entityId: entityId, // Assertion used as ts does not understand the skip removes nulls and undefined.
|
|
2192
|
+
systemOfMeasurement,
|
|
2193
|
+
},
|
|
2194
|
+
skip: entityType !== "SITE" || !entityId,
|
|
2195
|
+
context: {
|
|
2196
|
+
headers: {
|
|
2197
|
+
"TU-PREVIEW": "JUNGLE-DIGGER",
|
|
2198
|
+
},
|
|
2199
|
+
},
|
|
2200
|
+
});
|
|
2201
|
+
const fields = react.useMemo(() => {
|
|
2202
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2203
|
+
switch (entityType) {
|
|
2204
|
+
case "ASSET":
|
|
2205
|
+
return (((_c = (_b = (_a = assetFields === null || assetFields === void 0 ? void 0 : assetFields.asset) === null || _a === void 0 ? void 0 : _a.customFields) === null || _b === void 0 ? void 0 : _b.edges) === null || _c === void 0 ? void 0 : _c.map(edge => getAllCustomFieldValueAndDefinitionFromRelevantNode(edge === null || edge === void 0 ? void 0 : edge.node))) || []);
|
|
2206
|
+
case "SITE":
|
|
2207
|
+
return (((_f = (_e = (_d = siteFields === null || siteFields === void 0 ? void 0 : siteFields.site) === null || _d === void 0 ? void 0 : _d.customFields) === null || _e === void 0 ? void 0 : _e.edges) === null || _f === void 0 ? void 0 : _f.map(edge => getAllCustomFieldValueAndDefinitionFromRelevantNode(edge === null || edge === void 0 ? void 0 : edge.node))) || []);
|
|
2208
|
+
default:
|
|
2209
|
+
return [];
|
|
2210
|
+
}
|
|
2211
|
+
}, [(_b = (_a = assetFields === null || assetFields === void 0 ? void 0 : assetFields.asset) === null || _a === void 0 ? void 0 : _a.customFields) === null || _b === void 0 ? void 0 : _b.edges, entityType, (_d = (_c = siteFields === null || siteFields === void 0 ? void 0 : siteFields.site) === null || _c === void 0 ? void 0 : _c.customFields) === null || _d === void 0 ? void 0 : _d.edges]);
|
|
2212
|
+
const loading = react.useMemo(() => loadingAssetFields || loadingSiteFields, [loadingAssetFields, loadingSiteFields]);
|
|
2213
|
+
const noneNullableFields = react.useMemo(() => fields.filter(sharedUtils.nonNullable), [fields]);
|
|
2214
|
+
return react.useMemo(() => ({ fields: noneNullableFields, loading }), [noneNullableFields, loading]);
|
|
2215
|
+
};
|
|
2216
|
+
/**
|
|
2217
|
+
* Utility function that given a {CustomFieldValueAndDefinition} can tell if it contains a value or not
|
|
2218
|
+
*
|
|
2219
|
+
* @param {AllCustomFieldValueAndDefinition} field - the custom field that might contain a value.
|
|
2220
|
+
* @returns {boolean} true if the field contains a value.
|
|
2221
|
+
*/
|
|
2222
|
+
const allCustomFieldHasValue = (field) => {
|
|
2223
|
+
switch (field.__typename) {
|
|
2224
|
+
case "WebAddressFieldValueAndDefinition": {
|
|
2225
|
+
return !!field.stringValue;
|
|
2226
|
+
}
|
|
2227
|
+
case "EmailFieldValueAndDefinition": {
|
|
2228
|
+
return !!field.stringValue;
|
|
2229
|
+
}
|
|
2230
|
+
case "PhoneNumberFieldValueAndDefinition": {
|
|
2231
|
+
return !!field.stringValue;
|
|
2232
|
+
}
|
|
2233
|
+
case "StringFieldValueAndDefinition": {
|
|
2234
|
+
return !!field.stringValue;
|
|
2235
|
+
}
|
|
2236
|
+
case "NumberFieldValueAndDefinition": {
|
|
2237
|
+
return !!field.numberValue || field.numberValue === 0;
|
|
2238
|
+
}
|
|
2239
|
+
case "BooleanFieldValueAndDefinition": {
|
|
2240
|
+
return !(field.booleanValue === null);
|
|
2241
|
+
}
|
|
2242
|
+
case "DropDownFieldValueAndDefinition": {
|
|
2243
|
+
return !!field.stringArrayValue;
|
|
2244
|
+
}
|
|
2245
|
+
case "DateFieldValueAndDefinition": {
|
|
2246
|
+
return !!field.dateValue;
|
|
2247
|
+
}
|
|
2248
|
+
case "JsonFieldValueAndDefinition": {
|
|
2249
|
+
return false;
|
|
2250
|
+
}
|
|
2251
|
+
case "MonetaryFieldValueAndDefinition": {
|
|
2252
|
+
return !!field.numberValue || field.numberValue === 0;
|
|
2253
|
+
}
|
|
2254
|
+
default:
|
|
2255
|
+
return sharedUtils.exhaustiveCheck(field);
|
|
2256
|
+
}
|
|
2257
|
+
};
|
|
2258
|
+
|
|
1249
2259
|
const getCustomFieldDefinitionFromRelevantNode = (node) => getFragmentData(CustomFieldDefinitionFragmentDoc, node);
|
|
1250
2260
|
/**
|
|
1251
2261
|
* Custom hook to fetch custom field definitions for a specified entity type.
|
|
2262
|
+
* It only returns the custom field for the current iris app.
|
|
1252
2263
|
*
|
|
1253
2264
|
* @param {UseCustomFieldDefinitionsProps} props - The properties for the custom fields query.
|
|
1254
2265
|
* @param {SupportedEntityTypes} [props.entityType] - The type of the entity (e.g., 'ASSET' or 'SITE').
|
|
@@ -1256,11 +2267,14 @@ const getCustomFieldDefinitionFromRelevantNode = (node) => getFragmentData(Custo
|
|
|
1256
2267
|
*/
|
|
1257
2268
|
const useCustomFieldDefinitions = ({ entityType, filterQuery, owners, systemOfMeasurement, onlyEditable, }) => {
|
|
1258
2269
|
var _a;
|
|
1259
|
-
const {
|
|
2270
|
+
const { irisAppId } = reactCoreHooks.useIrisAppId();
|
|
2271
|
+
const { data: definitions, loading } = client.useQuery(GetCustomFieldDefinitionsForIrisAppDocument, {
|
|
1260
2272
|
variables: {
|
|
1261
2273
|
entityType,
|
|
1262
2274
|
systemOfMeasurement,
|
|
2275
|
+
irisAppId: irisAppId,
|
|
1263
2276
|
},
|
|
2277
|
+
skip: !irisAppId,
|
|
1264
2278
|
context: {
|
|
1265
2279
|
headers: {
|
|
1266
2280
|
"TU-PREVIEW": "JUNGLE-DIGGER",
|
|
@@ -1305,6 +2319,9 @@ const useCustomFieldDefinitions = ({ entityType, filterQuery, owners, systemOfMe
|
|
|
1305
2319
|
const getCustomFieldValueAndDefinitionFromRelevantNode = (node) => getFragmentData(CustomFieldValueAndDefinitionFragmentDoc, node);
|
|
1306
2320
|
/**
|
|
1307
2321
|
* Custom hook to fetch custom fields and definitions for a specified entity.
|
|
2322
|
+
* This only returns the values that are filled out. If the value is null or undefined, it will not be returned.
|
|
2323
|
+
* It does return all custom fields, even if they are not filled out.
|
|
2324
|
+
* It only returns the custom field for the current iris app.
|
|
1308
2325
|
*
|
|
1309
2326
|
* @param {UseCustomFieldsValueAndDefinitionProps} props - The properties for the custom fields query.
|
|
1310
2327
|
* @param {string} [props.entityId] - The ID of the entity for which custom fields are fetched. Can be either an asset or a site.
|
|
@@ -1314,26 +2331,31 @@ const getCustomFieldValueAndDefinitionFromRelevantNode = (node) => getFragmentDa
|
|
|
1314
2331
|
*/
|
|
1315
2332
|
const useCustomFieldsValueAndDefinition = ({ entityId, entityType, systemOfMeasurement, }) => {
|
|
1316
2333
|
var _a, _b, _c, _d;
|
|
1317
|
-
const {
|
|
2334
|
+
const { irisAppId } = reactCoreHooks.useIrisAppId();
|
|
2335
|
+
const { data: assetFields, loading: loadingAssetFields } = client.useQuery(GetCustomFieldsForAssetForIrisAppDocument, {
|
|
1318
2336
|
variables: {
|
|
1319
2337
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
1320
2338
|
entityId: entityId, // Assertion used as ts does not understand the skip removes nulls and undefined.
|
|
1321
2339
|
systemOfMeasurement,
|
|
2340
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
2341
|
+
irisAppId: irisAppId,
|
|
1322
2342
|
},
|
|
1323
|
-
skip: entityType !== "ASSET" || !entityId,
|
|
2343
|
+
skip: entityType !== "ASSET" || !entityId || !irisAppId,
|
|
1324
2344
|
context: {
|
|
1325
2345
|
headers: {
|
|
1326
2346
|
"TU-PREVIEW": "JUNGLE-DIGGER",
|
|
1327
2347
|
},
|
|
1328
2348
|
},
|
|
1329
2349
|
});
|
|
1330
|
-
const { data: siteFields, loading: loadingSiteFields } = client.useQuery(
|
|
2350
|
+
const { data: siteFields, loading: loadingSiteFields } = client.useQuery(GetCustomFieldsForSiteForIrisAppDocument, {
|
|
1331
2351
|
variables: {
|
|
1332
2352
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
1333
2353
|
entityId: entityId, // Assertion used as ts does not understand the skip removes nulls and undefined.
|
|
1334
2354
|
systemOfMeasurement,
|
|
2355
|
+
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
2356
|
+
irisAppId: irisAppId,
|
|
1335
2357
|
},
|
|
1336
|
-
skip: entityType !== "SITE" || !entityId,
|
|
2358
|
+
skip: entityType !== "SITE" || !entityId || !irisAppId,
|
|
1337
2359
|
context: {
|
|
1338
2360
|
headers: {
|
|
1339
2361
|
"TU-PREVIEW": "JUNGLE-DIGGER",
|
|
@@ -1493,8 +2515,12 @@ const useUpdateCustomFieldValues = (entityId, entityType, customFields, systemOf
|
|
|
1493
2515
|
exports.GetCustomFieldDefinitionsDocument = GetCustomFieldDefinitionsDocument;
|
|
1494
2516
|
exports.GetCustomFieldsForAssetDocument = GetCustomFieldsForAssetDocument;
|
|
1495
2517
|
exports.GetCustomFieldsForSiteDocument = GetCustomFieldsForSiteDocument;
|
|
2518
|
+
exports.allCustomFieldHasValue = allCustomFieldHasValue;
|
|
1496
2519
|
exports.customFieldHasValue = customFieldHasValue;
|
|
2520
|
+
exports.getAllCustomFieldValueAndDefinitionFromRelevantNode = getAllCustomFieldValueAndDefinitionFromRelevantNode;
|
|
1497
2521
|
exports.getCustomFieldValueAndDefinitionFromRelevantNode = getCustomFieldValueAndDefinitionFromRelevantNode;
|
|
2522
|
+
exports.useAllCustomFieldDefinitions = useAllCustomFieldDefinitions;
|
|
2523
|
+
exports.useAllCustomFieldsValueAndDefinition = useAllCustomFieldsValueAndDefinition;
|
|
1498
2524
|
exports.useCustomFieldDefinitions = useCustomFieldDefinitions;
|
|
1499
2525
|
exports.useCustomFieldsValueAndDefinition = useCustomFieldsValueAndDefinition;
|
|
1500
2526
|
exports.useUpdateCustomFieldValues = useUpdateCustomFieldValues;
|