@sprucelabs/spruce-file-utils 18.0.9 → 18.0.11
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.
@@ -921,80 +921,25 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
921
921
|
}
|
922
922
|
}
|
923
923
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
924
|
-
interface
|
925
|
-
|
926
|
-
|
927
|
-
interface SaveSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
928
|
-
id: 'saveSettingsEmitTarget';
|
929
|
-
version: 'v2022_05_13';
|
930
|
-
namespace: 'Files';
|
931
|
-
name: '';
|
932
|
-
fields: {
|
933
|
-
/** . */
|
934
|
-
'organizationId': {
|
935
|
-
type: 'id';
|
936
|
-
isRequired: true;
|
937
|
-
options: undefined;
|
938
|
-
};
|
939
|
-
};
|
940
|
-
}
|
941
|
-
interface SaveSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema> {
|
942
|
-
}
|
943
|
-
}
|
944
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
945
|
-
interface SaveSettingsEmitPayload {
|
946
|
-
'awsAccessKeyId': string;
|
947
|
-
'awsSecretAccessKey': string;
|
948
|
-
'awsS3Bucket': string;
|
924
|
+
interface GetUploadEndpointResponsePayload {
|
925
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
926
|
+
'restEndpointUrl'?: string | undefined | null;
|
949
927
|
}
|
950
|
-
interface
|
951
|
-
id: '
|
928
|
+
interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
|
929
|
+
id: 'getUploadEndpointResponsePayload';
|
952
930
|
version: 'v2022_05_13';
|
953
931
|
namespace: 'Files';
|
954
932
|
name: '';
|
955
933
|
fields: {
|
956
|
-
/** . */
|
957
|
-
'
|
958
|
-
type: 'id';
|
959
|
-
isRequired: true;
|
960
|
-
options: undefined;
|
961
|
-
};
|
962
|
-
/** . */
|
963
|
-
'awsSecretAccessKey': {
|
964
|
-
type: 'text';
|
965
|
-
isRequired: true;
|
966
|
-
options: undefined;
|
967
|
-
};
|
968
|
-
/** . */
|
969
|
-
'awsS3Bucket': {
|
934
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
935
|
+
'restEndpointUrl': {
|
970
936
|
type: 'text';
|
971
|
-
|
972
|
-
options: undefined;
|
973
|
-
};
|
974
|
-
};
|
975
|
-
}
|
976
|
-
interface SaveSettingsEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema> {
|
977
|
-
}
|
978
|
-
}
|
979
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
980
|
-
interface SaveSettingsResponsePayload {
|
981
|
-
'wasSuccessful': boolean;
|
982
|
-
}
|
983
|
-
interface SaveSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
984
|
-
id: 'saveSettingsResponsePayload';
|
985
|
-
version: 'v2022_05_13';
|
986
|
-
namespace: 'Files';
|
987
|
-
name: '';
|
988
|
-
fields: {
|
989
|
-
/** . */
|
990
|
-
'wasSuccessful': {
|
991
|
-
type: 'boolean';
|
992
|
-
isRequired: true;
|
937
|
+
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
993
938
|
options: undefined;
|
994
939
|
};
|
995
940
|
};
|
996
941
|
}
|
997
|
-
interface
|
942
|
+
interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
|
998
943
|
}
|
999
944
|
}
|
1000
945
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
@@ -1073,36 +1018,74 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1073
1018
|
}
|
1074
1019
|
}
|
1075
1020
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1076
|
-
interface
|
1077
|
-
|
1078
|
-
'
|
1021
|
+
interface UploadEmitTarget {
|
1022
|
+
'locationId'?: string | undefined | null;
|
1023
|
+
'organizationId'?: string | undefined | null;
|
1024
|
+
'filePersonId'?: string | undefined | null;
|
1079
1025
|
}
|
1080
|
-
interface
|
1081
|
-
id: '
|
1026
|
+
interface UploadEmitTargetSchema extends SpruceSchema.Schema {
|
1027
|
+
id: 'uploadEmitTarget';
|
1082
1028
|
version: 'v2022_05_13';
|
1083
1029
|
namespace: 'Files';
|
1084
1030
|
name: '';
|
1085
1031
|
fields: {
|
1086
|
-
/** .
|
1087
|
-
'
|
1032
|
+
/** . */
|
1033
|
+
'locationId': {
|
1034
|
+
type: 'id';
|
1035
|
+
options: undefined;
|
1036
|
+
};
|
1037
|
+
/** . */
|
1038
|
+
'organizationId': {
|
1039
|
+
type: 'id';
|
1040
|
+
options: undefined;
|
1041
|
+
};
|
1042
|
+
/** . */
|
1043
|
+
'filePersonId': {
|
1088
1044
|
type: 'text';
|
1089
|
-
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
1090
1045
|
options: undefined;
|
1091
1046
|
};
|
1092
1047
|
};
|
1093
1048
|
}
|
1094
|
-
interface
|
1049
|
+
interface UploadEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema> {
|
1095
1050
|
}
|
1096
1051
|
}
|
1097
1052
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1098
|
-
interface
|
1053
|
+
interface UploadEmitPayload {
|
1054
|
+
'base64Body': string;
|
1055
|
+
'name': string;
|
1056
|
+
}
|
1057
|
+
interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
|
1058
|
+
id: 'uploadEmitPayload';
|
1059
|
+
version: 'v2022_05_13';
|
1060
|
+
namespace: 'Files';
|
1061
|
+
name: '';
|
1062
|
+
fields: {
|
1063
|
+
/** . */
|
1064
|
+
'base64Body': {
|
1065
|
+
type: 'text';
|
1066
|
+
isRequired: true;
|
1067
|
+
options: undefined;
|
1068
|
+
};
|
1069
|
+
/** . */
|
1070
|
+
'name': {
|
1071
|
+
type: 'text';
|
1072
|
+
isRequired: true;
|
1073
|
+
options: undefined;
|
1074
|
+
};
|
1075
|
+
};
|
1076
|
+
}
|
1077
|
+
interface UploadEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema> {
|
1078
|
+
}
|
1079
|
+
}
|
1080
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1081
|
+
interface UploadEmitTargetAndPayload {
|
1099
1082
|
/** Source. */
|
1100
1083
|
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
1101
|
-
'target'
|
1102
|
-
'payload': SpruceSchemas.Files.v2022_05_13.
|
1084
|
+
'target'?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
|
1085
|
+
'payload': SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
|
1103
1086
|
}
|
1104
|
-
interface
|
1105
|
-
id: '
|
1087
|
+
interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
1088
|
+
id: 'uploadEmitTargetAndPayload';
|
1106
1089
|
version: 'v2022_05_13';
|
1107
1090
|
namespace: 'Files';
|
1108
1091
|
name: '';
|
@@ -1118,9 +1101,8 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1118
1101
|
/** . */
|
1119
1102
|
'target': {
|
1120
1103
|
type: 'schema';
|
1121
|
-
isRequired: true;
|
1122
1104
|
options: {
|
1123
|
-
schema: SpruceSchemas.Files.v2022_05_13.
|
1105
|
+
schema: SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema;
|
1124
1106
|
};
|
1125
1107
|
};
|
1126
1108
|
/** . */
|
@@ -1128,83 +1110,79 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1128
1110
|
type: 'schema';
|
1129
1111
|
isRequired: true;
|
1130
1112
|
options: {
|
1131
|
-
schema: SpruceSchemas.Files.v2022_05_13.
|
1113
|
+
schema: SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema;
|
1132
1114
|
};
|
1133
1115
|
};
|
1134
1116
|
};
|
1135
1117
|
}
|
1136
|
-
interface
|
1118
|
+
interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
|
1137
1119
|
}
|
1138
1120
|
}
|
1139
1121
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1140
|
-
interface
|
1141
|
-
'
|
1142
|
-
'organizationId'?: string | undefined | null;
|
1143
|
-
'filePersonId'?: string | undefined | null;
|
1122
|
+
interface SaveSettingsEmitTarget {
|
1123
|
+
'organizationId': string;
|
1144
1124
|
}
|
1145
|
-
interface
|
1146
|
-
id: '
|
1125
|
+
interface SaveSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
1126
|
+
id: 'saveSettingsEmitTarget';
|
1147
1127
|
version: 'v2022_05_13';
|
1148
1128
|
namespace: 'Files';
|
1149
1129
|
name: '';
|
1150
1130
|
fields: {
|
1151
|
-
/** . */
|
1152
|
-
'locationId': {
|
1153
|
-
type: 'id';
|
1154
|
-
options: undefined;
|
1155
|
-
};
|
1156
1131
|
/** . */
|
1157
1132
|
'organizationId': {
|
1158
1133
|
type: 'id';
|
1159
|
-
|
1160
|
-
};
|
1161
|
-
/** . */
|
1162
|
-
'filePersonId': {
|
1163
|
-
type: 'text';
|
1134
|
+
isRequired: true;
|
1164
1135
|
options: undefined;
|
1165
1136
|
};
|
1166
1137
|
};
|
1167
1138
|
}
|
1168
|
-
interface
|
1139
|
+
interface SaveSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema> {
|
1169
1140
|
}
|
1170
1141
|
}
|
1171
1142
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1172
|
-
interface
|
1173
|
-
'
|
1174
|
-
'
|
1143
|
+
interface SaveSettingsEmitPayload {
|
1144
|
+
'awsAccessKeyId': string;
|
1145
|
+
'awsSecretAccessKey': string;
|
1146
|
+
'awsS3Bucket': string;
|
1175
1147
|
}
|
1176
|
-
interface
|
1177
|
-
id: '
|
1148
|
+
interface SaveSettingsEmitPayloadSchema extends SpruceSchema.Schema {
|
1149
|
+
id: 'saveSettingsEmitPayload';
|
1178
1150
|
version: 'v2022_05_13';
|
1179
1151
|
namespace: 'Files';
|
1180
1152
|
name: '';
|
1181
1153
|
fields: {
|
1182
1154
|
/** . */
|
1183
|
-
'
|
1155
|
+
'awsAccessKeyId': {
|
1156
|
+
type: 'id';
|
1157
|
+
isRequired: true;
|
1158
|
+
options: undefined;
|
1159
|
+
};
|
1160
|
+
/** . */
|
1161
|
+
'awsSecretAccessKey': {
|
1184
1162
|
type: 'text';
|
1185
1163
|
isRequired: true;
|
1186
1164
|
options: undefined;
|
1187
1165
|
};
|
1188
1166
|
/** . */
|
1189
|
-
'
|
1167
|
+
'awsS3Bucket': {
|
1190
1168
|
type: 'text';
|
1191
1169
|
isRequired: true;
|
1192
1170
|
options: undefined;
|
1193
1171
|
};
|
1194
1172
|
};
|
1195
1173
|
}
|
1196
|
-
interface
|
1174
|
+
interface SaveSettingsEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema> {
|
1197
1175
|
}
|
1198
1176
|
}
|
1199
1177
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1200
|
-
interface
|
1178
|
+
interface SaveSettingsEmitTargetAndPayload {
|
1201
1179
|
/** Source. */
|
1202
1180
|
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
1203
|
-
'target'
|
1204
|
-
'payload': SpruceSchemas.Files.v2022_05_13.
|
1181
|
+
'target': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTarget;
|
1182
|
+
'payload': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayload;
|
1205
1183
|
}
|
1206
|
-
interface
|
1207
|
-
id: '
|
1184
|
+
interface SaveSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
1185
|
+
id: 'saveSettingsEmitTargetAndPayload';
|
1208
1186
|
version: 'v2022_05_13';
|
1209
1187
|
namespace: 'Files';
|
1210
1188
|
name: '';
|
@@ -1220,8 +1198,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1220
1198
|
/** . */
|
1221
1199
|
'target': {
|
1222
1200
|
type: 'schema';
|
1201
|
+
isRequired: true;
|
1223
1202
|
options: {
|
1224
|
-
schema: SpruceSchemas.Files.v2022_05_13.
|
1203
|
+
schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema;
|
1225
1204
|
};
|
1226
1205
|
};
|
1227
1206
|
/** . */
|
@@ -1229,12 +1208,33 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1229
1208
|
type: 'schema';
|
1230
1209
|
isRequired: true;
|
1231
1210
|
options: {
|
1232
|
-
schema: SpruceSchemas.Files.v2022_05_13.
|
1211
|
+
schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema;
|
1233
1212
|
};
|
1234
1213
|
};
|
1235
1214
|
};
|
1236
1215
|
}
|
1237
|
-
interface
|
1216
|
+
interface SaveSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetAndPayloadSchema> {
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1220
|
+
interface SaveSettingsResponsePayload {
|
1221
|
+
'wasSuccessful': boolean;
|
1222
|
+
}
|
1223
|
+
interface SaveSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
1224
|
+
id: 'saveSettingsResponsePayload';
|
1225
|
+
version: 'v2022_05_13';
|
1226
|
+
namespace: 'Files';
|
1227
|
+
name: '';
|
1228
|
+
fields: {
|
1229
|
+
/** . */
|
1230
|
+
'wasSuccessful': {
|
1231
|
+
type: 'boolean';
|
1232
|
+
isRequired: true;
|
1233
|
+
options: undefined;
|
1234
|
+
};
|
1235
|
+
};
|
1236
|
+
}
|
1237
|
+
interface SaveSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsResponsePayloadSchema> {
|
1238
1238
|
}
|
1239
1239
|
}
|
1240
1240
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
@@ -921,80 +921,25 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
921
921
|
}
|
922
922
|
}
|
923
923
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
924
|
-
interface
|
925
|
-
|
926
|
-
|
927
|
-
interface SaveSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
928
|
-
id: 'saveSettingsEmitTarget';
|
929
|
-
version: 'v2022_05_13';
|
930
|
-
namespace: 'Files';
|
931
|
-
name: '';
|
932
|
-
fields: {
|
933
|
-
/** . */
|
934
|
-
'organizationId': {
|
935
|
-
type: 'id';
|
936
|
-
isRequired: true;
|
937
|
-
options: undefined;
|
938
|
-
};
|
939
|
-
};
|
940
|
-
}
|
941
|
-
interface SaveSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema> {
|
942
|
-
}
|
943
|
-
}
|
944
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
945
|
-
interface SaveSettingsEmitPayload {
|
946
|
-
'awsAccessKeyId': string;
|
947
|
-
'awsSecretAccessKey': string;
|
948
|
-
'awsS3Bucket': string;
|
924
|
+
interface GetUploadEndpointResponsePayload {
|
925
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
926
|
+
'restEndpointUrl'?: string | undefined | null;
|
949
927
|
}
|
950
|
-
interface
|
951
|
-
id: '
|
928
|
+
interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
|
929
|
+
id: 'getUploadEndpointResponsePayload';
|
952
930
|
version: 'v2022_05_13';
|
953
931
|
namespace: 'Files';
|
954
932
|
name: '';
|
955
933
|
fields: {
|
956
|
-
/** . */
|
957
|
-
'
|
958
|
-
type: 'id';
|
959
|
-
isRequired: true;
|
960
|
-
options: undefined;
|
961
|
-
};
|
962
|
-
/** . */
|
963
|
-
'awsSecretAccessKey': {
|
964
|
-
type: 'text';
|
965
|
-
isRequired: true;
|
966
|
-
options: undefined;
|
967
|
-
};
|
968
|
-
/** . */
|
969
|
-
'awsS3Bucket': {
|
934
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
935
|
+
'restEndpointUrl': {
|
970
936
|
type: 'text';
|
971
|
-
|
972
|
-
options: undefined;
|
973
|
-
};
|
974
|
-
};
|
975
|
-
}
|
976
|
-
interface SaveSettingsEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema> {
|
977
|
-
}
|
978
|
-
}
|
979
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
980
|
-
interface SaveSettingsResponsePayload {
|
981
|
-
'wasSuccessful': boolean;
|
982
|
-
}
|
983
|
-
interface SaveSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
984
|
-
id: 'saveSettingsResponsePayload';
|
985
|
-
version: 'v2022_05_13';
|
986
|
-
namespace: 'Files';
|
987
|
-
name: '';
|
988
|
-
fields: {
|
989
|
-
/** . */
|
990
|
-
'wasSuccessful': {
|
991
|
-
type: 'boolean';
|
992
|
-
isRequired: true;
|
937
|
+
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
993
938
|
options: undefined;
|
994
939
|
};
|
995
940
|
};
|
996
941
|
}
|
997
|
-
interface
|
942
|
+
interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
|
998
943
|
}
|
999
944
|
}
|
1000
945
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
@@ -1073,36 +1018,74 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1073
1018
|
}
|
1074
1019
|
}
|
1075
1020
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1076
|
-
interface
|
1077
|
-
|
1078
|
-
'
|
1021
|
+
interface UploadEmitTarget {
|
1022
|
+
'locationId'?: string | undefined | null;
|
1023
|
+
'organizationId'?: string | undefined | null;
|
1024
|
+
'filePersonId'?: string | undefined | null;
|
1079
1025
|
}
|
1080
|
-
interface
|
1081
|
-
id: '
|
1026
|
+
interface UploadEmitTargetSchema extends SpruceSchema.Schema {
|
1027
|
+
id: 'uploadEmitTarget';
|
1082
1028
|
version: 'v2022_05_13';
|
1083
1029
|
namespace: 'Files';
|
1084
1030
|
name: '';
|
1085
1031
|
fields: {
|
1086
|
-
/** .
|
1087
|
-
'
|
1032
|
+
/** . */
|
1033
|
+
'locationId': {
|
1034
|
+
type: 'id';
|
1035
|
+
options: undefined;
|
1036
|
+
};
|
1037
|
+
/** . */
|
1038
|
+
'organizationId': {
|
1039
|
+
type: 'id';
|
1040
|
+
options: undefined;
|
1041
|
+
};
|
1042
|
+
/** . */
|
1043
|
+
'filePersonId': {
|
1088
1044
|
type: 'text';
|
1089
|
-
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
1090
1045
|
options: undefined;
|
1091
1046
|
};
|
1092
1047
|
};
|
1093
1048
|
}
|
1094
|
-
interface
|
1049
|
+
interface UploadEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema> {
|
1095
1050
|
}
|
1096
1051
|
}
|
1097
1052
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1098
|
-
interface
|
1053
|
+
interface UploadEmitPayload {
|
1054
|
+
'base64Body': string;
|
1055
|
+
'name': string;
|
1056
|
+
}
|
1057
|
+
interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
|
1058
|
+
id: 'uploadEmitPayload';
|
1059
|
+
version: 'v2022_05_13';
|
1060
|
+
namespace: 'Files';
|
1061
|
+
name: '';
|
1062
|
+
fields: {
|
1063
|
+
/** . */
|
1064
|
+
'base64Body': {
|
1065
|
+
type: 'text';
|
1066
|
+
isRequired: true;
|
1067
|
+
options: undefined;
|
1068
|
+
};
|
1069
|
+
/** . */
|
1070
|
+
'name': {
|
1071
|
+
type: 'text';
|
1072
|
+
isRequired: true;
|
1073
|
+
options: undefined;
|
1074
|
+
};
|
1075
|
+
};
|
1076
|
+
}
|
1077
|
+
interface UploadEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema> {
|
1078
|
+
}
|
1079
|
+
}
|
1080
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1081
|
+
interface UploadEmitTargetAndPayload {
|
1099
1082
|
/** Source. */
|
1100
1083
|
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
1101
|
-
'target'
|
1102
|
-
'payload': SpruceSchemas.Files.v2022_05_13.
|
1084
|
+
'target'?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
|
1085
|
+
'payload': SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
|
1103
1086
|
}
|
1104
|
-
interface
|
1105
|
-
id: '
|
1087
|
+
interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
1088
|
+
id: 'uploadEmitTargetAndPayload';
|
1106
1089
|
version: 'v2022_05_13';
|
1107
1090
|
namespace: 'Files';
|
1108
1091
|
name: '';
|
@@ -1118,9 +1101,8 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1118
1101
|
/** . */
|
1119
1102
|
'target': {
|
1120
1103
|
type: 'schema';
|
1121
|
-
isRequired: true;
|
1122
1104
|
options: {
|
1123
|
-
schema: SpruceSchemas.Files.v2022_05_13.
|
1105
|
+
schema: SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema;
|
1124
1106
|
};
|
1125
1107
|
};
|
1126
1108
|
/** . */
|
@@ -1128,83 +1110,79 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1128
1110
|
type: 'schema';
|
1129
1111
|
isRequired: true;
|
1130
1112
|
options: {
|
1131
|
-
schema: SpruceSchemas.Files.v2022_05_13.
|
1113
|
+
schema: SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema;
|
1132
1114
|
};
|
1133
1115
|
};
|
1134
1116
|
};
|
1135
1117
|
}
|
1136
|
-
interface
|
1118
|
+
interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
|
1137
1119
|
}
|
1138
1120
|
}
|
1139
1121
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1140
|
-
interface
|
1141
|
-
'
|
1142
|
-
'organizationId'?: string | undefined | null;
|
1143
|
-
'filePersonId'?: string | undefined | null;
|
1122
|
+
interface SaveSettingsEmitTarget {
|
1123
|
+
'organizationId': string;
|
1144
1124
|
}
|
1145
|
-
interface
|
1146
|
-
id: '
|
1125
|
+
interface SaveSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
1126
|
+
id: 'saveSettingsEmitTarget';
|
1147
1127
|
version: 'v2022_05_13';
|
1148
1128
|
namespace: 'Files';
|
1149
1129
|
name: '';
|
1150
1130
|
fields: {
|
1151
|
-
/** . */
|
1152
|
-
'locationId': {
|
1153
|
-
type: 'id';
|
1154
|
-
options: undefined;
|
1155
|
-
};
|
1156
1131
|
/** . */
|
1157
1132
|
'organizationId': {
|
1158
1133
|
type: 'id';
|
1159
|
-
|
1160
|
-
};
|
1161
|
-
/** . */
|
1162
|
-
'filePersonId': {
|
1163
|
-
type: 'text';
|
1134
|
+
isRequired: true;
|
1164
1135
|
options: undefined;
|
1165
1136
|
};
|
1166
1137
|
};
|
1167
1138
|
}
|
1168
|
-
interface
|
1139
|
+
interface SaveSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema> {
|
1169
1140
|
}
|
1170
1141
|
}
|
1171
1142
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1172
|
-
interface
|
1173
|
-
'
|
1174
|
-
'
|
1143
|
+
interface SaveSettingsEmitPayload {
|
1144
|
+
'awsAccessKeyId': string;
|
1145
|
+
'awsSecretAccessKey': string;
|
1146
|
+
'awsS3Bucket': string;
|
1175
1147
|
}
|
1176
|
-
interface
|
1177
|
-
id: '
|
1148
|
+
interface SaveSettingsEmitPayloadSchema extends SpruceSchema.Schema {
|
1149
|
+
id: 'saveSettingsEmitPayload';
|
1178
1150
|
version: 'v2022_05_13';
|
1179
1151
|
namespace: 'Files';
|
1180
1152
|
name: '';
|
1181
1153
|
fields: {
|
1182
1154
|
/** . */
|
1183
|
-
'
|
1155
|
+
'awsAccessKeyId': {
|
1156
|
+
type: 'id';
|
1157
|
+
isRequired: true;
|
1158
|
+
options: undefined;
|
1159
|
+
};
|
1160
|
+
/** . */
|
1161
|
+
'awsSecretAccessKey': {
|
1184
1162
|
type: 'text';
|
1185
1163
|
isRequired: true;
|
1186
1164
|
options: undefined;
|
1187
1165
|
};
|
1188
1166
|
/** . */
|
1189
|
-
'
|
1167
|
+
'awsS3Bucket': {
|
1190
1168
|
type: 'text';
|
1191
1169
|
isRequired: true;
|
1192
1170
|
options: undefined;
|
1193
1171
|
};
|
1194
1172
|
};
|
1195
1173
|
}
|
1196
|
-
interface
|
1174
|
+
interface SaveSettingsEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema> {
|
1197
1175
|
}
|
1198
1176
|
}
|
1199
1177
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1200
|
-
interface
|
1178
|
+
interface SaveSettingsEmitTargetAndPayload {
|
1201
1179
|
/** Source. */
|
1202
1180
|
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
1203
|
-
'target'
|
1204
|
-
'payload': SpruceSchemas.Files.v2022_05_13.
|
1181
|
+
'target': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTarget;
|
1182
|
+
'payload': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayload;
|
1205
1183
|
}
|
1206
|
-
interface
|
1207
|
-
id: '
|
1184
|
+
interface SaveSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
1185
|
+
id: 'saveSettingsEmitTargetAndPayload';
|
1208
1186
|
version: 'v2022_05_13';
|
1209
1187
|
namespace: 'Files';
|
1210
1188
|
name: '';
|
@@ -1220,8 +1198,9 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1220
1198
|
/** . */
|
1221
1199
|
'target': {
|
1222
1200
|
type: 'schema';
|
1201
|
+
isRequired: true;
|
1223
1202
|
options: {
|
1224
|
-
schema: SpruceSchemas.Files.v2022_05_13.
|
1203
|
+
schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetSchema;
|
1225
1204
|
};
|
1226
1205
|
};
|
1227
1206
|
/** . */
|
@@ -1229,12 +1208,33 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1229
1208
|
type: 'schema';
|
1230
1209
|
isRequired: true;
|
1231
1210
|
options: {
|
1232
|
-
schema: SpruceSchemas.Files.v2022_05_13.
|
1211
|
+
schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema;
|
1233
1212
|
};
|
1234
1213
|
};
|
1235
1214
|
};
|
1236
1215
|
}
|
1237
|
-
interface
|
1216
|
+
interface SaveSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTargetAndPayloadSchema> {
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1220
|
+
interface SaveSettingsResponsePayload {
|
1221
|
+
'wasSuccessful': boolean;
|
1222
|
+
}
|
1223
|
+
interface SaveSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
1224
|
+
id: 'saveSettingsResponsePayload';
|
1225
|
+
version: 'v2022_05_13';
|
1226
|
+
namespace: 'Files';
|
1227
|
+
name: '';
|
1228
|
+
fields: {
|
1229
|
+
/** . */
|
1230
|
+
'wasSuccessful': {
|
1231
|
+
type: 'boolean';
|
1232
|
+
isRequired: true;
|
1233
|
+
options: undefined;
|
1234
|
+
};
|
1235
|
+
};
|
1236
|
+
}
|
1237
|
+
interface SaveSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsResponsePayloadSchema> {
|
1238
1238
|
}
|
1239
1239
|
}
|
1240
1240
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
import { assertOptions, SchemaError } from '@sprucelabs/schema';
|
11
11
|
import FileType from 'file-type';
|
12
12
|
import MimeTypes from 'mime-types';
|
13
|
-
import * as uuid from 'uuid';
|
14
13
|
import LocalUploadStrategy from './LocalUploadStrategy.js';
|
15
14
|
import S3UploadStrategy from './S3UploadStrategy.js';
|
16
15
|
export default class FileUploaderImpl {
|
@@ -45,7 +44,7 @@ export default class FileUploaderImpl {
|
|
45
44
|
'target.organizationId': organizationId,
|
46
45
|
}));
|
47
46
|
const { type, ext, buffer } = yield this.findTypeAndBuffer(base64Body, name);
|
48
|
-
const uniqueName = `${uuid
|
47
|
+
const uniqueName = `${uuid()}.${ext}`;
|
49
48
|
const uri = yield this.uploadStrategy.upload({
|
50
49
|
name: uniqueName,
|
51
50
|
buffer,
|
@@ -83,3 +82,9 @@ export default class FileUploaderImpl {
|
|
83
82
|
});
|
84
83
|
}
|
85
84
|
}
|
85
|
+
function uuid() {
|
86
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
87
|
+
let r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
88
|
+
return v.toString(16);
|
89
|
+
});
|
90
|
+
}
|
@@ -1,37 +1,4 @@
|
|
1
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 () {
|
19
|
-
var ownKeys = function(o) {
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
-
var ar = [];
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
-
return ar;
|
24
|
-
};
|
25
|
-
return ownKeys(o);
|
26
|
-
};
|
27
|
-
return function (mod) {
|
28
|
-
if (mod && mod.__esModule) return mod;
|
29
|
-
var result = {};
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
-
__setModuleDefault(result, mod);
|
32
|
-
return result;
|
33
|
-
};
|
34
|
-
})();
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
37
4
|
};
|
@@ -39,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
const schema_1 = require("@sprucelabs/schema");
|
40
7
|
const file_type_1 = __importDefault(require("file-type"));
|
41
8
|
const mime_types_1 = __importDefault(require("mime-types"));
|
42
|
-
const uuid = __importStar(require("uuid"));
|
43
9
|
const LocalUploadStrategy_1 = __importDefault(require("./LocalUploadStrategy"));
|
44
10
|
const S3UploadStrategy_1 = __importDefault(require("./S3UploadStrategy"));
|
45
11
|
class FileUploaderImpl {
|
@@ -71,7 +37,7 @@ class FileUploaderImpl {
|
|
71
37
|
'target.organizationId': organizationId,
|
72
38
|
});
|
73
39
|
const { type, ext, buffer } = await this.findTypeAndBuffer(base64Body, name);
|
74
|
-
const uniqueName = `${uuid
|
40
|
+
const uniqueName = `${uuid()}.${ext}`;
|
75
41
|
const uri = await this.uploadStrategy.upload({
|
76
42
|
name: uniqueName,
|
77
43
|
buffer,
|
@@ -107,3 +73,9 @@ class FileUploaderImpl {
|
|
107
73
|
}
|
108
74
|
}
|
109
75
|
exports.default = FileUploaderImpl;
|
76
|
+
function uuid() {
|
77
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
78
|
+
let r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
79
|
+
return v.toString(16);
|
80
|
+
});
|
81
|
+
}
|