@sprucelabs/spruce-file-utils 17.0.0 → 17.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -719,45 +719,108 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
719
719
  }
720
720
  }
721
721
  namespace SpruceSchemas.Files.v2022_05_13 {
722
- interface GetSettingsStatusEmitTarget {
723
- 'organizationId': string;
722
+ interface GetUploadEndpointResponsePayload {
723
+ /** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
724
+ 'restEndpointUrl'?: string | undefined | null;
724
725
  }
725
- interface GetSettingsStatusEmitTargetSchema extends SpruceSchema.Schema {
726
- id: 'getSettingsStatusEmitTarget';
726
+ interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
727
+ id: 'getUploadEndpointResponsePayload';
727
728
  version: 'v2022_05_13';
728
729
  namespace: 'Files';
729
730
  name: '';
730
731
  fields: {
732
+ /** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
733
+ 'restEndpointUrl': {
734
+ type: 'text';
735
+ hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
736
+ options: undefined;
737
+ };
738
+ };
739
+ }
740
+ interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
741
+ }
742
+ }
743
+ namespace SpruceSchemas.Files.v2022_05_13 {
744
+ interface UploadEmitTarget {
745
+ 'locationId'?: string | undefined | null;
746
+ 'organizationId'?: string | undefined | null;
747
+ 'filePersonId'?: string | undefined | null;
748
+ }
749
+ interface UploadEmitTargetSchema extends SpruceSchema.Schema {
750
+ id: 'uploadEmitTarget';
751
+ version: 'v2022_05_13';
752
+ namespace: 'Files';
753
+ name: '';
754
+ fields: {
755
+ /** . */
756
+ 'locationId': {
757
+ type: 'id';
758
+ options: undefined;
759
+ };
731
760
  /** . */
732
761
  'organizationId': {
733
762
  type: 'id';
734
- isRequired: true;
763
+ options: undefined;
764
+ };
765
+ /** . */
766
+ 'filePersonId': {
767
+ type: 'text';
735
768
  options: undefined;
736
769
  };
737
770
  };
738
771
  }
739
- interface GetSettingsStatusEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema> {
772
+ interface UploadEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema> {
740
773
  }
741
774
  }
742
775
  namespace SpruceSchemas.Files.v2022_05_13 {
743
- interface GetSettingsStatusResponsePayload {
744
- 'didSupplyS3Creds': boolean;
776
+ interface UploadEmitPayload {
777
+ 'base64Body': string;
778
+ 'name': string;
745
779
  }
746
- interface GetSettingsStatusResponsePayloadSchema extends SpruceSchema.Schema {
747
- id: 'getSettingsStatusResponsePayload';
780
+ interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
781
+ id: 'uploadEmitPayload';
748
782
  version: 'v2022_05_13';
749
783
  namespace: 'Files';
750
784
  name: '';
751
785
  fields: {
752
786
  /** . */
753
- 'didSupplyS3Creds': {
754
- type: 'boolean';
787
+ 'base64Body': {
788
+ type: 'text';
789
+ isRequired: true;
790
+ options: undefined;
791
+ };
792
+ /** . */
793
+ 'name': {
794
+ type: 'text';
755
795
  isRequired: true;
756
796
  options: undefined;
757
797
  };
758
798
  };
759
799
  }
760
- interface GetSettingsStatusResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusResponsePayloadSchema> {
800
+ interface UploadEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema> {
801
+ }
802
+ }
803
+ namespace SpruceSchemas.Files.v2022_05_13 {
804
+ interface UploadResponsePayload {
805
+ 'file': SpruceSchemas.Files.v2022_05_13.UploadedFile;
806
+ }
807
+ interface UploadResponsePayloadSchema extends SpruceSchema.Schema {
808
+ id: 'uploadResponsePayload';
809
+ version: 'v2022_05_13';
810
+ namespace: 'Files';
811
+ name: '';
812
+ fields: {
813
+ /** . */
814
+ 'file': {
815
+ type: 'schema';
816
+ isRequired: true;
817
+ options: {
818
+ schema: SpruceSchemas.Files.v2022_05_13.UploadedFileSchema;
819
+ };
820
+ };
821
+ };
822
+ }
823
+ interface UploadResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadResponsePayloadSchema> {
761
824
  }
762
825
  }
763
826
  namespace SpruceSchemas.Files.v2022_05_13 {
@@ -783,9 +846,11 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
783
846
  }
784
847
  namespace SpruceSchemas.Files.v2022_05_13 {
785
848
  interface SaveSettingsEmitPayload {
786
- 'awsAccessKeyId': string;
787
- 'awsSecretAccessKey': string;
788
- 'awsS3Bucket': string;
849
+ 'awsAccessKeyId'?: string | undefined | null;
850
+ 'awsSecretAccessKey'?: string | undefined | null;
851
+ 'awsS3Bucket'?: string | undefined | null;
852
+ 'localUploadDir'?: string | undefined | null;
853
+ 'fileHostUrl'?: string | undefined | null;
789
854
  }
790
855
  interface SaveSettingsEmitPayloadSchema extends SpruceSchema.Schema {
791
856
  id: 'saveSettingsEmitPayload';
@@ -796,19 +861,26 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
796
861
  /** . */
797
862
  'awsAccessKeyId': {
798
863
  type: 'id';
799
- isRequired: true;
800
864
  options: undefined;
801
865
  };
802
866
  /** . */
803
867
  'awsSecretAccessKey': {
804
868
  type: 'text';
805
- isRequired: true;
806
869
  options: undefined;
807
870
  };
808
871
  /** . */
809
872
  'awsS3Bucket': {
810
873
  type: 'text';
811
- isRequired: true;
874
+ options: undefined;
875
+ };
876
+ /** . */
877
+ 'localUploadDir': {
878
+ type: 'text';
879
+ options: undefined;
880
+ };
881
+ /** . */
882
+ 'fileHostUrl': {
883
+ type: 'text';
812
884
  options: undefined;
813
885
  };
814
886
  };
@@ -821,7 +893,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
821
893
  /** Source. */
822
894
  'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
823
895
  'target': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTarget;
824
- 'payload': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayload;
896
+ 'payload'?: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayload | undefined | null;
825
897
  }
826
898
  interface SaveSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
827
899
  id: 'saveSettingsEmitTargetAndPayload';
@@ -848,7 +920,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
848
920
  /** . */
849
921
  'payload': {
850
922
  type: 'schema';
851
- isRequired: true;
852
923
  options: {
853
924
  schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema;
854
925
  };
@@ -880,35 +951,14 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
880
951
  }
881
952
  }
882
953
  namespace SpruceSchemas.Files.v2022_05_13 {
883
- interface GetUploadEndpointResponsePayload {
884
- /** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
885
- 'restEndpointUrl'?: string | undefined | null;
886
- }
887
- interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
888
- id: 'getUploadEndpointResponsePayload';
889
- version: 'v2022_05_13';
890
- namespace: 'Files';
891
- name: '';
892
- fields: {
893
- /** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
894
- 'restEndpointUrl': {
895
- type: 'text';
896
- hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
897
- options: undefined;
898
- };
899
- };
900
- }
901
- interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
902
- }
903
- }
904
- namespace SpruceSchemas.Files.v2022_05_13 {
905
- interface GetSettingsStatusEmitTargetAndPayload {
954
+ interface UploadEmitTargetAndPayload {
906
955
  /** Source. */
907
956
  'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
908
- 'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
957
+ 'target'?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
958
+ 'payload': SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
909
959
  }
910
- interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
911
- id: 'getSettingsStatusEmitTargetAndPayload';
960
+ interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
961
+ id: 'uploadEmitTargetAndPayload';
912
962
  version: 'v2022_05_13';
913
963
  namespace: 'Files';
914
964
  name: '';
@@ -923,86 +973,53 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
923
973
  };
924
974
  /** . */
925
975
  'target': {
976
+ type: 'schema';
977
+ options: {
978
+ schema: SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema;
979
+ };
980
+ };
981
+ /** . */
982
+ 'payload': {
926
983
  type: 'schema';
927
984
  isRequired: true;
928
985
  options: {
929
- schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
986
+ schema: SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema;
930
987
  };
931
988
  };
932
989
  };
933
990
  }
934
- interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
991
+ interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
935
992
  }
