@sprucelabs/spruce-file-utils 18.0.10 → 18.0.12
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.
@@ -718,6 +718,92 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
718
718
|
interface UpsertThemeResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Heartwood.v2021_02_11.UpsertThemeResponsePayloadSchema> {
|
719
719
|
}
|
720
720
|
}
|
721
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
722
|
+
interface GetLocalSettingsEmitTarget {
|
723
|
+
'organizationId': string;
|
724
|
+
}
|
725
|
+
interface GetLocalSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
726
|
+
id: 'getLocalSettingsEmitTarget';
|
727
|
+
version: 'v2022_05_13';
|
728
|
+
namespace: 'Files';
|
729
|
+
name: '';
|
730
|
+
fields: {
|
731
|
+
/** . */
|
732
|
+
'organizationId': {
|
733
|
+
type: 'id';
|
734
|
+
isRequired: true;
|
735
|
+
options: undefined;
|
736
|
+
};
|
737
|
+
};
|
738
|
+
}
|
739
|
+
interface GetLocalSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetSchema> {
|
740
|
+
}
|
741
|
+
}
|
742
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
743
|
+
interface GetLocalSettingsEmitTargetAndPayload {
|
744
|
+
/** Source. */
|
745
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
746
|
+
'target': SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTarget;
|
747
|
+
}
|
748
|
+
interface GetLocalSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
749
|
+
id: 'getLocalSettingsEmitTargetAndPayload';
|
750
|
+
version: 'v2022_05_13';
|
751
|
+
namespace: 'Files';
|
752
|
+
name: '';
|
753
|
+
fields: {
|
754
|
+
/** Source. */
|
755
|
+
'source': {
|
756
|
+
label: 'Source';
|
757
|
+
type: 'schema';
|
758
|
+
options: {
|
759
|
+
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
760
|
+
};
|
761
|
+
};
|
762
|
+
/** . */
|
763
|
+
'target': {
|
764
|
+
type: 'schema';
|
765
|
+
isRequired: true;
|
766
|
+
options: {
|
767
|
+
schema: SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetSchema;
|
768
|
+
};
|
769
|
+
};
|
770
|
+
};
|
771
|
+
}
|
772
|
+
interface GetLocalSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetAndPayloadSchema> {
|
773
|
+
}
|
774
|
+
}
|
775
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
776
|
+
interface GetLocalSettingsResponsePayload {
|
777
|
+
/** Local Upload Directory. */
|
778
|
+
'localUploadDir': string;
|
779
|
+
/** File Host URL. */
|
780
|
+
'fileHostUrl': string;
|
781
|
+
}
|
782
|
+
interface GetLocalSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
783
|
+
id: 'getLocalSettingsResponsePayload';
|
784
|
+
version: 'v2022_05_13';
|
785
|
+
namespace: 'Files';
|
786
|
+
name: '';
|
787
|
+
fields: {
|
788
|
+
/** Local Upload Directory. */
|
789
|
+
'localUploadDir': {
|
790
|
+
label: 'Local Upload Directory';
|
791
|
+
type: 'text';
|
792
|
+
isRequired: true;
|
793
|
+
options: undefined;
|
794
|
+
};
|
795
|
+
/** File Host URL. */
|
796
|
+
'fileHostUrl': {
|
797
|
+
label: 'File Host URL';
|
798
|
+
type: 'text';
|
799
|
+
isRequired: true;
|
800
|
+
options: undefined;
|
801
|
+
};
|
802
|
+
};
|
803
|
+
}
|
804
|
+
interface GetLocalSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsResponsePayloadSchema> {
|
805
|
+
}
|
806
|
+
}
|
721
807
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
722
808
|
interface SaveLocalSettingsEmitTarget {
|
723
809
|
'organizationId': string;
|
@@ -834,92 +920,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
834
920
|
interface SaveLocalSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsResponsePayloadSchema> {
|
835
921
|
}
|
836
922
|
}
|
837
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
838
|
-
interface GetLocalSettingsEmitTarget {
|
839
|
-
'organizationId': string;
|
840
|
-
}
|
841
|
-
interface GetLocalSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
842
|
-
id: 'getLocalSettingsEmitTarget';
|
843
|
-
version: 'v2022_05_13';
|
844
|
-
namespace: 'Files';
|
845
|
-
name: '';
|
846
|
-
fields: {
|
847
|
-
/** . */
|
848
|
-
'organizationId': {
|
849
|
-
type: 'id';
|
850
|
-
isRequired: true;
|
851
|
-
options: undefined;
|
852
|
-
};
|
853
|
-
};
|
854
|
-
}
|
855
|
-
interface GetLocalSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetSchema> {
|
856
|
-
}
|
857
|
-
}
|
858
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
859
|
-
interface GetLocalSettingsEmitTargetAndPayload {
|
860
|
-
/** Source. */
|
861
|
-
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
862
|
-
'target': SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTarget;
|
863
|
-
}
|
864
|
-
interface GetLocalSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
865
|
-
id: 'getLocalSettingsEmitTargetAndPayload';
|
866
|
-
version: 'v2022_05_13';
|
867
|
-
namespace: 'Files';
|
868
|
-
name: '';
|
869
|
-
fields: {
|
870
|
-
/** Source. */
|
871
|
-
'source': {
|
872
|
-
label: 'Source';
|
873
|
-
type: 'schema';
|
874
|
-
options: {
|
875
|
-
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
876
|
-
};
|
877
|
-
};
|
878
|
-
/** . */
|
879
|
-
'target': {
|
880
|
-
type: 'schema';
|
881
|
-
isRequired: true;
|
882
|
-
options: {
|
883
|
-
schema: SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetSchema;
|
884
|
-
};
|
885
|
-
};
|
886
|
-
};
|
887
|
-
}
|
888
|
-
interface GetLocalSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetAndPayloadSchema> {
|
889
|
-
}
|
890
|
-
}
|
891
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
892
|
-
interface GetLocalSettingsResponsePayload {
|
893
|
-
/** Local Upload Directory. */
|
894
|
-
'localUploadDir': string;
|
895
|
-
/** File Host URL. */
|
896
|
-
'fileHostUrl': string;
|
897
|
-
}
|
898
|
-
interface GetLocalSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
899
|
-
id: 'getLocalSettingsResponsePayload';
|
900
|
-
version: 'v2022_05_13';
|
901
|
-
namespace: 'Files';
|
902
|
-
name: '';
|
903
|
-
fields: {
|
904
|
-
/** Local Upload Directory. */
|
905
|
-
'localUploadDir': {
|
906
|
-
label: 'Local Upload Directory';
|
907
|
-
type: 'text';
|
908
|
-
isRequired: true;
|
909
|
-
options: undefined;
|
910
|
-
};
|
911
|
-
/** File Host URL. */
|
912
|
-
'fileHostUrl': {
|
913
|
-
label: 'File Host URL';
|
914
|
-
type: 'text';
|
915
|
-
isRequired: true;
|
916
|
-
options: undefined;
|
917
|
-
};
|
918
|
-
};
|
919
|
-
}
|
920
|
-
interface GetLocalSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsResponsePayloadSchema> {
|
921
|
-
}
|
922
|
-
}
|
923
923
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
924
924
|
interface GetSettingsStatusEmitTarget {
|
925
925
|
'organizationId': string;
|
@@ -941,39 +941,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
941
941
|
interface GetSettingsStatusEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema> {
|
942
942
|
}
|
943
943
|
}
|
944
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
945
|
-
interface GetSettingsStatusEmitTargetAndPayload {
|
946
|
-
/** Source. */
|
947
|
-
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
948
|
-
'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
|
949
|
-
}
|
950
|
-
interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
951
|
-
id: 'getSettingsStatusEmitTargetAndPayload';
|
952
|
-
version: 'v2022_05_13';
|
953
|
-
namespace: 'Files';
|
954
|
-
name: '';
|
955
|
-
fields: {
|
956
|
-
/** Source. */
|
957
|
-
'source': {
|
958
|
-
label: 'Source';
|
959
|
-
type: 'schema';
|
960
|
-
options: {
|
961
|
-
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
962
|
-
};
|
963
|
-
};
|
964
|
-
/** . */
|
965
|
-
'target': {
|
966
|
-
type: 'schema';
|
967
|
-
isRequired: true;
|
968
|
-
options: {
|
969
|
-
schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
|
970
|
-
};
|
971
|
-
};
|
972
|
-
};
|
973
|
-
}
|
974
|
-
interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
|
975
|
-
}
|
976
|
-
}
|
977
944
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
978
945
|
interface GetSettingsStatusResponsePayload {
|
979
946
|
'didConfigureFileUploads': boolean;
|
@@ -1114,6 +1081,61 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1114
1081
|
interface SaveSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsResponsePayloadSchema> {
|
1115
1082
|
}
|
1116
1083
|
}
|
1084
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1085
|
+
interface GetUploadEndpointResponsePayload {
|
1086
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1087
|
+
'restEndpointUrl'?: string | undefined | null;
|
1088
|
+
}
|
1089
|
+
interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
|
1090
|
+
id: 'getUploadEndpointResponsePayload';
|
1091
|
+
version: 'v2022_05_13';
|
1092
|
+
namespace: 'Files';
|
1093
|
+
name: '';
|
1094
|
+
fields: {
|
1095
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1096
|
+
'restEndpointUrl': {
|
1097
|
+
type: 'text';
|
1098
|
+
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
1099
|
+
options: undefined;
|
1100
|
+
};
|
1101
|
+
};
|
1102
|
+
}
|
1103
|
+
interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
|
1104
|
+
}
|
1105
|
+
}
|
1106
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1107
|
+
interface GetSettingsStatusEmitTargetAndPayload {
|
1108
|
+
/** Source. */
|
1109
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
1110
|
+
'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
|
1111
|
+
}
|
1112
|
+
interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
1113
|
+
id: 'getSettingsStatusEmitTargetAndPayload';
|
1114
|
+
version: 'v2022_05_13';
|
1115
|
+
namespace: 'Files';
|
1116
|
+
name: '';
|
1117
|
+
fields: {
|
1118
|
+
/** Source. */
|
1119
|
+
'source': {
|
1120
|
+
label: 'Source';
|
1121
|
+
type: 'schema';
|
1122
|
+
options: {
|
1123
|
+
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
1124
|
+
};
|
1125
|
+
};
|
1126
|
+
/** . */
|
1127
|
+
'target': {
|
1128
|
+
type: 'schema';
|
1129
|
+
isRequired: true;
|
1130
|
+
options: {
|
1131
|
+
schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
|
1132
|
+
};
|
1133
|
+
};
|
1134
|
+
};
|
1135
|
+
}
|
1136
|
+
interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
|
1137
|
+
}
|
1138
|
+
}
|
1117
1139
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1118
1140
|
interface UploadEmitTarget {
|
1119
1141
|
'locationId'?: string | undefined | null;
|
@@ -1215,28 +1237,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1215
1237
|
interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
|
1216
1238
|
}
|
1217
1239
|
}
|
1218
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
1219
|
-
interface GetUploadEndpointResponsePayload {
|
1220
|
-
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1221
|
-
'restEndpointUrl'?: string | undefined | null;
|
1222
|
-
}
|
1223
|
-
interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
|
1224
|
-
id: 'getUploadEndpointResponsePayload';
|
1225
|
-
version: 'v2022_05_13';
|
1226
|
-
namespace: 'Files';
|
1227
|
-
name: '';
|
1228
|
-
fields: {
|
1229
|
-
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1230
|
-
'restEndpointUrl': {
|
1231
|
-
type: 'text';
|
1232
|
-
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
1233
|
-
options: undefined;
|
1234
|
-
};
|
1235
|
-
};
|
1236
|
-
}
|
1237
|
-
interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
|
1238
|
-
}
|
1239
|
-
}
|
1240
1240
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1241
1241
|
interface UploadedFile {
|
1242
1242
|
'id': string;
|
@@ -718,6 +718,92 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
718
718
|
interface UpsertThemeResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Heartwood.v2021_02_11.UpsertThemeResponsePayloadSchema> {
|
719
719
|
}
|
720
720
|
}
|
721
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
722
|
+
interface GetLocalSettingsEmitTarget {
|
723
|
+
'organizationId': string;
|
724
|
+
}
|
725
|
+
interface GetLocalSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
726
|
+
id: 'getLocalSettingsEmitTarget';
|
727
|
+
version: 'v2022_05_13';
|
728
|
+
namespace: 'Files';
|
729
|
+
name: '';
|
730
|
+
fields: {
|
731
|
+
/** . */
|
732
|
+
'organizationId': {
|
733
|
+
type: 'id';
|
734
|
+
isRequired: true;
|
735
|
+
options: undefined;
|
736
|
+
};
|
737
|
+
};
|
738
|
+
}
|
739
|
+
interface GetLocalSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetSchema> {
|
740
|
+
}
|
741
|
+
}
|
742
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
743
|
+
interface GetLocalSettingsEmitTargetAndPayload {
|
744
|
+
/** Source. */
|
745
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
746
|
+
'target': SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTarget;
|
747
|
+
}
|
748
|
+
interface GetLocalSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
749
|
+
id: 'getLocalSettingsEmitTargetAndPayload';
|
750
|
+
version: 'v2022_05_13';
|
751
|
+
namespace: 'Files';
|
752
|
+
name: '';
|
753
|
+
fields: {
|
754
|
+
/** Source. */
|
755
|
+
'source': {
|
756
|
+
label: 'Source';
|
757
|
+
type: 'schema';
|
758
|
+
options: {
|
759
|
+
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
760
|
+
};
|
761
|
+
};
|
762
|
+
/** . */
|
763
|
+
'target': {
|
764
|
+
type: 'schema';
|
765
|
+
isRequired: true;
|
766
|
+
options: {
|
767
|
+
schema: SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetSchema;
|
768
|
+
};
|
769
|
+
};
|
770
|
+
};
|
771
|
+
}
|
772
|
+
interface GetLocalSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetAndPayloadSchema> {
|
773
|
+
}
|
774
|
+
}
|
775
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
776
|
+
interface GetLocalSettingsResponsePayload {
|
777
|
+
/** Local Upload Directory. */
|
778
|
+
'localUploadDir': string;
|
779
|
+
/** File Host URL. */
|
780
|
+
'fileHostUrl': string;
|
781
|
+
}
|
782
|
+
interface GetLocalSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
783
|
+
id: 'getLocalSettingsResponsePayload';
|
784
|
+
version: 'v2022_05_13';
|
785
|
+
namespace: 'Files';
|
786
|
+
name: '';
|
787
|
+
fields: {
|
788
|
+
/** Local Upload Directory. */
|
789
|
+
'localUploadDir': {
|
790
|
+
label: 'Local Upload Directory';
|
791
|
+
type: 'text';
|
792
|
+
isRequired: true;
|
793
|
+
options: undefined;
|
794
|
+
};
|
795
|
+
/** File Host URL. */
|
796
|
+
'fileHostUrl': {
|
797
|
+
label: 'File Host URL';
|
798
|
+
type: 'text';
|
799
|
+
isRequired: true;
|
800
|
+
options: undefined;
|
801
|
+
};
|
802
|
+
};
|
803
|
+
}
|
804
|
+
interface GetLocalSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsResponsePayloadSchema> {
|
805
|
+
}
|
806
|
+
}
|
721
807
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
722
808
|
interface SaveLocalSettingsEmitTarget {
|
723
809
|
'organizationId': string;
|
@@ -834,92 +920,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
834
920
|
interface SaveLocalSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveLocalSettingsResponsePayloadSchema> {
|
835
921
|
}
|
836
922
|
}
|
837
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
838
|
-
interface GetLocalSettingsEmitTarget {
|
839
|
-
'organizationId': string;
|
840
|
-
}
|
841
|
-
interface GetLocalSettingsEmitTargetSchema extends SpruceSchema.Schema {
|
842
|
-
id: 'getLocalSettingsEmitTarget';
|
843
|
-
version: 'v2022_05_13';
|
844
|
-
namespace: 'Files';
|
845
|
-
name: '';
|
846
|
-
fields: {
|
847
|
-
/** . */
|
848
|
-
'organizationId': {
|
849
|
-
type: 'id';
|
850
|
-
isRequired: true;
|
851
|
-
options: undefined;
|
852
|
-
};
|
853
|
-
};
|
854
|
-
}
|
855
|
-
interface GetLocalSettingsEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetSchema> {
|
856
|
-
}
|
857
|
-
}
|
858
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
859
|
-
interface GetLocalSettingsEmitTargetAndPayload {
|
860
|
-
/** Source. */
|
861
|
-
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
862
|
-
'target': SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTarget;
|
863
|
-
}
|
864
|
-
interface GetLocalSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
865
|
-
id: 'getLocalSettingsEmitTargetAndPayload';
|
866
|
-
version: 'v2022_05_13';
|
867
|
-
namespace: 'Files';
|
868
|
-
name: '';
|
869
|
-
fields: {
|
870
|
-
/** Source. */
|
871
|
-
'source': {
|
872
|
-
label: 'Source';
|
873
|
-
type: 'schema';
|
874
|
-
options: {
|
875
|
-
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
876
|
-
};
|
877
|
-
};
|
878
|
-
/** . */
|
879
|
-
'target': {
|
880
|
-
type: 'schema';
|
881
|
-
isRequired: true;
|
882
|
-
options: {
|
883
|
-
schema: SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetSchema;
|
884
|
-
};
|
885
|
-
};
|
886
|
-
};
|
887
|
-
}
|
888
|
-
interface GetLocalSettingsEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsEmitTargetAndPayloadSchema> {
|
889
|
-
}
|
890
|
-
}
|
891
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
892
|
-
interface GetLocalSettingsResponsePayload {
|
893
|
-
/** Local Upload Directory. */
|
894
|
-
'localUploadDir': string;
|
895
|
-
/** File Host URL. */
|
896
|
-
'fileHostUrl': string;
|
897
|
-
}
|
898
|
-
interface GetLocalSettingsResponsePayloadSchema extends SpruceSchema.Schema {
|
899
|
-
id: 'getLocalSettingsResponsePayload';
|
900
|
-
version: 'v2022_05_13';
|
901
|
-
namespace: 'Files';
|
902
|
-
name: '';
|
903
|
-
fields: {
|
904
|
-
/** Local Upload Directory. */
|
905
|
-
'localUploadDir': {
|
906
|
-
label: 'Local Upload Directory';
|
907
|
-
type: 'text';
|
908
|
-
isRequired: true;
|
909
|
-
options: undefined;
|
910
|
-
};
|
911
|
-
/** File Host URL. */
|
912
|
-
'fileHostUrl': {
|
913
|
-
label: 'File Host URL';
|
914
|
-
type: 'text';
|
915
|
-
isRequired: true;
|
916
|
-
options: undefined;
|
917
|
-
};
|
918
|
-
};
|
919
|
-
}
|
920
|
-
interface GetLocalSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetLocalSettingsResponsePayloadSchema> {
|
921
|
-
}
|
922
|
-
}
|
923
923
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
924
924
|
interface GetSettingsStatusEmitTarget {
|
925
925
|
'organizationId': string;
|
@@ -941,39 +941,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
941
941
|
interface GetSettingsStatusEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema> {
|
942
942
|
}
|
943
943
|
}
|
944
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
945
|
-
interface GetSettingsStatusEmitTargetAndPayload {
|
946
|
-
/** Source. */
|
947
|
-
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
948
|
-
'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
|
949
|
-
}
|
950
|
-
interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
951
|
-
id: 'getSettingsStatusEmitTargetAndPayload';
|
952
|
-
version: 'v2022_05_13';
|
953
|
-
namespace: 'Files';
|
954
|
-
name: '';
|
955
|
-
fields: {
|
956
|
-
/** Source. */
|
957
|
-
'source': {
|
958
|
-
label: 'Source';
|
959
|
-
type: 'schema';
|
960
|
-
options: {
|
961
|
-
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
962
|
-
};
|
963
|
-
};
|
964
|
-
/** . */
|
965
|
-
'target': {
|
966
|
-
type: 'schema';
|
967
|
-
isRequired: true;
|
968
|
-
options: {
|
969
|
-
schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
|
970
|
-
};
|
971
|
-
};
|
972
|
-
};
|
973
|
-
}
|
974
|
-
interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
|
975
|
-
}
|
976
|
-
}
|
977
944
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
978
945
|
interface GetSettingsStatusResponsePayload {
|
979
946
|
'didConfigureFileUploads': boolean;
|
@@ -1114,6 +1081,61 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1114
1081
|
interface SaveSettingsResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.SaveSettingsResponsePayloadSchema> {
|
1115
1082
|
}
|
1116
1083
|
}
|
1084
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1085
|
+
interface GetUploadEndpointResponsePayload {
|
1086
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1087
|
+
'restEndpointUrl'?: string | undefined | null;
|
1088
|
+
}
|
1089
|
+
interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
|
1090
|
+
id: 'getUploadEndpointResponsePayload';
|
1091
|
+
version: 'v2022_05_13';
|
1092
|
+
namespace: 'Files';
|
1093
|
+
name: '';
|
1094
|
+
fields: {
|
1095
|
+
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1096
|
+
'restEndpointUrl': {
|
1097
|
+
type: 'text';
|
1098
|
+
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
1099
|
+
options: undefined;
|
1100
|
+
};
|
1101
|
+
};
|
1102
|
+
}
|
1103
|
+
interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
|
1104
|
+
}
|
1105
|
+
}
|
1106
|
+
namespace SpruceSchemas.Files.v2022_05_13 {
|
1107
|
+
interface GetSettingsStatusEmitTargetAndPayload {
|
1108
|
+
/** Source. */
|
1109
|
+
'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
|
1110
|
+
'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
|
1111
|
+
}
|
1112
|
+
interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
|
1113
|
+
id: 'getSettingsStatusEmitTargetAndPayload';
|
1114
|
+
version: 'v2022_05_13';
|
1115
|
+
namespace: 'Files';
|
1116
|
+
name: '';
|
1117
|
+
fields: {
|
1118
|
+
/** Source. */
|
1119
|
+
'source': {
|
1120
|
+
label: 'Source';
|
1121
|
+
type: 'schema';
|
1122
|
+
options: {
|
1123
|
+
schema: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSourceSchema;
|
1124
|
+
};
|
1125
|
+
};
|
1126
|
+
/** . */
|
1127
|
+
'target': {
|
1128
|
+
type: 'schema';
|
1129
|
+
isRequired: true;
|
1130
|
+
options: {
|
1131
|
+
schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
|
1132
|
+
};
|
1133
|
+
};
|
1134
|
+
};
|
1135
|
+
}
|
1136
|
+
interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
|
1137
|
+
}
|
1138
|
+
}
|
1117
1139
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1118
1140
|
interface UploadEmitTarget {
|
1119
1141
|
'locationId'?: string | undefined | null;
|
@@ -1215,28 +1237,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
1215
1237
|
interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
|
1216
1238
|
}
|
1217
1239
|
}
|
1218
|
-
namespace SpruceSchemas.Files.v2022_05_13 {
|
1219
|
-
interface GetUploadEndpointResponsePayload {
|
1220
|
-
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1221
|
-
'restEndpointUrl'?: string | undefined | null;
|
1222
|
-
}
|
1223
|
-
interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
|
1224
|
-
id: 'getUploadEndpointResponsePayload';
|
1225
|
-
version: 'v2022_05_13';
|
1226
|
-
namespace: 'Files';
|
1227
|
-
name: '';
|
1228
|
-
fields: {
|
1229
|
-
/** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
|
1230
|
-
'restEndpointUrl': {
|
1231
|
-
type: 'text';
|
1232
|
-
hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
|
1233
|
-
options: undefined;
|
1234
|
-
};
|
1235
|
-
};
|
1236
|
-
}
|
1237
|
-
interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
|
1238
|
-
}
|
1239
|
-
}
|
1240
1240
|
namespace SpruceSchemas.Files.v2022_05_13 {
|
1241
1241
|
interface UploadedFile {
|
1242
1242
|
'id': string;
|
@@ -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
|
+
}
|