936
993
  }
937
994
  namespace SpruceSchemas.Files.v2022_05_13 {
938
- interface UploadEmitTarget {
939
- 'locationId'?: string | undefined | null;
940
- 'organizationId'?: string | undefined | null;
941
- 'filePersonId'?: string | undefined | null;
995
+ interface GetSettingsStatusEmitTarget {
996
+ 'organizationId': string;
942
997
  }
943
- interface UploadEmitTargetSchema extends SpruceSchema.Schema {
944
- id: 'uploadEmitTarget';
998
+ interface GetSettingsStatusEmitTargetSchema extends SpruceSchema.Schema {
999
+ id: 'getSettingsStatusEmitTarget';
945
1000
  version: 'v2022_05_13';
946
1001
  namespace: 'Files';
947
1002
  name: '';
948
1003
  fields: {
949
- /** . */
950
- 'locationId': {
951
- type: 'id';
952
- options: undefined;
953
- };
954
1004
  /** . */
955
1005
  'organizationId': {
956
1006
  type: 'id';
957
- options: undefined;
958
- };
959
- /** . */
960
- 'filePersonId': {
961
- type: 'text';
962
- options: undefined;
963
- };
964
- };
965
- }
966
- interface UploadEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema> {
967
- }
968
- }
969
- namespace SpruceSchemas.Files.v2022_05_13 {
970
- interface UploadEmitPayload {
971
- 'base64Body': string;
972
- 'name': string;
973
- }
974
- interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
975
- id: 'uploadEmitPayload';
976
- version: 'v2022_05_13';
977
- namespace: 'Files';
978
- name: '';
979
- fields: {
980
- /** . */
981
- 'base64Body': {
982
- type: 'text';
983
- isRequired: true;
984
- options: undefined;
985
- };
986
- /** . */
987
- 'name': {
988
- type: 'text';
989
1007
  isRequired: true;
990
1008
  options: undefined;
991
1009
  };
992
1010
  };
993
1011
  }
994
- interface UploadEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema> {
1012
+ interface GetSettingsStatusEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema> {
995
1013
  }
996
1014
  }
997
1015
  namespace SpruceSchemas.Files.v2022_05_13 {
998
- interface UploadEmitTargetAndPayload {
1016
+ interface GetSettingsStatusEmitTargetAndPayload {
999
1017
  /** Source. */
1000
1018
  'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
1001
- 'target'?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
1002
- 'payload': SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
1019
+ 'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
1003
1020
  }
1004
- interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
1005
- id: 'uploadEmitTargetAndPayload';
1021
+ interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
1022
+ id: 'getSettingsStatusEmitTargetAndPayload';
1006
1023
  version: 'v2022_05_13';
1007
1024
  namespace: 'Files';
1008
1025
  name: '';
@@ -1018,21 +1035,35 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
1018
1035
  /** . */
1019
1036
  'target': {
1020
1037
  type: 'schema';
1038
+ isRequired: true;
1021
1039
  options: {
1022
- schema: SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema;
1040
+ schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
1023
1041
  };
1024
1042
  };
1043
+ };
1044
+ }
1045
+ interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
1046
+ }
1047
+ }
1048
+ namespace SpruceSchemas.Files.v2022_05_13 {
1049
+ interface GetSettingsStatusResponsePayload {
1050
+ 'didSupplyS3Creds': boolean;
1051
+ }
1052
+ interface GetSettingsStatusResponsePayloadSchema extends SpruceSchema.Schema {
1053
+ id: 'getSettingsStatusResponsePayload';
1054
+ version: 'v2022_05_13';
1055
+ namespace: 'Files';
1056
+ name: '';
1057
+ fields: {
1025
1058
  /** . */
1026
- 'payload': {
1027
- type: 'schema';
1059
+ 'didSupplyS3Creds': {
1060
+ type: 'boolean';
1028
1061
  isRequired: true;
1029
- options: {
1030
- schema: SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema;
1031
- };
1062
+ options: undefined;
1032
1063
  };
1033
1064
  };
1034
1065
  }
1035
- interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
1066
+ interface GetSettingsStatusResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusResponsePayloadSchema> {
1036
1067
  }
1037
1068
  }
1038
1069
  namespace SpruceSchemas.Files.v2022_05_13 {
@@ -1077,29 +1108,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
1077
1108
  interface UploadedFileEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadedFileSchema> {
1078
1109
  }
1079
1110
  }
1080
- namespace SpruceSchemas.Files.v2022_05_13 {
1081
- interface UploadResponsePayload {
1082
- 'file': SpruceSchemas.Files.v2022_05_13.UploadedFile;
1083
- }
1084
- interface UploadResponsePayloadSchema extends SpruceSchema.Schema {
1085
- id: 'uploadResponsePayload';
1086
- version: 'v2022_05_13';
1087
- namespace: 'Files';
1088
- name: '';
1089
- fields: {
1090
- /** . */
1091
- 'file': {
1092
- type: 'schema';
1093
- isRequired: true;
1094
- options: {
1095
- schema: SpruceSchemas.Files.v2022_05_13.UploadedFileSchema;
1096
- };
1097
- };
1098
- };
1099
- }
1100
- interface UploadResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadResponsePayloadSchema> {
1101
- }
1102
- }
1103
1111
  namespace SpruceSchemas.Files.v2022_05_13 {
1104
1112
  interface SettingsTarget {
1105
1113
  'organizationId': string;
@@ -1125,11 +1133,15 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
1125
1133
  interface Settings {
1126
1134
  'id': string;
1127
1135
  /** AWS Access Key ID. */
1128
- 'awsAccessKeyId': string;
1136
+ 'awsAccessKeyId'?: string | undefined | null;
1129
1137
  /** AWS Secret Access Key. */
1130
- 'awsSecretAccessKey': string;
1138
+ 'awsSecretAccessKey'?: string | undefined | null;
1131
1139
  /** AWS S3 Bucket. */
1132
- 'awsS3Bucket': string;
1140
+ 'awsS3Bucket'?: string | undefined | null;
1141
+ /** Local Upload Directory. */
1142
+ 'localUploadDir'?: string | undefined | null;
1143
+ /** File Host URL. */
1144
+ 'fileHostUrl'?: string | undefined | null;
1133
1145
  'target'?: SpruceSchemas.Files.v2022_05_13.SettingsTarget | undefined | null;
1134
1146
  }
1135
1147
  interface SettingsSchema extends SpruceSchema.Schema {
@@ -1148,21 +1160,30 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
1148
1160
  'awsAccessKeyId': {
1149
1161
  label: 'AWS Access Key ID';
1150
1162
  type: 'text';
1151
- isRequired: true;
1152
1163
  options: undefined;
1153
1164
  };
1154
1165
  /** AWS Secret Access Key. */
1155
1166
  'awsSecretAccessKey': {
1156
1167
  label: 'AWS Secret Access Key';
1157
1168
  type: 'text';
1158
- isRequired: true;
1159
1169
  options: undefined;
1160
1170
  };
1161
1171
  /** AWS S3 Bucket. */
1162
1172
  'awsS3Bucket': {
1163
1173
  label: 'AWS S3 Bucket';
1164
1174
  type: 'text';
1165
- isRequired: true;
1175
+ options: undefined;
1176
+ };
1177
+ /** Local Upload Directory. */
1178
+ 'localUploadDir': {
1179
+ label: 'Local Upload Directory';
1180
+ type: 'text';
1181
+ options: undefined;
1182
+ };
1183
+ /** File Host URL. */
1184
+ 'fileHostUrl': {
1185
+ label: 'File Host URL';
1186
+ type: 'text';
1166
1187
  options: undefined;
1167
1188
  };
1168
1189
  /** . */
@@ -719,45 +719,108 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
719
719
  }
720
720
  }
721
721
  namespace SpruceSchemas.Files.v2022_05_13 {
722
- interface GetSettingsStatusEmitTarget {
723
- 'organizationId': string;
722
+ interface GetUploadEndpointResponsePayload {
723
+ /** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
724
+ 'restEndpointUrl'?: string | undefined | null;
724
725
  }
725
- interface GetSettingsStatusEmitTargetSchema extends SpruceSchema.Schema {
726
- id: 'getSettingsStatusEmitTarget';
726
+ interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
727
+ id: 'getUploadEndpointResponsePayload';
727
728
  version: 'v2022_05_13';
728
729
  namespace: 'Files';
729
730
  name: '';
730
731
  fields: {
732
+ /** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
733
+ 'restEndpointUrl': {
734
+ type: 'text';
735
+ hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
736
+ options: undefined;
737
+ };
738
+ };
739
+ }
740
+ interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
741
+ }
742
+ }
743
+ namespace SpruceSchemas.Files.v2022_05_13 {
744
+ interface UploadEmitTarget {
745
+ 'locationId'?: string | undefined | null;
746
+ 'organizationId'?: string | undefined | null;
747
+ 'filePersonId'?: string | undefined | null;
748
+ }
749
+ interface UploadEmitTargetSchema extends SpruceSchema.Schema {
750
+ id: 'uploadEmitTarget';
751
+ version: 'v2022_05_13';
752
+ namespace: 'Files';
753
+ name: '';
754
+ fields: {
755
+ /** . */
756
+ 'locationId': {
757
+ type: 'id';
758
+ options: undefined;
759
+ };
731
760
  /** . */
732
761
  'organizationId': {
733
762
  type: 'id';
734
- isRequired: true;
763
+ options: undefined;
764
+ };
765
+ /** . */
766
+ 'filePersonId': {
767
+ type: 'text';
735
768
  options: undefined;
736
769
  };
737
770
  };
738
771
  }
739
- interface GetSettingsStatusEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema> {
772
+ interface UploadEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema> {
740
773
  }
741
774
  }
742
775
  namespace SpruceSchemas.Files.v2022_05_13 {
743
- interface GetSettingsStatusResponsePayload {
744
- 'didSupplyS3Creds': boolean;
776
+ interface UploadEmitPayload {
777
+ 'base64Body': string;
778
+ 'name': string;
745
779
  }
746
- interface GetSettingsStatusResponsePayloadSchema extends SpruceSchema.Schema {
747
- id: 'getSettingsStatusResponsePayload';
780
+ interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
781
+ id: 'uploadEmitPayload';
748
782
  version: 'v2022_05_13';
749
783
  namespace: 'Files';
750
784
  name: '';
751
785
  fields: {
752
786
  /** . */
753
- 'didSupplyS3Creds': {
754
- type: 'boolean';
787
+ 'base64Body': {
788
+ type: 'text';
789
+ isRequired: true;
790
+ options: undefined;
791
+ };
792
+ /** . */
793
+ 'name': {
794
+ type: 'text';
755
795
  isRequired: true;
756
796
  options: undefined;
757
797
  };
758
798
  };
759
799
  }
760
- interface GetSettingsStatusResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusResponsePayloadSchema> {
800
+ interface UploadEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema> {
801
+ }
802
+ }
803
+ namespace SpruceSchemas.Files.v2022_05_13 {
804
+ interface UploadResponsePayload {
805
+ 'file': SpruceSchemas.Files.v2022_05_13.UploadedFile;
806
+ }
807
+ interface UploadResponsePayloadSchema extends SpruceSchema.Schema {
808
+ id: 'uploadResponsePayload';
809
+ version: 'v2022_05_13';
810
+ namespace: 'Files';
811
+ name: '';
812
+ fields: {
813
+ /** . */
814
+ 'file': {
815
+ type: 'schema';
816
+ isRequired: true;
817
+ options: {
818
+ schema: SpruceSchemas.Files.v2022_05_13.UploadedFileSchema;
819
+ };
820
+ };
821
+ };
822
+ }
823
+ interface UploadResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadResponsePayloadSchema> {
761
824
  }
762
825
  }
763
826
  namespace SpruceSchemas.Files.v2022_05_13 {
@@ -783,9 +846,11 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
783
846
  }
784
847
  namespace SpruceSchemas.Files.v2022_05_13 {
785
848
  interface SaveSettingsEmitPayload {
786
- 'awsAccessKeyId': string;
787
- 'awsSecretAccessKey': string;
788
- 'awsS3Bucket': string;
849
+ 'awsAccessKeyId'?: string | undefined | null;
850
+ 'awsSecretAccessKey'?: string | undefined | null;
851
+ 'awsS3Bucket'?: string | undefined | null;
852
+ 'localUploadDir'?: string | undefined | null;
853
+ 'fileHostUrl'?: string | undefined | null;
789
854
  }
790
855
  interface SaveSettingsEmitPayloadSchema extends SpruceSchema.Schema {
791
856
  id: 'saveSettingsEmitPayload';
@@ -796,19 +861,26 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
796
861
  /** . */
797
862
  'awsAccessKeyId': {
798
863
  type: 'id';
799
- isRequired: true;
800
864
  options: undefined;
801
865
  };
802
866
  /** . */
803
867
  'awsSecretAccessKey': {
804
868
  type: 'text';
805
- isRequired: true;
806
869
  options: undefined;
807
870
  };
808
871
  /** . */
809
872
  'awsS3Bucket': {
810
873
  type: 'text';
811
- isRequired: true;
874
+ options: undefined;
875
+ };
876
+ /** . */
877
+ 'localUploadDir': {
878
+ type: 'text';
879
+ options: undefined;
880
+ };
881
+ /** . */
882
+ 'fileHostUrl': {
883
+ type: 'text';
812
884
  options: undefined;
813
885
  };
814
886
  };
@@ -821,7 +893,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
821
893
  /** Source. */
822
894
  'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
823
895
  'target': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitTarget;
824
- 'payload': SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayload;
896
+ 'payload'?: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayload | undefined | null;
825
897
  }
826
898
  interface SaveSettingsEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
827
899
  id: 'saveSettingsEmitTargetAndPayload';
@@ -848,7 +920,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
848
920
  /** . */
849
921
  'payload': {
850
922
  type: 'schema';
851
- isRequired: true;
852
923
  options: {
853
924
  schema: SpruceSchemas.Files.v2022_05_13.SaveSettingsEmitPayloadSchema;
854
925
  };
@@ -880,35 +951,14 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
880
951
  }
881
952
  }
882
953
  namespace SpruceSchemas.Files.v2022_05_13 {
883
- interface GetUploadEndpointResponsePayload {
884
- /** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
885
- 'restEndpointUrl'?: string | undefined | null;
886
- }
887
- interface GetUploadEndpointResponsePayloadSchema extends SpruceSchema.Schema {
888
- id: 'getUploadEndpointResponsePayload';
889
- version: 'v2022_05_13';
890
- namespace: 'Files';
891
- name: '';
892
- fields: {
893
- /** . The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client. */
894
- 'restEndpointUrl': {
895
- type: 'text';
896
- hint: 'The REST endpoint URL to user when uploading a file. If not set, you must use upload using the Mercury Client.';
897
- options: undefined;
898
- };
899
- };
900
- }
901
- interface GetUploadEndpointResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetUploadEndpointResponsePayloadSchema> {
902
- }
903
- }
904
- namespace SpruceSchemas.Files.v2022_05_13 {
905
- interface GetSettingsStatusEmitTargetAndPayload {
954
+ interface UploadEmitTargetAndPayload {
906
955
  /** Source. */
907
956
  'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
908
- 'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
957
+ 'target'?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
958
+ 'payload': SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
909
959
  }
910
- interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
911
- id: 'getSettingsStatusEmitTargetAndPayload';
960
+ interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
961
+ id: 'uploadEmitTargetAndPayload';
912
962
  version: 'v2022_05_13';
913
963
  namespace: 'Files';
914
964
  name: '';
@@ -923,86 +973,53 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
923
973
  };
924
974
  /** . */
925
975
  'target': {
976
+ type: 'schema';
977
+ options: {
978
+ schema: SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema;
979
+ };
980
+ };
981
+ /** . */
982
+ 'payload': {
926
983
  type: 'schema';
927
984
  isRequired: true;
928
985
  options: {
929
- schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
986
+ schema: SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema;
930
987
  };
931
988
  };
932
989
  };
933
990
  }
934
- interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
991
+ interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
935
992
  }
936
993
  }
937
994
  namespace SpruceSchemas.Files.v2022_05_13 {
938
- interface UploadEmitTarget {
939
- 'locationId'?: string | undefined | null;
940
- 'organizationId'?: string | undefined | null;
941
- 'filePersonId'?: string | undefined | null;
995
+ interface GetSettingsStatusEmitTarget {
996
+ 'organizationId': string;
942
997
  }
943
- interface UploadEmitTargetSchema extends SpruceSchema.Schema {
944
- id: 'uploadEmitTarget';
998
+ interface GetSettingsStatusEmitTargetSchema extends SpruceSchema.Schema {
999
+ id: 'getSettingsStatusEmitTarget';
945
1000
  version: 'v2022_05_13';
946
1001
  namespace: 'Files';
947
1002
  name: '';
948
1003
  fields: {
949
- /** . */
950
- 'locationId': {
951
- type: 'id';
952
- options: undefined;
953
- };
954
1004
  /** . */
955
1005
  'organizationId': {
956
1006
  type: 'id';
957
- options: undefined;
958
- };
959
- /** . */
960
- 'filePersonId': {
961
- type: 'text';
962
- options: undefined;
963
- };
964
- };
965
- }
966
- interface UploadEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema> {
967
- }
968
- }
969
- namespace SpruceSchemas.Files.v2022_05_13 {
970
- interface UploadEmitPayload {
971
- 'base64Body': string;
972
- 'name': string;
973
- }
974
- interface UploadEmitPayloadSchema extends SpruceSchema.Schema {
975
- id: 'uploadEmitPayload';
976
- version: 'v2022_05_13';
977
- namespace: 'Files';
978
- name: '';
979
- fields: {
980
- /** . */
981
- 'base64Body': {
982
- type: 'text';
983
- isRequired: true;
984
- options: undefined;
985
- };
986
- /** . */
987
- 'name': {
988
- type: 'text';
989
1007
  isRequired: true;
990
1008
  options: undefined;
991
1009
  };
992
1010
  };
993
1011
  }
994
- interface UploadEmitPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema> {
1012
+ interface GetSettingsStatusEmitTargetEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema> {
995
1013
  }
996
1014
  }
997
1015
  namespace SpruceSchemas.Files.v2022_05_13 {
998
- interface UploadEmitTargetAndPayload {
1016
+ interface GetSettingsStatusEmitTargetAndPayload {
999
1017
  /** Source. */
1000
1018
  'source'?: SpruceSchemas.SpruceEventUtils.v2021_09_13.EventSource | undefined | null;
1001
- 'target'?: SpruceSchemas.Files.v2022_05_13.UploadEmitTarget | undefined | null;
1002
- 'payload': SpruceSchemas.Files.v2022_05_13.UploadEmitPayload;
1019
+ 'target': SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTarget;
1003
1020
  }
1004
- interface UploadEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
1005
- id: 'uploadEmitTargetAndPayload';
1021
+ interface GetSettingsStatusEmitTargetAndPayloadSchema extends SpruceSchema.Schema {
1022
+ id: 'getSettingsStatusEmitTargetAndPayload';
1006
1023
  version: 'v2022_05_13';
1007
1024
  namespace: 'Files';
1008
1025
  name: '';
@@ -1018,21 +1035,35 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
1018
1035
  /** . */
1019
1036
  'target': {
1020
1037
  type: 'schema';
1038
+ isRequired: true;
1021
1039
  options: {
1022
- schema: SpruceSchemas.Files.v2022_05_13.UploadEmitTargetSchema;
1040
+ schema: SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetSchema;
1023
1041
  };
1024
1042
  };
1043
+ };
1044
+ }
1045
+ interface GetSettingsStatusEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusEmitTargetAndPayloadSchema> {
1046
+ }
1047
+ }
1048
+ namespace SpruceSchemas.Files.v2022_05_13 {
1049
+ interface GetSettingsStatusResponsePayload {
1050
+ 'didSupplyS3Creds': boolean;
1051
+ }
1052
+ interface GetSettingsStatusResponsePayloadSchema extends SpruceSchema.Schema {
1053
+ id: 'getSettingsStatusResponsePayload';
1054
+ version: 'v2022_05_13';
1055
+ namespace: 'Files';
1056
+ name: '';
1057
+ fields: {
1025
1058
  /** . */
1026
- 'payload': {
1027
- type: 'schema';
1059
+ 'didSupplyS3Creds': {
1060
+ type: 'boolean';
1028
1061
  isRequired: true;
1029
- options: {
1030
- schema: SpruceSchemas.Files.v2022_05_13.UploadEmitPayloadSchema;
1031
- };
1062
+ options: undefined;
1032
1063
  };
1033
1064
  };
1034
1065
  }
1035
- interface UploadEmitTargetAndPayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadEmitTargetAndPayloadSchema> {
1066
+ interface GetSettingsStatusResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.GetSettingsStatusResponsePayloadSchema> {
1036
1067
  }
1037
1068
  }
1038
1069
  namespace SpruceSchemas.Files.v2022_05_13 {
@@ -1077,29 +1108,6 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
1077
1108
  interface UploadedFileEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadedFileSchema> {
1078
1109
  }
1079
1110
  }
1080
- namespace SpruceSchemas.Files.v2022_05_13 {
1081
- interface UploadResponsePayload {
1082
- 'file': SpruceSchemas.Files.v2022_05_13.UploadedFile;
1083
- }
1084
- interface UploadResponsePayloadSchema extends SpruceSchema.Schema {
1085
- id: 'uploadResponsePayload';
1086
- version: 'v2022_05_13';
1087
- namespace: 'Files';
1088
- name: '';
1089
- fields: {
1090
- /** . */
1091
- 'file': {
1092
- type: 'schema';
1093
- isRequired: true;
1094
- options: {
1095
- schema: SpruceSchemas.Files.v2022_05_13.UploadedFileSchema;
1096
- };
1097
- };
1098
- };
1099
- }
1100
- interface UploadResponsePayloadEntity extends SchemaEntity<SpruceSchemas.Files.v2022_05_13.UploadResponsePayloadSchema> {
1101
- }
1102
- }
1103
1111
  namespace SpruceSchemas.Files.v2022_05_13 {
1104
1112
  interface SettingsTarget {
1105
1113
  'organizationId': string;
@@ -1125,11 +1133,15 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
1125
1133
  interface Settings {
1126
1134
  'id': string;
1127
1135
  /** AWS Access Key ID. */
1128
- 'awsAccessKeyId': string;
1136
+ 'awsAccessKeyId'?: string | undefined | null;
1129
1137
  /** AWS Secret Access Key. */
1130
- 'awsSecretAccessKey': string;
1138
+ 'awsSecretAccessKey'?: string | undefined | null;
1131
1139
  /** AWS S3 Bucket. */
1132
- 'awsS3Bucket': string;
1140
+ 'awsS3Bucket'?: string | undefined | null;
1141
+ /** Local Upload Directory. */
1142
+ 'localUploadDir'?: string | undefined | null;
1143
+ /** File Host URL. */
1144
+ 'fileHostUrl'?: string | undefined | null;
1133
1145
  'target'?: SpruceSchemas.Files.v2022_05_13.SettingsTarget | undefined | null;
1134
1146
  }
1135
1147
  interface SettingsSchema extends SpruceSchema.Schema {
@@ -1148,21 +1160,30 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
1148
1160
  'awsAccessKeyId': {
1149
1161
  label: 'AWS Access Key ID';
1150
1162
  type: 'text';
1151
- isRequired: true;
1152
1163
  options: undefined;
1153
1164
  };
1154
1165
  /** AWS Secret Access Key. */
1155
1166
  'awsSecretAccessKey': {
1156
1167
  label: 'AWS Secret Access Key';
1157
1168
  type: 'text';
1158
- isRequired: true;
1159
1169
  options: undefined;
1160
1170
  };
1161
1171
  /** AWS S3 Bucket. */
1162
1172
  'awsS3Bucket': {
1163
1173
  label: 'AWS S3 Bucket';
1164
1174
  type: 'text';
1165
- isRequired: true;
1175
+ options: undefined;
1176
+ };
1177
+ /** Local Upload Directory. */
1178
+ 'localUploadDir': {
1179
+ label: 'Local Upload Directory';
1180
+ type: 'text';
1181
+ options: undefined;
1182
+ };
1183
+ /** File Host URL. */
1184
+ 'fileHostUrl': {
1185
+ label: 'File Host URL';
1186
+ type: 'text';
1166
1187
  options: undefined;
1167
1188
  };
1168
1189
  /** . */
@@ -3,6 +3,19 @@ export default class LocalUploadStrategy implements UploadStrategy {
3
3
  static Class?: new (options: LocalStrategyOptions) => UploadStrategy;
4
4
  private localUploadDir;
5
5
  private fileHostUrl;
6
+ static settingsSchema: {
7
+ id: string;
8
+ fields: {
9
+ localUploadDir: {
10
+ label: string;
11
+ type: "text";
12
+ };
13
+ fileHostUrl: {
14
+ label: string;
15
+ type: "text";
16
+ };
17
+ };
18
+ };
6
19
  constructor(options: {
7
20
  localUploadDir: string;
8
21
  fileHostUrl: string;
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { assertOptions } from '@sprucelabs/schema';
10
+ import { assertOptions, buildSchema } from '@sprucelabs/schema';
11
11
  import { diskUtil } from '@sprucelabs/spruce-skill-utils';
12
- export default class LocalUploadStrategy {
12
+ class LocalUploadStrategy {
13
13
  constructor(options) {
14
14
  const { localUploadDir, fileHostUrl } = assertOptions(options, [
15
15
  'localUploadDir',
@@ -32,3 +32,17 @@ export default class LocalUploadStrategy {
32
32
  });
33
33
  }
34
34
  }
35
+ LocalUploadStrategy.settingsSchema = buildSchema({
36
+ id: 'localUploadSettings',
37
+ fields: {
38
+ localUploadDir: {
39
+ label: 'Local Upload Directory',
40
+ type: 'text',
41
+ },
42
+ fileHostUrl: {
43
+ label: 'File Host URL',
44
+ type: 'text',
45
+ },
46
+ },
47
+ });
48
+ export default LocalUploadStrategy;
@@ -2,5 +2,25 @@ import AWS from 'aws-sdk';
2
2
  import { UploadStrategy, UploadStrategyUploadOptions } from './FileUploader';
3
3
  export default class S3UploadStrategy implements UploadStrategy {
4
4
  static AWS: typeof AWS;
5
+ static settingsSchema: {
6
+ id: string;
7
+ fields: {
8
+ awsAccessKeyId: {
9
+ label: string;
10
+ type: "text";
11
+ options: undefined;
12
+ };
13
+ awsSecretAccessKey: {
14
+ label: string;
15
+ type: "text";
16
+ options: undefined;
17
+ };
18
+ awsS3Bucket: {
19
+ label: string;
20
+ type: "text";
21
+ options: undefined;
22
+ };
23
+ };
24
+ };
5
25
  upload(options: UploadStrategyUploadOptions): Promise<string>;
6
26
  }
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { assertOptions } from '@sprucelabs/schema';
10
+ import { assertOptions, buildSchema } from '@sprucelabs/schema';
11
11
  import AWS from 'aws-sdk';
12
12
  class S3UploadStrategy {
13
13
  upload(options) {
@@ -27,6 +27,7 @@ class S3UploadStrategy {
27
27
  AWS_S3_BUCKET = awsS3Bucket;
28
28
  }
29
29
  else {
30
+ //TODO: added bang here
30
31
  const { awsAccessKeyId, awsSecretAccessKey, awsS3Bucket } = settings;
31
32
  AWS_ACCESS_KEY_ID = awsAccessKeyId;
32
33
  AWS_SECRET_ACCESS_KEY = awsSecretAccessKey;
@@ -49,4 +50,24 @@ class S3UploadStrategy {
49
50
  }
50
51
  }
51
52
  S3UploadStrategy.AWS = AWS;
53
+ S3UploadStrategy.settingsSchema = buildSchema({
54
+ id: 's3UploadSettings',
55
+ fields: {
56
+ awsAccessKeyId: {
57
+ label: 'AWS Access Key ID',
58
+ type: 'text',
59
+ options: undefined,
60
+ },
61
+ awsSecretAccessKey: {
62
+ label: 'AWS Secret Access Key',
63
+ type: 'text',
64
+ options: undefined,
65
+ },
66
+ awsS3Bucket: {
67
+ label: 'AWS S3 Bucket',
68
+ type: 'text',
69
+ options: undefined,
70
+ },
71
+ },
72
+ });
52
73
  export default S3UploadStrategy;
@@ -3,6 +3,19 @@ export default class LocalUploadStrategy implements UploadStrategy {
3
3
  static Class?: new (options: LocalStrategyOptions) => UploadStrategy;
4
4
  private localUploadDir;
5
5
  private fileHostUrl;
6
+ static settingsSchema: {
7
+ id: string;
8
+ fields: {
9
+ localUploadDir: {
10
+ label: string;
11
+ type: "text";
12
+ };
13
+ fileHostUrl: {
14
+ label: string;
15
+ type: "text";
16
+ };
17
+ };
18
+ };
6
19
  constructor(options: {
7
20
  localUploadDir: string;
8
21
  fileHostUrl: string;
@@ -22,4 +22,17 @@ class LocalUploadStrategy {
22
22
  return `${this.fileHostUrl}/${name}`;
23
23
  }
24
24
  }
25
+ LocalUploadStrategy.settingsSchema = (0, schema_1.buildSchema)({
26
+ id: 'localUploadSettings',
27
+ fields: {
28
+ localUploadDir: {
29
+ label: 'Local Upload Directory',
30
+ type: 'text',
31
+ },
32
+ fileHostUrl: {
33
+ label: 'File Host URL',
34
+ type: 'text',
35
+ },
36
+ },
37
+ });
25
38
  exports.default = LocalUploadStrategy;
@@ -2,5 +2,25 @@ import AWS from 'aws-sdk';
2
2
  import { UploadStrategy, UploadStrategyUploadOptions } from './FileUploader';
3
3
  export default class S3UploadStrategy implements UploadStrategy {
4
4
  static AWS: typeof AWS;
5
+ static settingsSchema: {
6
+ id: string;
7
+ fields: {
8
+ awsAccessKeyId: {
9
+ label: string;
10
+ type: "text";
11
+ options: undefined;
12
+ };
13
+ awsSecretAccessKey: {
14
+ label: string;
15
+ type: "text";
16
+ options: undefined;
17
+ };
18
+ awsS3Bucket: {
19
+ label: string;
20
+ type: "text";
21
+ options: undefined;
22
+ };
23
+ };
24
+ };
5
25
  upload(options: UploadStrategyUploadOptions): Promise<string>;
6
26
  }
@@ -22,6 +22,7 @@ class S3UploadStrategy {
22
22
  AWS_S3_BUCKET = awsS3Bucket;
23
23
  }
24
24
  else {
25
+ //TODO: added bang here
25
26
  const { awsAccessKeyId, awsSecretAccessKey, awsS3Bucket } = settings;
26
27
  AWS_ACCESS_KEY_ID = awsAccessKeyId;
27
28
  AWS_SECRET_ACCESS_KEY = awsSecretAccessKey;
@@ -43,4 +44,24 @@ class S3UploadStrategy {
43
44
  }
44
45
  }
45
46
  S3UploadStrategy.AWS = aws_sdk_1.default;
47
+ S3UploadStrategy.settingsSchema = (0, schema_1.buildSchema)({
48
+ id: 's3UploadSettings',
49
+ fields: {
50
+ awsAccessKeyId: {
51
+ label: 'AWS Access Key ID',
52
+ type: 'text',
53
+ options: undefined,
54
+ },
55
+ awsSecretAccessKey: {
56
+ label: 'AWS Secret Access Key',
57
+ type: 'text',
58
+ options: undefined,
59
+ },
60
+ awsS3Bucket: {
61
+ label: 'AWS S3 Bucket',
62
+ type: 'text',
63
+ options: undefined,
64
+ },
65
+ },
66
+ });
46
67
  exports.default = S3UploadStrategy;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-file-utils",
3
3
  "description": "Utils for working with files and Sprucebot.",
4
- "version": "17.0.0",
4
+ "version": "17.0.1",
5
5
  "skill": {
6
6
  "namespace": "files"
7
7
  },